/* ═══════════════════════════════════════════════════════════════════════════
   CONNECT ACCOUNTING — UNIFIED DESIGN SYSTEM
   Single source of truth for all tokens, components, and layouts.
   Replaces all v7–v21.10.x patch layers with one coherent stylesheet.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── 1. DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* Typography */
  --ds-font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ds-text:        #0f172a;
  --ds-text-2:      #334155;
  --ds-text-3:      #64748b;
  --ds-text-4:      #94a3b8;

  /* Brand */
  --ds-primary:     #0ea5e9;
  --ds-primary-d:   #0284c7;
  --ds-primary-bg:  #e0f2fe;
  --ds-primary-txt: #0c4a6e;

  /* Surfaces */
  --ds-bg:          #f0f4f8;
  --ds-surface:     #ffffff;
  --ds-border:      #e2e8f0;
  --ds-border-2:    #cbd5e1;

  /* Shadows */
  --ds-shadow-sm:   0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --ds-shadow-md:   0 4px 16px rgba(15,23,42,.08);
  --ds-shadow-lg:   0 12px 32px rgba(15,23,42,.10);

  /* Radii */
  --ds-r-sm:        8px;
  --ds-r-md:        12px;
  --ds-r-lg:        16px;
  --ds-r-xl:        22px;
  --ds-r-pill:      999px;

  /* Spacing (8px base) */
  --ds-space-1:     4px;
  --ds-space-2:     8px;
  --ds-space-3:     12px;
  --ds-space-4:     16px;
  --ds-space-5:     20px;
  --ds-space-6:     24px;

  /* Layout */
  --ds-sidebar-w:   232px;
  --ds-shell-max:   1680px;
  --ds-gap:         20px;

  /* Status colours */
  --c-draft-bg:     #f1f5f9; --c-draft-txt:   #475569; --c-draft-bdr:   #cbd5e1;
  --c-sent-bg:      #dbeafe; --c-sent-txt:    #1d4ed8; --c-sent-bdr:    #93c5fd;
  --c-paid-bg:      #dcfce7; --c-paid-txt:    #166534; --c-paid-bdr:    #86efac;
  --c-unpaid-bg:    #fef3c7; --c-unpaid-txt:  #92400e; --c-unpaid-bdr:  #fcd34d;
  --c-overdue-bg:   #fee2e2; --c-overdue-txt: #b91c1c; --c-overdue-bdr: #fca5a5;
  --c-partial-bg:   #ede9fe; --c-partial-txt: #6d28d9; --c-partial-bdr: #c4b5fd;
}

/* ── 2. GLOBAL RESET ───────────────────────────────────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }

.wave-wrap *, .wave-portal-shell * {
  box-sizing: border-box;
  font-family: var(--ds-font);
}

/* ── 3. SHELL & LAYOUT ─────────────────────────────────────────────────────── */
.wave-wave-shell,
.wave-portal-shell {
  width: min(var(--ds-shell-max), calc(100% - 32px)) !important;
  max-width: none !important;
  margin: 0 auto;
  padding: 18px !important;
  background: var(--ds-bg) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 24px !important;
  overflow-x: hidden;
}

.wave-portal-layout {
  display: grid !important;
  grid-template-columns: var(--ds-sidebar-w) minmax(0,1fr) !important;
  gap: var(--ds-gap) !important;
  align-items: start !important;
}

.wave-portal-content { min-width: 0; overflow: visible !important; }

.wave-main { max-width: none !important; width: 100% !important; }

/* ── 4. SIDEBAR ────────────────────────────────────────────────────────────── */
.wave-portal-sidebar {
  position: sticky !important;
  top: 16px !important;
  min-height: calc(100vh - 60px) !important;
  background: var(--ds-surface) !important;
  border: 1px solid var(--ds-border) !important;
  border-radius: var(--ds-r-xl) !important;
  box-shadow: var(--ds-shadow-sm) !important;
  padding: 18px 14px !important;
  overflow: hidden;
}

.wave-sidebar-brand-logo-only {
  padding: 14px 0 20px !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
}

.wave-brand-logo {
  width: 100% !important;
  max-width: 220px !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
}

.wave-sidebar-brand-logo-only strong,
.wave-sidebar-brand-logo-only small { display: none !important; }

/* Nav group title */
.wave-nav-group-title {
  padding: 8px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ds-text-3);
}

/* Nav links */
.wave-side-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: var(--ds-r-md);
  color: var(--ds-text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.wave-side-nav a:hover  { background: #f0f7ff; color: #1d4ed8; }
.wave-side-nav a.active { background: #dbeafe; color: #1d4ed8; font-weight: 600; }

/* Sidebar icons (SVG next to nav labels) */
.wave-nav-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .12s;
}
.wave-side-nav a:hover .wave-nav-icon,
.wave-side-nav a.active .wave-nav-icon { opacity: 1; }
.wave-side-group summary:hover .wave-nav-icon,
.wave-side-group summary.active .wave-nav-icon { opacity: 1; }
/* Summary inner wrap (icon + label sit together, chevron stays right) */
.wave-nav-inner {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Collapsible group (Expenses, Sales & Payments) */
.wave-side-group { margin: 2px 0; }
.wave-side-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--ds-r-md);
  color: var(--ds-text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.wave-side-group summary::-webkit-details-marker { display: none; }
.wave-side-group summary::after {
  content: "▾";
  font-size: 11px;
  color: var(--ds-text-3);
  transition: transform .18s ease;
}
.wave-side-group[open] summary::after { transform: rotate(180deg); }
.wave-side-group summary:hover  { background: #f0f7ff; color: #1d4ed8; }
.wave-side-group summary.active { background: #dbeafe; color: #1d4ed8; font-weight: 600; }

.wave-side-subnav {
  padding: 3px 0 3px 12px;
  display: grid;
  gap: 1px;
}
.wave-side-subnav a { font-size: 13px; }

/* ── 5. CARDS ──────────────────────────────────────────────────────────────── */
.wave-card,
.wave-header-card {
  background: var(--ds-surface) !important;
  border: 1px solid var(--ds-border) !important;
  border-radius: var(--ds-r-lg) !important;
  box-shadow: var(--ds-shadow-sm) !important;
}

.wave-portal-content .wave-card     { padding: 22px 24px !important; }
.wave-portal-content .wave-header-card {
  padding: 20px 24px !important;
  margin-bottom: 18px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
}

.wave-portal-content .wave-header-card h1 {
  margin: 0 0 4px;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--ds-text) !important;
  letter-spacing: -.02em;
}
.wave-portal-content .wave-header-card p {
  margin: 0;
  font-size: 13px !important;
  color: var(--ds-text-3) !important;
}

.wave-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.wave-section-head h2 {
  margin: 0;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--ds-text) !important;
}
.wave-section-head span { font-size: 13px; color: var(--ds-text-3); }

/* Metric cards */
.wave-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.metric {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  padding: 18px 20px;
  box-shadow: var(--ds-shadow-sm);
}
.metric span  { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ds-text-3); margin-bottom: 6px; }
.metric strong{ display: block; font-size: 26px; font-weight: 800; color: var(--ds-text); margin-bottom: 2px; }
.metric small { display: block; font-size: 12px; color: var(--ds-text-3); }

/* ── 6. BUTTONS ────────────────────────────────────────────────────────────── */
/* Primary */
.wave-btn,
.wave-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-family: var(--ds-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--ds-r-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s, box-shadow .14s, transform .08s;
  white-space: nowrap;
}
.wave-btn-primary {
  background: var(--ds-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(14,165,233,.30);
}
.wave-btn-primary:hover {
  background: var(--ds-primary-d) !important;
  box-shadow: 0 4px 12px rgba(14,165,233,.35);
}

/* Secondary */
.wave-btn-secondary {
  background: var(--ds-surface) !important;
  color: var(--ds-text) !important;
  border: 1px solid var(--ds-border-2) !important;
  box-shadow: var(--ds-shadow-sm) !important;
}
.wave-btn-secondary:hover { background: #f8fafc !important; }

/* Small */
.wave-btn-sm,
.wave-round-btn {
  padding: 7px 14px !important;
  font-size: 12px !important;
  border-radius: var(--ds-r-md) !important;
  min-height: auto !important;
}

/* Create / sidebar CTA */
.wave-create-btn,
.wave-create-btn.wave-create-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 9px 14px !important;
  background: var(--ds-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--ds-r-md) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  margin-bottom: 12px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(14,165,233,.28);
}
.wave-create-btn:hover { background: var(--ds-primary-d) !important; }

/* Link button (inline action) */
.wave-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--ds-r-sm);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  color: var(--ds-text);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.wave-link-btn:hover { background: #f8fafc; }
.wave-link-btn.danger  { color: #b91c1c; border-color: #fecaca; }
.wave-link-btn.success { color: #166534; border-color: #bbf7d0; }

/* Icon button (remove row) */
.wave-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--ds-r-sm);
  border: 1px solid #fecaca;
  background: var(--ds-surface);
  color: #dc2626;
  cursor: pointer;
}
.wave-icon-btn:hover { background: #fff1f2; }
.wave-icon-btn.wave-remove-item {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: auto !important; height: auto !important;
  color: #dc2626 !important;
  padding: 0 !important;
}

/* ── 7. TOPBAR & ACCOUNT MENU ──────────────────────────────────────────────── */
.wave-portal-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 4px 0 16px;
  position: relative;
  z-index: 3000;
}

.wave-account-menu  { position: relative; z-index: 3001; margin-left: auto; }
.wave-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--ds-r-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-primary-txt);
  cursor: pointer;
  min-width: 200px;
}
.wave-account-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wave-account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave-account-caret { font-size: 11px; margin-left: auto; }

.wave-account-dropdown {
  display: none;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  width: 270px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-lg);
  z-index: 3002 !important;
  overflow: hidden;
}
.wave-account-menu.is-open .wave-account-dropdown { display: block !important; }
.wave-account-dropdown-head {
  padding: 14px 16px;
  background: #fafcff;
  border-bottom: 1px solid var(--ds-border);
}
.wave-account-dropdown-head strong { display: block; font-size: 13px; color: var(--ds-text); }
.wave-account-dropdown-head span   { display: block; font-size: 12px; color: var(--ds-text-3); margin-top: 2px; }
.wave-account-dropdown a,
.wave-account-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 11px 16px;
  font-size: 13px; font-family: var(--ds-font);
  color: var(--ds-text); background: var(--ds-surface);
  border: none; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; cursor: pointer;
}
.wave-account-dropdown a:hover,
.wave-account-dropdown button:hover { background: #f8fafc; }
body.wave-account-open .wave-dashboard-create-menu { opacity: 0; pointer-events: none; }

/* Create menu */
.wave-dashboard-create-menu { position: relative; z-index: 100; margin-left: auto; }
.wave-dashboard-create-menu .wave-create-toggle {
  gap: 6px; min-width: 130px;
  background: var(--ds-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--ds-r-md) !important;
  padding: 9px 16px !important;
  box-shadow: 0 2px 8px rgba(14,165,233,.28);
}
.wave-dashboard-create-menu .wave-create-dropdown {
  display: none;
  position: absolute;
  right: 0 !important; left: auto !important;
  top: calc(100% + 8px) !important;
  width: 200px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-lg);
  overflow: hidden;
  z-index: 101;
  padding: 4px 0;
}
.wave-dashboard-create-menu.is-open .wave-create-dropdown { display: block; }
.wave-dashboard-create-menu .wave-create-dropdown a {
  display: block; padding: 11px 16px;
  font-size: 13px; color: var(--ds-text);
  text-decoration: none; border-bottom: 1px solid #f1f5f9;
  background: var(--ds-surface);
}
.wave-dashboard-create-menu .wave-create-dropdown a:last-child { border-bottom: none; }
.wave-dashboard-create-menu .wave-create-dropdown a:hover { background: #f8fafc; }

/* Actions menu (table row) */
.wave-actions-menu { position: relative; display: inline-flex; align-items: center; gap: 6px; z-index: 5000; }
.wave-actions-menu.is-open { z-index: 999999 !important; }
.wave-actions-trigger {
  width: 32px; height: 32px;
  border: 1px solid var(--ds-primary);
  background: var(--ds-surface);
  color: var(--ds-primary);
  border-radius: var(--ds-r-pill);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.wave-actions-dropdown {
  display: none;
  position: absolute;
  right: 0; top: auto;
  bottom: calc(100% + 8px) !important;
  min-width: 175px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  box-shadow: var(--ds-shadow-lg);
  overflow: hidden;
  z-index: 1000001 !important;
}
.wave-actions-menu.is-open .wave-actions-dropdown { display: block; }
.wave-actions-dropdown a,
.wave-actions-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; font-size: 13px;
  font-family: var(--ds-font);
  color: var(--ds-text); background: var(--ds-surface);
  border: none; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.wave-actions-dropdown a:hover,
.wave-actions-dropdown button:hover { background: #f8fafc; }
.wave-actions-dropdown .danger { color: #b91c1c; }

/* ── 8. TABLES ─────────────────────────────────────────────────────────────── */
.wave-table-wrap { overflow-x: auto !important; overflow-y: visible !important; }
.wave-table { width: 100%; border-collapse: collapse; }
.wave-table th {
  padding: 10px 12px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--ds-text-3);
  background: #f8fafc;
  border-bottom: 2px solid var(--ds-border);
  text-align: left;
  white-space: nowrap;
}
.wave-table td {
  padding: 12px 12px;
  font-size: 13px;
  color: var(--ds-text-2);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.wave-table tbody tr:hover td { background: #fafcff; }

/* Sortable */
.wave-sortable-table th[data-sort] { cursor:pointer;user-select:none;position:relative;padding-right:10px;white-space:nowrap; }
.wave-sortable-table th[data-sort]::after { content:'↕';position:static;display:inline-block;margin-left:5px;transform:none;font-size:10px;color:var(--ds-text-4);vertical-align:middle; }
.wave-sortable-table th[data-dir="asc"]::after  { content: '↑'; color: var(--ds-primary); }
.wave-sortable-table th[data-dir="desc"]::after { content: '↓'; color: var(--ds-primary); }

/* Actions cell */
.wave-actions-cell { min-width: 130px; overflow: visible !important; position: relative; }
.wave-list-page .wave-card,
.wave-list-page .wave-table-wrap,
.wave-list-page .wave-table,
.wave-list-page .wave-enhanced-list  { overflow: visible !important; }
.wave-list-page .wave-table-wrap     { overflow-x: auto !important; }

/* ── 9. FORMS ──────────────────────────────────────────────────────────────── */
.wave-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}
.wave-form-grid label { display: block; }
.wave-form-grid span,
.wave-label,
.wave-auth-form-stack label span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-text-2);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.wave-form-grid input,
.wave-form-grid select,
.wave-form-grid textarea,
.wave-auth-form-stack input,
.wave-list-tools input,
.wave-list-tools select {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--ds-font);
  font-size: 13px !important;
  color: var(--ds-text);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-2);
  border-radius: var(--ds-r-md);
  transition: border-color .14s, box-shadow .14s;
}
.wave-form-grid input:focus,
.wave-form-grid select:focus,
.wave-form-grid textarea:focus,
.wave-auth-form-stack input:focus {
  outline: none;
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.wave-form-grid textarea { min-height: 100px; resize: vertical; }
.wave-col-2 { grid-column: 1 / -1; }
.wave-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.wave-input-error { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.08) !important; }
.wave-field-error { margin-top: 6px; color: #dc2626; font-size: 12px; font-weight: 600; }

/* List tools (filter bar above tables) */
.wave-list-tools { margin: 0 0 16px; }
.wave-list-tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.wave-list-tools-grid-invoices { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1fr; }
.wave-list-tools-grid-invoices.ca-invoice-project-filter-grid { grid-template-columns: 1.4fr repeat(6, minmax(0,1fr)); }
.wave-list-tools label { display: block; }
.wave-list-tools label span { display: block; font-size: 11px; font-weight: 600; color: var(--ds-text-3); margin: 0 0 5px; text-transform: uppercase; letter-spacing: .04em; }
.wave-list-tools input,
.wave-list-tools select { height: 38px; padding: 0 10px; }

/* ── 10. STATUS BADGES ─────────────────────────────────────────────────────── */
.wave-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 5px 12px;
  border-radius: var(--ds-r-pill);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: .02em;
}
.wave-status-badge.is-compact { min-width: 68px; padding: 4px 10px; font-size: 11px; }
.wave-status-badge.status-draft   { background: var(--c-draft-bg);   color: var(--c-draft-txt);   border-color: var(--c-draft-bdr); }
.wave-status-badge.status-unsent  { background: #e5e7eb;             color: #4b5563;               border-color: #cbd5e1; }
.wave-status-badge.status-sent    { background: var(--c-sent-bg);    color: var(--c-sent-txt);    border-color: var(--c-sent-bdr); }
.wave-status-badge.status-paid    { background: var(--c-paid-bg);    color: var(--c-paid-txt);    border-color: var(--c-paid-bdr); }
.wave-status-badge.status-unpaid  { background: var(--c-unpaid-bg);  color: var(--c-unpaid-txt);  border-color: var(--c-unpaid-bdr); }
.wave-status-badge.status-overdue { background: var(--c-overdue-bg); color: var(--c-overdue-txt); border-color: var(--c-overdue-bdr); }
.wave-status-badge.status-partial { background: var(--c-partial-bg); color: var(--c-partial-txt); border-color: var(--c-partial-bdr); }

/* Status select (inline dropdown) */
.wave-status-select { padding: 4px 8px; border-radius: var(--ds-r-sm); border: 1px solid; font-size: 12px; font-weight: 600; }
.wave-status-select.status-draft   { background: var(--c-draft-bg);   color: var(--c-draft-txt);   border-color: var(--c-draft-bdr); }
.wave-status-select.status-sent    { background: var(--c-sent-bg);    color: var(--c-sent-txt);    border-color: var(--c-sent-bdr); }
.wave-status-select.status-unsent  { background: #e5e7eb;             color: #4b5563;               border-color: #cbd5e1; }
.wave-status-select.status-paid    { background: var(--c-paid-bg);    color: var(--c-paid-txt);    border-color: var(--c-paid-bdr); }
.wave-status-select.status-unpaid  { background: var(--c-unpaid-bg);  color: var(--c-unpaid-txt);  border-color: var(--c-unpaid-bdr); }
.wave-status-select.status-overdue { background: var(--c-overdue-bg); color: var(--c-overdue-txt); border-color: var(--c-overdue-bdr); }
.wave-status-select.status-partial { background: var(--c-partial-bg); color: var(--c-partial-txt); border-color: var(--c-partial-bdr); }

/* ── 11. NOTICES & MESSAGES ────────────────────────────────────────────────── */
.wave-front-notice {
  display: block;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--ds-r-md);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.wave-front-notice-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.wave-front-notice-error   { background: #fff1f2; border-color: #fca5a5; color: #b91c1c; }
.wave-message {
  margin: 0 0 16px;
  padding: 11px 16px;
  border-radius: var(--ds-r-md);
  font-size: 13px;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.wave-message.error { background: #fff1f2; color: #b91c1c; border-color: #fecaca; }

/* ── 12. INVOICE LINE ITEMS ────────────────────────────────────────────────── */
.wave-item-row {
  display: grid !important;
  grid-template-columns: 220px minmax(0,1fr) 110px 110px 32px !important;
  gap: 10px !important;
  align-items: end !important;
}
.wave-item-row label { margin: 0; }
.wave-item-row-actions {
  grid-column: 5; grid-row: 1;
  display: flex; justify-content: center; align-items: center;
  padding: 0 0 10px;
}
.wave-item-tax-row { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 4px; }
.wave-item-tax-label { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 320px; }
.wave-item-tax-label span { margin: 0; font-size: 13px; font-weight: 600; color: var(--ds-text-2); white-space: nowrap; }
.wave-item-tax-select { min-width: 180px; }

/* Product picker */
.wave-product-picker    { position: relative; min-width: 0; }
.wave-product-search    { width: 100%; }
.wave-product-dropdown  {
  position: absolute; left: 0; top: calc(100% + 6px);
  min-width: 480px !important; max-width: 720px !important;
  width: clamp(480px, 55vw, 720px) !important;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  box-shadow: var(--ds-shadow-lg);
  max-height: 300px; overflow: auto;
  z-index: 500000 !important;
}
.wave-product-option, .wave-product-create-option {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; background: var(--ds-surface);
  border: none; border-top: 1px solid #f1f5f9; cursor: pointer;
}
.wave-product-option:hover        { background: #f8fafc; }
.wave-product-option-top          { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.wave-product-option-top strong   { display: block; font-size: 14px; }
.wave-product-option-top em       { font-style: normal; color: var(--ds-text); white-space: nowrap; font-weight: 600; }
.wave-product-option span         { display: block; color: var(--ds-text-3); margin-top: 3px; font-size: 12px; }
.wave-product-empty               { padding: 12px 14px; color: var(--ds-text-3); font-size: 13px; }
.wave-product-create-option       { background: var(--ds-primary) !important; color: #fff !important; border-top: 1px solid var(--ds-primary-d); }
.wave-product-create-option:hover { background: var(--ds-primary-d) !important; }
.wave-product-create-cta          { color: #fff !important; font-weight: 600; }

/* Tax picker */
.wave-tax-picker    { position: relative; }
.wave-tax-search    { width: 100%; }
.wave-tax-rate-input { display: none !important; }
.wave-tax-dropdown  {
  position: absolute; left: 0; top: calc(100% + 6px);
  min-width: 280px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  box-shadow: var(--ds-shadow-lg);
  overflow: hidden;
  z-index: 400000 !important;
}
.wave-tax-option, .wave-tax-create {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 11px 14px;
  background: var(--ds-surface); border: none;
  border-top: 1px solid #f1f5f9; cursor: pointer;
  font-family: var(--ds-font); font-size: 13px;
}
.wave-tax-option:hover  { background: #f8fafc; }
.wave-tax-option em     { font-style: normal; color: var(--ds-text-3); }
.wave-tax-empty         { padding: 11px 14px; color: var(--ds-text-3); }
.wave-tax-create        { background: var(--ds-primary); color: #fff; justify-content: center; font-weight: 600; }

/* Invoice summary box */
.wave-summary-box-vertical { max-width: 340px; width: 100%; margin-left: auto; margin-right: 20px; }
.wave-summary-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--ds-text-2); }
.wave-summary-row strong { font-weight: 700; color: var(--ds-text); }
.wave-discount-panel { display: none !important; }
.wave-discount-panel.is-open { display: block !important; }
.wave-discount-fields { display: grid; grid-template-columns: minmax(0,1fr) 110px 84px auto; gap: 10px; align-items: center; padding: 4px 0 6px; }
.wave-item-create-product { display: none !important; }

/* ── 13. AUTH SCREEN ───────────────────────────────────────────────────────── */
.wave-auth-wave { padding: 20px 12px 36px; }
.wave-auth-panel {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px;
  align-items: center;
  background: var(--ds-surface);
  border-radius: var(--ds-r-xl); padding: 36px 44px;
  border: 1px solid var(--ds-border); box-shadow: var(--ds-shadow-lg);
  overflow: hidden;
}
.wave-auth-hero h2 { margin: 14px 0 12px; font-size: 48px; line-height: 1.05; letter-spacing: -.04em; color: var(--ds-text); }
.wave-auth-hero p  { font-size: 17px; line-height: 1.55; color: var(--ds-text-3); max-width: 520px; margin: 0 0 18px; }
.wave-auth-forms   { max-width: 400px; margin-left: auto; width: 100%; }
.wave-auth-form-head h3 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.03em; color: var(--ds-text); }
.wave-auth-form-head span { color: var(--ds-text-3); font-size: 14px; }
.wave-auth-form-stack { display: grid; gap: 14px; }
.wave-auth-form-stack input { height: 48px; padding: 0 14px; border-radius: var(--ds-r-md); }
.wave-auth-submit { height: 48px; border-radius: var(--ds-r-pill); font-size: 16px; }
.wave-auth-brand-logo { width: 220px !important; max-width: 100%; height: auto; display: block; margin-bottom: 16px; }
.wave-auth-divider { display: flex; align-items: center; gap: 10px; color: var(--ds-text-4); font-size: 13px; margin: 18px 0; }
.wave-auth-divider::before, .wave-auth-divider::after { content: ''; height: 1px; background: var(--ds-border); flex: 1; }

/* ── 14. PUBLIC INVOICE ────────────────────────────────────────────────────── */
.wave-public-body         { background: #edf2f7; padding: 20px 14px; }
.wave-public-invoice-flat { max-width: 1040px; margin: 0 auto; font-family: var(--ds-font); }
.wave-public-toolbar {
  position: sticky; top: 12px; z-index: 9;
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  max-width: 1040px; margin: 0 auto 14px;
}
.wave-public-toolbtn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: var(--ds-r-md);
  border: 1px solid var(--ds-border-2); background: var(--ds-surface);
  color: var(--ds-text); font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; min-height: 40px; white-space: nowrap;
}
.wave-public-toolbtn-primary { background: var(--ds-primary); border-color: var(--ds-primary); color: #fff; }
.wave-public-toolbtn-primary:hover { background: var(--ds-primary-d); }

.wave-public-sheet-flat {
  background: var(--ds-surface);
  padding: 48px 46px 30px;
  border: 1px solid #dde5ec;
  border-radius: 16px;
  box-shadow: var(--ds-shadow-md);
  display: block !important;
  overflow: visible !important;
}
.wave-public-flat-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 24px; align-items: start; padding-bottom: 24px;
}
.wave-public-flat-brand { min-height: 80px; display: flex; align-items: flex-start; }
.wave-public-logo { max-width: 260px; max-height: 80px; height: auto; width: auto; display: block; object-fit: contain; }
.wave-public-logo-text { font-size: 28px; font-weight: 700; color: var(--ds-text); letter-spacing: -.02em; }
.wave-public-flat-titlebox { text-align: right; }
.wave-public-flat-kicker { font-size: 30px; font-weight: 500; letter-spacing: .01em; color: var(--ds-text); margin-bottom: 8px; }
.wave-public-flat-vat { font-size: 12px; color: var(--ds-text-3); margin-bottom: 10px; }
.wave-public-flat-business-lines { display: grid; gap: 2px; font-size: 13px; line-height: 1.55; color: var(--ds-text-2); text-align: right; }
.wave-public-flat-business-lines strong { font-size: 14px; font-weight: 700; color: var(--ds-text); }

.wave-public-flat-meta-row { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; padding: 24px 0 20px; border-top: 1px solid var(--ds-border); }
.wave-public-flat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ds-text-3); margin-bottom: 6px; font-weight: 700; }
.wave-public-flat-billto strong { font-size: 14px; font-weight: 700; color: var(--ds-text); }
.wave-public-flat-billto span   { font-size: 13px; line-height: 1.6; color: var(--ds-text-2); }
.wave-public-flat-meta-box { display: grid; gap: 7px; align-content: start; }
.wave-public-flat-meta-box > div { display: grid; grid-template-columns: 1fr auto; gap: 14px; font-size: 13px; }
.wave-public-flat-meta-box span  { color: var(--ds-text-3); font-weight: 600; }
.wave-public-flat-meta-box strong { font-weight: 600; text-align: right; color: var(--ds-text); }
.wave-public-flat-due { background: #f8fafc; border-radius: 8px; padding: 9px 12px; }

.wave-public-flat-items { padding-top: 4px; }
.wave-public-flat-items-head,
.wave-public-flat-item-row { display: grid; grid-template-columns: minmax(0,1fr) 90px 130px 130px; gap: 16px; align-items: start; }
.wave-public-flat-items-head { padding: 10px 0 10px; border-bottom: 1px solid var(--ds-border); font-size: 11px; font-weight: 700; color: var(--ds-text-3); text-transform: uppercase; letter-spacing: .07em; }
.wave-public-flat-item-row   { padding: 13px 0; border-bottom: 1px solid #f1f5f9; }
.wave-public-flat-item-row:last-child { border-bottom: none; }
.wave-public-flat-item-row strong { display: block; font-size: 13px; font-weight: 600; }
.wave-public-flat-item-row div    { font-size: 13px; color: var(--ds-text-2); }
.wave-public-item-description { display: block; margin-top: 3px; color: var(--ds-text-3); font-size: 12px; line-height: 1.5; }

.wave-public-flat-bottom { display: block !important; padding-top: 8px; margin-top: 6px; }
.wave-public-flat-totals { max-width: 96mm; margin-left: auto; }
.wave-public-flat-totals > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; padding: 5px 0; font-size: 13px; color: var(--ds-text-2); }
.wave-public-flat-totals span  { color: var(--ds-text-3); font-weight: 600; }
.wave-public-flat-totals strong { font-weight: 600; text-align: right; color: var(--ds-text); white-space: nowrap; }
.wave-public-flat-total     { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--ds-border); }
.wave-public-flat-due-total { margin-top: 6px; padding-top: 8px; border-top: 2px solid var(--ds-border-2); }
.wave-public-flat-total span, .wave-public-flat-total strong,
.wave-public-flat-due-total span, .wave-public-flat-due-total strong { font-weight: 800; font-size: 15px; color: var(--ds-text); }

.wave-public-flat-notes-below { margin-top: 22px; }
.wave-public-note-text { font-size: 13px; line-height: 1.7; color: var(--ds-text-3); white-space: pre-line; }
.wave-public-flat-footer { border-top: 1px solid var(--ds-border); margin-top: 24px; padding-top: 14px; }
.wave-public-flat-footer-bank { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px 16px; font-size: 12px; color: var(--ds-text-3); }
.wave-public-flat-footer-note { margin-top: 10px; font-size: 12px; line-height: 1.7; color: var(--ds-text-3); }
.wave-public-flat-payment-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding-top: 10px; border-top: 1px solid var(--ds-border); font-size: 13px; color: var(--ds-text-2); }

/* Print footer */
.wave-public-print-footer {
  position: relative !important; left: auto !important; right: auto !important; bottom: auto !important; transform: none !important;
  display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important;
  width: 100% !important; margin: 18px auto 0 !important;
  padding-top: 10px !important; border-top: 1px solid var(--ds-border) !important;
  background: var(--ds-surface) !important; text-align: center !important;
}
.wave-public-powered-by-text { font-size: 13px !important; font-weight: 700 !important; color: #0c4a6e !important; line-height: 1; }
.wave-public-powered-by-logo { width: 160px !important; height: auto !important; display: block !important; object-fit: contain !important; }

/* PDF export clone */
.wave-pdf-export-clone { position: fixed !important; left: -100000px !important; top: 0 !important; z-index: -1 !important; overflow: visible !important; }
.wave-pdf-export-clone .wave-public-print-footer { display: flex !important; position: relative !important; margin-top: 14px !important; }

/* ── 15. RECEIPT PAGE ──────────────────────────────────────────────────────── */
.wave-receipt-page { max-width: 680px; margin: 0 auto; }
.wave-receipt-sheet { background: var(--ds-surface); border: 1px solid var(--ds-border); padding: 36px 34px 28px; text-align: center; color: var(--ds-text); }
.wave-receipt-brand-logo { max-width: 300px; max-height: 110px; height: auto; display: block; margin: 0 auto 16px; }
.wave-receipt-brand-text { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.wave-receipt-sheet h1  { margin: 0 0 8px; font-size: 26px; color: var(--ds-text); }
.wave-receipt-subtitle  { font-weight: 700; font-size: 15px; color: var(--ds-text-2); margin-bottom: 4px; }
.wave-receipt-customer  { font-size: 15px; color: var(--ds-text-2); margin-bottom: 20px; }
.wave-receipt-business-block { display: flex; flex-direction: column; gap: 4px; align-items: center; margin: 16px 0 20px; font-size: 13px; color: var(--ds-text-2); }
.wave-receipt-note      { padding: 14px 0; border-top: 1px solid var(--ds-border); border-bottom: 1px solid var(--ds-border); margin: 6px 0 20px; color: var(--ds-text-2); text-align: left; }
.wave-receipt-money-line { display: flex; justify-content: center; gap: 8px; align-items: baseline; border-top: 1px solid var(--ds-border); border-bottom: 1px solid var(--ds-border); padding: 14px 0; margin-bottom: 16px; font-size: 17px; }
.wave-receipt-money-line strong { font-size: 20px; }
.wave-receipt-method-line { font-size: 13px; color: var(--ds-text-2); margin-bottom: 18px; }
.wave-receipt-powered   { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: #1d4ed8; margin: 16px 0 18px; }
.wave-receipt-powered img { height: auto; width: 120px; object-fit: contain; }
.wave-receipt-footer-note { background: #f3f6fb; border-radius: 0 0 14px 14px; margin: 0 -34px -28px; padding: 18px 24px; font-size: 13px; line-height: 1.55; color: var(--ds-text-3); }

/* ── 16. INLINE LINKS & UTILS ──────────────────────────────────────────────── */
.wave-link-inline { color: var(--ds-primary-d); text-decoration: none; font-weight: 600; }
.wave-link-inline:hover { text-decoration: underline; }
.wave-link-button  { background: none; border: 0; padding: 0; color: var(--ds-primary-d); cursor: pointer; font: inherit; }
.wave-link-button:hover { text-decoration: underline; }
.wave-danger-link  { color: #dc2626; }
.wave-dot-sep      { display: inline-block; margin: 0 6px; color: var(--ds-text-4); }
.wave-subtle       { font-size: 12px; color: var(--ds-text-3); }
.wave-inline-note  { font-size: 12px; color: var(--ds-text-3); margin-top: 2px; }
.no-print          { }

/* Payment history */
.wave-payment-history {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ds-border);
  width: 100%;
}
.wave-payment-history-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wave-payment-history-row + .wave-payment-history-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.wave-payment-history-note    { color: var(--ds-text-3); font-size: 12px; margin-top: 2px; }
.wave-payment-history-actions {
  margin-top: 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.wave-payment-history-actions .wave-inline-form { display: inline; }
.wave-payment-history-actions .wave-link-button,
.wave-payment-history-actions .wave-link-inline {
  font-size: 13px;
  white-space: nowrap;
}

/* Logo upload */
.wave-logo-row { display: flex; gap: 10px; align-items: center; }
.wave-logo-row .wave-logo-input { flex: 1; }
.wave-logo-preview img { max-height: 60px; max-width: 200px; display: block; border: 1px solid var(--ds-border); border-radius: 8px; padding: 6px; background: var(--ds-surface); }

/* Quick links (dashboard workspace) */
.wave-quick-links { display: grid; gap: 8px; }
.wave-quick-link  { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--ds-r-md); border: 1px solid var(--ds-border); text-decoration: none; transition: background .12s; }
.wave-quick-link:hover  { background: #f8fafc; }
.wave-quick-link strong { font-size: 13px; font-weight: 600; color: var(--ds-primary-d); }
.wave-quick-link span   { font-size: 12px; color: var(--ds-text-3); }

/* Inline customer form */
.wave-inline-customer { display: none; margin-top: 10px; padding: 14px; border: 1px dashed #bfdbfe; border-radius: var(--ds-r-md); background: #f8fbff; }
.wave-inline-customer.is-open { display: block; }
.wave-inline-customer-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }

/* Expense side badge */
.ca-expenses-placeholder-badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: var(--ds-r-pill); background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ca-expenses-placeholder-card h2 { margin: 0; font-size: 22px; }
.ca-expenses-placeholder-card p  { margin: 0; max-width: 720px; color: var(--ds-text-3); }
.ca-expenses-placeholder-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── 17. PRINT / PDF ───────────────────────────────────────────────────────── */
@media print {
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice.ca-invoice-print-pages-v2 .wave-public-sheet-flat.ca-invoice-print-page-v2 {
    min-height: 296.8mm !important;
    height: 296.8mm !important;
    overflow: hidden !important;
  }

  @page { size: A4 portrait; margin: 0 !important; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; overflow: visible !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .wave-public-body, .wave-public-invoice-flat { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .wave-public-toolbar, .no-print { display: none !important; }
  .wave-public-sheet-flat {
    width: 190mm !important; max-width: 190mm !important;
    height: auto !important; min-height: 0 !important;
    margin: 8mm auto 0 !important;
    padding: 14mm 12mm 12mm !important;
    border: 0 !important; box-shadow: none !important;
    overflow: visible !important; display: block !important;
  }
  .wave-public-flat-head, .wave-public-flat-meta-row { grid-template-columns: minmax(0,1fr) 80mm !important; }
  .wave-public-flat-item-row { break-inside: avoid !important; page-break-inside: avoid !important; }
  .wave-public-flat-bottom, .wave-public-flat-notes-below, .wave-public-print-footer { break-inside: avoid !important; page-break-inside: avoid !important; }
  .wave-public-print-footer { position: relative !important; left: auto !important; right: auto !important; bottom: auto !important; transform: none !important; margin: 14px 0 0 !important; }
  /* Bill print — scoped to bill page only */
  .wave-bill-view-page, .wave-bill-view-page * { visibility: visible !important; }
  .wave-bill-view-page { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .wave-bill-view-page .no-print, .wave-bill-view-page .wave-payment-manage-card, .wave-bill-view-page .wave-public-toolbar { display: none !important; }
  .wave-receipt-page .wave-public-toolbar { display: none !important; }
  /* Invoice print — make sure content is visible */
  .wave-public-invoice-flat * { visibility: visible !important; }
}

/* ── 18. RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .wave-portal-shell, .wave-wave-shell { width: calc(100% - 20px) !important; padding: 14px !important; }
  .wave-list-tools-grid-invoices { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  .wave-metrics { grid-template-columns: repeat(2,1fr) !important; }
  .wave-invoice-form .wave-summary-box-vertical { margin-right: 0 !important; max-width: 100% !important; }
  .wave-invoice-form .wave-item-tax-row { grid-column: 1 / -1 !important; justify-content: flex-start !important; }
}

@media (max-width: 1024px) {
  html, body { overflow-x: hidden !important; }
  .wave-portal-layout { grid-template-columns: 1fr !important; gap: 14px !important; }
  .wave-portal-sidebar { position: static !important; top: auto !important; min-height: auto !important; }
  .wave-portal-shell, .wave-wave-shell { border-radius: 18px !important; }
}

@media (max-width: 900px) {
  .wave-portal-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .wave-account-menu { width: 100%; }
  .wave-account-trigger { width: 100%; justify-content: space-between; min-width: 0; }
  .wave-account-dropdown { left: 0 !important; right: auto !important; width: 100%; }
  .wave-header-card { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
  .wave-section-head { flex-direction: column; align-items: flex-start; }
  .wave-item-row { grid-template-columns: 1fr !important; }
  .wave-item-row-actions { justify-content: flex-start !important; padding-bottom: 0 !important; grid-column: auto !important; grid-row: auto !important; }
  .wave-invoice-form .wave-item-tax-row { position: relative !important; top: auto !important; right: auto !important; padding-right: 2mm !important; display: flex !important; justify-content: space-between !important; }
  .wave-invoice-form .wave-item-tax-label, .wave-invoice-form .wave-item-tax-select { min-width: 100% !important; width: 100% !important; max-width: none !important; }
  .wave-product-dropdown { min-width: min(100%, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px) !important; width: calc(100vw - 32px) !important; left: 0 !important; }
  .wave-list-tools-grid, .wave-list-tools-grid-invoices { grid-template-columns: repeat(2,1fr) !important; }
  .wave-public-flat-head, .wave-public-flat-meta-row, .wave-public-flat-bottom { grid-template-columns: 1fr !important; gap: 16px !important; }
  .wave-public-flat-titlebox, .wave-public-flat-business-lines, .wave-public-flat-meta-box { text-align: left !important; }
  .wave-dashboard-create-menu { width: 100% !important; max-width: none !important; min-width: 0 !important; margin-left: 0 !important; }
  .wave-dashboard-create-menu .wave-create-toggle, .wave-dashboard-create-menu .wave-btn { width: 100% !important; }
  .wave-dashboard-create-menu .wave-create-dropdown { left: 0 !important; right: 0 !important; width: 100% !important; top: calc(100% + 8px) !important; }
}

@media (max-width: 760px) {
  .wave-portal-shell, .wave-wave-shell { width: 100% !important; max-width: 100% !important; padding: 8px !important; border-radius: 0 !important; border: 0 !important; }
  .wave-portal-content .wave-card, .wave-portal-content .wave-header-card, .wave-portal-sidebar { border-radius: 14px !important; }
  .wave-portal-content .wave-card, .wave-portal-content .wave-header-card { padding: 16px !important; }
  .wave-metrics { grid-template-columns: 1fr 1fr !important; }
  .wave-form-grid, .wave-inline-customer-grid { grid-template-columns: 1fr !important; }
  .wave-form-grid .wave-col-2 { grid-column: auto !important; }
  .wave-list-tools-grid, .wave-list-tools-grid-invoices { grid-template-columns: 1fr !important; }
  .wave-side-nav { display: grid !important; grid-template-columns: 1fr !important; gap: 2px !important; }

  /* Mobile card table (stacked rows) */
  .wave-enhanced-list .wave-table-wrap { overflow-x: hidden !important; }
  .wave-enhanced-list .wave-table { min-width: 0 !important; width: 100% !important; }
  .wave-enhanced-list .wave-table thead { display: none !important; }
  .wave-enhanced-list .wave-table, .wave-enhanced-list .wave-table tbody,
  .wave-enhanced-list .wave-table tr, .wave-enhanced-list .wave-table td { display: block !important; width: 100% !important; }
  .wave-enhanced-list .wave-table tr { border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); margin-bottom: 10px; background: var(--ds-surface); padding: 10px 12px; }
  .wave-enhanced-list .wave-table td { border: 0 !important; padding: 6px 0 !important; text-align: left !important; }
  .wave-enhanced-list .wave-table td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--ds-text-3); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }

  /* Public invoice mobile */
  .wave-public-body { padding: 0; }
  .wave-public-sheet-flat { width: calc(100vw - 20px) !important; max-width: none !important; height: auto !important; min-height: auto !important; margin: 0 10px !important; padding: 18px 14px !important; border-radius: 14px !important; overflow: hidden !important; box-sizing: border-box !important; }
  .wave-public-flat-items-head { display: grid !important; grid-template-columns: minmax(0,1fr) 56px 72px 80px !important; gap: 8px !important; font-size: 11px !important; }
  .wave-public-flat-item-row   { display: grid !important; grid-template-columns: minmax(0,1fr) 56px 72px 80px !important; gap: 8px !important; }
  .wave-public-flat-item-row > div:nth-child(n+2), .wave-public-flat-items-head > div:nth-child(n+2) { text-align: right !important; justify-self: end !important; }
  .wave-public-flat-item-row > div:nth-child(2)::before, .wave-public-flat-item-row > div:nth-child(3)::before, .wave-public-flat-item-row > div:nth-child(4)::before { content: none !important; }
  .wave-public-flat-totals { max-width: 100% !important; margin-left: 0 !important; }
  .wave-public-flat-footer-bank { grid-template-columns: 1fr !important; }
  .wave-public-toolbar { padding: 0 10px; gap: 8px; position: static; }
  .wave-public-toolbtn { flex: 1 1 calc(50% - 8px); width: auto !important; }
}

@media (max-width: 480px) {
  .wave-portal-shell, .wave-wave-shell { padding: 6px !important; }
  .wave-portal-content .wave-header-card h1 { font-size: 20px !important; }
  .wave-public-toolbtn { flex-basis: 100%; }
  .wave-metrics { grid-template-columns: 1fr !important; }
  .wave-actions { flex-direction: column; }
  .wave-actions .wave-btn { width: 100%; }
  .ca-expenses-placeholder-actions { flex-direction: column; }
  .ca-expenses-placeholder-actions .wave-btn, .ca-expenses-placeholder-actions .wave-link-btn { width: 100%; text-align: center; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   FUNCTIONAL OVERRIDES — invoice editor, discount, bill print
   (structural/functional CSS that extends the design system above)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Bill print ──────────────────────────────────────────────────────────────── */
/* Bill print: force a clean single-page A4 output */
.wave-bill-view-page .wave-public-invoice-card{max-width:100%;}
@media print{
  @page{size:A4 portrait;margin:8mm;}
  html,body{background:#fff!important;}
  /* NO body * visibility:hidden — it breaks invoice print */
  .wave-bill-view-page{position:absolute!important;left:0!important;top:0!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;background:#fff!important;}
  .wave-bill-view-page .no-print,
  .wave-bill-view-page .wave-payment-manage-card,
  .wave-bill-view-page .wave-public-toolbar{display:none!important;}
  .wave-bill-view-page .wave-public-invoice-card{display:block!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:8mm 7mm 6mm!important;margin:0!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  .wave-bill-view-page .wave-public-invoice-top{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10mm!important;margin-bottom:6mm!important;align-items:start!important;}
  .wave-bill-view-page .wave-public-doc-title{font-size:26px!important;line-height:1!important;margin-bottom:4mm!important;}
  .wave-bill-view-page .wave-public-meta-row{margin-bottom:1.5mm!important;font-size:13px!important;}
  .wave-bill-view-page .wave-public-section-label{font-size:11px!important;margin-bottom:2mm!important;}
  .wave-bill-view-page .wave-table-wrap{overflow:visible!important;}
  .wave-bill-view-page .wave-table{width:100%!important;table-layout:fixed!important;}
  .wave-bill-view-page .wave-table th,
  .wave-bill-view-page .wave-table td{padding:6px 7px!important;font-size:12px!important;line-height:1.25!important;}
  .wave-bill-view-page .wave-table th:nth-child(1),
  .wave-bill-view-page .wave-table td:nth-child(1){width:24%!important;}
  .wave-bill-view-page .wave-table th:nth-child(2),
  .wave-bill-view-page .wave-table td:nth-child(2){width:24%!important;}
  .wave-bill-view-page .wave-table th:nth-child(3),
  .wave-bill-view-page .wave-table td:nth-child(3){width:8%!important;}
  .wave-bill-view-page .wave-table th:nth-child(4),
  .wave-bill-view-page .wave-table td:nth-child(4),
  .wave-bill-view-page .wave-table th:nth-child(5),
  .wave-bill-view-page .wave-table td:nth-child(5),
  .wave-bill-view-page .wave-table th:nth-child(6),
  .wave-bill-view-page .wave-table td:nth-child(6){width:14%!important;}
  .wave-bill-view-page .wave-public-totals-wrap{margin-top:5mm!important;}
  .wave-bill-view-page .wave-public-totals{width:82mm!important;max-width:82mm!important;margin-left:auto!important;}
  .wave-bill-view-page .wave-public-total-row{padding:2mm 0!important;}
  .wave-bill-view-page .wave-public-total-row span,
  .wave-bill-view-page .wave-public-total-row strong{font-size:13px!important;}
  .wave-bill-view-page .wave-public-grand-total span,
  .wave-bill-view-page .wave-public-grand-total strong{font-size:16px!important;}
  .wave-bill-view-page .wave-public-notes{margin-top:5mm!important;padding-top:4mm!important;border-top:1px solid #e2e8f0!important;}
  .wave-bill-view-page .wave-public-notes p{font-size:12px!important;line-height:1.35!important;margin:0!important;}
}


/* ── Invoice editor layout ───────────────────────────────────────────────────── */
/* v21.10.12 final invoice editor + print/pdf layout fixes */
.wave-invoice-form .wave-summary-box-vertical{
  max-width: 360px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: 36px !important;
}
.wave-invoice-form .wave-summary-box-vertical .wave-summary-row,
.wave-invoice-form .wave-summary-discount-toggle-row,
.wave-invoice-form .wave-discount-panel{
  padding-left: 0 !important;
  padding-right: 2mm !important;
}
.wave-invoice-form .wave-item-tax-row{
  grid-column: 2 / -1 !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  margin-top: -2px !important;
}
.wave-invoice-form .wave-item-tax-label{
  min-width: 214px !important;
  max-width: 214px !important;
  width: 214px !important;
}
.wave-invoice-form .wave-item-tax-select{
  min-width: 214px !important;
  width: 214px !important;
  max-width: 214px !important;
}
.wave-invoice-form .wave-item-tax-amount{
  min-width: 132px !important;
}
@media (max-width: 1000px){
  .wave-invoice-form .wave-summary-box-vertical{margin-right: 0 !important; max-width: 100% !important;}
  .wave-invoice-form .wave-item-tax-row{grid-column: 1 / -1 !important; justify-content: flex-start !important;}
  .wave-invoice-form .wave-item-tax-label,
  .wave-invoice-form .wave-item-tax-select{min-width: 100% !important; width: 100% !important; max-width: none !important;}
}

.wave-public-invoice-flat .wave-public-flat-items{
  break-inside: auto !important;
  page-break-inside: auto !important;
}
.wave-public-invoice-flat .wave-public-flat-bottom,
.wave-public-invoice-flat .wave-public-flat-notes,
.wave-public-invoice-flat .wave-public-flat-footer,
.wave-public-invoice-flat .wave-public-print-footer{
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
.wave-public-invoice-flat .wave-public-flat-bottom{
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 88mm !important;
  gap: 18px !important;
  align-items: start !important;
  border-top: 0 !important;
  margin-top: 6px !important;
  padding-top: 10px !important;
}
.wave-public-invoice-flat .wave-public-flat-totals{
  width: 88mm !important;
  max-width: 88mm !important;
  margin-left: auto !important;
  padding-top: 0 !important;
}
.wave-public-invoice-flat .wave-public-flat-totals > div{
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto !important;
  gap: 12px !important;
  padding: 4px 0 !important;
}
.wave-public-invoice-flat .wave-public-flat-totals span,
.wave-public-invoice-flat .wave-public-flat-totals strong{
  text-align: right !important;
  white-space: nowrap !important;
}
.wave-public-invoice-flat .wave-public-flat-total,
.wave-public-invoice-flat .wave-public-flat-due-total{
  border-top: 1px solid #d9e1e8 !important;
  margin-top: 4px !important;
  padding-top: 8px !important;
}
.wave-public-invoice-flat .wave-public-print-footer{
  position: relative !important;
  width: 88mm !important;
  max-width: 88mm !important;
  margin: 12px 0 0 auto !important;
  padding-top: 10px !important;
  justify-content: center !important;
}
@media (max-width: 900px){
  .wave-public-invoice-flat .wave-public-flat-bottom{grid-template-columns: 1fr !important; gap: 12px !important;}
  .wave-public-invoice-flat .wave-public-flat-totals,
  .wave-public-invoice-flat .wave-public-print-footer{width: 100% !important; max-width: 100% !important; margin-left: 0 !important;}
}
@media print{
  html, body{height: auto !important; overflow: visible !important;}
  .wave-public-invoice-flat .wave-public-sheet-flat{
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 auto !important;
    padding: 14mm 12mm 10mm !important;
  }
  .wave-public-invoice-flat .wave-public-flat-items{break-inside: auto !important; page-break-inside: auto !important;}
  .wave-public-invoice-flat .wave-public-flat-items-head{break-after: avoid !important; page-break-after: avoid !important;}
  .wave-public-invoice-flat .wave-public-flat-item-row{break-inside: avoid !important; page-break-inside: avoid !important;}
  .wave-public-invoice-flat .wave-public-flat-bottom{display: grid !important; grid-template-columns: minmax(0,1fr) 88mm !important; gap: 18px !important;}
  .wave-public-invoice-flat .wave-public-flat-totals{width: 88mm !important; max-width: 88mm !important; margin-left: auto !important;}
  .wave-public-invoice-flat .wave-public-print-footer{width: 88mm !important; max-width: 88mm !important; margin: 10px 0 0 auto !important;}
}



/* v21.10.14 final alignment pass */
.wave-invoice-form .wave-item-tax-label,
.wave-invoice-form .wave-item-tax-select{
  min-width:190px !important;
  width:190px !important;
  max-width:190px !important;
}
.wave-invoice-form .wave-item-tax-row{
  gap:12px !important;
}
.wave-invoice-form .wave-item-tax-amount{
  min-width:120px !important;
}

.wave-public-invoice-flat .wave-public-flat-bottom{
  display:block !important;
  border-top:0 !important;
  margin-top:6px !important;
  padding-top:10px !important;
}
.wave-public-invoice-flat .wave-public-flat-totals{
  width:96mm !important;
  max-width:96mm !important;
  margin-left:auto !important;
  margin-right:0 !important;
  justify-self:end !important;
}
.wave-public-invoice-flat .wave-public-flat-totals > div{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:14px !important;
}
.wave-public-invoice-flat .wave-public-flat-totals span,
.wave-public-invoice-flat .wave-public-flat-totals strong{
  text-align:right !important;
}
.wave-public-invoice-flat .wave-public-flat-notes-below{
  margin-top:14px !important;
}
.wave-public-invoice-flat .wave-public-print-footer{
  width:100% !important;
  max-width:none !important;
  margin:22px auto 0 !important;
  padding-top:12px !important;
  justify-content:center !important;
  text-align:center !important;
  border-top:1px solid #d9e1e8 !important;
}

@media print{
  .wave-public-invoice-flat .wave-public-flat-bottom{
    display:block !important;
  }
  .wave-public-invoice-flat .wave-public-flat-totals{
    width:96mm !important;
    max-width:96mm !important;
    margin-left:auto !important;
    margin-right:0 !important;
  }
  .wave-public-invoice-flat .wave-public-print-footer{
    width:100% !important;
    max-width:none !important;
    margin:20px auto 0 !important;
    padding-top:12px !important;
    border-top:1px solid #d9e1e8 !important;
    justify-content:center !important;
  }
}



/* ── Discount + multi-page ───────────────────────────────────────────────────── */
/* v21.10.11: discount collapse + multi-page invoice/pdf fixes */
.wave-discount-panel[hidden]{display:none!important;}
.wave-discount-panel{display:none!important;}
.wave-discount-panel.is-open{display:block!important;}

.wave-public-sheet-flat{
  min-height:auto!important;
  height:auto!important;
  overflow:visible!important;
  display:block!important;
  padding-bottom:14mm!important;
}
.wave-public-flat-items,
.wave-public-flat-bottom,
.wave-public-flat-notes,
.wave-public-flat-footer,
.wave-public-print-footer{
  break-inside:avoid-page!important;
  page-break-inside:avoid!important;
}
.wave-public-flat-item-row{
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
.wave-public-print-footer{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  width:100%!important;
  margin:14px 0 0!important;
  padding-top:10px!important;
  border-top:1px solid #d9e1e8!important;
  background:#fff!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  text-align:center!important;
}
.wave-pdf-export-clone .wave-public-sheet-flat{
  min-height:auto!important;
  height:auto!important;
  overflow:visible!important;
  display:block!important;
}
.wave-pdf-export-clone .wave-public-print-footer{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  margin:14px 0 0!important;
  display:flex!important;
}
@media print{
  html,body{width:auto!important;height:auto!important;overflow:visible!important;}
  .wave-public-sheet-flat{
    min-height:auto!important;
    height:auto!important;
    overflow:visible!important;
    display:block!important;
    margin:10mm auto!important;
    padding:14mm 12mm 14mm!important;
  }
  .wave-public-flat-item-row,
  .wave-public-flat-items,
  .wave-public-flat-bottom,
  .wave-public-flat-notes,
  .wave-public-flat-footer,
  .wave-public-print-footer{
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .wave-public-print-footer{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    transform:none!important;
    margin:14px 0 0!important;
  }
}



/* v21.10.2 create menu final polish */
.wave-portal-content,
.wave-portal-content .wave-header-card,
.wave-dashboard-create-menu{overflow:visible!important}
.wave-dashboard-create-menu{position:relative;z-index:1000005!important}
.wave-dashboard-create-menu .wave-create-dropdown{
  padding:0!important;
  overflow:hidden!important;
  border-radius:16px!important;
  z-index:1000006!important;
}
.wave-dashboard-create-menu .wave-create-dropdown a{
  display:block;
  padding:12px 16px!important;
  margin:0!important;
  border-radius:0!important;
  border-bottom:1px solid #eef2f7!important;
  background:#fff!important;
}
.wave-dashboard-create-menu .wave-create-dropdown a::after{display:none!important;content:none!important}
.wave-dashboard-create-menu .wave-create-dropdown a:last-child{border-bottom:0!important}
.wave-dashboard-create-menu .wave-create-dropdown a:hover{background:#f5f8ff!important}
@media (max-width:700px){
  .wave-dashboard-create-menu{width:100%!important;min-width:0!important;max-width:none!important;justify-content:stretch!important}
  .wave-dashboard-create-menu .wave-create-toggle,
  .wave-dashboard-create-menu .wave-btn{width:100%!important;min-width:0!important;justify-content:center!important}
  .wave-dashboard-create-menu .wave-create-dropdown{left:0!important;right:0!important;width:100%!important;max-width:none!important;top:calc(100% + 8px)!important}
}


/* ── ACTION BUTTONS: Uniform inline horizontal layout ─────────────────────── */
/* Consistent action button row used across ALL list pages */
.wave-table .wave-actions-cell,
.wave-table td.wave-actions-cell,
.wave-table td:last-child > .wave-inline-actions {
  white-space: nowrap;
}

/* Row of action buttons (View Bill / Edit / Delete etc.) */
.wave-inline-actions,
.wave-table td.wave-actions-cell { 
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
}

/* Uniform link-btn size across all tables */
.wave-table .wave-link-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  min-width: 52px !important;
  height: 30px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #334155 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
.wave-table .wave-link-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
.wave-table .wave-link-btn.danger {
  color: #b91c1c !important;
  border-color: #fecaca !important;
}
.wave-table .wave-link-btn.danger:hover {
  background: #fff1f2 !important;
}

/* Fix taxes table: Edit/Delete stacked → inline */
.wave-table .ta-r {
  text-align: right;
}
.wave-table .ta-r form.wave-inline-form {
  display: inline !important;
  margin: 0 !important;
}

/* Taxes table action td */
.taxes-grid .wave-table td:last-child,
.wave-table td.ta-r:last-child {
  display: table-cell !important;
}
.wave-table td.ta-r > a.wave-link-btn,
.wave-table td.ta-r > form.wave-inline-form > button.wave-link-btn {
  display: inline-flex !important;
  vertical-align: middle !important;
  margin: 0 3px !important;
}

/* FIX for taxes: the cell has a form adjacent to an anchor — force inline-flex row */
.wave-table td.ta-r {
  display: table-cell !important;
  white-space: nowrap !important;
}

/* Invoice list: Ensure the actions cell flex layout works */
.wave-list-page .wave-actions-cell {
  display: table-cell !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}
.wave-actions-menu {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

/* ── INVOICE LIST DROPDOWN FIX ─────────────────────────────────────────────── */
/* Use JS portal for first few rows; CSS fallback: open above */
.wave-list-page .wave-actions-dropdown {
  bottom: calc(100% + 6px) !important;
  top: auto !important;
  right: 0 !important;
  left: auto !important;
  z-index: 1000000 !important;
}
.wave-list-page .wave-actions-menu { z-index: 999 !important; }
.wave-list-page .wave-actions-menu.is-open { z-index: 1000001 !important; }

/* ── DELETE ICON (trash) — visible red ──────────────────────────────────────── */
.wave-icon-btn.wave-remove-item {
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
  width: 32px !important;
  height: 32px !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
}
.wave-icon-btn.wave-remove-item:hover { background: #fff1f2 !important; }
.wave-icon-btn.wave-remove-item .dashicons {
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  color: #ef4444 !important;
}


/* ── BILLTO: each field on its own line ─────────────────────────────────────── */
.wave-public-flat-billto span,
.wave-public-flat-billto-line {
  display: block !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: #475569 !important;
  margin-top: 2px !important;
}
.wave-public-flat-billto strong {
  display: block !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 4px !important;
}

/* ── INVOICE EDITOR REDESIGN ───────────────────────────────────────────────── */
.wave-editor-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
}
.wave-editor-card {
  padding: 28px 30px !important;
}
.wave-editor-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}
.wave-editor-section-head h2 {
  margin: 0;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* Invoice form — cleaner grid */
.wave-invoice-form {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 18px 24px !important;
  align-items: start !important;
}
.wave-invoice-form label > span,
.wave-invoice-form .wave-label {
  display: block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  color: #0ea5e9 !important;
  margin-bottom: 7px !important;
}
.wave-invoice-form input[type=text],
.wave-invoice-form input[type=number],
.wave-invoice-form input[type=date],
.wave-invoice-form input[type=email],
.wave-invoice-form select,
.wave-invoice-form textarea {
  width: 100% !important;
  padding: 10px 13px !important;
  font-size: 14px !important;
  font-family: var(--ds-font, 'Inter', sans-serif) !important;
  color: #0f172a !important;
  background: #fff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  transition: border-color .14s, box-shadow .14s !important;
}
.wave-invoice-form input:focus,
.wave-invoice-form select:focus,
.wave-invoice-form textarea:focus {
  outline: none !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,.14) !important;
}
.wave-invoice-form textarea { min-height: 90px; resize: vertical; }

/* Line items section */
.wave-invoice-form .wave-mini-head h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.wave-invoice-form .wave-section-head.wave-mini-head {
  margin-top: 8px !important;
  padding-top: 20px !important;
  border-top: 1.5px solid #f1f5f9 !important;
}

/* Item rows — cleaner layout */
.wave-invoice-form .wave-item-row {
  display: grid !important;
  grid-template-columns: 200px minmax(0,1fr) 90px 120px 36px !important;
  gap: 8px !important;
  align-items: end !important;
  padding: 12px 14px !important;
  background: #f9fafb !important;
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  margin-bottom: 8px !important;
}
.wave-invoice-form .wave-item-row label > span {
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  color: #94a3b8 !important;
  margin-bottom: 5px !important;
}
.wave-invoice-form .wave-item-row input {
  background: #fff !important;
}

/* Remove item button — clearly visible */
.wave-invoice-form .wave-item-row-actions {
  grid-column: 5 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding-bottom: 1px !important;
}
.wave-invoice-form .wave-icon-btn.wave-remove-item {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  border: 1.5px solid #fca5a5 !important;
  background: #fff1f2 !important;
  color: #ef4444 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background .12s !important;
}
.wave-invoice-form .wave-icon-btn.wave-remove-item:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
}
.wave-invoice-form .wave-icon-btn.wave-remove-item .dashicons {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  line-height: 1 !important;
}

/* Add row button */
.wave-invoice-form .wave-add-item {
  background: #0ea5e9 !important;
  color: #fff !important;
  border-color: #0ea5e9 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.wave-invoice-form .wave-add-item:hover { background: #0284c7 !important; }

/* Summary box at bottom of form */
.wave-invoice-form .wave-summary-box-vertical,
.wave-invoice-form .wave-col-2 > .wave-summary-box-vertical {
  max-width: 360px !important;
  margin-left: auto !important;
  background: #f9fafb !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
}
.wave-invoice-form .wave-summary-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 5px 0 !important;
  font-size: 13px !important;
  color: #475569 !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.wave-invoice-form .wave-summary-row:last-child { border-bottom: none !important; }
.wave-invoice-form .wave-summary-row strong { font-weight: 700 !important; color: #0f172a !important; font-size: 15px !important; }

/* Tax row below item */
.wave-invoice-form .wave-item-tax-row {
  grid-column: 1 / -1 !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: -4px !important;
  margin-bottom: 4px !important;
}
.wave-invoice-form .wave-item-tax-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.wave-invoice-form .wave-item-tax-label span {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  white-space: nowrap !important;
}
.wave-invoice-form .wave-item-tax-select {
  min-width: 140px !important;
  width: 140px !important;
  max-width: 140px !important;
  height: 36px !important;
  font-size: 12px !important;
  padding: 0 8px !important;
}
.wave-invoice-form .wave-item-tax-amount {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  min-width: 60px !important;
  text-align: right !important;
}

/* Save invoice button */
.wave-invoice-form .wave-actions.wave-col-2 {
  padding-top: 8px !important;
}
.wave-invoice-form .wave-actions .wave-btn-primary {
  min-width: 160px !important;
  height: 44px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
}

/* Auto-status note styling */
.wave-auto-status-note {
  grid-column: 1 / -1 !important;
}
.wave-auto-status-note > span {
  display: block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  color: #64748b !important;
  margin-bottom: 6px !important;
}
.wave-auto-status-note .wave-subtle {
  font-size: 12px !important;
  color: #94a3b8 !important;
  line-height: 1.55 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
}

/* ── PRINT FIX: ensure invoice prints properly ──────────────────────────────── */
@media print {
  html, body {
    height: auto !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .wave-public-body {
    padding: 0 !important;
    background: #fff !important;
  }
  .wave-public-toolbar,
  .wave-payment-manage-card,
  .no-print {
    display: none !important;
    visibility: hidden !important;
  }
  .wave-public-invoice-flat {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .wave-public-sheet-flat {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 14mm 14mm 10mm !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    display: block !important;
    page-break-inside: avoid !important;
  }
  .wave-public-flat-head,
  .wave-public-flat-meta-row {
    grid-template-columns: minmax(0,1fr) 80mm !important;
  }
  .wave-public-flat-item-row {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .wave-public-flat-bottom,
  .wave-public-flat-notes-below,
  .wave-public-print-footer {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .wave-public-print-footer {
    position: relative !important;
    margin: 14px 0 0 !important;
    page-break-inside: avoid !important;
  }
}

/* ── INVOICE/BILL FONT SIZE: larger, more readable ─────────────────────────── */
.wave-public-sheet-flat {
  font-size: 14px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}
.wave-public-flat-item-row strong { font-size: 14px !important; }
.wave-public-flat-item-row div    { font-size: 13px !important; }
.wave-public-flat-billto strong   { font-size: 15px !important; }
.wave-public-flat-billto-line,
.wave-public-flat-billto span     { font-size: 13px !important; }
.wave-public-flat-meta-box > div  { font-size: 13px !important; }
.wave-public-flat-kicker          { font-size: 32px !important; font-weight: 700 !important; }
.wave-public-flat-business-lines  { font-size: 13px !important; line-height: 1.7 !important; }
.wave-public-flat-totals > div    { font-size: 13px !important; }
.wave-public-flat-total span,
.wave-public-flat-total strong    { font-size: 15px !important; font-weight: 800 !important; }
.wave-public-flat-due-total span,
.wave-public-flat-due-total strong { font-size: 16px !important; font-weight: 800 !important; }

/* Responsive: invoice editor mobile */
@media (max-width: 900px) {
  .wave-invoice-form .wave-item-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .wave-invoice-form .wave-item-row-actions {
    grid-column: auto !important;
    justify-content: flex-start !important;
  }
}
@media (max-width: 760px) {
  .wave-invoice-form {
    grid-template-columns: 1fr !important;
  }
  .wave-editor-card {
    padding: 18px 16px !important;
  }
}



/* ════════════════════════════════════════════════════════════════════════════
   TARGETED FIXES  (Photo 1-6)
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Photo 1 & 2: All dropdowns — guaranteed to appear above everything ─────── */
/* Dashboard "+ Create" dropdown */
.wave-dashboard-create-menu {
  position: relative !important;
  z-index: 9000 !important;
}
.wave-dashboard-create-menu .wave-create-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: auto !important;
  z-index: 9001 !important;
  display: none;
}
.wave-dashboard-create-menu.is-open .wave-create-dropdown {
  display: block !important;
}

/* Invoice list row actions dropdown */
.wave-list-page .wave-actions-menu {
  position: relative !important;
  z-index: 8000 !important;
}
.wave-list-page .wave-actions-menu.is-open {
  z-index: 8002 !important;
}
.wave-list-page .wave-actions-dropdown {
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 4px) !important;  /* open BELOW the trigger */
  bottom: auto !important;
  z-index: 8001 !important;
  min-width: 175px !important;
  display: none !important;
}
.wave-list-page .wave-actions-menu.is-open .wave-actions-dropdown {
  display: block !important;
}
/* Make sure table rows don't clip the dropdown */
.wave-list-page .wave-table,
.wave-list-page .wave-table tbody,
.wave-list-page .wave-table tr,
.wave-list-page .wave-table td,
.wave-list-page .wave-card,
.wave-list-page .wave-enhanced-list,
.wave-list-page .wave-table-wrap {
  overflow: visible !important;
}
.wave-list-page .wave-table-wrap {
  overflow-x: auto !important;
}

/* Account dropdown — stays on top of everything */
.wave-portal-topbar {
  position: relative !important;
  z-index: 9100 !important;
  overflow: visible !important;
}
.wave-account-menu {
  position: relative !important;
  z-index: 9101 !important;
}
.wave-account-menu.is-open {
  z-index: 9102 !important;
}
.wave-account-dropdown {
  z-index: 9103 !important;
}

/* ── Photo 3: Toolbar + Manage Payments — clean layout ─────────────────────── */
.wave-public-invoice-flat .wave-public-toolbar.no-print {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 14px 0 12px !important;
  max-width: 1040px !important;
  margin: 0 auto 14px !important;
}
.wave-public-toolbtn {
  height: 38px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #334155 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
}
.wave-public-toolbtn:hover { background: #f8fafc !important; }
.wave-public-toolbtn-primary {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #fff !important;
}
.wave-public-toolbtn-primary:hover { background: #0284c7 !important; }
.wave-public-toolbtn-send {
  color: #0ea5e9 !important;
  border-color: #bae6fd !important;
}

/* Manage payments card */
.wave-payment-manage-card {
  max-width: 1040px !important;
  margin: 0 auto 16px !important;
  padding: 16px 20px !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
}
.wave-payment-manage-card .wave-payment-history {
  flex-basis: 100% !important;
  width: 100% !important;
}
.wave-payment-manage-card .wave-section-head {
  margin-bottom: 0 !important;
  flex: 1 !important;
}
.wave-payment-manage-card .wave-section-head h2 {
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 0 4px !important;
}
.wave-payment-manage-card .wave-inline-note {
  font-size: 13px !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.wave-payment-manage-card .wave-section-head-actions {
  flex-shrink: 0 !important;
}

/* ── Photo 4: Invoice footer — Wave-style horizontal bank details ────────────── */
.wave-public-flat-footer {
  border-top: 1px solid #e2e8f0 !important;
  margin-top: 20px !important;
  padding-top: 14px !important;
}
.wave-public-flat-footer-bank {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 24px !important;
  font-size: 12px !important;
  color: #475569 !important;
}
.wave-public-flat-footer-bank span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
}
.wave-public-flat-footer-bank strong {
  color: #334155 !important;
  font-weight: 600 !important;
}
/* Separator between bank fields */
.wave-public-flat-footer-bank span + span::before {
  content: '|' !important;
  margin-right: 24px !important;
  color: #cbd5e1 !important;
}
.wave-public-flat-footer-note {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.6 !important;
}
/* Powered by row */
.wave-public-print-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: 16px !important;
  padding-top: 10px !important;
  border-top: 1px solid #e2e8f0 !important;
}
.wave-public-powered-by-text {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}
.wave-public-powered-by-logo {
  height: auto !important;
  width: 150px !important;
  max-width: 100% !important;
  display: block !important;
  object-fit: contain !important;
}

/* ── Photo 5: Line item row — trash icon visible + tax row spacing ───────────── */
.wave-item-row {
  position: relative !important;
  padding-bottom: 44px !important;  /* space for tax row below */
}

/* Trash button — clearly visible red */
.wave-icon-btn.wave-remove-item {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 8px !important;
  border: 1.5px solid #fca5a5 !important;
  background: #fff1f2 !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
}
.wave-icon-btn.wave-remove-item:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
}
.wave-icon-btn.wave-remove-item .dashicons {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  color: #ef4444 !important;
  line-height: 1 !important;
}

/* Tax row — more spacing, not cramped */
.wave-item-tax-row {
  position: absolute !important;
  bottom: 6px !important;
  right: 40px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
}
.wave-item-tax-label {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.wave-item-tax-label span {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
.wave-item-tax-select {
  height: 34px !important;
  min-width: 120px !important;
  width: 120px !important;
  max-width: 120px !important;
  font-size: 12px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
}
.wave-item-tax-amount {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  min-width: 60px !important;
  text-align: right !important;
  white-space: nowrap !important;
}

/* ── Photo 6: Sidebar — align with content top (no extra margin-top) ─────────── */
.wave-portal-sidebar {
  margin-top: 0 !important;
  padding-top: 16px !important;
}
/* Content area — same top alignment */
.wave-portal-content .wave-main {
  padding-top: 0 !important;
}
/* The invoice create/edit page header card */
.wave-editor-card .wave-header-card,
.wave-portal-content > .wave-main > .wave-header-card:first-child {
  margin-top: 0 !important;
}

/* Mobile tax row fix */
@media (max-width: 900px) {
  .wave-item-row {
    padding-bottom: 0 !important;
  }
  .wave-item-tax-row {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 8px !important;
  }
}

/* Footer bank separator */
.wave-footer-sep {
  color: #cbd5e1 !important;
  font-weight: 400 !important;
  user-select: none !important;
}


/* ══ CRITICAL OVERRIDES — sidebar + dropdowns ══════════════════════════════ */

/* Sidebar: no margin-top */
.wave-portal-sidebar,
.ca-invoicing-sidebar {
  margin-top: 0 !important;
}

/* Shell: overflow visible — dropdowns must not be clipped */
.wave-portal-shell,
.wave-wave-shell,
.ca-invoicing-shell {
  overflow: visible !important;
}

/* Every dropdown container: overflow visible */
.wave-portal-layout,
.wave-portal-content,
.wave-portal-content .wave-main,
.wave-portal-content .wave-card,
.wave-portal-content .wave-header-card {
  overflow: visible !important;
}

/* Dashboard + Create dropdown */
.wave-dashboard-create-menu {
  position: relative !important;
  z-index: 9000 !important;
  overflow: visible !important;
}
.wave-dashboard-create-menu .wave-create-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 9001 !important;
  display: none;
  overflow: hidden !important;
}
.wave-dashboard-create-menu.is-open .wave-create-dropdown {
  display: block !important;
}

/* Invoice list actions dropdown */
.wave-list-page .wave-card,
.wave-list-page .wave-enhanced-list,
.wave-list-page .wave-table-wrap,
.wave-list-page .wave-table,
.wave-list-page .wave-table tbody,
.wave-list-page .wave-table tr,
.wave-list-page .wave-table td,
.wave-list-page .wave-actions-cell {
  overflow: visible !important;
}
.wave-list-page .wave-table-wrap {
  overflow-x: auto !important;
}
.wave-actions-menu {
  position: relative !important;
  overflow: visible !important;
  z-index: 8000 !important;
}
.wave-actions-menu.is-open {
  z-index: 8002 !important;
}
.wave-actions-menu .wave-actions-dropdown {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  bottom: auto !important;
  right: 0 !important;
  left: auto !important;
  z-index: 8001 !important;
  display: none !important;
  overflow: hidden !important;
}
.wave-actions-menu.is-open .wave-actions-dropdown:not(.wave-actions-dropdown-portal) {
  display: block !important;
}

/* ── Line item row: Qty + Price always visible, tax row with space ─────────── */
.wave-invoice-form .wave-item-row {
  display: grid !important;
  grid-template-columns: 200px minmax(0,1fr) 90px 120px 36px !important;
  align-items: end !important;
  gap: 8px !important;
  padding: 14px !important;
  padding-bottom: 52px !important;
  background: #f9fafb !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  margin-bottom: 10px !important;
  position: relative !important;
  overflow: visible !important;
}
.wave-invoice-form .wave-item-row > label:nth-child(3),
.wave-invoice-form .wave-item-row > label:nth-child(4) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 0 !important;
}
.wave-invoice-form .wave-item-row-actions {
  grid-column: 5 !important;
  grid-row: 1 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding-bottom: 2px !important;
}
.wave-invoice-form .wave-item-tax-row {
  position: absolute !important;
  bottom: 10px !important;
  right: 48px !important;
  left: auto !important;
  top: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  z-index: 2 !important;
  grid-column: unset !important;
  margin: 0 !important;
  padding: 0 !important;
}
.wave-invoice-form .wave-icon-btn.wave-remove-item {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  border: 1.5px solid #fca5a5 !important;
  background: #fff1f2 !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
.wave-invoice-form .wave-icon-btn.wave-remove-item .dashicons {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  color: #ef4444 !important;
}
@media (max-width: 900px) {
  .wave-invoice-form .wave-item-row {
    grid-template-columns: 1fr !important;
    padding-bottom: 14px !important;
  }
  .wave-invoice-form .wave-item-tax-row {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    margin-top: 8px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }
  .wave-invoice-form .wave-item-row-actions {
    grid-column: auto !important;
    grid-row: auto !important;
    justify-content: flex-start !important;
  }
}



/* ══════════════════════════════════════════════════════════════════
   LINE ITEM ROW — DEFINITIVE FIX
   Structure inside .wave-item-row:
   col1: product picker  col2: description  col3: qty  col4: price
   col5: delete btn      col6 (full-width): tax row below
   ══════════════════════════════════════════════════════════════════ */

/* Reset the row to a clean 5-column grid + auto rows */
.wave-item-row {
  display: grid !important;
  grid-template-columns: 180px 1fr 90px 110px 40px !important;
  grid-template-rows: auto auto !important;
  gap: 8px !important;
  column-gap: 10px !important;
  align-items: end !important;
  padding: 14px 14px 10px !important;
  background: #f9fafb !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  margin-bottom: 10px !important;
  position: relative !important;
  overflow: visible !important;
}

/* Column 1: product picker */
.wave-item-row > .wave-product-picker {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

/* Column 2: description */
.wave-item-row > label:nth-of-type(2) {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

/* Column 3: quantity */
.wave-item-row > label:nth-of-type(3) {
  grid-column: 3 !important;
  grid-row: 1 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Column 4: price */
.wave-item-row > label:nth-of-type(4) {
  grid-column: 4 !important;
  grid-row: 1 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Column 5: delete button */
.wave-item-row > .wave-item-row-actions {
  grid-column: 5 !important;
  grid-row: 1 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding-bottom: 1px !important;
}

/* Hidden fields — no space */
.wave-item-row > input[type="hidden"],
.wave-item-row > .wave-item-create-product {
  display: none !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* Tax row — second row, full width */
.wave-item-row > .wave-item-tax-row {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  padding-top: 6px !important;
  border-top: 1px solid #e2e8f0 !important;
  margin-top: 2px !important;
  position: static !important;
  bottom: auto !important;
  right: auto !important;
}

/* Tax label */
.wave-item-tax-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-direction: row !important;
}
.wave-item-tax-label span {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
.wave-item-tax-select {
  height: 34px !important;
  min-width: 130px !important;
  width: 130px !important;
  max-width: 130px !important;
  font-size: 12px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  display: block !important;
  visibility: visible !important;
}

/* Tax amount display */
.wave-item-tax-amount {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
.wave-item-tax-amount span {
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
}
.wave-item-tax-amount strong {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* Trash button */
.wave-icon-btn.wave-remove-item {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  border: 1.5px solid #fca5a5 !important;
  background: #fff1f2 !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.wave-icon-btn.wave-remove-item:hover {
  background: #fee2e2 !important;
}
.wave-icon-btn.wave-remove-item .dashicons {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  color: #ef4444 !important;
  line-height: 1 !important;
}

/* Form labels inside items */
.wave-item-row label > span {
  display: block !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  color: #94a3b8 !important;
  margin-bottom: 5px !important;
}
.wave-item-row input[type=text],
.wave-item-row input[type=number] {
  width: 100% !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #fff !important;
}
.wave-item-row input:focus {
  outline: none !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12) !important;
}

/* Mobile */
@media (max-width: 900px) {
  .wave-item-row {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto auto !important;
  }
  .wave-item-row > .wave-product-picker { grid-column: 1 !important; grid-row: 1 !important; }
  .wave-item-row > label:nth-of-type(2) { grid-column: 2 !important; grid-row: 1 !important; }
  .wave-item-row > label:nth-of-type(3) { grid-column: 1 !important; grid-row: 2 !important; }
  .wave-item-row > label:nth-of-type(4) { grid-column: 2 !important; grid-row: 2 !important; }
  .wave-item-row > .wave-item-row-actions { grid-column: 1 !important; grid-row: 3 !important; justify-content: flex-start !important; }
  .wave-item-row > .wave-item-tax-row { grid-column: 1 / -1 !important; grid-row: 4 !important; justify-content: flex-start !important; flex-wrap: wrap !important; }
}



/* ══════════════════════════════════════════════════════════════════
   FINAL DEFINITIVE FIXES — SIDEBAR TOP + DROPDOWN PORTAL
   ══════════════════════════════════════════════════════════════════ */

/* ── Sidebar: position:static (not sticky) to avoid admin-bar top offset ── */
/* sticky + WordPress admin bar = unexpected top offset. Use static instead. */
html body .wave-portal-sidebar,
html body .ca-invoicing-sidebar {
  position: static !important;
  top: auto !important;
  margin-top: 0 !important;
  min-height: auto !important;
  /* Keep it visually sticky via JS if needed, but not CSS sticky */
}

/* ── Dropdown portal: when JS moves it to document.body ────────────────── */
/* The portal dropdown gets position:fixed via inline style from JS */
/* We must NOT have overflow:hidden on it */
.wave-actions-dropdown {
  overflow: hidden !important; /* keep for border-radius clipping */
}

/* When portaled to body, needs position:fixed and block display */
.wave-actions-dropdown.wave-actions-dropdown-portal {
  position: fixed !important;
  display: block !important;
  overflow: hidden !important;
  z-index: 2147483000 !important;
  bottom: auto !important;
  /* top and left are set by JS inline style */
}

/* Dashboard create dropdown — simpler, not portaled */
.wave-dashboard-create-menu {
  position: relative !important;
  z-index: 9000 !important;
}
.wave-dashboard-create-menu .wave-create-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 9001 !important;
  display: none !important;
}
.wave-dashboard-create-menu.is-open .wave-create-dropdown {
  display: block !important;
}
/* Parent must not clip it */
html body .wave-portal-topbar,
html body .wave-portal-content,
html body .wave-portal-layout,
html body .wave-wave-shell,
html body .wave-portal-shell,
html body .ca-invoicing-shell {
  overflow: visible !important;
}
/* But table wrap can still scroll horizontally */
html body .wave-table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
}



/* ═══════════════════════════════════════════════════════════════════════
   FINAL v5: SIDEBAR MARGIN + DROPDOWN PORTAL FIX
   ═══════════════════════════════════════════════════════════════════════ */

/* Sidebar: push down by topbar height so it aligns with content */
html body .wave-portal-sidebar {
  position: static !important;
  top: auto !important;
  margin-top: 54px !important;   /* = topbar height (account trigger ~38px + padding 16px) */
  align-self: start !important;
  min-height: auto !important;
}

/* Portal dropdown — attached to document.body by JS, must be visible */
html body .wave-actions-dropdown.wave-actions-dropdown-portal {
  position: fixed !important;
  display: block !important;
  overflow: hidden !important;
  z-index: 2147483647 !important;
  bottom: auto !important;
  /* top + left set by inline JS style */
}

/* Dashboard +Create dropdown */
html body .wave-dashboard-create-menu {
  position: relative !important;
  z-index: 9500 !important;
  overflow: visible !important;
}
html body .wave-dashboard-create-menu.is-open .wave-create-dropdown {
  display: block !important;
  position: absolute !important;
  z-index: 9501 !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
}



/* ═══════════════════════════════════════════════════════════════════════
   v6 FINAL: SIDEBAR STRETCH + DROPDOWN WIDTH
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Portal layout: sidebar stretches full height of content column ─────── */
html body .wave-portal-layout {
  display: grid !important;
  grid-template-columns: var(--ds-sidebar-w) minmax(0,1fr) !important;
  gap: var(--ds-gap) !important;
  align-items: stretch !important;   /* sidebar grows with content */
}

/* ── Sidebar: starts at the same top as Dashboard header ────────────────── */
/*   The topbar (account menu) is 38px height + 4px top + 16px bottom = 58px */
/*   So sidebar needs margin-top: 58px to align with the first card           */
html body .wave-portal-sidebar,
html body .ca-invoicing-sidebar {
  position: relative !important;
  top: auto !important;
  margin-top: 58px !important;
  align-self: stretch !important;
  min-height: auto !important;
  /* Full height via align-items:stretch on parent grid */
}

/* ── Dropdown: compact width, not full-width ─────────────────────────────── */
html body .wave-actions-dropdown,
html body .wave-actions-dropdown.wave-actions-dropdown-portal {
  min-width: 160px !important;
  max-width: 200px !important;
  width: auto !important;
}

/* Portal dropdown still fixed position */
html body .wave-actions-dropdown.wave-actions-dropdown-portal {
  position: fixed !important;
  display: block !important;
  overflow: hidden !important;
  z-index: 2147483647 !important;
  bottom: auto !important;
}



/* ═══════════════════════════════════════════════════════════
   TRASH ICON + TAX LABEL FIXES
   ═══════════════════════════════════════════════════════════ */

/* Trash button — force dashicons font to load and display */
html body .wave-icon-btn.wave-remove-item {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  border: 1.5px solid #fca5a5 !important;
  background: #fff1f2 !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: 0 !important;   /* hide any text fallback */
}
html body .wave-icon-btn.wave-remove-item:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
}

/* Dashicons trash glyph */
html body .wave-icon-btn.wave-remove-item .dashicons,
html body .wave-icon-btn.wave-remove-item .dashicons-trash {
  font-family: dashicons !important;
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  line-height: 1 !important;
  color: #ef4444 !important;
  display: inline-block !important;
  visibility: visible !important;
  speak: never;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Force dashicons-trash unicode char */
html body .wave-icon-btn.wave-remove-item .dashicons-trash::before {
  content: "\f182" !important;
  color: #ef4444 !important;
  font-size: 18px !important;
}

/* Tax amount — just show the amount, no duplicate label */
.wave-item-tax-amount {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
.wave-item-tax-amount span {
  display: none !important;  /* hide the duplicate tax name label */
}
.wave-item-tax-amount strong[data-line-tax] {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  min-width: 50px !important;
  text-align: right !important;
}



/* ── VAT select: narrow so it doesn't overlap the amount ─── */
html body .wave-item-tax-select {
  min-width: 90px !important;
  width: 90px !important;
  max-width: 90px !important;
  height: 32px !important;
  font-size: 11px !important;
  padding: 0 4px 0 6px !important;
  border-radius: 6px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  cursor: pointer !important;
}
html body .wave-item-tax-row {
  gap: 10px !important;
}
html body .wave-item-tax-label {
  gap: 6px !important;
}
html body .wave-item-tax-label span {
  font-size: 10px !important;
  white-space: nowrap !important;
  color: #94a3b8 !important;
}



/* ═══════════════════════════════════════════════════════════════════
   PRINT FIX — Invoice must be visible, only bill hides body
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  /* When printing a regular invoice page — ensure everything is visible */
  .wave-public-invoice-flat {
    visibility: visible !important;
  }
  .wave-public-invoice-flat,
  .wave-public-invoice-flat * {
    visibility: visible !important;
  }
  
  /* Override the bill-only visibility hack for invoice pages */
  .wave-public-sheet-flat,
  .wave-public-sheet-flat * {
    visibility: visible !important;
  }
  
  /* Hide only what should be hidden on print */
  .wave-public-toolbar,
  .wave-payment-manage-card,
  .no-print {
    display: none !important;
    visibility: hidden !important;
  }
  
  /* Ensure invoice body prints correctly */
  html, body {
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


@media print {
  /* BILL print: hide everything except the bill */
  body.is-bill-print-page * { visibility: hidden !important; }
  body.is-bill-print-page .wave-bill-view-page,
  body.is-bill-print-page .wave-bill-view-page * { visibility: visible !important; }
  
  /* INVOICE print: everything must be visible */
  body.wave-invoice-print-body .wave-public-invoice-flat,
  body.wave-invoice-print-body .wave-public-invoice-flat *,
  body.wave-public-body .wave-public-invoice-flat,
  body.wave-public-body .wave-public-invoice-flat * {
    visibility: visible !important;
  }
  body.wave-invoice-print-body,
  body.wave-public-body {
    visibility: visible !important;
    background: #fff !important;
  }
}



/* ═══════════════════════════════════════════════════════════════════
   PORTAL PRINT FIX — hide sidebar/topbar/toolbar, show only invoice
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  /* Hide ALL portal chrome */
  .wave-portal-sidebar,
  .ca-invoicing-sidebar,
  .wave-portal-topbar,
  .wave-public-toolbar,
  .wave-payment-manage-card,
  .no-print {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* Portal layout: remove grid, let invoice take full width */
  .wave-portal-layout,
  .wave-portal-shell,
  .wave-wave-shell,
  .ca-invoicing-shell {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .wave-portal-content,
  .ca-invoicing-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Invoice sheet: full page */
  .wave-public-invoice-flat,
  .wave-public-invoice {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .wave-public-invoice-flat *,
  .wave-public-invoice * {
    visibility: visible !important;
  }
  .wave-public-sheet-flat {
    display: block !important;
    visibility: visible !important;
    width: 190mm !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 14mm 12mm 10mm !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* WordPress admin bar */
  #wpadminbar { display: none !important; }
  html { margin-top: 0 !important; }
}



/* VAT select: force narrow — arrow + text fit in 90px */
html body .wave-item-tax-select {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  min-width: 85px !important;
  width: 85px !important;
  max-width: 85px !important;
  height: 30px !important;
  font-size: 11px !important;
  padding: 0 2px 0 5px !important;
  border-radius: 6px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
html body .wave-item-tax-row {
  gap: 12px !important;
  flex-wrap: nowrap !important;
}
html body .wave-item-tax-amount strong[data-line-tax] {
  min-width: 52px !important;
  text-align: right !important;
  white-space: nowrap !important;
}



/* ═══════════════════════════════════════════════════════════
   DEFINITIVE VAT SELECT WIDTH — overrides all older rules
   ═══════════════════════════════════════════════════════════ */
html body .wave-invoice-form .wave-item-tax-select,
html body .wave-item-row .wave-item-tax-select,
html body .wave-item-tax-select {
  min-width: 90px !important;
  width: 90px !important;
  max-width: 90px !important;
  height: 32px !important;
  font-size: 11px !important;
  padding: 0 2px 0 6px !important;
  border-radius: 6px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
}
/* Ensure amount has enough space */
html body .wave-invoice-form .wave-item-tax-amount,
html body .wave-item-tax-amount {
  min-width: 50px !important;
  max-width: none !important;
}
html body .wave-invoice-form .wave-item-tax-row,
html body .wave-item-tax-row {
  gap: 10px !important;
  flex-wrap: nowrap !important;
}




/* ═══════════════════════════════════════════════════════════
   PRINT: hide toolbar always, show only invoice content
   ═══════════════════════════════════════════════════════════ */
@media print {
  /* Hide toolbar and buttons — no exceptions */
  .no-print,
  .wave-public-toolbar,
  .wave-payment-manage-card,
  .wave-portal-sidebar,
  .wave-portal-topbar,
  .wave-side-nav,
  .wave-portal-layout > aside {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* Show invoice content */
  .wave-public-sheet-flat,
  .wave-public-sheet-flat * {
    visibility: visible !important;
  }

  /* Full page for invoice */
  body, html {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .wave-public-body {
    background: #fff !important;
    padding: 0 !important;
  }

  .wave-public-invoice-flat {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .wave-public-sheet-flat {
    width: 190mm !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 14mm 12mm 10mm !important;
    border: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
    overflow: visible !important;
  }
}



/* ═══════════════════════════════════════════════════════════
   TOTALS: right-aligned, matching Amount column width
   ═══════════════════════════════════════════════════════════ */

/* Totals box: right-aligned, width = amount+price+qty columns */
html body .wave-public-flat-totals {
  width: auto !important;
  max-width: none !important;
  min-width: 280px !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}

/* Each totals row: label left, amount right — right edge matches Amount col */
html body .wave-public-flat-totals > div {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 130px !important;
  gap: 16px !important;
  padding: 5px 0 !important;
  font-size: 13px !important;
}
html body .wave-public-flat-totals span {
  text-align: left !important;
  color: #64748b !important;
  font-weight: 600 !important;
}
html body .wave-public-flat-totals strong {
  text-align: right !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}
html body .wave-public-flat-total > div,
html body .wave-public-flat-due-total > div {
  grid-template-columns: minmax(0,1fr) 130px !important;
}
html body .wave-public-flat-total span,
html body .wave-public-flat-total strong,
html body .wave-public-flat-due-total span,
html body .wave-public-flat-due-total strong {
  font-weight: 800 !important;
}

/* Payment line same alignment */
html body .wave-public-flat-payment-line {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 130px !important;
  gap: 16px !important;
}
html body .wave-public-flat-payment-line strong {
  text-align: right !important;
  white-space: nowrap !important;
}




/* ── Print from portal page (contains sidebar) ───────────────── */
@media print {
  /* Hide everything except the invoice sheet */
  .wave-portal-shell,
  .wave-portal-sidebar,
  .wave-portal-topbar,
  .wave-portal-layout > aside,
  .wave-side-nav,
  .wave-header-card,
  .wave-payment-manage-card,
  .wave-public-toolbar,
  .no-print {
    display: none !important;
  }
  
  /* Show only the invoice */
  .wave-portal-layout {
    display: block !important;
  }
  .wave-portal-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  .wave-public-invoice-flat {
    max-width: 100% !important;
  }
  .wave-public-sheet-flat {
    width: 190mm !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 14mm 12mm 10mm !important;
    border: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
    overflow: visible !important;
  }
  
  /* Body background */
  body, html {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* All content visible */
  body * {
    visibility: visible !important;
  }
  .no-print,
  .wave-portal-sidebar,
  .wave-portal-topbar,
  .wave-public-toolbar,
  .wave-payment-manage-card {
    visibility: hidden !important;
    display: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   DEFINITIVE PRINT CSS — replaces all previous @media print rules
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  
  /* Base */
  html, body {
    margin: 0 !important; padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Hide UI chrome */
  .no-print,
  .wave-public-toolbar,
  .wave-payment-manage-card,
  .wave-portal-sidebar,
  .wave-portal-topbar,
  .wave-portal-layout > aside {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  /* Portal layout: single column for print */
  .wave-portal-layout { display: block !important; }
  .wave-portal-content { width: 100% !important; }
  .wave-portal-shell, .wave-wave-shell {
    width: 100% !important; padding: 0 !important;
    background: #fff !important; border: none !important;
    box-shadow: none !important;
  }

  /* Public invoice sheet */
  .wave-public-invoice-flat { max-width: 100% !important; margin: 0 !important; }
  .wave-public-body { background: #fff !important; padding: 0 !important; }
  .wave-public-sheet-flat {
    width: 190mm !important; max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 14mm 12mm 10mm !important;
    border: 0 !important; box-shadow: none !important;
    height: auto !important; min-height: 0 !important;
    display: block !important; overflow: visible !important;
  }
  .wave-public-flat-items-head > div:nth-child(n+2),
  .wave-public-flat-item-row > div:nth-child(n+2) { text-align: right !important; }
  .wave-public-print-footer { position: relative !important; margin-top: 14px !important; }
  
  /* Bill print */
  .wave-bill-view-page .no-print,
  .wave-bill-view-page .wave-public-toolbar,
  .wave-bill-view-page .wave-payment-manage-card { display: none !important; }
  .wave-bill-view-page .wave-public-invoice-card {
    border: 0 !important; box-shadow: none !important;
    border-radius: 0 !important; padding: 8mm 7mm 6mm !important;
  }
}



/* ═══════════════════════════════════════════════════════════════════
   FINAL FIXES: SIDEBAR RESPONSIVE + LOGO SIZE + PRINT
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. SIDEBAR LOGO — fills sidebar width ───────────────────────── */
html body .wave-sidebar-brand-logo-only .wave-brand-logo,
html body .wave-brand-logo {
  width: 100% !important;
  max-width: 220px !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
}
html body .wave-sidebar-brand-logo-only {
  padding: 14px 0 20px !important;
}

/* Logo on public invoice (view invoice page) */
html body .wave-public-logo {
  max-width: 200px !important;
  max-height: 80px !important;
  width: auto !important;
  height: auto !important;
}

/* ── 2. SIDEBAR RESPONSIVE (mobile hamburger) ───────────────────── */
/* Mobile: sidebar becomes a collapsible drawer */
@media (max-width: 1024px) {
  html body .wave-portal-layout {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  html body .wave-portal-sidebar {
    position: static !important;
    margin-top: 0 !important;
    min-height: auto !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    padding: 12px 16px !important;
  }
  /* Sidebar nav becomes horizontal scrollable on tablet */
  html body .wave-side-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 0 !important;
  }
  html body .wave-side-nav a {
    padding: 7px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
  /* Hide nav group titles on mobile */
  html body .wave-nav-group-title {
    display: none !important;
  }
  /* Collapsed groups */
  html body .wave-side-subnav {
    padding-left: 0 !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    display: flex !important;
    gap: 4px !important;
  }
  html body .wave-side-group summary {
    display: none !important;
  }
  html body .wave-side-group[open] .wave-side-subnav,
  html body .wave-side-group .wave-side-subnav {
    display: flex !important;
  }
}

@media (max-width: 760px) {
  html body .wave-portal-shell,
  html body .wave-wave-shell {
    width: 100% !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    background: #f0f4f8 !important;
  }
  html body .wave-portal-sidebar {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 12px !important;
  }
  html body .wave-sidebar-brand-logo-only {
    padding: 8px 4px 10px !important;
  }
  html body .wave-brand-logo {
    width: 140px !important;
  }
  /* Topbar */
  html body .wave-portal-topbar {
    padding: 8px 12px 10px !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  html body .wave-account-trigger {
    width: 100% !important;
    justify-content: space-between !important;
    min-width: 0 !important;
  }
  html body .wave-portal-content .wave-main {
    padding: 12px !important;
  }
  html body .wave-portal-content .wave-header-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 16px !important;
  }
  html body .wave-portal-content .wave-card {
    padding: 16px !important;
  }
  html body .wave-metrics {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  html body .wave-list-tools-grid,
  html body .wave-list-tools-grid-invoices {
    grid-template-columns: 1fr !important;
  }
  /* Side nav on mobile: single column */
  html body .wave-side-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
  }
  html body .wave-side-subnav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
  }
  html body .wave-side-nav a,
  html body .wave-side-subnav a {
    font-size: 12px !important;
    padding: 8px 10px !important;
    text-align: center !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 480px) {
  html body .wave-side-nav,
  html body .wave-side-subnav {
    grid-template-columns: 1fr 1fr !important;
  }
  html body .wave-metrics {
    grid-template-columns: 1fr !important;
  }
  html body .wave-portal-content .wave-main {
    padding: 8px !important;
  }
}

/* ── 3. PRINT: no visibility:hidden anywhere ────────────────────── */
@media print {
  /* Remove ALL visibility rules — just use display:none for unwanted elements */
  html, body, .wave-public-invoice-flat, .wave-public-sheet-flat,
  .wave-public-sheet-flat * { visibility: visible !important; }

  .wave-public-toolbar, .wave-payment-manage-card, .no-print,
  .wave-portal-sidebar, .wave-portal-topbar, .wave-portal-layout > aside {
    display: none !important;
    visibility: hidden !important;
  }

  body { background: #fff !important; }
  .wave-public-invoice-flat { max-width: 100% !important; margin: 0 !important; }
  .wave-public-sheet-flat {
    width: 190mm !important; max-width: 190mm !important;
    margin: 0 auto !important; padding: 14mm 12mm 10mm !important;
    border: 0 !important; box-shadow: none !important;
    height: auto !important; min-height: 0 !important;
    display: block !important; overflow: visible !important;
  }
}



/* ═══════════════════════════════════════════════════════════════════
   MOBILE HAMBURGER NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

/* Mobile topbar — logo + hamburger, only visible on mobile */
.wave-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 8000;
}
.wave-mobile-logo {
  height: auto;
  width: 160px;
  max-width: 55vw;
  display: block;
  object-fit: contain;
}

/* Hamburger button */
.wave-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  gap: 6px;
}
.wave-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #0f172a;
  border-radius: 2px;
  transition: all .25s ease;
  transform-origin: center;
}
.wave-hamburger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.wave-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.wave-hamburger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Overlay */
.wave-mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 8001;
  backdrop-filter: blur(2px);
}
.wave-mobile-nav-overlay.wave-nav-overlay-visible {
  display: block;
}

/* Close button inside sidebar */
.wave-sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.wave-sidebar-close:hover { background: #e2e8f0; }

/* ── Responsive breakpoints ───────────────────────────────────────── */
@media (max-width: 900px) {
  /* Hide desktop sidebar brand from layout */
  .wave-portal-layout {
    display: block !important;
  }

  /* Mobile topbar visible */
  .wave-mobile-topbar {
    display: flex !important;
  }

  /* Desktop sidebar — slide-in drawer */
  .wave-portal-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    z-index: 8002 !important;
    transition: left .28s cubic-bezier(.4,0,.2,1) !important;
    border-radius: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    padding-top: 16px !important;
    background: #fff !important;
  }
  .wave-portal-sidebar.wave-sidebar-open {
    left: 0 !important;
    box-shadow: 4px 0 24px rgba(15,23,42,.15) !important;
  }

  /* Show close button inside open sidebar */
  .wave-sidebar-close {
    display: flex !important;
  }

  /* Brand logo inside drawer */
  .wave-sidebar-brand-logo-only .wave-brand-logo {
    width: 160px !important;
    margin-bottom: 8px !important;
  }

  /* Nav layout inside drawer */
  .wave-side-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  .wave-side-nav a {
    font-size: 14px !important;
    padding: 11px 14px !important;
    text-align: left !important;
    border-radius: 10px !important;
  }
  .wave-side-group summary {
    font-size: 14px !important;
    padding: 11px 14px !important;
  }
  .wave-side-subnav {
    display: flex !important;
    flex-direction: column !important;
    padding-left: 14px !important;
    gap: 2px !important;
  }
  .wave-side-subnav a {
    font-size: 13px !important;
    padding: 9px 12px !important;
  }
  .wave-nav-group-title {
    display: block !important;
    padding: 8px 12px 4px !important;
    font-size: 10px !important;
    color: #94a3b8 !important;
  }

  /* Content area: full width, no sidebar offset */
  .wave-portal-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .wave-portal-content .wave-main {
    padding: 14px !important;
  }
  .wave-portal-topbar {
    padding: 8px 0 12px !important;
  }
  .wave-account-trigger {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 600px) {
  .wave-portal-content .wave-main { padding: 10px !important; }
  .wave-portal-content .wave-header-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 14px !important;
  }
  .wave-portal-content .wave-card { padding: 14px !important; }
  .wave-metrics { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .wave-list-tools-grid,
  .wave-list-tools-grid-invoices { grid-template-columns: 1fr !important; }
  .wave-portal-content .wave-header-card h1 { font-size: 18px !important; }
  .wave-dashboard-create-menu { width: 100% !important; }
  .wave-dashboard-create-menu .wave-create-toggle { width: 100% !important; }
}

@media (max-width: 420px) {
  .wave-metrics { grid-template-columns: 1fr !important; }
  .wave-portal-content .wave-main { padding: 8px !important; }
}



/* ══════════════════════════════════════════════════════════════════
   MOBILE NAV FIX v2 — sidebar hidden by default, opens on demand
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Layout: single column, no grid gap */
  html body .wave-portal-layout {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }

  /* SIDEBAR: hidden off-screen by default */
  html body .wave-portal-sidebar,
  html body #wave-sidebar {
    display: block !important;        /* keep in DOM */
    position: fixed !important;
    top: 0 !important;
    left: -300px !important;          /* off-screen */
    width: 270px !important;
    max-width: 80vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    z-index: 9002 !important;
    transition: left .28s cubic-bezier(.4,0,.2,1) !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    padding: 16px 14px !important;
    background: #fff !important;
  }

  /* Open state */
  html body .wave-portal-sidebar.wave-sidebar-open,
  html body #wave-sidebar.wave-sidebar-open {
    left: 0 !important;
    box-shadow: 4px 0 30px rgba(15,23,42,.18) !important;
  }

  /* Mobile topbar: always visible */
  html body .wave-mobile-topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  html body .wave-mobile-logo {
    height: 34px !important;
    width: auto !important;
  }

  /* Hamburger */
  html body .wave-hamburger {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 32px !important;
    height: 22px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    gap: 5px !important;
  }
  html body .wave-hamburger span {
    display: block !important;
    height: 2px !important;
    width: 100% !important;
    background: #0f172a !important;
    border-radius: 2px !important;
    transition: all .22s ease !important;
    transform-origin: center !important;
  }
  html body .wave-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }
  html body .wave-hamburger.is-open span:nth-child(2) {
    opacity: 0 !important; transform: scaleX(0) !important;
  }
  html body .wave-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* Overlay */
  html body .wave-mobile-nav-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15,23,42,.55) !important;
    z-index: 9001 !important;
  }
  html body .wave-mobile-nav-overlay.wave-nav-overlay-visible {
    display: block !important;
  }

  /* Close X inside sidebar */
  html body .wave-sidebar-close {
    display: flex !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 30px !important; height: 30px !important;
    background: #f1f5f9 !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    cursor: pointer !important;
    color: #64748b !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Sidebar nav — vertical list */
  html body .wave-portal-sidebar .wave-side-nav,
  html body #wave-sidebar .wave-side-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    margin-top: 8px !important;
  }
  html body .wave-portal-sidebar .wave-side-nav a,
  html body #wave-sidebar .wave-side-nav a {
    font-size: 14px !important;
    padding: 11px 14px !important;
    text-align: left !important;
    border-radius: 10px !important;
    white-space: normal !important;
    display: flex !important;          /* was block — needs flex for icon+text gap */
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
  }
  html body .wave-side-group summary {
    font-size: 14px !important;
    padding: 11px 14px !important;
  }
  html body .wave-side-subnav {
    display: flex !important;
    flex-direction: column !important;
    padding-left: 14px !important;
    gap: 2px !important;
  }
  html body .wave-side-subnav a {
    font-size: 13px !important;
    padding: 9px 12px !important;
  }
  html body .wave-nav-group-title {
    display: block !important;
    padding: 8px 12px 4px !important;
    font-size: 10px !important;
  }

  /* Content area takes full width */
  html body .wave-portal-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
  }
  html body .wave-portal-content .wave-main {
    padding: 12px !important;
  }
  html body .wave-portal-topbar {
    padding: 8px 0 10px !important;
  }
  html body .wave-account-trigger {
    width: 100% !important;
    min-width: 0 !important;
  }
}



/* Desktop: ensure sidebar is normal (not fixed) above 900px */
@media (min-width: 901px) {
  html body .wave-portal-layout {
    display: grid !important;
    grid-template-columns: var(--ds-sidebar-w, 232px) minmax(0,1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
  }
  html body .wave-portal-sidebar,
  html body #wave-sidebar {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    margin-top: 58px !important;
    transition: none !important;
    overflow-y: visible !important;
    z-index: auto !important;
    box-shadow: var(--ds-shadow-sm) !important;
  }
  html body .wave-mobile-topbar { display: none !important; }
  html body .wave-mobile-nav-overlay { display: none !important; }
  html body .wave-sidebar-close { display: none !important; }
  html body .wave-hamburger { display: none !important; }
}



/* ══════════════════════════════════════════════════════════════════
   MOBILE NAV v3 — DEFINITIVE
   ══════════════════════════════════════════════════════════════════ */

/* ── Mobile topbar (outside grid, always on top) ─── */
.wave-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 9000;
  width: 100%;
  box-sizing: border-box;
}
.wave-mobile-logo {
  height: 32px;
  width: auto;
}
.wave-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.wave-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #0f172a;
  border-radius: 2px;
  transition: all .22s ease;
  transform-origin: center;
}
.wave-hamburger.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.wave-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.wave-hamburger.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Overlay */
.wave-mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 9001;
}
.wave-mobile-nav-overlay.wave-nav-overlay-visible {
  display: block;
}

/* Close button inside sidebar */
.wave-sidebar-close {
  display: none;
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* ── DESKTOP (≥901px) ─── */
@media (min-width: 901px) {
  .wave-mobile-topbar  { display: none !important; }
  .wave-hamburger      { display: none !important; }
  .wave-sidebar-close  { display: none !important; }
  .wave-mobile-nav-overlay { display: none !important; }

  html body .wave-portal-layout {
    display: grid !important;
    grid-template-columns: 232px minmax(0,1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
  }
  html body .wave-portal-sidebar,
  html body #wave-sidebar {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    overflow-y: visible !important;
    z-index: auto !important;
    transition: none !important;
    margin-top: 58px !important;
  }
}

/* ── MOBILE (≤900px) ─── */
@media (max-width: 900px) {
  /* Show topbar + hamburger */
  .wave-mobile-topbar { display: flex !important; }
  .wave-hamburger     { display: flex !important; }
  .wave-sidebar-close { display: flex !important; }

  /* Layout: single block, no grid */
  html body .wave-portal-layout {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  /* Sidebar: fixed drawer, off-screen by default */
  html body .wave-portal-sidebar,
  html body #wave-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;       /* HIDDEN */
    width: 260px !important;
    max-width: 82vw !important;
    height: 100dvh !important;
    overflow-y: auto !important;
    z-index: 9002 !important;
    transition: left .27s cubic-bezier(.4,0,.2,1) !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    padding: 50px 14px 20px !important;  /* top padding for close btn */
    background: #fff !important;
  }

  /* OPEN state (JS adds this class) */
  html body .wave-portal-sidebar.wave-sidebar-open,
  html body #wave-sidebar.wave-sidebar-open {
    left: 0 !important;
    box-shadow: 4px 0 30px rgba(15,23,42,.20) !important;
  }

  /* Sidebar nav — vertical list inside drawer */
  html body .wave-portal-sidebar .wave-side-nav,
  html body #wave-sidebar .wave-side-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  html body .wave-portal-sidebar .wave-side-nav a,
  html body #wave-sidebar .wave-side-nav a {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 11px 14px !important;
    text-align: left !important;
    border-radius: 10px !important;
    white-space: normal !important;
    color: #334155 !important;
    text-decoration: none !important;
  }
  html body .wave-side-group summary {
    font-size: 14px !important;
    padding: 11px 14px !important;
    display: flex !important;
  }
  html body .wave-side-subnav {
    display: flex !important;
    flex-direction: column !important;
    padding-left: 12px !important;
    gap: 1px !important;
  }
  html body .wave-side-subnav a {
    font-size: 13px !important;
    padding: 9px 12px !important;
  }
  html body .wave-nav-group-title {
    display: block !important;
    padding: 8px 12px 4px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: #94a3b8 !important;
  }
  html body .wave-sidebar-brand-logo-only {
    padding: 0 0 16px !important;
  }
  html body .wave-sidebar-brand-logo-only .wave-brand-logo {
    width: 150px !important;
  }

  /* Content area: full width */
  html body .wave-portal-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  html body .wave-portal-content .wave-main {
    padding: 12px !important;
  }
  html body .wave-portal-topbar {
    padding: 8px 0 10px !important;
  }
  html body .wave-account-trigger {
    width: 100% !important;
    min-width: 0 !important;
  }
  html body .wave-portal-shell,
  html body .wave-wave-shell {
    border-radius: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    border: none !important;
  }

  /* Metrics: 2 columns on mobile */
  html body .wave-metrics {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
}

@media (max-width: 500px) {
  html body .wave-metrics {
    grid-template-columns: 1fr !important;
  }
  html body .wave-portal-content .wave-main {
    padding: 8px !important;
  }
}


/* === Portal frontend: fully hide WP admin bar so mobile app header is not covered === */
html body.ca-invoicing-shell #wpadminbar,
html body.wave-portal-shell #wpadminbar,
html body.wave-wave-shell #wpadminbar {
  display: none !important;
}

@media (max-width: 900px) {
  html,
  body {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  html body .wave-mobile-topbar {
    top: 0 !important;
  }

  html body .wave-portal-sidebar,
  html body #wave-sidebar {
    top: 0 !important;
    height: 100dvh !important;
  }
}


/* === MOBILE MENU FULL-WIDTH HOTFIX === */
@media (max-width: 900px) {
  html body .wave-mobile-nav-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10010 !important;
    background: rgba(15, 23, 42, 0.34) !important;
  }

  html body .wave-portal-sidebar,
  html body #wave-sidebar {
    left: -100vw !important;
    top: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    padding: 20px 24px 32px !important;
    z-index: 10020 !important;
    box-sizing: border-box !important;
  }

  html body .wave-portal-sidebar.wave-sidebar-open,
  html body #wave-sidebar.wave-sidebar-open {
    left: 0 !important;
  }

  html body .wave-sidebar-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 10030 !important;
  }

  html body .wave-sidebar-brand,
  html body .wave-sidebar-brand-logo-only {
    padding-right: 56px !important;
  }

  body.wave-mobile-menu-open .wave-portal-topbar,
  body.wave-mobile-menu-open .wave-account-menu,
  body.wave-mobile-menu-open .wave-account-trigger,
  body.wave-mobile-menu-open .wave-dashboard-create-menu,
  body.wave-mobile-menu-open .wave-create-toggle,
  body.wave-mobile-menu-open .wave-create-dropdown {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}



/* ======================================================================
   DISCOUNT FIELDS: Description wider, amount+type narrower, trash icon
   ====================================================================== */

/* Discount fields grid: description 2x wider */
html body .wave-discount-fields {
  display: grid !important;
  grid-template-columns: 2fr 90px 64px 36px !important;
  gap: 6px !important;
  align-items: center !important;
  padding: 10px 0 8px !important;
}
html body .wave-discount-fields input[name="discount_description"] {
  width: 100% !important;
  min-width: 0 !important;
}
html body .wave-discount-fields input[name="discount_value"] {
  width: 100% !important;
  min-width: 0 !important;
  text-align: right !important;
}
html body .wave-discount-fields select.wave-discount-type {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 4px !important;
  font-size: 13px !important;
}

/* Trash icon on remove-discount button */
html body .wave-remove-discount {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: #ef4444 !important;
  padding: 0 !important;
  border-radius: 6px !important;
  font-size: 16px !important;
}
html body .wave-remove-discount:hover {
  background: #fee2e2 !important;
}
/* Force dashicons to load on the trash span */
html body .wave-remove-discount .dashicons,
html body .wave-remove-discount .dashicons-trash {
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  line-height: 1 !important;
  color: #ef4444 !important;
}
/* Fallback if dashicons font not loaded */
html body .wave-remove-discount .dashicons-trash::before {
  content: "\f182" !important;
  font-family: dashicons !important;
  font-size: 18px !important;
  color: #ef4444 !important;
}

/* Summary box sizing */
html body .wave-summary-box-vertical,
html body .wave-summary-box {
  min-width: 260px !important;
  max-width: 340px !important;
  margin-left: auto !important;
}


/* FIX: invoice print should not create an empty first page on long invoices */
@media print {
  .wave-public-invoice-flat .wave-public-sheet-flat{
    break-inside: auto !important;
    page-break-inside: auto !important;
    break-before: auto !important;
    page-break-before: auto !important;
    margin-top: 0 !important;
  }

  .wave-public-invoice-flat .wave-public-flat-head,
  .wave-public-invoice-flat .wave-public-flat-meta-row{
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .wave-public-invoice-flat .wave-public-flat-items,
  .wave-public-invoice-flat .wave-public-flat-bottom,
  .wave-public-invoice-flat .wave-public-flat-notes-below,
  .wave-public-invoice-flat .wave-public-flat-footer,
  .wave-public-invoice-flat .wave-public-print-footer{
    break-before: auto !important;
    page-break-before: auto !important;
  }
}


/* FIX: estimate print should not create a blank first page */
@media print {
  .wave-public-invoice-flat.estimate-print .wave-public-sheet-flat{
    break-inside: auto !important;
    page-break-inside: auto !important;
    break-before: auto !important;
    page-break-before: auto !important;
    margin-top: 0 !important;
  }

  .wave-public-invoice-flat.estimate-print .wave-public-flat-head,
  .wave-public-invoice-flat.estimate-print .wave-public-flat-meta-row{
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .wave-public-invoice-flat.estimate-print .wave-public-flat-items,
  .wave-public-invoice-flat.estimate-print .wave-public-flat-bottom,
  .wave-public-invoice-flat.estimate-print .wave-public-flat-notes-below,
  .wave-public-invoice-flat.estimate-print .wave-public-flat-footer,
  .wave-public-invoice-flat.estimate-print .wave-public-print-footer{
    break-before: auto !important;
    page-break-before: auto !important;
  }
}

/* DEFINITIVE FIX: match invoice print visibility logic */
@media print {
  body * {
    visibility: hidden !important;
  }

  .wave-public-invoice-flat {
    visibility: visible !important;
    position: absolute !important;
    left: 0;
    top: 0;
    width: 100%;
  }

  .wave-public-invoice-flat * {
    visibility: visible !important;
  }
}


/* v22.14 — Invoice print ghost-line cleanup
   Removes faint rounded/duplicate top lines in browser print preview. */
@media print {
  body.wave-invoice-print-body,
  body.wave-public-body,
  body.wave-invoice-print-body .wave-public-invoice-flat,
  body.wave-public-body .wave-public-invoice-flat {
    background: #fff !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: 0 !important;
  }

  body.wave-invoice-print-body .wave-public-invoice-flat::before,
  body.wave-invoice-print-body .wave-public-invoice-flat::after,
  body.wave-invoice-print-body .wave-public-sheet-flat::before,
  body.wave-invoice-print-body .wave-public-sheet-flat::after,
  body.wave-public-body .wave-public-invoice-flat::before,
  body.wave-public-body .wave-public-invoice-flat::after,
  body.wave-public-body .wave-public-sheet-flat::before,
  body.wave-public-body .wave-public-sheet-flat::after {
    display: none !important;
    content: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.wave-invoice-print-body .wave-public-sheet-flat,
  body.wave-public-body .wave-public-sheet-flat {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    background-clip: border-box !important;
    margin-top: 0 !important;
  }

  body.wave-invoice-print-body .wave-public-toolbar,
  body.wave-invoice-print-body .wave-payment-manage-card,
  body.wave-public-body .wave-public-toolbar,
  body.wave-public-body .wave-payment-manage-card {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }
}


/* ===== v23 HARD PRINT FIX (ghost lines FINAL) ===== */
@media print {

  html, body {
    background: #ffffff !important;
  }

  /* REMOVE EVERYTHING OUTSIDE INVOICE */
  body * {
    visibility: hidden !important;
  }

  .wave-public-sheet-flat,
  .wave-public-sheet-flat * {
    visibility: visible !important;
  }

  /* FORCE CLEAN PAGE */
  .wave-public-sheet-flat {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;

    margin: 0 !important;
    padding: 14mm 12mm 12mm !important;

    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;

    background: #fff !important;

    width: 190mm !important;
  }

  /* REMOVE ANY GHOST HEADER ELEMENT */
  .wave-public-invoice-flat,
  .wave-public-body,
  .wave-portal-shell,
  .wave-portal-layout {
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  /* KILL ALL pseudo lines */
  *::before,
  *::after {
    display: none !important;
    content: none !important;
  }

}


/* ===== v23.1 PRINT CENTERING + LAST TOP RIGHT LINE FIX ===== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0 !important;
  }

  html,
  body {
    width: 210mm !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  body.wave-invoice-print-body .wave-public-invoice-flat,
  body.wave-public-body .wave-public-invoice-flat {
    position: static !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  body.wave-invoice-print-body .wave-public-sheet-flat,
  body.wave-public-body .wave-public-sheet-flat {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: 186mm !important;
    max-width: 186mm !important;
    margin: 0 auto !important;
    padding: 12mm 0 10mm !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  /* Hide any remaining browser-rendered clipped edge/ghost line */
  body.wave-invoice-print-body .wave-public-sheet-flat::before,
  body.wave-invoice-print-body .wave-public-sheet-flat::after,
  body.wave-public-body .wave-public-sheet-flat::before,
  body.wave-public-body .wave-public-sheet-flat::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 28mm !important;
    height: 3mm !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    z-index: 999999 !important;
  }
}


/* ===== v23.2 FINAL PRINT CLEAN =====
   Removes top ghost rounded lines by using display:none outside invoice sheet,
   not visibility:hidden. Also recenters the printable sheet. */
@media print {
  @page {
    size: A4 portrait;
    margin: 0 !important;
  }

  html,
  body {
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.wave-invoice-print-body * {
    visibility: visible !important;
  }

  body.wave-invoice-print-body > *:not(.wave-public-invoice):not(.wave-public-invoice-flat) {
    display: none !important;
  }

  body.wave-invoice-print-body .wave-public-toolbar,
  body.wave-invoice-print-body .wave-payment-manage-card,
  body.wave-invoice-print-body .no-print,
  body.wave-invoice-print-body .wave-portal-sidebar,
  body.wave-invoice-print-body .wave-portal-topbar,
  body.wave-invoice-print-body #wpadminbar {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body.wave-invoice-print-body .wave-public-invoice,
  body.wave-invoice-print-body .wave-public-invoice-flat {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body.wave-invoice-print-body .wave-public-sheet-flat {
    display: block !important;
    position: relative !important;
    width: 186mm !important;
    max-width: 186mm !important;
    margin: 0 auto !important;
    padding: 12mm 0 10mm !important;
    background: #fff !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body.wave-invoice-print-body .wave-public-invoice::before,
  body.wave-invoice-print-body .wave-public-invoice::after,
  body.wave-invoice-print-body .wave-public-invoice-flat::before,
  body.wave-invoice-print-body .wave-public-invoice-flat::after,
  body.wave-invoice-print-body .wave-public-sheet-flat::before,
  body.wave-invoice-print-body .wave-public-sheet-flat::after {
    display: none !important;
    content: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}


/* ===== v23.4 UNIVERSAL PRINT CENTER FIX (Invoice + Estimate) ===== */
@media print {

  .wave-public-invoice,
  .wave-public-invoice-flat {
    width: 210mm !important;
    max-width: 210mm !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }

  .wave-public-sheet-flat {
    width: 186mm !important;
    max-width: 186mm !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    padding: 12mm 0 10mm !important;
  }

}


/* v23.5 - Modern shared account handoff screen */
.ca-auth-handoff-wrap {
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 18px;
  background:
    radial-gradient(circle at 12% 16%, rgba(49,94,251,.10), transparent 28%),
    radial-gradient(circle at 88% 86%, rgba(14,165,233,.12), transparent 30%),
    #eef4fb;
}
.ca-auth-handoff-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 34px;
  align-items: center;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .10);
  padding: 40px 46px;
  overflow: hidden;
  position: relative;
}
.ca-auth-handoff-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 420px;
  height: 260px;
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(14,165,233,.03));
  border-radius: 50%;
  pointer-events: none;
}
.ca-auth-handoff-art {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 24px;
}
.ca-auth-handoff-logo {
  width: 230px;
  max-width: 100%;
  height: auto;
  display: block;
}
.ca-auth-handoff-icon {
  width: 158px;
  height: 158px;
  border-radius: 50%;
  background: linear-gradient(145deg, #eef6ff, #ffffff);
  border: 1px solid #dce8f7;
  box-shadow: inset 0 0 0 10px rgba(37,99,235,.04), 0 18px 34px rgba(37,99,235,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 54px;
}
.ca-auth-handoff-lock {
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #315efb;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 10px 22px rgba(49,94,251,.28);
}
.ca-auth-handoff-content {
  position: relative;
  z-index: 1;
}
.ca-auth-handoff-kicker {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #315efb;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.ca-auth-handoff-content h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -.05em;
  color: #0f172a;
}
.ca-auth-handoff-content p {
  margin: 0;
  color: #475569;
  font-size: 18px;
  line-height: 1.55;
  max-width: 540px;
}
.ca-auth-handoff-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ca-auth-handoff-btn {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ca-auth-handoff-btn:hover {
  transform: translateY(-1px);
}
.ca-auth-handoff-btn-primary {
  background: linear-gradient(135deg, #315efb, #18aeea);
  color: #fff;
  box-shadow: 0 14px 24px rgba(49,94,251,.24);
}
.ca-auth-handoff-btn-secondary {
  background: #fff;
  color: #0f172a;
  border-color: #315efb;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
@media (max-width: 760px) {
  .ca-auth-handoff-card {
    grid-template-columns: 1fr;
    padding: 30px 24px;
    text-align: center;
  }
  .ca-auth-handoff-content p {
    margin-left: auto;
    margin-right: auto;
  }
  .ca-auth-handoff-actions {
    justify-content: center;
  }
}


/* ===== v24.2 Unified auth handoff + estimate print centering ===== */

/* Reuse the same visual language as the Core account page */
.ca-auth-page--handoff,
.ca-auth-handoff-wrap {
  min-height: 78vh !important;
  padding: 48px 18px !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ca-auth-box--handoff {
  max-width: 960px !important;
  width: min(960px, 100%) !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  background: #fff !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 60px rgba(15,23,42,.10) !important;
  overflow: hidden !important;
}

.ca-auth-box--handoff .ca-auth-left {
  padding: 48px 44px !important;
  background: linear-gradient(145deg, #0c1a3a 0%, #0f2d63 60%, #1e4d9b 100%) !important;
  color: #fff !important;
}

.ca-auth-box--handoff .ca-auth-logo {
  width: 230px !important;
  height: auto !important;
  filter: none !important;
}

.ca-auth-box--handoff .ca-auth-right {
  padding: 40px 44px !important;
  background: #fff !important;
}

.ca-auth-handoff-actions {
  margin-top: 22px !important;
  display: flex !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.ca-auth-btn-inline,
.ca-auth-btn-secondary-inline {
  min-height: 48px !important;
  padding: 0 22px !important;
  border-radius: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-weight: 800 !important;
}

.ca-auth-btn-inline {
  background: linear-gradient(135deg, #315efb, #18aeea) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 14px 24px rgba(49,94,251,.22) !important;
}

.ca-auth-btn-secondary-inline {
  background: #fff !important;
  color: #315efb !important;
  border: 1px solid #315efb !important;
}

/* Mobile */
@media (max-width: 820px) {
  .ca-auth-box--handoff {
    grid-template-columns: 1fr !important;
  }
  .ca-auth-box--handoff .ca-auth-left,
  .ca-auth-box--handoff .ca-auth-right {
    padding: 30px 24px !important;
  }
}

/* Estimate print: force true A4 centering regardless of body class or previous rules */
@media print {
  @page {
    size: A4 portrait !important;
    margin: 0 !important;
  }

  html,
  body {
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  .wave-public-invoice,
  .wave-public-invoice-flat,
  .estimate-print {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: block !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .wave-public-sheet-flat {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
    width: 186mm !important;
    max-width: 186mm !important;
    min-width: 186mm !important;
    margin: 0 auto !important;
    padding: 12mm 0 10mm !important;
    display: block !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  .wave-public-sheet-flat::before,
  .wave-public-sheet-flat::after,
  .wave-public-invoice-flat::before,
  .wave-public-invoice-flat::after {
    content: none !important;
    display: none !important;
  }
}


/* ===== v24.3 official logo + logged-in invoice sidebar ===== */

/* ── Logo base reset — natural proportions everywhere ───────────── */
.wave-brand-logo,
.wave-mobile-logo,
.wave-auth-brand-logo,
.ca-auth-logo,
.ca-auth-handoff-logo,
.wave-public-logo,
.wave-public-powered-by-logo {
  object-fit: contain !important;
  filter: none !important;         /* never invert the full-colour logo */
  display: block !important;
}

/* Auth / login screen logo */
.wave-auth-brand-logo {
  width: 220px !important;
  max-width: 100% !important;
  height: auto !important;
  margin-bottom: 16px !important;
}

/* Sidebar on logged-in View Invoice page */
body.wave-public-view-with-sidebar {
  padding: 0 !important;
  background: #edf2f7 !important;
}

.wave-public-view-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: #edf2f7;
}

.wave-public-view-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #dbe5f0;
  padding: 22px 18px;
  box-shadow: 8px 0 24px rgba(15,23,42,.04);
  z-index: 20;
}

.wave-public-view-sidebar .wave-brand-logo {
  width: 100% !important;
  max-width: 210px !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

.wave-public-view-main {
  min-width: 0;
  padding: 26px 18px 42px;
}

body.wave-public-view-with-sidebar .wave-public-invoice-flat {
  max-width: 1040px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .wave-public-view-shell {
    display: block;
  }
  .wave-public-view-sidebar {
    display: none !important;
  }
  .wave-public-view-main {
    padding: 14px;
  }
}

/* Estimate print centering: target the actual print body used by estimates too */
@media print {
  body.wave-invoice-print-body,
  body.wave-public-body {
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .wave-public-view-sidebar,
  .wave-public-view-with-sidebar .wave-public-view-sidebar {
    display: none !important;
  }

  .wave-public-view-shell,
  .wave-public-view-main,
  .wave-public-invoice,
  .wave-public-invoice-flat,
  .estimate-print {
    display: block !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .wave-public-sheet-flat {
    display: block !important;
    box-sizing: border-box !important;
    width: 186mm !important;
    max-width: 186mm !important;
    min-width: 186mm !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 2mm !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
}


/* ===== v24.4 View Invoice sidebar: match normal portal sidebar layout ===== */
@media screen {
  body.wave-public-view-with-sidebar {
    background: #edf2f7 !important;
    padding: 38px 42px !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell {
    width: min(1500px, 100%) !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: 240px minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    background: transparent !important;
    min-height: auto !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    position: sticky !important;
    top: 24px !important;
    height: auto !important;
    min-height: calc(100vh - 76px) !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border: 1px solid #dbe5f0 !important;
    border-radius: 18px !important;
    padding: 24px 14px !important;
    box-shadow: none !important;
    z-index: 20 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-sidebar-brand {
    padding: 0 0 26px !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-brand-logo {
    width: 100% !important;
    max-width: 210px !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav {
    font-size: 13px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-nav-group-title {
    font-size: 10px !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    font-weight: 800 !important;
    padding: 0 10px !important;
    margin: 0 0 12px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav > a,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group > summary,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav a {
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    min-height: 36px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav > a,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group > summary {
    padding: 10px 12px !important;
    margin: 2px 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav {
    padding: 6px 0 6px 10px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav a {
    padding: 9px 12px !important;
    margin: 2px 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar a.active,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar summary.active {
    background: #dbeafe !important;
    color: #0f4fd6 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-main {
    padding: 0 !important;
    min-width: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    max-width: 1040px !important;
    margin: 0 auto !important;
  }
}

@media screen and (max-width: 900px) {
  body.wave-public-view-with-sidebar {
    padding: 14px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell {
    display: block !important;
    width: 100% !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    display: none !important;
  }
}


/* ===== v24.6 View Invoice sidebar repair: keep working layout, match normal sidebar ===== */
@media screen {
  body.wave-public-view-with-sidebar {
    background: #edf2f7 !important;
    padding: 38px 42px !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell {
    width: min(1500px, 100%) !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: 200px minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    background: transparent !important;
    min-height: auto !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    /* Same visual card as the normal portal sidebar */
    position: sticky !important;
    top: 24px !important;
    height: auto !important;
    min-height: calc(100vh - 76px) !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border: 1px solid #dbe5f0 !important;
    border-radius: 18px !important;
    padding: 24px 14px !important;
    box-shadow: none !important;
    z-index: 20 !important;
    box-sizing: border-box !important;
    width: auto !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-sidebar-brand {
    padding: 0 8px 26px !important;
    margin: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-brand-logo {
    width: 154px !important;
    max-width: 154px !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav {
    display: grid !important;
    gap: 2px !important;
    font-size: 13px !important;
    font-family: inherit !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-nav-group-title {
    font-size: 10px !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    font-weight: 800 !important;
    padding: 0 10px !important;
    margin: 0 0 12px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav > a,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 36px !important;
    padding: 10px 12px !important;
    margin: 2px 0 !important;
    border-radius: 10px !important;
    color: #0f172a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group {
    margin: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group > summary {
    cursor: pointer !important;
    list-style: none !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav {
    display: grid !important;
    gap: 2px !important;
    padding: 6px 0 6px 10px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav a {
    display: flex !important;
    align-items: center !important;
    min-height: 34px !important;
    padding: 9px 12px !important;
    margin: 2px 0 !important;
    border-radius: 10px !important;
    color: #0f172a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar a.active,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar summary.active {
    background: #dbeafe !important;
    color: #0f4fd6 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-main {
    padding: 0 !important;
    min-width: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    max-width: 1040px !important;
    margin: 0 auto !important;
  }

  body.wave-public-view-with-sidebar .wave-public-toolbar {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    max-width: 1040px !important;
    margin: 0 auto 14px !important;
  }

  body.wave-public-view-with-sidebar .wave-payment-manage-card {
    max-width: 1040px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media screen and (max-width: 900px) {
  body.wave-public-view-with-sidebar {
    padding: 14px !important;
  }
  body.wave-public-view-with-sidebar .wave-public-view-shell {
    display: block !important;
    width: 100% !important;
  }
  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    display: none !important;
  }
}


/* ===== v24.7 EXACT sidebar style match for View Invoice ===== */
@media screen {
  body.wave-public-view-with-sidebar {
    --ds-sidebar-w: 200px !important;
    --ds-gap: 18px !important;
    --ds-bg: #edf2f7 !important;
    --ds-surface: #ffffff !important;
    --ds-border: #dbe5f0 !important;
    --ds-r-xl: 18px !important;
    --ds-r-md: 10px !important;
    --ds-shadow-sm: none !important;
    --ds-text: #0f172a !important;
    --ds-text-2: #1e293b !important;
    --ds-text-3: #64748b !important;
    background: var(--ds-bg) !important;
    padding: 38px 42px !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell {
    width: min(1500px, 100%) !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: var(--ds-sidebar-w) minmax(0, 1fr) !important;
    gap: var(--ds-gap) !important;
    align-items: start !important;
    background: transparent !important;
    min-height: auto !important;
    padding: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar.wave-portal-sidebar.ca-invoicing-sidebar,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    position: sticky !important;
    top: 16px !important;
    min-height: calc(100vh - 60px) !important;
    height: auto !important;
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-r-xl) !important;
    box-shadow: var(--ds-shadow-sm) !important;
    padding: 18px 14px !important;
    overflow: hidden !important;
    width: auto !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-sidebar-brand-logo-only,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-sidebar-brand {
    padding: 14px 8px 20px !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-brand-logo {
    width: 250px !important;
    max-width: 250px !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-nav-group-title {
    padding: 8px 10px 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: var(--ds-text-3) !important;
    margin: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav {
    display: block !important;
    font-family: inherit !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav a {
    display: block !important;
    padding: 9px 12px !important;
    margin: 1px 0 !important;
    border-radius: var(--ds-r-md) !important;
    color: var(--ds-text-2) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: normal !important;
    min-height: 0 !important;
    text-decoration: none !important;
    transition: background .12s, color .12s !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav a:hover {
    background: #f0f7ff !important;
    color: #1d4ed8 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav a.active {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group {
    margin: 2px 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary {
    list-style: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 9px 12px !important;
    margin: 0 !important;
    border-radius: var(--ds-r-md) !important;
    color: var(--ds-text-2) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: normal !important;
    min-height: 0 !important;
    cursor: pointer !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary::-webkit-details-marker {
    display: none !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary::after {
    content: "▾" !important;
    font-size: 11px !important;
    color: var(--ds-text-3) !important;
    transition: transform .18s ease !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group[open] summary::after {
    transform: rotate(180deg) !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary:hover {
    background: #f0f7ff !important;
    color: #1d4ed8 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary.active {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav {
    padding: 3px 0 3px 12px !important;
    display: grid !important;
    gap: 1px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav a {
    font-size: 13px !important;
    padding: 9px 12px !important;
    margin: 1px 0 !important;
    font-weight: 500 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-main {
    padding: 0 !important;
    min-width: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-toolbar {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    max-width: 1040px !important;
    margin: 0 auto 14px !important;
  }

  body.wave-public-view-with-sidebar .wave-payment-manage-card,
  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    max-width: 1040px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media screen and (max-width: 900px) {
  body.wave-public-view-with-sidebar {
    padding: 14px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell {
    display: block !important;
    width: 100% !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    display: none !important;
  }
}


/* ===== v24.8 TRUE MATCH: View Invoice uses the exact normal portal sidebar sizing/font/layout ===== */
@media screen {
  body.wave-public-view-with-sidebar {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell.wave-portal-shell {
    /* exact same shell values as normal invoice pages */
    --ds-sidebar-w: 232px !important;
    --ds-shell-max: 1680px !important;
    --ds-gap: 20px !important;
    width: min(var(--ds-shell-max), calc(100% - 32px)) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 18px !important;
    background: var(--ds-bg) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 24px !important;
    overflow-x: hidden !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-layout {
    display: grid !important;
    grid-template-columns: var(--ds-sidebar-w) minmax(0, 1fr) !important;
    gap: var(--ds-gap) !important;
    align-items: start !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-shell.wave-portal-shell *,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar *,
  body.wave-public-view-with-sidebar .wave-public-view-main * {
    font-family: var(--ds-font) !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar.wave-portal-sidebar.ca-invoicing-sidebar {
    /* exact normal sidebar card */
    position: sticky !important;
    top: 16px !important;
    min-height: calc(100vh - 60px) !important;
    height: auto !important;
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-r-xl) !important;
    box-shadow: var(--ds-shadow-sm) !important;
    padding: 18px 14px !important;
    overflow: hidden !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-sidebar-brand-logo-only,
  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-sidebar-brand {
    padding: 14px 0 20px !important;   /* no side padding — full content width for logo */
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-brand-logo {
    width: 100% !important;
    max-width: 190px !important;       /* fits inside 204px content area (232px − 2×14px padding) */
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-nav-group-title {
    padding: 8px 10px 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: var(--ds-text-3) !important;
    margin: 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav a {
    display: flex !important;          /* was block — needed for icon+text alignment */
    align-items: center !important;
    justify-content: flex-start !important; /* override v24.6 space-between */
    gap: 9px !important;
    padding: 9px 12px !important;
    margin: 1px 0 !important;
    border-radius: var(--ds-r-md) !important;
    color: var(--ds-text-2) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: normal !important;
    min-height: 0 !important;
    text-decoration: none !important;
    transition: background .12s, color .12s !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav a:hover {
    background: #f0f7ff !important;
    color: #1d4ed8 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-nav a.active {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group {
    margin: 2px 0 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary {
    list-style: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 9px 12px !important;
    margin: 0 !important;
    border-radius: var(--ds-r-md) !important;
    color: var(--ds-text-2) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: normal !important;
    min-height: 0 !important;
    cursor: pointer !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary::-webkit-details-marker {
    display: none !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary::after {
    content: "▾" !important;
    font-size: 11px !important;
    color: var(--ds-text-3) !important;
    transition: transform .18s ease !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group[open] summary::after {
    transform: rotate(180deg) !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary:hover {
    background: #f0f7ff !important;
    color: #1d4ed8 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-group summary.active {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav {
    padding: 3px 0 3px 12px !important;
    display: grid !important;
    gap: 1px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-sidebar .wave-side-subnav a {
    font-size: 13px !important;
    padding: 9px 12px !important;
    margin: 1px 0 !important;
    font-weight: 500 !important;
  }

  body.wave-public-view-with-sidebar .wave-public-view-main {
    min-width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.wave-public-view-with-sidebar .wave-public-toolbar,
  body.wave-public-view-with-sidebar .wave-payment-manage-card,
  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    max-width: none !important;
  }

  body.wave-public-view-with-sidebar .wave-public-toolbar {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin: 0 0 14px !important;
  }

  body.wave-public-view-with-sidebar .wave-payment-manage-card {
    margin: 0 0 18px !important;
  }

  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    margin: 0 !important;
  }
}

@media screen and (max-width: 900px) {
  body.wave-public-view-with-sidebar .wave-public-view-shell.wave-portal-shell {
    display: block !important;
    width: calc(100% - 28px) !important;
    padding: 14px !important;
  }
  body.wave-public-view-with-sidebar .wave-public-view-sidebar {
    display: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════
   MOBILE POLISH — Responsive fixes for ≤680px screens only
   All rules are inside media queries — zero desktop impact.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Table wraps always scrollable ─────────────────────────────────── */
.wave-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Toolbar: forms inside toolbar must stretch like buttons ────────── */
.wave-public-toolbar .wave-inline-form,
.wave-public-toolbar form {
  display: contents;
}

/* ── Estimates: view page duplicate button consistent ───────────────── */
.wave-public-toolbar form button.wave-public-toolbtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ── Invoice / Estimate document: responsive two-column → one-column ─ */
@media (max-width: 680px) {
  .wave-public-sheet-flat {
    padding: 20px 16px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .wave-public-flat-head {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .wave-public-flat-titlebox { text-align: left !important; }
  .wave-public-flat-kicker   { font-size: 22px !important; }
  .wave-public-flat-business-lines { text-align: left !important; }

  .wave-public-flat-meta-row {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .wave-public-flat-meta-box > div {
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
    font-size: 12px !important;
  }

  .wave-public-flat-items-head { display: none !important; }
  .wave-public-flat-item-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid var(--ds-border) !important;
  }
  .wave-public-flat-item-row > div {
    text-align: left !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  .wave-public-flat-item-row > div:nth-child(2)::before { content: "Qty: ";    font-weight: 600; color: var(--ds-text-3); font-size: 11px; }
  .wave-public-flat-item-row > div:nth-child(3)::before { content: "Price: ";  font-weight: 600; color: var(--ds-text-3); font-size: 11px; }
  .wave-public-flat-item-row > div:nth-child(4)::before { content: "Amount: "; font-weight: 600; color: var(--ds-text-3); font-size: 11px; }
  .wave-public-flat-item-row > div:nth-child(2),
  .wave-public-flat-item-row > div:nth-child(3),
  .wave-public-flat-item-row > div:nth-child(4) {
    display: inline-block !important;
    width: auto !important;
    margin-right: 12px !important;
    font-size: 12px !important;
    color: var(--ds-text-2) !important;
  }

  .wave-public-flat-bottom {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .wave-public-flat-totals {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  .wave-public-flat-totals > div { font-size: 13px !important; }
  .wave-public-print-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  .wave-public-flat-footer-bank {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
}

/* ── Fix: Invoice/Estimate totals — match base selector specificity ─── */
@media (max-width: 680px) {
  .wave-public-invoice-flat .wave-public-flat-totals {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
  }
  .wave-public-invoice-flat .wave-public-sheet-flat {
    overflow: visible !important;
  }
}

/* ── Toolbar buttons: all full-width on mobile ──────────────────────── */
@media (max-width: 680px) {
  .wave-public-toolbar {
    position: static !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 !important;
    margin-bottom: 12px !important;
  }
  .wave-public-toolbtn {
    width: 100% !important;
    flex: 1 1 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }
  .wave-public-toolbar form,
  .wave-public-toolbar .wave-inline-form,
  .wave-public-toolbar .wave-public-toolbar-form {
    display: block !important;
    width: 100% !important;
  }
  .wave-public-toolbar form .wave-public-toolbtn,
  .wave-public-toolbar .wave-inline-form .wave-public-toolbtn,
  .wave-public-toolbar .wave-public-toolbar-form .wave-public-toolbtn {
    width: 100% !important;
    display: flex !important;
  }
}

/* ── Edit form: no overflow, all fields full-width ──────────────────── */
@media (max-width: 680px) {
  .wave-invoice-form,
  .wave-estimate-form {
    padding: 0 !important;
    overflow: hidden !important;
  }
  .wave-invoice-form .wave-form-row,
  .wave-estimate-form .wave-form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .wave-invoice-form .wave-form-group,
  .wave-estimate-form .wave-form-group,
  .wave-invoice-form input,
  .wave-invoice-form select,
  .wave-invoice-form textarea,
  .wave-estimate-form input,
  .wave-estimate-form select,
  .wave-estimate-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .wave-item-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-bottom: 12px !important;
  }
  .wave-item-row > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .wave-item-tax-label,
  .wave-item-tax-select {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .wave-product-picker,
  .wave-product-dropdown {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .wave-items-header { display: none !important; }

  .wave-discount-row,
  .wave-discount-section {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .wave-discount-row > *,
  .wave-discount-section > * {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ── Line item rows — refined grid layout ───────────────────────────── */
@media (max-width: 680px) {
  .wave-invoice-form .wave-item-row {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto auto auto auto !important;
    padding-bottom: 14px !important;
  }
  .wave-invoice-form .wave-item-row > .wave-product-picker {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
  }
  .wave-invoice-form .wave-item-row > label:nth-of-type(2) {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }
  .wave-invoice-form .wave-item-row > label:nth-of-type(3) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }
  .wave-invoice-form .wave-item-row > label:nth-of-type(4) {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }
  .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    position: static !important;
    top: auto !important; bottom: auto !important;
    right: auto !important; left: auto !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .wave-invoice-form .wave-item-row > .wave-item-row-actions {
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
    justify-content: flex-start !important;
    padding-bottom: 0 !important;
  }
  .wave-invoice-form .wave-product-dropdown {
    width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
  }
}

/* ── Payment manage card: stack on mobile ───────────────────────────── */
@media (max-width: 680px) {
  .wave-payment-manage-card {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .wave-payment-manage-card .wave-btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }
  .wave-payment-history-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .wave-payment-history-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    width: 100% !important;
  }
  .wave-dot-sep { display: none !important; }
  .wave-payment-history-actions .wave-link-button,
  .wave-payment-history-actions .wave-link-inline,
  .wave-payment-history-actions .wave-danger-link {
    background: #f1f5f9 !important;
    border-radius: 6px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    text-decoration: none !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
}

/* ── General cards / list pages ─────────────────────────────────────── */
@media (max-width: 680px) {
  .wave-header-card {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }
  .wave-header-card .wave-actions,
  .wave-list-head .wave-actions {
    flex-direction: column !important;
    width: 100% !important;
  }
  .wave-header-card .wave-actions .wave-btn,
  .wave-list-head .wave-actions .wave-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .wave-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .wave-table th,
  .wave-table td {
    font-size: 12px !important;
    padding: 8px 6px !important;
    white-space: nowrap !important;
  }
  .wave-table td:first-child,
  .wave-table th:first-child {
    white-space: normal !important;
    max-width: 110px !important;
  }

  .wave-filters,
  .wave-filter-row {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .wave-filters input,
  .wave-filters select,
  .wave-filter-row input,
  .wave-filter-row select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .wave-modal,
  .wave-overlay-content {
    width: calc(100vw - 32px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 20px 16px !important;
    margin: 16px auto !important;
    box-sizing: border-box !important;
  }
}

/* ── Edit-form embedded tables — card layout ────────────────────────── */
@media (max-width: 680px) {
  .wave-grid .wave-table-wrap { overflow-x: hidden !important; }
  .wave-grid .wave-table {
    min-width: 0 !important;
    width: 100% !important;
  }
  .wave-grid .wave-table thead { display: none !important; }
  .wave-grid .wave-table,
  .wave-grid .wave-table tbody,
  .wave-grid .wave-table tr,
  .wave-grid .wave-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .wave-grid .wave-table tr {
    border: 1px solid var(--ds-border, #e2e8f0) !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    background: var(--ds-surface, #fff) !important;
    padding: 10px 12px !important;
  }
  .wave-grid .wave-table td {
    border: 0 !important;
    padding: 4px 0 !important;
    text-align: left !important;
    font-size: 13px !important;
    white-space: normal !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
  }
  .wave-grid .wave-table td:last-child {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 6px !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--ds-border, #e2e8f0) !important;
  }
}

/* ── Product & Tax dropdowns — readable on mobile ────────────────────── */
@media (max-width: 680px) {
  .wave-product-dropdown {
    width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    left: 0 !important;
    max-height: 50vh !important;
  }
  .wave-tax-dropdown {
    width: calc(100vw - 64px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    left: 0 !important;
  }
  .wave-product-option-top {
    flex-wrap: wrap !important;
    gap: 4px 12px !important;
  }
  .wave-product-option-top em { white-space: normal !important; }
  .wave-product-option span {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}

/* ── Mobile topbar: logo + hamburger row ────────────────────────────── */
@media (max-width: 680px) {
  .wave-mobile-topbar {
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
  .wave-mobile-logo {
    width: 140px !important;
    height: auto !important;
    max-width: 50vw !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════
   DARK MODE — manual toggle via [data-theme="dark"] on .wave-portal-shell
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Token overrides ─────────────────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] {
  /* Surfaces */
  --ds-bg:          #0f172a;
  --ds-surface:     #1e293b;
  --ds-border:      #334155;
  --ds-border-2:    #475569;

  /* Text */
  --ds-text:        #f1f5f9;
  --ds-text-2:      #cbd5e1;
  --ds-text-3:      #94a3b8;
  --ds-text-4:      #64748b;

  /* Brand — lighter for dark bg */
  --ds-primary:     #38bdf8;
  --ds-primary-d:   #0ea5e9;
  --ds-primary-bg:  #0c4a6e;
  --ds-primary-txt: #bae6fd;

  /* Shadows */
  --ds-shadow-sm:   0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --ds-shadow-md:   0 4px 16px rgba(0,0,0,.5);
  --ds-shadow-lg:   0 12px 32px rgba(0,0,0,.6);

  /* Status badges */
  --c-draft-bg:     #1e293b; --c-draft-txt:   #94a3b8; --c-draft-bdr:   #334155;
  --c-sent-bg:      #1e3a5f; --c-sent-txt:    #93c5fd; --c-sent-bdr:    #1d4ed8;
  --c-paid-bg:      #14532d; --c-paid-txt:    #86efac; --c-paid-bdr:    #166534;
  --c-unpaid-bg:    #451a03; --c-unpaid-txt:  #fcd34d; --c-unpaid-bdr:  #92400e;
  --c-overdue-bg:   #450a0a; --c-overdue-txt: #fca5a5; --c-overdue-bdr: #b91c1c;
  --c-partial-bg:   #2e1065; --c-partial-txt: #c4b5fd; --c-partial-bdr: #6d28d9;
}

/* ── 2. Shell & layout backgrounds ──────────────────────────────────── */
.wave-portal-shell[data-theme="dark"],
.wave-portal-shell[data-theme="dark"] .wave-wave-shell {
  background: var(--ds-bg) !important;
  color: var(--ds-text) !important;
}

/* ── 3. Sidebar nav — hard-coded hover/active overrides ─────────────── */
.wave-portal-shell[data-theme="dark"] .wave-side-nav a {
  color: var(--ds-text-2) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-side-nav a:hover {
  background: rgba(56,189,248,.10) !important;
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-side-nav a.active {
  background: rgba(56,189,248,.18) !important;
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-side-group summary {
  color: var(--ds-text-2) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-side-group summary:hover {
  background: rgba(56,189,248,.10) !important;
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-side-group summary.active {
  background: rgba(56,189,248,.18) !important;
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-nav-icon {
  color: var(--ds-text-3);
}

/* ── 4. Account menu ─────────────────────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-account-trigger {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #bae6fd !important;
}
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown-head {
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown-head strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown-head span {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown a,
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown button {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown a:hover,
.wave-portal-shell[data-theme="dark"] .wave-account-dropdown button:hover {
  background: rgba(255,255,255,.06) !important;
}

/* ── 5. Inputs, selects, textareas ──────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] input,
.wave-portal-shell[data-theme="dark"] select,
.wave-portal-shell[data-theme="dark"] textarea {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] input::placeholder,
.wave-portal-shell[data-theme="dark"] textarea::placeholder {
  color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] input:focus,
.wave-portal-shell[data-theme="dark"] select:focus,
.wave-portal-shell[data-theme="dark"] textarea:focus {
  border-color: #38bdf8 !important;
  outline-color: rgba(56,189,248,.3) !important;
}

/* ── 6. Tables ───────────────────────────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-table thead th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-table td {
  border-bottom-color: #334155 !important;
  color: var(--ds-text-2) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-table tbody tr:hover td {
  background: rgba(255,255,255,.04) !important;
}

/* ── 7. Buttons ──────────────────────────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-btn-secondary {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-btn-secondary:hover {
  background: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-link-btn {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-link-btn:hover {
  background: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-btn {
  background: #1e293b !important;
  border-color: #7f1d1d !important;
  color: #fca5a5 !important;
}

/* ── 8. Metric cards ─────────────────────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] .metric {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* ── 9. Form labels & section heads ─────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] label {
  color: var(--ds-text-2) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-section-head h2 {
  color: var(--ds-text) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-form-label,
.wave-portal-shell[data-theme="dark"] .wave-field-label {
  color: var(--ds-text-3) !important;
}

/* ── 10. Dark mode toggle button ─────────────────────────────────────── */
.ca-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  color: var(--ds-text-3);
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  flex-shrink: 0;
  padding: 0;
}
.ca-theme-btn:hover {
  background: #f0f7ff;
  border-color: #bfdbfe;
  color: var(--ds-primary);
}
.wave-portal-shell[data-theme="dark"] .ca-theme-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
.wave-portal-shell[data-theme="dark"] .ca-theme-btn:hover {
  background: #334155;
  border-color: #475569;
  color: #38bdf8;
}
/* Show moon on light, sun on dark */
.ca-theme-icon-sun  { display: none; }
.ca-theme-icon-moon { display: block; }
.wave-portal-shell[data-theme="dark"] .ca-theme-icon-sun  { display: block; }
.wave-portal-shell[data-theme="dark"] .ca-theme-icon-moon { display: none; }

/* ── 11. Dashboard wvd-* inline-style overrides (specificity wins) ─── */
.wave-portal-shell[data-theme="dark"] .wvd-section-head h2 {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-section-head p {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-section-head .wvd-view-link {
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-chart-legend {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-period-btns span {
  color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-period-btns span.active {
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-owing-grid h3 {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-owing-row {
  color: #94a3b8 !important;
  border-bottom-color: #1e293b !important;
}
.wave-portal-shell[data-theme="dark"] .wvd-owing-row.coming {
  color: #38bdf8 !important;
}
/* Payable & Owing main heading */
.wave-portal-shell[data-theme="dark"] .wave-card h2[style],
.wave-portal-shell[data-theme="dark"] .wave-card h3[style] {
  color: #f1f5f9 !important;
}
/* Catch-all: any hard-coded dark heading inside a card */
.wave-portal-shell[data-theme="dark"] .wave-card h2,
.wave-portal-shell[data-theme="dark"] .wave-card h3,
.wave-portal-shell[data-theme="dark"] .wave-card h4 {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-card p,
.wave-portal-shell[data-theme="dark"] .wave-card > div > p {
  color: #94a3b8 !important;
}

/* ── 12. Create / Actions dropdowns ─────────────────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-create-dropdown,
.wave-portal-shell[data-theme="dark"] .wave-actions-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-create-dropdown a,
.wave-portal-shell[data-theme="dark"] .wave-create-dropdown button,
.wave-portal-shell[data-theme="dark"] .wave-actions-dropdown a,
.wave-portal-shell[data-theme="dark"] .wave-actions-dropdown button {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-create-dropdown a:hover,
.wave-portal-shell[data-theme="dark"] .wave-create-dropdown button:hover,
.wave-portal-shell[data-theme="dark"] .wave-actions-dropdown a:hover,
.wave-portal-shell[data-theme="dark"] .wave-actions-dropdown button:hover {
  background: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-actions-dropdown .danger {
  color: #f87171 !important;
}

/* ── 12b. PORTALED dropdowns — JS moves to document.body ────────────── */
/* caThemeToggle() also sets document.body[data-theme="dark"]              */
body[data-theme="dark"] .wave-actions-dropdown-portal {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}
body[data-theme="dark"] .wave-actions-dropdown-portal a,
body[data-theme="dark"] .wave-actions-dropdown-portal button {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}
body[data-theme="dark"] .wave-actions-dropdown-portal a:hover,
body[data-theme="dark"] .wave-actions-dropdown-portal button:hover {
  background: #334155 !important;
}
body[data-theme="dark"] .wave-actions-dropdown-portal .danger {
  color: #f87171 !important;
}

/* ── 12c. Floating toggle button on public invoice/estimate view ─────── */
.ca-theme-btn-public {
  position: fixed;
  top: 14px;
  left: 246px;
  z-index: 99999;
}

/* ── 13. Invoice / Estimate summary (totals) box ─────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-summary-box-vertical,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-box-vertical,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-col-2 > .wave-summary-box-vertical {
  background: #0f172a !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-summary-row,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-row {
  color: #94a3b8 !important;
  border-bottom-color: #1e293b !important;
}
.wave-portal-shell[data-theme="dark"] .wave-summary-row strong,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-row strong {
  color: #f1f5f9 !important;
}

/* ── 14. Reports — wvr-* classes ─────────────────────────────────────── */
/* KPI cards */
.wave-portal-shell[data-theme="dark"] .wvr-kpi {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-kpi .lbl {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-kpi .val {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-kpi.c-blue  .val { color: #38bdf8 !important; }
.wave-portal-shell[data-theme="dark"] .wvr-kpi.c-green .val { color: #4ade80 !important; }
.wave-portal-shell[data-theme="dark"] .wvr-kpi.c-amber .val { color: #fbbf24 !important; }
.wave-portal-shell[data-theme="dark"] .wvr-kpi.c-red   .val { color: #f87171 !important; }

/* Chart cards */
.wave-portal-shell[data-theme="dark"] .wvr-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-card h3 {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-no-data {
  color: #475569 !important;
}

/* Date filter bar */
.wave-portal-shell[data-theme="dark"] .wvr-date-form {
  background: #0f172a !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-date-form label {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-date-form input[type=date] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

/* Reports index page cards */
.wave-portal-shell[data-theme="dark"] .wvr-index-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-index-section h2 {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-section-desc {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-link {
  border-bottom-color: #334155 !important;
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-link:hover {
  background: rgba(255,255,255,.04) !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-link .wvr-rl-title {
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-link .wvr-rl-desc {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-link .wvr-rl-arrow {
  color: #475569 !important;
}

/* Report content wrapper & tables */
.wave-portal-shell[data-theme="dark"] .wvr-report-wrap {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-table th {
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-table td {
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-table .total-row td {
  background: #0f172a !important;
  border-top-color: #334155 !important;
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-table .subtotal-row td {
  background: #0f172a !important;
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-report-table .section-head td {
  background: #0f172a !important;
  color: #94a3b8 !important;
}

/* ── 15. Customer Statements — wvst-* classes ────────────────────────── */
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar {
  background: #0f172a !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar select,
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar input[type=date] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-summary {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-table tr.row-open td,
.wave-portal-shell[data-theme="dark"] .wvst-table tr.row-close td {
  background: #0f172a !important;
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-table tr.final-total td {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-more-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-more-dropdown a,
.wave-portal-shell[data-theme="dark"] .wvst-more-dropdown button {
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-more-dropdown a:hover,
.wave-portal-shell[data-theme="dark"] .wvst-more-dropdown button:hover {
  background: #0f172a !important;
}

/* ── 17a. Cards — guarantee dark surface via explicit rule ───────────── */
/* (Needed because CSS custom-property inheritance can fail if a more      */
/*  specific rule anywhere re-declares --ds-surface to #fff)               */
.wave-portal-shell[data-theme="dark"] .wave-card,
.wave-portal-shell[data-theme="dark"] .wave-header-card {
  background: #1e293b !important;
}

/* ── 17b. Status-note box — transparent so the dark card shows through ── */
.wave-portal-shell[data-theme="dark"] .wave-auto-status-note,
.wave-portal-shell[data-theme="dark"] .wave-auto-status-note .wave-subtle {
  background: transparent !important;
  color: #94a3b8 !important;
}

/* ── 17. Invoice form — new customer inline panel ────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-inline-customer {
  background: #0f172a !important;
  border-color: #334155 !important;
}

/* ── 18. Line item inputs — override hard-coded #fff !important rules ── */
.wave-portal-shell[data-theme="dark"] .wave-item-row input,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-row input,
.wave-portal-shell[data-theme="dark"] .wave-item-row input[type="text"],
.wave-portal-shell[data-theme="dark"] .wave-item-row input[type="number"] {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
/* Items box container — ensure no rogue white background */
.wave-portal-shell[data-theme="dark"] .wave-items-box {
  background: transparent !important;
}
.wave-portal-shell[data-theme="dark"] .wave-item-row {
  background: transparent !important;
}

/* ── 19. Status badge — unsent (uses hard-coded grays) ───────────────── */
.wave-portal-shell[data-theme="dark"] .wave-status-select.status-unsent {
  background: #334155 !important;
  color: #94a3b8 !important;
  border-color: #475569 !important;
}

/* ── 20. Tax & product dropdown — full dark override ─────────────────── */
/* Container */
.wave-portal-shell[data-theme="dark"] .wave-tax-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-product-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
}
/* Options — explicit bg (can't rely on var() cascading through high-z stacking) */
.wave-portal-shell[data-theme="dark"] .wave-tax-option,
.wave-portal-shell[data-theme="dark"] .wave-tax-create {
  background: #1e293b !important;
  border-top-color: #334155 !important;
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-tax-option em {
  color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] .wave-tax-empty {
  color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] .wave-tax-option:hover {
  background: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-product-option {
  background: #1e293b !important;
  border-top-color: #334155 !important;
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-product-option:hover {
  background: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-product-option-top strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-product-option span {
  color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] .wave-product-empty {
  color: #64748b !important;
}

/* ── 21. Invoice/Estimate document — "Amount Due / Total" header box ──── */
/* .wave-public-flat-due { background: #f8fafc } is hard-coded light gray  */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due {
  background: #0f172a !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due span {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due strong {
  color: #f1f5f9 !important;
}
/* Document text inside the printable area — keep readable in dark mode */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-meta-box span {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-meta-box strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-billto strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-billto-line,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-billto span {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-label {
  color: #64748b !important;
}

/* ── 22. Estimate/Invoice document — totals, items, footer text ──────── */
/* html body .wave-public-flat-totals strong uses hard-coded #0f172a      */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-totals > div {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-totals span {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-totals strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-total {
  border-top-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-total span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-total strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due-total {
  border-top-color: #475569 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due-total span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due-total strong {
  color: #f1f5f9 !important;
}
/* Payment line */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-payment-line {
  border-top-color: #334155 !important;
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-payment-line strong {
  color: #f1f5f9 !important;
}
/* Business header (company name, address on document) */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-kicker {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-vat {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-business-lines {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-business-lines strong {
  color: #f1f5f9 !important;
}
/* Item rows */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-items-head div {
  color: #64748b !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-item-row {
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-item-row div {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-item-description {
  color: #94a3b8 !important;
}
/* Footer: bank & notes */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer {
  border-top-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-bank {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-note {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-note-text {
  color: #94a3b8 !important;
}
/* "Powered by" print footer */
.wave-portal-shell[data-theme="dark"] .wave-public-print-footer {
  background: transparent !important;
  color: #64748b !important;
}

/* ── 23. Customer Statement document — hard-coded dark text overrides ─── */
/* .wvst-doc has background: #1e293b (section 15) but inner text still    */
/* uses #111827 / #374151 hard-coded colors                                */
.wave-portal-shell[data-theme="dark"] .wvst-doc-header .biz-info {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-header .biz-info strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-title h2 {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-title p {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-meta .bill-to {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-meta .bill-to small {
  color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-meta .bill-to strong {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-meta .dates-summary {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc-meta .dates-summary .row span:first-child {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-summary .row {
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-summary .row.total {
  color: #f1f5f9 !important;
  border-top-color: #334155 !important;
}
/* Statement table */
.wave-portal-shell[data-theme="dark"] .wvst-table th {
  color: #64748b !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-table td {
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-table tr.row-open td,
.wave-portal-shell[data-theme="dark"] .wvst-table tr.row-close td,
.wave-portal-shell[data-theme="dark"] .wvst-table tr.final-total td {
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* ── 16. Page body background when dark mode is on ───────────────────── */
body.ca-dark-page {
  background: #07101f !important;
}
body.ca-dark-page .entry-content,
body.ca-dark-page .site-content,
body.ca-dark-page main,
body.ca-dark-page #content,
body.ca-dark-page #main,
body.ca-dark-page .elementor-section-wrap {
  background: #07101f !important;
}

/* ── 24. Tax select dropdown dark mode ───────────────────────────────── */
.wave-portal-shell[data-theme="dark"] .wave-item-tax-select {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-item-tax-select option {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}
/* Line tax amount — base rule hardcodes color:#0f172a (near-black, invisible on   */
/* dark surfaces). Override here to make the tax total legible in dark mode.        */
/* Selector specificity (0,2,2) beats base rule (0,1,1) and html body rule (0,1,3) */
.wave-portal-shell[data-theme="dark"] .wave-item-tax-amount strong[data-line-tax],
.wave-portal-shell[data-theme="dark"] .wave-item-tax-amount strong {
  color: #f1f5f9 !important;
}

/* ── 25. View Invoice dark mode — toolbar, manage payments, footer ────── */
.wave-portal-shell[data-theme="dark"] .wave-public-toolbar {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn-primary {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #fff !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn-send {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #fff !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card div[style],
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card span[style],
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card strong[style] {
  color: #f1f5f9 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-inline-note {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-payment-history {
  border-top-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-payment-history-row {
  border-bottom-color: #334155 !important;
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-link-button,
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-link-inline {
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-danger-link {
  color: #f87171 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card .wave-dot-sep {
  color: #475569 !important;
}
/* Footer bank details — fix strong labels staying dark */
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-bank strong {
  color: #e2e8f0 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-bank span + span::before {
  color: #475569 !important;
}

/* ── 26. Mobile View Invoice: full-width single-column layout ────────── */
/* v24.8 @media screen sets display:grid + 232px|1fr on .wave-public-view-layout.  */
/* On mobile the sidebar is position:fixed (out of flow), so the main auto-places   */
/* to col-1 = 232px wide. Fix: force display:grid + grid-template-columns:1fr.     */
@media screen and (max-width: 1024px) {
  body.wave-public-view-with-sidebar .wave-public-view-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  body.wave-public-view-with-sidebar .wave-public-view-main {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
@media screen and (max-width: 900px) {
  body.wave-public-view-with-sidebar .wave-public-view-shell.wave-portal-shell {
    width: 100% !important;
    padding: 12px !important;
    border-radius: 12px !important;
    margin: 0 !important;
  }
}
@media screen and (max-width: 760px) {
  body.wave-public-view-with-sidebar .wave-public-view-shell.wave-portal-shell {
    width: 100% !important;
    padding: 8px !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    max-width: 100% !important;
    margin: 0 !important;
  }
  body.wave-public-view-with-sidebar .wave-public-sheet-flat {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}
/* Dark mode topbar background — use both shell[data-theme] and body.ca-dark-page  */
/* so the fix applies regardless of which selector wins the specificity battle.     */
.wave-portal-shell[data-theme="dark"] .wave-public-view-topbar,
body.ca-dark-page .wave-public-view-topbar,
body[data-theme="dark"] .wave-public-view-topbar {
  background: #0f172a !important;
}
/* Dark body background on View Invoice page (matches shell) */
body.wave-public-view-with-sidebar.ca-dark-page,
body.wave-public-view-with-sidebar[data-theme="dark"] {
  background: #0f172a !important;
}

/* ── 27. Mobile menu dark mode ────────────────────────────────────────── */
/* wave-mobile-topbar has hardcoded background:#fff — override here        */
.wave-portal-shell[data-theme="dark"] .wave-mobile-topbar {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-hamburger span {
  background: #94a3b8 !important;
}
/* html body #wave-sidebar { background:#fff !important } has specificity (1,0,2).    */
/* body.ca-dark-page #wave-sidebar has (1,1,1) which beats it.             */
body.ca-dark-page .wave-portal-sidebar,
body.ca-dark-page #wave-sidebar,
body[data-theme="dark"] .wave-portal-sidebar,
body[data-theme="dark"] #wave-sidebar {
  background: #1e293b !important;
  border-color: #334155 !important;
}
/* Mobile nav links: line 4044 has html body .wave-portal-sidebar .wave-side-nav a    */
/* specificity (0,2,3). We need (0,4,1) to beat it.                       */
body.ca-dark-page #wave-sidebar .wave-side-nav a,
body.ca-dark-page .wave-portal-sidebar .wave-side-nav a {
  color: #cbd5e1 !important;
  background: transparent !important;
}
body.ca-dark-page #wave-sidebar .wave-side-nav a:hover,
body.ca-dark-page .wave-portal-sidebar .wave-side-nav a:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
}
body.ca-dark-page #wave-sidebar .wave-side-nav a.active,
body.ca-dark-page .wave-portal-sidebar .wave-side-nav a.active {
  background: rgba(56,189,248,.12) !important;
  color: #38bdf8 !important;
}
body.ca-dark-page #wave-sidebar .wave-side-subnav a,
body.ca-dark-page .wave-portal-sidebar .wave-side-subnav a {
  color: #94a3b8 !important;
}
body.ca-dark-page #wave-sidebar .wave-side-group summary,
body.ca-dark-page .wave-portal-sidebar .wave-side-group summary {
  color: #94a3b8 !important;
}
body.ca-dark-page #wave-sidebar .wave-side-group summary.active,
body.ca-dark-page .wave-portal-sidebar .wave-side-group summary.active {
  color: #38bdf8 !important;
}
body.ca-dark-page .wave-sidebar-close,
body[data-theme="dark"] .wave-sidebar-close {
  background: #334155 !important;
  color: #94a3b8 !important;
  border-color: #475569 !important;
}
body.ca-dark-page .wave-sidebar-close:hover,
body[data-theme="dark"] .wave-sidebar-close:hover {
  background: #475569 !important;
  color: #f1f5f9 !important;
}
body.ca-dark-page .wave-mobile-nav-overlay,
body[data-theme="dark"] .wave-mobile-nav-overlay {
  background: rgba(0,0,0,.7) !important;
}

/* ── 28. Mobile public invoice line items — horizontal grid with headers ─── */
/* v24.8 @media(max-width:680px) stacks items vertically (display:flex/column)   */
/* and hides the items-head (display:none). The PHP already outputs correct        */
/* column labels (Product, Quantity, Price, Amount) — this CSS makes them visible  */
/* and lays out items in a compact horizontal grid on all mobile widths.            */
/* body.wave-public-body / body.wave-public-view-with-sidebar gives specificity    */
/* (0,2,1) which beats v24.8's (0,1,0) — and being later in file wins ties.       */
@media screen and (max-width: 760px) {
  /* Show the column header row */
  body.wave-public-body .wave-public-flat-items-head,
  body.wave-public-view-with-sidebar .wave-public-flat-items-head {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 38px 64px 72px !important;
    gap: 4px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    color: var(--ds-text-3, #64748b) !important;
    padding: 8px 0 6px !important;
    border-bottom: 1px solid var(--ds-border, #e2e8f0) !important;
  }
  /* Each line item row: horizontal grid matching header columns */
  body.wave-public-body .wave-public-flat-item-row,
  body.wave-public-view-with-sidebar .wave-public-flat-item-row {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 38px 64px 72px !important;
    gap: 4px !important;
    align-items: start !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid var(--ds-border, #e2e8f0) !important;
    flex-direction: unset !important;
  }
  /* All cells: reset vertical stacking styles */
  body.wave-public-body .wave-public-flat-item-row > div,
  body.wave-public-view-with-sidebar .wave-public-flat-item-row > div {
    text-align: left !important;
    width: auto !important;
    margin-right: 0 !important;
    display: block !important;
  }
  /* Qty, Price, Amount columns: right-align */
  body.wave-public-body .wave-public-flat-item-row > div:nth-child(n+2),
  body.wave-public-view-with-sidebar .wave-public-flat-item-row > div:nth-child(n+2) {
    text-align: right !important;
    justify-self: end !important;
    font-size: 12px !important;
  }
  /* Remove the ::before data-labels (Qty:, Price:, Amount:) — proper headers replace them */
  body.wave-public-body .wave-public-flat-item-row > div::before,
  body.wave-public-view-with-sidebar .wave-public-flat-item-row > div::before {
    content: none !important;
  }
  /* Items-head right cols: right-align */
  body.wave-public-body .wave-public-flat-items-head > div:nth-child(n+2),
  body.wave-public-view-with-sidebar .wave-public-flat-items-head > div:nth-child(n+2) {
    text-align: right !important;
    justify-self: end !important;
  }
}

/* ── 29. DEFINITIVE PRINT FIX for View Invoice with sidebar shell ───────────
   Root cause: earlier @media print blocks contain
     .wave-portal-shell { display: none !important }
   The View Invoice page wraps ALL content in .wave-public-view-shell.wave-portal-shell,
   so that rule hides the entire page → blank print preview.
   Fix: use body.wave-public-view-with-sidebar scope (specificity 0,1,1 + class)
   to override every conflicting rule. Being LAST in file wins same-specificity ties.
   ────────────────────────────────────────────────────────────────────────────── */
@media print {

  /* ① Page setup */
  @page { size: A4 portrait; margin: 12mm 10mm; }

  html, body {
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ② The shell MUST be visible — invoice lives inside it */
  body.wave-public-view-with-sidebar .wave-public-view-shell,
  body.wave-public-view-with-sidebar .wave-portal-shell,
  body.wave-public-view-with-sidebar .ca-invoicing-shell {
    display: block !important;
    visibility: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ③ Layout: collapse grid to single block */
  body.wave-public-view-with-sidebar .wave-public-view-layout,
  body.wave-public-view-with-sidebar .wave-portal-layout,
  body.wave-public-view-with-sidebar .ca-invoicing-layout {
    display: block !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  /* ④ Main content area: full width, no padding */
  body.wave-public-view-with-sidebar .wave-public-view-main {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ⑤ Hide ALL UI chrome */
  body.wave-public-view-with-sidebar .wave-public-view-sidebar,
  body.wave-public-view-with-sidebar .wave-portal-sidebar,
  body.wave-public-view-with-sidebar #wave-sidebar,
  body.wave-public-view-with-sidebar .wave-public-view-topbar,
  body.wave-public-view-with-sidebar .wave-portal-topbar,
  body.wave-public-view-with-sidebar .wave-mobile-topbar,
  body.wave-public-view-with-sidebar .wave-public-toolbar,
  body.wave-public-view-with-sidebar .wave-payment-manage-card,
  body.wave-public-view-with-sidebar .no-print {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* ⑥ Invoice wrapper: A4 width, centered */
  body.wave-public-view-with-sidebar .wave-public-invoice,
  body.wave-public-view-with-sidebar .wave-public-invoice-flat {
    display: block !important;
    visibility: visible !important;
    width: 190mm !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  body.wave-public-view-with-sidebar .wave-public-invoice-flat * {
    visibility: visible !important;
  }

  /* ⑦ Invoice sheet: proper print padding */
  body.wave-public-view-with-sidebar .wave-public-sheet-flat {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10mm 8mm !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  /* ⑧ Item rows: no page-break inside */
  body.wave-public-view-with-sidebar .wave-public-flat-item-row {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* ⑨ Dark mode: force white bg + dark text for print */
  body.wave-public-view-with-sidebar .wave-portal-shell[data-theme="dark"] .wave-public-sheet-flat,
  body.wave-public-view-with-sidebar .wave-portal-shell[data-theme="dark"] .wave-public-sheet-flat * {
    background: #fff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
  }
}


/* ===== v1.0.3 Receipt print blank-page fix only ===== */
@media print {
  body.wave-receipt-print-body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.wave-receipt-print-body .wave-portal-shell,
  body.wave-receipt-print-body .wave-wave-shell,
  body.wave-receipt-print-body .ca-invoicing-shell {
    display: block !important;
    visibility: visible !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.wave-receipt-print-body * {
    visibility: hidden !important;
  }

  body.wave-receipt-print-body .wave-receipt-page,
  body.wave-receipt-print-body .wave-receipt-page *,
  body.wave-receipt-print-body .wave-receipt-sheet,
  body.wave-receipt-print-body .wave-receipt-sheet * {
    visibility: visible !important;
  }

  body.wave-receipt-print-body .wave-receipt-page {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.wave-receipt-print-body .wave-receipt-sheet {
    display: block !important;
    width: 170mm !important;
    max-width: 170mm !important;
    margin: 10mm auto 0 !important;
    padding: 12mm 10mm 10mm !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.wave-receipt-print-body .wave-public-toolbar,
  body.wave-receipt-print-body .wave-public-toolbar *,
  body.wave-receipt-print-body .no-print,
  body.wave-receipt-print-body .no-print * {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Bulk selection + bulk actions */
.wave-bulk-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0 14px;padding:10px 12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px}
.wave-bulk-toolbar select{min-height:36px;border:1px solid #cbd5e1;border-radius:10px;padding:6px 10px;background:#fff;color:#0f172a}
.wave-bulk-select-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;color:#334155;margin:0!important}
.wave-bulk-select-label input,.wave-bulk-row-check{width:16px;height:16px;accent-color:#2563eb}
.wave-bulk-count{font-size:12px;color:#64748b;font-weight:700}
.wave-bulk-col{width:42px;text-align:center!important;vertical-align:middle!important}
.wave-portal-shell[data-theme="dark"] .wave-bulk-toolbar{background:#0f172a;border-color:#334155}
.wave-portal-shell[data-theme="dark"] .wave-bulk-toolbar select{background:#111827;color:#e5e7eb;border-color:#475569}
.wave-portal-shell[data-theme="dark"] .wave-bulk-select-label{color:#e2e8f0}
.wave-portal-shell[data-theme="dark"] .wave-bulk-count{color:#94a3b8}
@media(max-width:720px){.wave-bulk-toolbar{align-items:stretch}.wave-bulk-toolbar select,.wave-bulk-toolbar button{width:100%}.wave-bulk-select-label{width:100%}.wave-bulk-col{width:36px}}

/* Bulk actions polish */
.wave-bulk-toolbar{
  margin:18px 0 22px!important;
  padding:16px 18px!important;
  gap:12px!important;
  background:#fff!important;
  border:1px solid #e2e8f0!important;
  border-radius:18px!important;
  box-shadow:0 8px 24px rgba(15,23,42,.04)!important;
}
.wave-bulk-action-select{
  min-width:190px!important;
  min-height:42px!important;
  height:42px!important;
  padding:0 42px 0 16px!important;
  border:1px solid #dbe3ef!important;
  border-radius:12px!important;
  background-color:#fff!important;
  color:#0f172a!important;
  font-weight:600!important;
  box-shadow:0 6px 16px rgba(15,23,42,.04)!important;
  appearance:auto!important;
}
.wave-bulk-apply{
  min-height:42px!important;
  padding:0 18px!important;
  border-radius:12px!important;
}
.wave-bulk-select-label{
  min-height:42px!important;
  padding:0 4px!important;
  font-size:14px!important;
}
.wave-bulk-count{
  min-height:42px!important;
  display:inline-flex!important;
  align-items:center!important;
  font-size:14px!important;
  color:#334155!important;
}
.wave-portal-shell[data-theme="dark"] .wave-bulk-toolbar{
  background:#0f172a!important;
  border-color:#334155!important;
  box-shadow:none!important;
}
.wave-portal-shell[data-theme="dark"] .wave-bulk-action-select{
  background-color:#111827!important;
  color:#e5e7eb!important;
  border-color:#475569!important;
}
@media(max-width:720px){
  .wave-bulk-toolbar{padding:14px!important;margin:16px 0 20px!important;}
  .wave-bulk-action-select,.wave-bulk-apply{width:100%!important;}
}


/* v1.1.0: PDF footer visibility fix for single and bulk exports */
.wave-pdf-export-clone.wave-pdf-page{
  position:relative!important;
  overflow:visible!important;
  padding-bottom:78px!important;
  box-sizing:border-box!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer{
  border-top:1px solid #e2e8f0!important;
  margin-top:22px!important;
  padding-top:10px!important;
  font-size:10px!important;
  color:#64748b!important;
  display:block!important;
  page-break-inside:avoid!important;
  break-inside:avoid!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  flex-wrap:nowrap!important;
  width:100%!important;
  font-size:9.5px!important;
  line-height:1.25!important;
  color:#64748b!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank span{
  white-space:nowrap!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-print-footer{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:100%!important;
  max-width:none!important;
  margin:12px auto 0!important;
  padding-top:8px!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
  page-break-inside:avoid!important;
  break-inside:avoid!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-powered-by-logo{
  width:108px!important;
  max-height:28px!important;
  object-fit:contain!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-powered-by-text{
  font-size:9.5px!important;
  color:#64748b!important;
}

/* v1.1.1: stable PDF footer / no cut text fix */
.wave-pdf-stage{background:#fff!important;}
.wave-pdf-export-clone.wave-pdf-page{
  width:794px!important;
  max-width:794px!important;
  min-height:1122px!important;
  height:1122px!important;
  overflow:visible!important;
  display:flex!important;
  flex-direction:column!important;
  box-sizing:border-box!important;
  padding:28px 32px 22px!important;
  background:#fff!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-head,
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-meta-row,
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-items,
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-bottom{flex:0 0 auto!important;}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-notes{flex:0 0 auto!important; break-inside:avoid!important; page-break-inside:avoid!important;}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer{
  flex:0 0 auto!important;
  margin-top:auto!important;
  padding-top:10px!important;
  border-top:1px solid #e2e8f0!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-print-footer{
  flex:0 0 auto!important;
  margin:8px auto 0!important;
  padding-top:6px!important;
  border-top:1px solid #e2e8f0!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
  justify-content:space-between!important;
  line-height:1.25!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank span{font-size:9px!important; white-space:nowrap!important;}
.wave-pdf-export-clone.wave-pdf-page .wave-public-powered-by-logo{width:100px!important; max-height:24px!important;}

/* v1.1.5: compact PDF footer - prevent horizontal stretched layout */
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer{
  width:100%!important;
  max-width:640px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-top:10px!important;
  border-top:1px solid #e2e8f0!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank{
  display:grid!important;
  grid-template-columns:repeat(2, minmax(0, 1fr))!important;
  column-gap:28px!important;
  row-gap:5px!important;
  justify-content:center!important;
  align-items:center!important;
  width:100%!important;
  max-width:640px!important;
  margin:0 auto!important;
  font-size:9px!important;
  line-height:1.25!important;
  color:#64748b!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank span{
  display:block!important;
  white-space:nowrap!important;
  text-align:left!important;
  font-size:9px!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-flat-footer-bank strong{
  font-size:9px!important;
  font-weight:700!important;
  color:#334155!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-footer-sep{
  display:none!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-print-footer{
  width:100%!important;
  max-width:360px!important;
  margin:8px auto 0!important;
  padding-top:7px!important;
  border-top:1px solid #e2e8f0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-powered-by-text{
  font-size:9px!important;
  color:#64748b!important;
  font-weight:600!important;
}
.wave-pdf-export-clone.wave-pdf-page .wave-public-powered-by-logo{
  width:92px!important;
  max-width:92px!important;
  max-height:24px!important;
  object-fit:contain!important;
}

/* Connect Accounting v1.2.0 FINAL PDF/Print footer
   Footer is a normal content-flow block, matching Print Preview. */
.wave-public-invoice-flat .wave-public-sheet-flat,
.wave-pdf-export-clone.wave-public-sheet-flat {
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
  padding-bottom: 28px !important;
}
.wave-public-invoice-flat .wave-public-flat-footer,
.wave-pdf-export-clone .wave-public-flat-footer {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 34px 0 0 !important;
  padding: 10px 0 0 !important;
  border-top: 1px solid #e2e8f0 !important;
  background: #fff !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
  text-align: left !important;
}
.wave-public-invoice-flat .wave-public-flat-footer-bank,
.wave-pdf-export-clone .wave-public-flat-footer-bank {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: center !important;
  font-size: 10.5px !important;
  line-height: 1.8 !important;
  color: #64748b !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
}
.wave-public-invoice-flat .wave-public-flat-footer-bank strong,
.wave-pdf-export-clone .wave-public-flat-footer-bank strong {
  color: #334155 !important;
  font-weight: 700 !important;
}
.wave-public-invoice-flat .wave-public-flat-footer-bank .wave-footer-sep,
.wave-pdf-export-clone .wave-public-flat-footer-bank .wave-footer-sep {
  display: inline !important;
  color: #cbd5e1 !important;
  margin: 0 7px !important;
}
.wave-public-invoice-flat .wave-public-flat-footer-bank span::before,
.wave-pdf-export-clone .wave-public-flat-footer-bank span::before {
  content: none !important;
  display: none !important;
}
.wave-public-invoice-flat .wave-public-flat-footer-note,
.wave-pdf-export-clone .wave-public-flat-footer-note {
  text-align: center !important;
  margin-top: 6px !important;
  font-size: 10.5px !important;
  line-height: 1.55 !important;
}
.wave-public-invoice-flat .wave-public-print-footer,
.wave-pdf-export-clone .wave-public-print-footer {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 14px auto 0 !important;
  padding: 10px 0 0 !important;
  border-top: 1px solid #e2e8f0 !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
  text-align: center !important;
}
.wave-public-invoice-flat .wave-public-powered-by-text,
.wave-pdf-export-clone .wave-public-powered-by-text {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}
.wave-public-invoice-flat .wave-public-powered-by-logo,
.wave-pdf-export-clone .wave-public-powered-by-logo {
  width: 118px !important;
  max-width: 118px !important;
  height: auto !important;
  max-height: 34px !important;
  object-fit: contain !important;
}
.wave-public-flat-items,
.wave-public-flat-bottom,
.wave-public-flat-notes,
.wave-public-flat-footer,
.wave-public-print-footer,
.wave-public-flat-item-row {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
@media print {
  .wave-public-invoice-flat .wave-public-flat-footer,
  .wave-public-invoice-flat .wave-public-print-footer {
    position: relative !important;
    width: 100% !important;
  }
}


/* v1.4.6: Mobile filters fix - hide filtered rows even when mobile card layout uses display:block!important */
.wave-table tbody tr.wave-filter-hidden,
.wave-grid .wave-table tbody tr.wave-filter-hidden,
.wave-enhanced-list .wave-table tbody tr.wave-filter-hidden {
  display: none !important;
}

/* v1.4.9: Dark mode fixes for Invoice / Estimate view and editor */
body.ca-dark-page,
body.ca-dark-page.wave-public-view-with-sidebar,
body.ca-dark-page .wave-public-view-shell,
body.ca-dark-page .wave-public-view-layout,
body.ca-dark-page .wave-public-view-main,
.wave-portal-shell[data-theme="dark"] .wave-public-view-layout,
.wave-portal-shell[data-theme="dark"] .wave-public-view-main {
  background: #07101f !important;
  color: #e5edf7 !important;
}
body.ca-dark-page .wave-public-toolbar,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbar,
body.ca-dark-page.wave-public-view-with-sidebar .wave-public-toolbar {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.35) !important;
}
body.ca-dark-page .wave-public-toolbtn,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn {
  background: #0f172a !important;
  color: #dbeafe !important;
  border-color: #334155 !important;
}
body.ca-dark-page .wave-public-toolbtn:hover,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn:hover {
  background: #17253b !important;
  color: #fff !important;
  border-color: #475569 !important;
}
body.ca-dark-page .wave-public-toolbtn-primary,
body.ca-dark-page .wave-public-toolbtn-send,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn-primary,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn-send {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #fff !important;
}
body.ca-dark-page .wave-payment-manage-card,
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card,
body.ca-dark-page.wave-public-view-with-sidebar .wave-payment-manage-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
body.ca-dark-page .wave-payment-manage-card *,
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card * { border-color: #334155 !important; }
body.ca-dark-page .wave-payment-manage-card div[style],
body.ca-dark-page .wave-payment-manage-card span[style],
body.ca-dark-page .wave-payment-manage-card strong[style],
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card div[style],
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card span[style],
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card strong[style] { color: #e5edf7 !important; }
body.ca-dark-page .wave-payment-history-actions .wave-link-button,
body.ca-dark-page .wave-payment-history-actions .wave-link-inline,
.wave-portal-shell[data-theme="dark"] .wave-payment-history-actions .wave-link-button,
.wave-portal-shell[data-theme="dark"] .wave-payment-history-actions .wave-link-inline { color: #38bdf8 !important; }
body.ca-dark-page .wave-payment-history-actions .wave-danger-link,
.wave-portal-shell[data-theme="dark"] .wave-payment-history-actions .wave-danger-link { color: #fb7185 !important; }
body.ca-dark-page .wave-dot-sep,
.wave-portal-shell[data-theme="dark"] .wave-dot-sep { color: #64748b !important; }

body.ca-dark-page .wave-public-sheet-flat,
.wave-portal-shell[data-theme="dark"] .wave-public-sheet-flat,
body.ca-dark-page.wave-public-view-with-sidebar .wave-public-invoice-flat,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat {
  background: #1e293b !important;
  border-color: #94a3b8 !important;
  color: #e5edf7 !important;
}
body.ca-dark-page .wave-public-flat-meta-row,
body.ca-dark-page .wave-public-flat-items-head,
body.ca-dark-page .wave-public-flat-item-row,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-meta-row,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-items-head,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-item-row { border-color: #334155 !important; }
body.ca-dark-page .wave-public-flat-kicker,
body.ca-dark-page .wave-public-flat-business-lines strong,
body.ca-dark-page .wave-public-flat-billto strong,
body.ca-dark-page .wave-public-flat-meta-box strong,
body.ca-dark-page .wave-public-flat-item-row strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-kicker,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-business-lines strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-billto strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-meta-box strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-item-row strong { color: #f8fafc !important; }
body.ca-dark-page .wave-public-flat-vat,
body.ca-dark-page .wave-public-flat-business-lines,
body.ca-dark-page .wave-public-flat-billto span,
body.ca-dark-page .wave-public-flat-billto-line,
body.ca-dark-page .wave-public-flat-meta-box span,
body.ca-dark-page .wave-public-flat-items-head div,
body.ca-dark-page .wave-public-item-description,
body.ca-dark-page .wave-public-note-text,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-vat,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-business-lines,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-billto span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-billto-line,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-meta-box span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-items-head div,
.wave-portal-shell[data-theme="dark"] .wave-public-item-description,
.wave-portal-shell[data-theme="dark"] .wave-public-note-text { color: #9fb2c9 !important; }
body.ca-dark-page .wave-public-flat-due,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due {
  background: #0f172a !important;
  border: 1px solid #1e3a5f !important;
}
body.ca-dark-page .wave-public-flat-totals > div,
body.ca-dark-page .wave-public-flat-totals span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-totals > div,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-totals span { color: #9fb2c9 !important; }
body.ca-dark-page .wave-public-flat-totals strong,
body.ca-dark-page .wave-public-flat-total span,
body.ca-dark-page .wave-public-flat-total strong,
body.ca-dark-page .wave-public-flat-due-total span,
body.ca-dark-page .wave-public-flat-due-total strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-totals strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-total span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-total strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due-total span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due-total strong { color: #f8fafc !important; }
body.ca-dark-page .wave-public-flat-total,
body.ca-dark-page .wave-public-flat-due-total,
body.ca-dark-page .wave-public-flat-payment-line,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-total,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-due-total,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-payment-line { border-color: #475569 !important; }
body.ca-dark-page .wave-public-invoice-flat .wave-public-flat-footer,
body.ca-dark-page .wave-public-flat-footer,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-flat-footer,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer {
  background: transparent !important;
  border-top-color: #475569 !important;
  color: #9fb2c9 !important;
}
body.ca-dark-page .wave-public-invoice-flat .wave-public-flat-footer-bank,
body.ca-dark-page .wave-public-flat-footer-bank,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-flat-footer-bank,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-bank {
  background: #111c2e !important;
  border: 1px solid #334155 !important;
  color: #b6c5d8 !important;
  padding: 8px 10px !important;
}
body.ca-dark-page .wave-public-flat-footer-bank strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-bank strong { color: #e2e8f0 !important; }
body.ca-dark-page .wave-public-flat-footer-bank .wave-footer-sep,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-footer-bank .wave-footer-sep { color: #64748b !important; }
body.ca-dark-page .wave-public-invoice-flat .wave-public-print-footer,
body.ca-dark-page .wave-public-print-footer,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-print-footer,
.wave-portal-shell[data-theme="dark"] .wave-public-print-footer {
  background: transparent !important;
  border-top-color: #475569 !important;
  color: #94a3b8 !important;
}
body.ca-dark-page .wave-public-powered-by-text,
.wave-portal-shell[data-theme="dark"] .wave-public-powered-by-text { color: #94a3b8 !important; }

.wave-portal-shell[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
body.ca-dark-page input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.6) contrast(.9) !important;
  opacity: .85 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-message,
.wave-portal-shell[data-theme="dark"] .wave-message[style],
body.ca-dark-page .wave-message,
body.ca-dark-page .wave-message[style] {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-message a,
body.ca-dark-page .wave-message a { color: #38bdf8 !important; }
.wave-portal-shell[data-theme="dark"] .wave-card[style*="background:#f0fdf4"],
.wave-portal-shell[data-theme="dark"] .wave-card[style*="background: #f0fdf4"],
body.ca-dark-page .wave-card[style*="background:#f0fdf4"],
body.ca-dark-page .wave-card[style*="background: #f0fdf4"] {
  background: #102a21 !important;
  border-color: #14532d !important;
}
.wave-portal-shell[data-theme="dark"] .wave-card[style*="background:#f0fdf4"] div[style],
.wave-portal-shell[data-theme="dark"] .wave-card[style*="background: #f0fdf4"] div[style],
body.ca-dark-page .wave-card[style*="background:#f0fdf4"] div[style],
body.ca-dark-page .wave-card[style*="background: #f0fdf4"] div[style] { color: #86efac !important; }
.wave-portal-shell[data-theme="dark"] .wave-card span[style*="color:#64748b"],
body.ca-dark-page .wave-card span[style*="color:#64748b"] { color: #94a3b8 !important; }
.wave-portal-shell[data-theme="dark"] .wave-card strong,
body.ca-dark-page .wave-card strong { color: #f1f5f9; }
.wave-portal-shell[data-theme="dark"] .wave-public-logo-wrap,
body.ca-dark-page .wave-public-logo-wrap {
  background: rgba(255,255,255,.92) !important;
  display: inline-flex !important;
  padding: 4px 8px !important;
}

/* =======================================================================
   v1.5.1 — Dark mode View Invoice / View Estimate outer background cleanup
   Keeps the outside page background identical to list pages (#07101f) and
   prevents old light/alternate wrappers from showing between cards.
   ======================================================================= */
body[data-theme="dark"],
body.ca-dark-page,
body.ca-dark-page #page,
body.ca-dark-page .site,
body.ca-dark-page .site-content,
body.ca-dark-page .entry-content,
body.ca-dark-page .wp-site-blocks,
body.ca-dark-page .wp-block-post-content,
body.ca-dark-page .wave-public-body,
body.ca-dark-page .wave-public-invoice-flat,
body.ca-dark-page .wave-wave-shell,
body.ca-dark-page .wave-portal-shell,
.wave-portal-shell[data-theme="dark"],
.wave-portal-shell[data-theme="dark"] .wave-wave-shell,
.wave-portal-shell[data-theme="dark"] .wave-public-body,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat {
  background: #07101f !important;
  background-color: #07101f !important;
}

/* The main public view wrapper must not draw its own panel behind cards. */
body.ca-dark-page .wave-public-invoice,
body.ca-dark-page .wave-public-invoice-flat,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat {
  background: transparent !important;
  box-shadow: none !important;
}

/* Toolbar should look like a separate dark card, not like a different page bg. */
body.ca-dark-page .wave-public-toolbar,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbar {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 14px 16px !important;
  margin-bottom: 14px !important;
}

/* Cards/sheets keep the same surface as the invoices list cards. */
body.ca-dark-page .wave-payment-manage-card,
body.ca-dark-page .wave-public-sheet-flat,
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card,
.wave-portal-shell[data-theme="dark"] .wave-public-sheet-flat {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.45) !important;
}

/* Remove any inherited/inline light strips inside the public invoice page. */
body.ca-dark-page .wave-public-invoice-flat [style*="background:#fff"],
body.ca-dark-page .wave-public-invoice-flat [style*="background: #fff"],
body.ca-dark-page .wave-public-invoice-flat [style*="background:white"],
body.ca-dark-page .wave-public-invoice-flat [style*="background: white"],
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat [style*="background:#fff"],
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat [style*="background: #fff"],
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat [style*="background:white"],
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat [style*="background: white"] {
  background: transparent !important;
  background-color: transparent !important;
}

@media print {
  body.ca-dark-page,
  body.ca-dark-page .wave-public-body,
  body.ca-dark-page .wave-public-invoice-flat,
  .wave-portal-shell[data-theme="dark"] .wave-public-body,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat {
    background: #fff !important;
    background-color: #fff !important;
  }
}

/* v1.6.0 Customer Payments System */
.ca-payment-system-card .wave-section-head span{color:#64748b;font-size:13px}
.ca-payment-alloc-wrap{border:1px solid #e5e7eb;border-radius:18px;padding:16px;background:#f8fafc;margin-top:6px}
.ca-payment-alloc-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.ca-payment-alloc-head p{margin:4px 0 0;color:#64748b;font-size:13px}
.ca-payment-allocation-table input[type="number"]{max-width:130px}
.ca-payment-summary-line{display:flex;justify-content:flex-end;gap:22px;flex-wrap:wrap;margin-top:12px;font-size:14px;color:#334155}
body.ca-dark-page .ca-payment-alloc-wrap,.wave-portal-shell[data-theme="dark"] .ca-payment-alloc-wrap{background:#0f172a;border-color:#334155;color:#e5edf7}
body.ca-dark-page .ca-payment-alloc-head p,.wave-portal-shell[data-theme="dark"] .ca-payment-alloc-head p,body.ca-dark-page .ca-payment-system-card .wave-section-head span,.wave-portal-shell[data-theme="dark"] .ca-payment-system-card .wave-section-head span{color:#94a3b8}
body.ca-dark-page .ca-payment-summary-line,.wave-portal-shell[data-theme="dark"] .ca-payment-summary-line{color:#cbd5e1}
@media (max-width: 760px){.ca-payment-alloc-head{align-items:flex-start;flex-direction:column}.ca-payment-summary-line{justify-content:flex-start;gap:8px;flex-direction:column}.ca-payment-allocation-table input[type="number"]{max-width:100%;width:100%}}

/* v1.6.1 Customer payment allocation UI */
.ca-receive-payment-btn { white-space: nowrap; }
.ca-receive-payment-page .ca-allocation-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:10px; }
.ca-receive-payment-page .ca-allocation-head h3 { margin:0 0 4px; }
.ca-receive-payment-page .ca-allocation-head p { margin:0; color:var(--wave-muted, #64748b); }
.ca-receive-payment-page .ca-allocation-wrap { overflow-x:auto; }
.ca-receive-payment-page .ca-allocation-input { max-width:140px; }
@media (max-width: 760px) {
  .ca-receive-payment-page .ca-allocation-head { align-items:flex-start; flex-direction:column; }
  .ca-receive-payment-btn { display:inline-flex; margin-top:6px; }
}

/* v1.6.3 Native Receive Payment UI */
.wave-receive-payment-link { margin-left: 8px; }
.wave-receive-payment-page .wave-receive-payment-card .wave-table-wrap { margin-top: 8px; }
.wave-receive-payment-table input[type="number"] { max-width: 150px; }
.wave-allocation-total { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; background:#f8fafc; color:#0f172a; }
[data-theme="dark"] .wave-allocation-total, .ca-dark-page .wave-allocation-total { background:#111827; color:#f8fafc; }
@media (max-width: 760px) {
  .wave-receive-payment-table input[type="number"] { width: 100%; max-width: none; }
  .wave-receive-payment-link { display:inline-block; margin: 6px 6px 0 0; }
}

/* v1.6.4 Customer payment totals + overpayment guard */
.wave-owing-total { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; background:#eef6ff; color:#0f172a; }
.wave-overpayment-warning { align-items:center; padding:9px 12px; border-radius:12px; background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; font-weight:700; font-size:13px; }
.wave-receive-payment-table tfoot th { border-top:2px solid #dbe5f1; font-weight:800; background:#f8fafc; }
.wave-receive-payment-table .wave-total-row th:first-child { text-align:right; }
[data-theme="dark"] .wave-owing-total, .ca-dark-page .wave-owing-total { background:#172554; color:#eff6ff; }
[data-theme="dark"] .wave-overpayment-warning, .ca-dark-page .wave-overpayment-warning { background:#431407; color:#fed7aa; border-color:#9a3412; }
[data-theme="dark"] .wave-receive-payment-table tfoot th, .ca-dark-page .wave-receive-payment-table tfoot th { background:#111827; border-top-color:#334155; color:#f8fafc; }
@media (max-width: 760px) {
  .wave-owing-total, .wave-overpayment-warning { width:100%; justify-content:center; }
  .wave-receive-payment-table .wave-total-row th:first-child { text-align:left; }
}

/* v1.6.6 Receive Payment clean render + totals */
.wave-receive-payment-summary{gap:12px;align-items:center;flex-wrap:wrap}
.wave-total-owing-badge{background:#f7fbff;border:1px solid #d9e7f5;border-radius:18px;padding:10px 14px;display:inline-flex;gap:6px;align-items:center}
.wave-total-owing-row td{background:#fbfdff!important;color:#14213d}
#wave-overpayment-warning{box-sizing:border-box}
@media (max-width: 760px){.wave-total-owing-row td{text-align:left!important;display:block}.wave-total-owing-row td[colspan]{padding-bottom:0}.wave-receive-payment-summary .wave-allocation-total{width:100%;justify-content:flex-start}}

/* v1.7.4 Flat customer action buttons */
.wave-customer-actions-cell {
    white-space: nowrap;
    min-width: 172px;
}
.wave-customer-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: nowrap;
}
.wave-icon-action-form {
    margin: 0;
    display: inline-flex;
}
.wave-icon-action {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid #dbe5f1;
    border-radius: 9px;
    background: #ffffff;
    color: #637083;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.wave-icon-action .wave-action-svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.wave-icon-action:hover {
    background: #f5f9ff;
    border-color: #bfd0e8;
    color: #2563eb;
    transform: translateY(-1px);
}

.wave-icon-action.wave-icon-action-disabled,
.wave-icon-action.wave-icon-action-disabled:hover {
    cursor: not-allowed;
    opacity: .48;
    transform: none;
    box-shadow: none;
}
.wave-icon-payment {
    color: #637083;
}
.wave-icon-payment:hover {
    color: #087f5b;
    border-color: #b7e4d5;
    background: #f0fdf8;
}
.wave-icon-danger {
    color: #637083;
}
.wave-icon-danger:hover {
    color: #dc2626;
    background: #fff1f2;
    border-color: #fecaca;
}
@media (max-width: 760px) {
    .wave-customer-actions-cell { min-width: 154px; }
    .wave-customer-actions { gap: 6px; }
    .wave-icon-action { width: 32px; height: 32px; min-width: 32px; }
    .wave-icon-action .wave-action-svg { width: 17px; height: 17px; }
}

/* v1.7.7 Customer filtered views */
.wave-filter-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-top:10px;
    padding:8px 12px;
    border:1px solid #dbeafe;
    border-radius:999px;
    background:#eff6ff;
    color:#1e3a8a;
    font-size:13px;
    font-weight:600;
}
.wave-filter-chip a{
    color:#2563eb;
    text-decoration:none;
    font-weight:700;
}
.wave-filter-chip a:hover{text-decoration:underline;}
@media (max-width: 640px){
    .wave-filter-chip{width:100%;justify-content:space-between;border-radius:14px;}
}

/* v1.7.8 Flat icon actions everywhere */
.wave-actions-cell{white-space:nowrap;min-width:112px}
.wave-payment-actions-cell .wave-customer-actions{justify-content:flex-start;gap:8px;flex-wrap:nowrap}
.wave-table .wave-actions-cell .wave-customer-actions{display:inline-flex;align-items:center;gap:8px;flex-wrap:nowrap}
.wave-payment-history-actions.wave-customer-actions{display:inline-flex;align-items:center;gap:8px;flex-wrap:nowrap;margin-top:8px}
.wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
.wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td{
  border-bottom:1px solid #f1f5f9!important;
}
.wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td.wave-payment-actions-cell,
.wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td.wave-actions-cell{
  display:table-cell!important;
  height:auto!important;
  vertical-align:middle!important;
}
@media (max-width:760px){
  .wave-actions-cell{min-width:0}
  .wave-table .wave-actions-cell .wave-customer-actions,
  .wave-payment-actions-cell .wave-customer-actions{gap:6px;flex-wrap:nowrap}
  .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
  .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td.wave-payment-actions-cell,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td.wave-actions-cell{
    display:block!important;
    height:auto!important;
    border-bottom:0!important;
  }
}

.wave-portal-shell[data-theme="dark"] .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
body.ca-dark-page .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
body.ca-dark .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
body.ca-theme-dark .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td{
  border-bottom-color:#27384e!important;
}
.wave-portal-shell[data-theme="dark"] .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
body.ca-dark-page .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
body.ca-dark .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
body.ca-theme-dark .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td{
  border-bottom-color:#27384e!important;
}
@media (max-width:760px){
  .wave-portal-shell[data-theme="dark"] .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
  body.ca-dark-page .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
  body.ca-dark .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td,
  body.ca-theme-dark .wave-enhanced-list[data-table-kind="payments"] .wave-grouped-payment-row > td{
    border-bottom:0!important;
  }
  .wave-portal-shell[data-theme="dark"] .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
  body.ca-dark-page .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
  body.ca-dark .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td,
  body.ca-theme-dark .wave-enhanced-list[data-table-kind="bill-payments"] .wave-grouped-payment-row > td{
    border-bottom:0!important;
  }
}

/* v1.7.9 Payments polish */
.wave-payment-header-actions{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.wave-payment-header-actions .wave-payment-helper{font-size:12px;font-weight:700;color:#64748b;line-height:1.2;white-space:nowrap}
.wave-pay-invoice-card{margin-bottom:24px!important}
.wave-enhanced-list[data-table-kind="payments"]{margin-top:24px!important}
.wave-pay-invoice-card + .wave-enhanced-list[data-table-kind="payments"]{margin-top:24px!important}
.wave-receive-payment-page .wave-receive-payment-summary{margin-top:8px;margin-bottom:8px}

@media (max-width: 760px){
  .wave-payment-header-actions{width:100%;align-items:stretch}
  .wave-payment-header-actions .wave-btn{width:100%;justify-content:center}
  .wave-payment-header-actions .wave-payment-helper{text-align:center;white-space:normal}
  .wave-pay-invoice-card{margin-bottom:18px!important}
  .wave-enhanced-list[data-table-kind="payments"]{margin-top:18px!important}

  .wave-receive-payment-page .wave-card{overflow:visible!important}
  .wave-receive-payment-page .wave-table-wrap{overflow:visible!important;width:100%!important}
  .wave-receive-payment-page .wave-receive-payment-table{display:block;width:100%!important;min-width:0!important;border-collapse:separate!important}
  .wave-receive-payment-page .wave-receive-payment-table thead{display:none!important}
  .wave-receive-payment-page .wave-receive-payment-table tbody,
  .wave-receive-payment-page .wave-receive-payment-table tfoot{display:block;width:100%!important}
  .wave-receive-payment-page .wave-receive-payment-table tbody tr{display:block;width:100%;margin:0 0 14px;padding:14px;border:1px solid #e2e8f0;border-radius:16px;background:#fff;box-sizing:border-box}
  .wave-receive-payment-page .wave-receive-payment-table tbody td{display:flex!important;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:9px 0!important;border:0!important;white-space:normal!important;box-sizing:border-box;text-align:right}
  .wave-receive-payment-page .wave-receive-payment-table tbody td::before{content:attr(data-label);font-size:12px;font-weight:850;text-transform:uppercase;letter-spacing:.04em;color:#64748b;text-align:left;flex:0 0 auto}
  .wave-receive-payment-page .wave-receive-payment-table tbody td[data-label="Allocate amount"]{display:block!important;text-align:left}
  .wave-receive-payment-page .wave-receive-payment-table tbody td[data-label="Allocate amount"]::before{display:block;margin-bottom:8px}
  .wave-receive-payment-page .wave-money-input-wrap{width:100%!important;display:block!important;position:relative!important}
  .wave-receive-payment-page .wave-receive-payment-table .wave-alloc-amount{width:100%!important;max-width:none!important;box-sizing:border-box!important}
  .wave-receive-payment-page .wave-total-owing-row{display:grid!important;grid-template-columns:1fr!important;gap:10px;width:100%;padding:14px;border:1px solid #e2e8f0;border-radius:16px;background:#f8fbff!important;box-sizing:border-box}
  .wave-receive-payment-page .wave-total-owing-row td{display:block!important;width:100%!important;padding:8px 0!important;text-align:left!important;border:0!important;white-space:normal!important;background:transparent!important;box-sizing:border-box}
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label{font-size:18px!important;text-align:left!important}
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span{min-height:0!important}
  .wave-receive-payment-page .wave-total-cell{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px}
  .wave-receive-payment-page .wave-total-cell .wave-total-amount{display:block!important;font-size:16px!important;line-height:1.1!important}
  .wave-receive-payment-page .wave-total-cell .wave-total-caption{display:block!important;margin:0!important;text-align:right!important;font-size:12px!important;max-width:45%}
  .wave-receive-payment-page .wave-actions.wave-col-2 .wave-btn{width:100%;justify-content:center}
}

.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tbody tr,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tbody tr{background:#0f172a;border-color:#334155}

/* v1.7.10 Receive Payment mobile totals card polish */
@media (max-width: 760px) {
  .wave-receive-payment-page .wave-total-owing-row {
    display: block !important;
    width: 100% !important;
    padding: 18px 14px !important;
    border: 1px solid #dbe5f0 !important;
    border-radius: 18px !important;
    background: #f8fbff !important;
    box-sizing: border-box !important;
  }

  .wave-receive-payment-page .wave-total-owing-row td {
    background: transparent !important;
    border: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-label {
    display: grid !important;
    grid-template-columns: minmax(150px, 42%) 1fr !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 0 16px 0 !important;
    text-align: left !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span {
    grid-column: 2 !important;
    justify-self: start !important;
    min-height: 0 !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    color: #12233f !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell {
    display: grid !important;
    grid-template-columns: minmax(150px, 42%) 1fr !important;
    align-items: baseline !important;
    column-gap: 10px !important;
    width: 100% !important;
    padding: 6px 0 !important;
    text-align: left !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-caption {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    text-align: left !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    font-weight: 750 !important;
    color: #12233f !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-amount {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: block !important;
    justify-self: start !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
    min-width: 120px !important;
    font-family: inherit !important;
  }
}


/* v1.7.12 Receive Payment mobile totals alignment final */
@media (max-width: 760px) {
  .wave-receive-payment-page .wave-total-owing-row {
    display: block !important;
    width: 100% !important;
    padding: 18px 20px 20px !important;
    border: 1px solid #dbe5f0 !important;
    border-radius: 18px !important;
    background: #f8fbff !important;
    box-sizing: border-box !important;
  }

  .wave-receive-payment-page .wave-total-owing-row td {
    background: transparent !important;
    border: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    padding-left: 0 !important;
    padding-right: 2mm !important;
  }

  /* Title sits exactly above the amount column */
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label {
    display: grid !important;
    grid-template-columns: 43% 57% !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 0 18px 0 !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span {
    grid-column: 2 !important;
    justify-self: start !important;
    min-height: 0 !important;
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    color: #12233f !important;
  }

  /* Rows: label left, amount right column, perfectly aligned */
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell {
    display: grid !important;
    grid-template-columns: 43% 57% !important;
    align-items: center !important;
    column-gap: 0 !important;
    width: 100% !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-caption {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    text-align: left !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
    color: #12233f !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-amount {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: block !important;
    justify-self: start !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
    min-width: 120px !important;
    font-family: inherit !important;
  }
}

@media (max-width: 420px) {
  .wave-receive-payment-page .wave-total-owing-row {
    padding: 16px 18px 18px !important;
  }
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label,
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell {
    grid-template-columns: 42% 58% !important;
  }
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-caption,
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-amount {
    font-size: 14px !important;
  }
}


/* v1.7.12 Receive Payment mobile totals title alignment - force title above amount column */
@media (max-width: 760px) {
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label {
    display: block !important;
    width: 100% !important;
    padding: 0 0 18px 0 !important;
    margin: 0 !important;
    text-align: center !important;
  }
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding-left: 43% !important;
    box-sizing: border-box !important;
    text-align: left !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    color: #12233f !important;
  }
}

@media (max-width: 420px) {
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span {
    padding-left: 42% !important;
  }
}


/* v1.8.0 - user requested exact mobile Totals title alignment override */
@media (max-width: 760px) { 
    .wave-receive-payment-page .wave-total-owing-row .wave-total-label span {
        display: block !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding-left: 43% !important;
        box-sizing: border-box !important;
        text-align: left !important;
        font-size: 18px !important;
        line-height: 1.2 !important;
        font-weight: 900 !important;
        color: #12233f !important;
        position: relative;
        left: 98px;
        top: 15px;
    }
}

/* v1.8.1 Receive Payment dark mode + card spacing polish */
.wave-receive-payment-page .wave-card,
.wave-receive-payment-page .wave-section,
.wave-receive-payment-page .wave-enhanced-list,
.wave-receive-payment-page .wave-payment-manage-card {
  margin-bottom: 24px !important;
}
.wave-receive-payment-page .wave-card + .wave-card,
.wave-receive-payment-page .wave-section + .wave-section,
.wave-receive-payment-page .wave-enhanced-list + .wave-enhanced-list,
.wave-receive-payment-page .wave-payment-manage-card + .wave-enhanced-list,
.wave-receive-payment-page .wave-form-card + .wave-enhanced-list {
  margin-top: 24px !important;
}

.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-summary .wave-payment-pill,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-summary .wave-payment-pill,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-allocation-total,
body.ca-dark-page .wave-receive-payment-page .wave-allocation-total {
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  color: #e5edf7 !important;
  box-shadow: none !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-summary .wave-payment-pill .wave-pill-label,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-summary .wave-payment-pill .wave-pill-value,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-summary .wave-payment-pill .wave-pill-label,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-summary .wave-payment-pill .wave-pill-value {
  color: #e5edf7 !important;
}

.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tfoot tr.wave-total-owing-row,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tfoot tr.wave-total-owing-row,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row,
body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e5edf7 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tfoot td,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tfoot th,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tfoot td,
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tfoot th {
  background: #0f172a !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-label,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-label span,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-caption,
body.ca-dark-page .wave-receive-payment-page .wave-total-label,
body.ca-dark-page .wave-receive-payment-page .wave-total-label span,
body.ca-dark-page .wave-receive-payment-page .wave-total-caption {
  color: #cbd5e1 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-amount,
body.ca-dark-page .wave-receive-payment-page .wave-total-amount {
  color: inherit !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-amount.wave-money-red,
body.ca-dark-page .wave-receive-payment-page .wave-total-amount.wave-money-red,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-money-red,
body.ca-dark-page .wave-receive-payment-page .wave-money-red {
  color: #f87171 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-amount.wave-money-green,
body.ca-dark-page .wave-receive-payment-page .wave-total-amount.wave-money-green,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-money-green,
body.ca-dark-page .wave-receive-payment-page .wave-money-green {
  color: #34d399 !important;
}

/* Fix any white footer/summary cells caused by table defaults in dark mode */
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page tfoot *,
body.ca-dark-page .wave-receive-payment-page tfoot * {
  background-color: transparent !important;
}
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page tfoot,
body.ca-dark-page .wave-receive-payment-page tfoot {
  background: #0f172a !important;
}

@media (max-width: 760px) {
  .wave-receive-payment-page .wave-card,
  .wave-receive-payment-page .wave-section,
  .wave-receive-payment-page .wave-enhanced-list,
  .wave-receive-payment-page .wave-payment-manage-card {
    margin-bottom: 18px !important;
  }
  .wave-receive-payment-page .wave-card + .wave-card,
  .wave-receive-payment-page .wave-section + .wave-section,
  .wave-receive-payment-page .wave-enhanced-list + .wave-enhanced-list,
  .wave-receive-payment-page .wave-payment-manage-card + .wave-enhanced-list,
  .wave-receive-payment-page .wave-form-card + .wave-enhanced-list {
    margin-top: 18px !important;
  }
}


/* v1.8.4 - Receive Payment mobile totals: hide title + align amounts hard right */
@media (max-width: 760px) {
  .wave-receive-payment-page .wave-receive-payment-table tfoot tr.wave-total-owing-row,
  .wave-receive-payment-page .wave-total-owing-row {
    display: block !important;
    width: 100% !important;
    padding: 24px 18px !important;
    border: 1px solid #dbe5f0 !important;
    border-radius: 18px !important;
    background: #f8fbff !important;
    box-sizing: border-box !important;
  }

  /* Hide the mobile Totals title completely */
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label,
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span,
  .wave-receive-payment-page .ca-totals-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
  }

  .wave-receive-payment-page .wave-total-owing-row td {
    background: transparent !important;
    border: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 2mm !important;
  }

  /* One clean row: label left, amount hard right */
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    column-gap: 14px !important;
    width: 100% !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-caption {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    text-align: left !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
    color: #12233f !important;
    white-space: nowrap !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-amount {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: block !important;
    justify-self: end !important;
    margin: 0 !important;
    min-width: 118px !important;
    text-align: right !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
    font-family: inherit !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 380px) {
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-caption {
    font-size: 14px !important;
  }
  .wave-receive-payment-page .wave-total-owing-row .wave-total-cell .wave-total-amount {
    min-width: 104px !important;
    font-size: 15px !important;
  }
}

/* v1.8.5 - Receive Payment totals polish: mobile dark fix + desktop Totals title larger */

/* Desktop: make the Totals label bigger and clearer */
@media (min-width: 761px) {
  .wave-receive-payment-page .wave-receive-payment-table tfoot .wave-total-label span {
    font-size: 18px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    color: #12233f !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tfoot .wave-total-label span,
  body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tfoot .wave-total-label span {
    color: #eaf2ff !important;
  }
}

/* Mobile: clean totals card and make dark mode readable */
@media (max-width: 760px) {
  .wave-receive-payment-page .wave-table-wrap,
  .wave-receive-payment-page .wave-receive-payment-table,
  .wave-receive-payment-page .wave-receive-payment-table tfoot {
    overflow: hidden !important;
  }

  .wave-receive-payment-page .wave-total-owing-row {
    display: block !important;
    width: 100% !important;
    padding: 24px 18px !important;
    margin-top: 14px !important;
    border: 1px solid #dbe5f0 !important;
    border-radius: 18px !important;
    background: #f8fbff !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .wave-receive-payment-page .wave-total-owing-row td.wave-total-cell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-caption {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    color: #12233f !important;
    font-size: 15px !important;
    font-weight: 850 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: nowrap !important;
    opacity: 1 !important;
  }

  .wave-receive-payment-page .wave-total-owing-row .wave-total-amount {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: block !important;
    justify-self: end !important;
    min-width: 128px !important;
    margin: 0 !important;
    text-align: right !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
  }

  /* keep Totals title hidden on mobile */
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label,
  .wave-receive-payment-page .wave-total-owing-row .wave-total-label span,
  .wave-receive-payment-page .ca-totals-title {
    display: none !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row {
    background: #111827 !important;
    border-color: #334155 !important;
    box-shadow: none !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row td,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row td,
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-total-cell,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-total-cell {
    background: transparent !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-total-caption,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-total-caption {
    color: #cbd5e1 !important;
    opacity: 1 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-total-amount,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-total-amount {
    color: #eaf2ff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-money-owed,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-money-owed {
    color: #fca5a5 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-money-allocated,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-money-allocated {
    color: #34d399 !important;
  }
}

/* v1.8.7 - Receive Payment mobile dark totals final polish */
@media (max-width: 760px) {
  /* Remove the black strip above the totals card in mobile dark mode */
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tfoot,
  body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tfoot,
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tfoot tr,
  body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tfoot tr {
    background: #1e293b !important;
    background-color: #1e293b !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: none !important;
  }

  /* Ensure the cells do not create black corner/edge blocks */
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row td,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row td,
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-total-cell,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-total-cell {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
  }

  /* Dark mobile labels readable */
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-total-caption,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-total-caption {
    color: #e5edf7 !important;
    opacity: 1 !important;
  }

  /* Make Total owing + Remaining proper red, not orange/pink */
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-money-owed,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-money-owed,
  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-money-red,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-money-red {
    color: #ef4444 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-total-owing-row .wave-money-allocated,
  body.ca-dark-page .wave-receive-payment-page .wave-total-owing-row .wave-money-allocated {
    color: #00d084 !important;
  }
}

/* =========================================================
   v1.8.8 - Topbar Toggle Alignment Fix
   Move Day/Night toggle next to the account menu on desktop.
   ========================================================= */
@media (min-width: 901px){
  .wave-portal-topbar{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:10px !important;
  }

  .wave-portal-topbar > div:first-child{
    flex:1 1 auto !important;
  }

  .wave-portal-topbar .ca-theme-btn{
    margin-left:auto !important;
    order:10 !important;
  }

  .wave-portal-topbar .wave-account-menu{
    margin-left:0 !important;
    order:11 !important;
  }
}

@media (max-width: 900px){
  .wave-portal-topbar .ca-theme-btn{
    align-self:flex-end !important;
    margin-left:0 !important;
  }
}

/* v1.9.0 - DD/MM/YYYY date filters */
.wave-list-tools input.wave-date-ddmmyyyy{
  height:42px;
  border:1px solid var(--wave-border, #d5e0ec);
  border-radius:12px;
  padding:0 14px;
  background:var(--wave-input-bg, #fff);
  color:var(--wave-text, #13233a);
  font-size:15px;
  width:100%;
  box-sizing:border-box;
}
.wave-list-tools input.wave-date-ddmmyyyy::placeholder{color:#7b8798;opacity:1;}
.ca-dark .wave-list-tools input.wave-date-ddmmyyyy,
body.ca-dark .wave-list-tools input.wave-date-ddmmyyyy,
.wave-dark .wave-list-tools input.wave-date-ddmmyyyy,
body.wave-dark .wave-list-tools input.wave-date-ddmmyyyy{
  background:#0f1a2d;
  color:#eaf2ff;
  border-color:#33445f;
}

/* v1.9.1 - DD/MM/YYYY visible date filters with native calendar popup button */
.wave-date-picker-wrap{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
}
.wave-date-picker-wrap .wave-date-ddmmyyyy{
  width:100%;
  padding-right:44px !important;
}
.wave-date-picker-wrap .wave-native-date-picker{
  position:absolute;
  right:0;
  bottom:0;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.wave-date-picker-wrap .wave-date-picker-btn{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  border:0;
  background:transparent;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  line-height:1;
  padding:0;
  opacity:.85;
}
.wave-date-picker-wrap .wave-date-picker-btn:hover{opacity:1;}
.wave-portal-shell[data-theme="dark"] .wave-date-picker-wrap .wave-date-picker-btn,
body.ca-dark-page .wave-date-picker-wrap .wave-date-picker-btn{
  color:#dbeafe;
}

/* v1.9.2 - Flat calendar icons for DD/MM/YYYY date filters */
.wave-date-picker-wrap .wave-date-picker-btn{
  width:32px !important;
  height:32px !important;
  right:8px !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  font-size:0 !important;
  color:transparent !important;
  opacity:1 !important;
  border-radius:10px !important;
}
.wave-date-picker-wrap .wave-date-picker-btn::before{
  content:"";
  width:18px;
  height:18px;
  display:block;
  background-repeat:no-repeat;
  background-position:center;
  background-size:18px 18px;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B7A90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3' ry='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
.wave-date-picker-wrap .wave-date-picker-btn:hover{
  background:rgba(59,130,246,.08) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-date-picker-wrap .wave-date-picker-btn::before,
body.ca-dark-page .wave-date-picker-wrap .wave-date-picker-btn::before,
.ca-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
body.ca-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
.wave-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
body.wave-dark .wave-date-picker-wrap .wave-date-picker-btn::before{
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23D7E6FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3' ry='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
.wave-portal-shell[data-theme="dark"] .wave-date-picker-wrap .wave-date-picker-btn:hover,
body.ca-dark-page .wave-date-picker-wrap .wave-date-picker-btn:hover,
.ca-dark .wave-date-picker-wrap .wave-date-picker-btn:hover,
body.ca-dark .wave-date-picker-wrap .wave-date-picker-btn:hover,
.wave-dark .wave-date-picker-wrap .wave-date-picker-btn:hover,
body.wave-dark .wave-date-picker-wrap .wave-date-picker-btn:hover{
  background:rgba(215,230,255,.10) !important;
}


/* v2.0.0 - Universal flat DD/MM/YYYY date fields */
.wave-date-picker-wrap,
.ca-universal-date-picker{
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  width:100% !important;
}
.wave-date-picker-wrap .wave-date-ddmmyyyy,
.ca-universal-date-picker .ca-date-ddmmyyyy{
  width:100% !important;
  padding-right:46px !important;
}
.wave-date-picker-wrap .wave-native-date-picker,
.ca-universal-date-picker .ca-native-date-picker{
  position:absolute !important;
  right:0 !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:38px !important;
  height:38px !important;
  opacity:0 !important;
  cursor:pointer !important;
  z-index:4 !important;
}
.wave-date-picker-wrap .wave-date-picker-btn,
.ca-universal-date-picker .ca-date-picker-btn{
  position:absolute !important;
  right:8px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:32px !important;
  height:32px !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  font-size:0 !important;
  color:transparent !important;
  opacity:1 !important;
  border-radius:10px !important;
  cursor:pointer !important;
  z-index:3 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 !important;
}
.wave-date-picker-wrap .wave-date-picker-btn::before,
.ca-universal-date-picker .ca-date-picker-btn::before{
  content:"" !important;
  width:18px !important;
  height:18px !important;
  display:block !important;
  background-repeat:no-repeat !important;
  background-position:center !important;
  background-size:18px 18px !important;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B7A90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3' ry='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
}
.wave-date-picker-wrap .wave-date-picker-btn:hover,
.ca-universal-date-picker .ca-date-picker-btn:hover{
  background:rgba(59,130,246,.08) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-date-picker-wrap .wave-date-picker-btn::before,
.wave-portal-shell[data-theme="dark"] .ca-universal-date-picker .ca-date-picker-btn::before,
body.ca-dark-page .wave-date-picker-wrap .wave-date-picker-btn::before,
body.ca-dark-page .ca-universal-date-picker .ca-date-picker-btn::before,
.ca-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
.ca-dark .ca-universal-date-picker .ca-date-picker-btn::before,
body.ca-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
body.ca-dark .ca-universal-date-picker .ca-date-picker-btn::before,
.wave-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
.wave-dark .ca-universal-date-picker .ca-date-picker-btn::before,
body.wave-dark .wave-date-picker-wrap .wave-date-picker-btn::before,
body.wave-dark .ca-universal-date-picker .ca-date-picker-btn::before{
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23D7E6FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3' ry='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
}
.wave-portal-shell[data-theme="dark"] .wave-date-picker-wrap .wave-date-picker-btn:hover,
.wave-portal-shell[data-theme="dark"] .ca-universal-date-picker .ca-date-picker-btn:hover,
body.ca-dark-page .wave-date-picker-wrap .wave-date-picker-btn:hover,
body.ca-dark-page .ca-universal-date-picker .ca-date-picker-btn:hover,
.ca-dark .wave-date-picker-wrap .wave-date-picker-btn:hover,
.ca-dark .ca-universal-date-picker .ca-date-picker-btn:hover,
body.ca-dark .wave-date-picker-wrap .wave-date-picker-btn:hover,
body.ca-dark .ca-universal-date-picker .ca-date-picker-btn:hover,
.wave-dark .wave-date-picker-wrap .wave-date-picker-btn:hover,
.wave-dark .ca-universal-date-picker .ca-date-picker-btn:hover{
  background:rgba(215,230,255,.10) !important;
}
input[type="date"]::-webkit-calendar-picker-indicator{
  opacity:0 !important;
}


/* v2.0.2 Balance Sheet UI Polish - Wave-style compact filter row + horizontal equation */
.wvr-page .wvr-title-plain,
.wvr-page > .wave-header-card.wave-list-head.wvr-title-plain{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  margin:0 0 18px !important;
}
.wvr-page .wvr-title-plain h1{
  margin:0 !important;
  font-size:28px !important;
  line-height:1.15 !important;
}
.wvr-bs-filter.wvr-date-form,
.wvr-bs-filter.wvr-wave-filter{
  display:grid !important;
  grid-template-columns:80px minmax(120px,170px) minmax(150px,180px) minmax(190px,240px) 160px !important;
  gap:10px !important;
  align-items:end !important;
  padding:16px 18px !important;
  margin-bottom:24px !important;
}
.wvr-bs-filter .wvr-field{
  min-width:0 !important;
  margin:0 !important;
}
.wvr-bs-filter .wvr-asof-label{
  align-self:end !important;
  padding-bottom:11px !important;
  display:block !important;
  font-size:13px !important;
  font-weight:800 !important;
  color:#0f172a !important;
  white-space:nowrap !important;
}
.wvr-bs-filter .wvr-field span{
  font-size:12px !important;
  line-height:1.2 !important;
  margin-bottom:6px !important;
}
.wvr-bs-filter select,
.wvr-bs-filter input[type="text"],
.wvr-bs-filter input[type="date"]{
  height:38px !important;
  min-height:38px !important;
  padding:7px 36px 7px 11px !important;
  font-size:13px !important;
  border-radius:8px !important;
  width:100% !important;
  box-sizing:border-box !important;
}
.wvr-bs-filter .wvr-update-btn,
.wvr-bs-filter button[type="submit"]{
  height:38px !important;
  min-height:38px !important;
  padding:0 16px !important;
  width:100% !important;
  white-space:nowrap !important;
  align-self:end !important;
  margin:0 !important;
  border-radius:999px !important;
}
.wvr-bs-summary{
  display:flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
  flex-wrap:nowrap !important;
  gap:22px !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:26px 0 24px !important;
  margin:8px 0 18px !important;
  border-bottom:1px solid rgba(148,163,184,.35) !important;
}
.wvr-bs-metric{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:flex-end !important;
  text-align:center !important;
  min-width:130px !important;
}
.wvr-bs-metric span{
  display:block !important;
  margin:0 0 8px !important;
  font-size:12px !important;
  line-height:1.2 !important;
  font-weight:800 !important;
  color:#475569 !important;
  min-height:15px !important;
}
.wvr-bs-metric.green span{
  font-size:0 !important;
}
.wvr-bs-metric.green span::before{
  content:"Balance" !important;
  font-size:12px !important;
  font-weight:800 !important;
  color:#475569 !important;
}
.wvr-bs-metric strong{
  display:block !important;
  font-size:26px !important;
  line-height:1.05 !important;
  font-weight:500 !important;
  color:#0f172a !important;
  white-space:nowrap !important;
}
.wvr-bs-metric.green strong{
  color:#047857 !important;
  font-weight:650 !important;
}
.wvr-bs-op{
  font-size:26px !important;
  line-height:1 !important;
  font-weight:800 !important;
  color:#b6c2cf !important;
  padding-bottom:1px !important;
  min-width:20px !important;
  text-align:center !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-page .wvr-title-plain h1,
body.ca-dark-page .wvr-page .wvr-title-plain h1,
.ca-dark .wvr-page .wvr-title-plain h1,
body.ca-dark .wvr-page .wvr-title-plain h1{
  color:#f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-filter .wvr-asof-label,
body.ca-dark-page .wvr-bs-filter .wvr-asof-label,
.ca-dark .wvr-bs-filter .wvr-asof-label,
body.ca-dark .wvr-bs-filter .wvr-asof-label{
  color:#eaf2ff !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-summary,
body.ca-dark-page .wvr-bs-summary,
.ca-dark .wvr-bs-summary,
body.ca-dark .wvr-bs-summary{
  background:transparent !important;
  border-bottom-color:rgba(148,163,184,.28) !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-metric span,
.wave-portal-shell[data-theme="dark"] .wvr-bs-metric.green span::before,
body.ca-dark-page .wvr-bs-metric span,
body.ca-dark-page .wvr-bs-metric.green span::before,
.ca-dark .wvr-bs-metric span,
.ca-dark .wvr-bs-metric.green span::before,
body.ca-dark .wvr-bs-metric span,
body.ca-dark .wvr-bs-metric.green span::before{
  color:#cfe0f4 !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-metric strong,
body.ca-dark-page .wvr-bs-metric strong,
.ca-dark .wvr-bs-metric strong,
body.ca-dark .wvr-bs-metric strong{
  color:#f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-metric.green strong,
body.ca-dark-page .wvr-bs-metric.green strong,
.ca-dark .wvr-bs-metric.green strong,
body.ca-dark .wvr-bs-metric.green strong{
  color:#22c55e !important;
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-op,
body.ca-dark-page .wvr-bs-op,
.ca-dark .wvr-bs-op,
body.ca-dark .wvr-bs-op{
  color:#9fb1c7 !important;
}
@media (max-width:1100px){
  .wvr-bs-filter.wvr-date-form,
  .wvr-bs-filter.wvr-wave-filter{
    grid-template-columns:70px minmax(110px,150px) minmax(145px,1fr) minmax(180px,1fr) 145px !important;
    gap:8px !important;
  }
  .wvr-bs-summary{gap:14px !important;}
  .wvr-bs-metric{min-width:112px !important;}
  .wvr-bs-metric strong{font-size:22px !important;}
  .wvr-bs-op{font-size:22px !important;}
}
@media (max-width:820px){
  .wvr-bs-filter.wvr-date-form,
  .wvr-bs-filter.wvr-wave-filter{
    grid-template-columns:1fr 1fr !important;
  }
  .wvr-bs-filter .wvr-asof-label{padding-bottom:0 !important;align-self:start !important;}
  .wvr-bs-filter .wvr-update-btn{grid-column:1 / -1 !important;}
  .wvr-bs-summary{
    flex-wrap:wrap !important;
    justify-content:flex-start !important;
    gap:12px !important;
  }
}

/* v2.0.4 Import Reset Tool */
.wave-btn-danger{background:#dc2626!important;border-color:#dc2626!important;color:#fff!important;box-shadow:0 8px 18px rgba(220,38,38,.22)!important}.wave-btn-danger:hover{background:#b91c1c!important;border-color:#b91c1c!important}
html.ca-dark .wave-card[style*="f8fbff"]{background:#1f2b3d!important;border-color:#334155!important}html.ca-dark .wave-card hr{border-top-color:#334155!important}html.ca-dark .wave-card h3{color:#f8fafc}

/* v2.0.5 - Advanced reset UI in frontend Business Settings */
.ca-advanced-reset-card {
  border-radius: 18px !important;
}
.ca-advanced-reset-card .wave-section-head {
  margin-bottom: 14px !important;
}
.ca-reset-form select {
  min-height: 42px;
}
.ca-reset-check span {
  line-height: 1.4;
}
html.ca-dark .ca-advanced-reset-card,
body[data-theme="dark"] .ca-advanced-reset-card {
  background: #1f2937 !important;
  border-color: #7f1d1d !important;
}
html.ca-dark .ca-advanced-reset-card h3,
body[data-theme="dark"] .ca-advanced-reset-card h3 {
  color: #fecaca !important;
}
html.ca-dark .ca-advanced-reset-card .wave-section-head span,
html.ca-dark .ca-advanced-reset-card .wave-form-help,
html.ca-dark .ca-advanced-reset-card .ca-reset-check span,
body[data-theme="dark"] .ca-advanced-reset-card .wave-section-head span,
body[data-theme="dark"] .ca-advanced-reset-card .wave-form-help,
body[data-theme="dark"] .ca-advanced-reset-card .ca-reset-check span {
  color: #cbd5e1 !important;
}

/* v2.2.1 Cash Flow Upgrade: mobile + dark mode polish */
.wvr-cf-equation{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:28px;
  margin:22px 0 24px;
  padding:8px 0 18px;
  border-bottom:1px solid rgba(148,163,184,.25);
}
.wvr-cf-metric{
  min-width:180px;
  text-align:center;
}
.wvr-cf-metric span{
  display:block;
  margin-bottom:10px;
  font-size:12px;
  font-weight:850;
  color:#526174;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.wvr-cf-metric strong{
  display:block;
  font-size:34px;
  line-height:1.05;
  font-weight:500;
  color:#0f172a;
}
.wvr-cf-metric.result strong{color:#087b46;font-weight:650;}
.wvr-cf-op{
  font-size:28px;
  font-weight:900;
  color:#a8b6c6;
  margin-top:22px;
}
.wvr-cf-table-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px 10px;
  color:#0f172a;
}
.wvr-cf-table-head strong{
  font-size:14px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.wvr-cf-table-head span{
  font-size:13px;
  font-weight:800;
  color:#334155;
  text-align:right;
}
.wvr-cf-table .section-row td{
  background:#d9e3ec!important;
  color:#0f172a!important;
  font-weight:900!important;
  border-top:24px solid transparent!important;
}
.wvr-cf-table tr:first-child.section-row td{border-top:0!important;}
.wvr-cf-table .total-row td{
  font-weight:900!important;
  color:#0f172a!important;
  border-top:1px solid #94a3b8!important;
}
.wvr-cf-kpis{margin-bottom:18px!important;}

/* dark mode: make cash flow readable and remove day-mode white blocks */
.wave-portal-shell[data-theme="dark"] .wvr-cf-equation,
body.ca-dark-page .wvr-cf-equation,
.ca-dark .wvr-cf-equation,
body.ca-dark .wvr-cf-equation{
  border-bottom-color:#334155!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-metric span,
body.ca-dark-page .wvr-cf-metric span,
.ca-dark .wvr-cf-metric span,
body.ca-dark .wvr-cf-metric span{
  color:#cbd5e1!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-metric strong,
body.ca-dark-page .wvr-cf-metric strong,
.ca-dark .wvr-cf-metric strong,
body.ca-dark .wvr-cf-metric strong{
  color:#f8fafc!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-metric.result strong,
body.ca-dark-page .wvr-cf-metric.result strong,
.ca-dark .wvr-cf-metric.result strong,
body.ca-dark .wvr-cf-metric.result strong{
  color:#22c55e!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-op,
body.ca-dark-page .wvr-cf-op,
.ca-dark .wvr-cf-op,
body.ca-dark .wvr-cf-op{
  color:#9fb1c7!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-advanced,
body.ca-dark-page .wvr-cf-advanced,
.ca-dark .wvr-cf-advanced,
body.ca-dark .wvr-cf-advanced,
.wave-portal-shell[data-theme="dark"] .wvr-cf-chart-card,
body.ca-dark-page .wvr-cf-chart-card,
.ca-dark .wvr-cf-chart-card,
body.ca-dark .wvr-cf-chart-card{
  background:#1f2b3d!important;
  border-color:#334155!important;
  color:#e5edf7!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-table-head,
body.ca-dark-page .wvr-cf-table-head,
.ca-dark .wvr-cf-table-head,
body.ca-dark .wvr-cf-table-head,
.wave-portal-shell[data-theme="dark"] .wvr-cf-table-head span,
body.ca-dark-page .wvr-cf-table-head span,
.ca-dark .wvr-cf-table-head span,
body.ca-dark .wvr-cf-table-head span{
  color:#e5edf7!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-table .section-row td,
body.ca-dark-page .wvr-cf-table .section-row td,
.ca-dark .wvr-cf-table .section-row td,
body.ca-dark .wvr-cf-table .section-row td{
  background:#26354a!important;
  color:#f8fafc!important;
  border-top-color:#0b1421!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-table td,
body.ca-dark-page .wvr-cf-table td,
.ca-dark .wvr-cf-table td,
body.ca-dark .wvr-cf-table td,
.wave-portal-shell[data-theme="dark"] .wvr-cf-table th,
body.ca-dark-page .wvr-cf-table th,
.ca-dark .wvr-cf-table th,
body.ca-dark .wvr-cf-table th{
  background:#1f2b3d!important;
  color:#dbeafe!important;
  border-color:#334155!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-cf-table .total-row td,
body.ca-dark-page .wvr-cf-table .total-row td,
.ca-dark .wvr-cf-table .total-row td,
body.ca-dark .wvr-cf-table .total-row td{
  background:#162236!important;
  color:#ffffff!important;
  border-top-color:#64748b!important;
}

@media (max-width: 900px){
  .wvr-cf-equation{
    gap:14px;
    justify-content:flex-start;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding:8px 4px 18px;
  }
  .wvr-cf-metric{min-width:145px;text-align:left;}
  .wvr-cf-metric strong{font-size:25px;}
  .wvr-cf-op{font-size:22px;margin-top:20px;}
  .wvr-cf-table-head{align-items:flex-start;flex-direction:column;gap:4px;}
  .wvr-cf-table-head span{text-align:left;}
}
@media (max-width: 640px){
  .wvr-cf-equation{
    display:grid;
    grid-template-columns:1fr 28px;
    gap:10px 8px;
    margin-top:12px;
  }
  .wvr-cf-metric{
    min-width:0;
    width:100%;
    padding:14px 14px;
    border:1px solid #dbe5f0;
    border-radius:16px;
    background:#fff;
  }
  .wvr-cf-metric.result{grid-column:1 / -1;}
  .wvr-cf-metric span{font-size:11px;margin-bottom:6px;}
  .wvr-cf-metric strong{font-size:24px;}
  .wvr-cf-op{
    margin-top:0;
    align-self:center;
    justify-self:center;
  }
  .wvr-cf-kpis{
    grid-template-columns:1fr!important;
    max-width:none!important;
  }
  .wvr-canvas-wrap{aspect-ratio:1.25/1!important;min-height:280px;}
  .wvr-cf-advanced{overflow-x:auto;}
  .wvr-cf-table{min-width:520px;}
  .wvr-cf-table-head{position:sticky;left:0;background:inherit;}
  .wave-portal-shell[data-theme="dark"] .wvr-cf-metric,
  body.ca-dark-page .wvr-cf-metric,
  .ca-dark .wvr-cf-metric,
  body.ca-dark .wvr-cf-metric{
    background:#1f2b3d!important;
    border-color:#334155!important;
  }
}


/* v2.3.12 Balance Sheet filter polish: balanced full-width desktop row */
@media(min-width:1001px){
  .wvr-bs-filter.wvr-wave-filter{
    width:100%!important;
    display:grid!important;
    grid-template-columns:72px minmax(0,1fr) minmax(0,1fr) minmax(0,1.28fr) minmax(0,1fr)!important;
    gap:14px!important;
    align-items:end!important;
    padding:18px 20px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-field,
  .wvr-bs-filter.wvr-wave-filter .wvr-asof-label{
    min-width:0!important;
    height:auto!important;
    margin:0!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-asof-label{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    padding:0 0 10px 0!important;
    font-size:13px!important;
    line-height:40px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-field>span:first-child{
    height:16px!important;
    line-height:16px!important;
    margin:0 0 6px!important;
  }
  .wvr-bs-filter.wvr-wave-filter select,
  .wvr-bs-filter.wvr-wave-filter input[type="text"],
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap{
    height:40px!important;
    min-height:40px!important;
    width:100%!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-update-btn,
  .wvr-bs-filter.wvr-wave-filter button[type="submit"]{
    height:40px!important;
    min-height:40px!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    padding:0 14px!important;
    align-self:end!important;
    margin:0!important;
  }
}
@media(min-width:1001px) and (max-width:1180px){
  .wvr-bs-filter.wvr-wave-filter{
    grid-template-columns:58px minmax(0,.95fr) minmax(0,1fr) minmax(0,1.15fr) minmax(0,.9fr)!important;
    gap:10px!important;
    padding:16px!important;
  }
}



/* v2.3.14 Balance Sheet Wave details + filter alignment */
@media(min-width:1001px){
  .wvr-bs-filter.wvr-wave-filter{
    grid-template-columns:70px minmax(150px,180px) minmax(190px,240px) minmax(230px,1fr) minmax(150px,180px)!important;
    align-items:end!important;
    column-gap:14px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-field,
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap,
  .wvr-bs-filter.wvr-wave-filter select,
  .wvr-bs-filter.wvr-wave-filter input[type="text"],
  .wvr-bs-filter.wvr-wave-filter .wvr-update-btn{
    height:40px!important;min-height:40px!important;line-height:40px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-field{justify-content:flex-end!important;gap:6px!important;}
  .wvr-bs-filter.wvr-wave-filter .wvr-field>span:first-child{height:16px!important;line-height:16px!important;margin:0!important;}
  .wvr-bs-filter.wvr-wave-filter .wvr-asof-label{align-self:end!important;padding:0 0 10px!important;height:40px!important;line-height:40px!important;display:flex!important;align-items:center!important;}
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap{display:block!important;position:relative!important;}
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap input[type="text"]{display:block!important;padding-top:0!important;padding-bottom:0!important;}
  .wvr-bs-filter.wvr-wave-filter .ca-cal-btn{top:50%!important;transform:translateY(-50%)!important;}
}
.wvr-bs-tabs .wvr-bs-pill button{appearance:none;border:0;background:transparent;padding:6px 16px;border-radius:9px;font-weight:700;color:#075985;cursor:pointer;line-height:1.2;}
.wvr-bs-tabs .wvr-bs-pill button.active{background:#fff;box-shadow:0 1px 5px rgba(15,23,42,.18);color:#0f172a;}
.wvr-bs-section-row td{background:#d7e1ea!important;color:#0f172a!important;font-weight:800!important;border-top:1px solid #cbd5e1!important;border-bottom:1px solid #cbd5e1!important;}
.wvr-bs-subsection-row td{background:#eef3f7!important;color:#0f172a!important;font-weight:800!important;padding-left:36px!important;}
.wvr-bs-indent{padding-left:36px!important;}
.wvr-bs-table a{color:#004cff!important;text-decoration:none!important;font-weight:700!important;}
.wvr-bs-total td{font-weight:800!important;color:#0f172a!important;}
.wvr-bs-grand-total td{font-weight:900!important;color:#0f172a!important;border-top:1px solid #cbd5e1!important;}
.wvr-bs-spacer td{height:28px!important;background:transparent!important;border:0!important;padding:0!important;}
.wave-portal-shell[data-theme="dark"] .wvr-bs-tabs .wvr-bs-pill button.active,body[data-theme="dark"] .wvr-bs-tabs .wvr-bs-pill button.active,.ca-dark .wvr-bs-tabs .wvr-bs-pill button.active{background:#eaf5ff!important;color:#082f49!important;}
.wave-portal-shell[data-theme="dark"] .wvr-bs-subsection-row td,body[data-theme="dark"] .wvr-bs-subsection-row td,.ca-dark .wvr-bs-subsection-row td{background:#1e293b!important;color:#f8fafc!important;}

/* v2.3.15 Balance Sheet final polish: remove redundant date/bottom toggle, exact field alignment, mobile/dark */
.wvr-bs-report-date,
.wvr-bs-show-details{
  display:none!important;
}
.wvr-bs-tabs{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:18px!important;
  margin:0 0 18px!important;
  padding:0!important;
}
.wvr-bs-tabs::after{
  content:"";
  flex:1 1 auto;
  height:1px;
  background:#d7e1ea;
}
.wvr-bs-tabs .wvr-bs-pill{
  display:inline-flex!important;
  align-items:center!important;
  background:#dceffb!important;
  border-radius:12px!important;
  padding:3px!important;
  height:34px!important;
  flex:0 0 auto!important;
}
@media(min-width:901px){
  .wvr-bs-filter.wvr-date-form,
  .wvr-bs-filter.wvr-wave-filter{
    display:grid!important;
    grid-template-columns:56px minmax(130px,170px) minmax(180px,230px) minmax(250px,1fr) minmax(150px,190px)!important;
    gap:12px!important;
    align-items:end!important;
    padding:18px 20px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-field,
  .wvr-bs-filter.wvr-wave-filter .wvr-asof-label{
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-end!important;
    min-height:58px!important;
    margin:0!important;
    padding:0!important;
    min-width:0!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-asof-label{
    justify-content:center!important;
    height:40px!important;
    min-height:40px!important;
    padding-top:18px!important;
    line-height:40px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-field>span:first-child{
    display:block!important;
    height:18px!important;
    min-height:18px!important;
    line-height:18px!important;
    margin:0 0 4px!important;
    padding:0!important;
  }
  .wvr-bs-filter.wvr-wave-filter select,
  .wvr-bs-filter.wvr-wave-filter input[type="text"],
  .wvr-bs-filter.wvr-wave-filter input[type="date"],
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap,
  .wvr-bs-filter.wvr-wave-filter .wvr-update-btn,
  .wvr-bs-filter.wvr-wave-filter button[type="submit"]{
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    line-height:40px!important;
    box-sizing:border-box!important;
    margin:0!important;
  }
  .wvr-bs-filter.wvr-wave-filter input[type="text"],
  .wvr-bs-filter.wvr-wave-filter input[type="date"],
  .wvr-bs-filter.wvr-wave-filter select{
    padding-top:0!important;
    padding-bottom:0!important;
    display:block!important;
    vertical-align:middle!important;
  }
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap{
    display:block!important;
    position:relative!important;
    width:100%!important;
  }
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap input{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
  }
  .wvr-bs-filter.wvr-wave-filter .ca-cal-btn{
    position:absolute!important;
    top:50%!important;
    right:8px!important;
    transform:translateY(-50%)!important;
    margin:0!important;
  }
}
.wave-portal-shell[data-theme="dark"] .wvr-bs-tabs::after,
body.ca-dark-page .wvr-bs-tabs::after,
.ca-dark .wvr-bs-tabs::after,
body.ca-dark .wvr-bs-tabs::after{background:#334155!important;}
.wave-portal-shell[data-theme="dark"] .wvr-bs-tabs .wvr-bs-pill,
body.ca-dark-page .wvr-bs-tabs .wvr-bs-pill,
.ca-dark .wvr-bs-tabs .wvr-bs-pill,
body.ca-dark .wvr-bs-tabs .wvr-bs-pill{background:#26354a!important;}
.wave-portal-shell[data-theme="dark"] .wvr-bs-tabs .wvr-bs-pill button.active,
body.ca-dark-page .wvr-bs-tabs .wvr-bs-pill button.active,
.ca-dark .wvr-bs-tabs .wvr-bs-pill button.active,
body.ca-dark .wvr-bs-tabs .wvr-bs-pill button.active{background:#0f172a!important;color:#fff!important;}
.wave-portal-shell[data-theme="dark"] .wvr-bs-section-row td,
body.ca-dark-page .wvr-bs-section-row td,
.ca-dark .wvr-bs-section-row td,
body.ca-dark .wvr-bs-section-row td{background:#26354a!important;color:#f8fafc!important;border-color:#334155!important;}
.wave-portal-shell[data-theme="dark"] .wvr-bs-subsection-row td,
body.ca-dark-page .wvr-bs-subsection-row td,
.ca-dark .wvr-bs-subsection-row td,
body.ca-dark .wvr-bs-subsection-row td{background:#1f2b3d!important;color:#f8fafc!important;}
@media(max-width:900px){
  .wvr-bs-filter.wvr-date-form,
  .wvr-bs-filter.wvr-wave-filter{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding:14px!important;
  }
  .wvr-bs-filter.wvr-wave-filter .wvr-asof-label{padding:0!important;min-height:auto!important;}
  .wvr-bs-filter.wvr-wave-filter .wvr-field,
  .wvr-bs-filter.wvr-wave-filter select,
  .wvr-bs-filter.wvr-wave-filter input[type="text"],
  .wvr-bs-filter.wvr-wave-filter .ca-date-wrap,
  .wvr-bs-filter.wvr-wave-filter .wvr-update-btn{width:100%!important;max-width:none!important;}
  .wvr-bs-summary{overflow-x:auto!important;justify-content:flex-start!important;}
  .wvr-bs-tabs{margin-top:4px!important;}
  .wvr-bs-tabs::after{display:none!important;}
  .wvr-bs-tabs .wvr-bs-pill{width:100%!important;justify-content:center!important;}
}


/* v2.14.0 global report mobile overflow guard */
@media (max-width: 768px){
  html, body, .wave-portal-shell, .wave-content, .wvr-page, .wave-report-page{max-width:100%!important;overflow-x:hidden!important;}
  .wvr-report-wrap, .wvr-card, .wvr-grid, .wvr-canvas-wrap{max-width:100%!important;overflow-x:hidden!important;box-sizing:border-box!important;}
  .wvr-report-table{width:100%!important;min-width:0!important;table-layout:fixed!important;}
  .wvr-report-table th,.wvr-report-table td{white-space:normal!important;word-break:break-word!important;overflow-wrap:anywhere!important;}
  .wvr-report-table .num{text-align:right!important;}
}


/* =========================================================
   v2.14.2 - Income by Customer mobile polish + Create Bill mobile
   Scope: Income by Customer report and Create/Edit Bill form only
   ========================================================= */

/* Keep the portal from creating accidental horizontal page scrolls on phones */
@media (max-width: 768px){
  html, body,
  .wave-portal-shell,
  .wave-portal-page,
  .wave-main,
  .wave-content,
  .wvr-page{
    max-width:100%!important;
    overflow-x:hidden!important;
    box-sizing:border-box!important;
  }
}

/* ---------- Income by Customer: clean mobile cards, no horizontal scrollbar ---------- */
@media (max-width: 768px){
  .wvr-ibc-table-wrap{
    overflow-x:hidden!important;
    width:100%!important;
    max-width:100%!important;
  }
  .wvr-ibc-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
    border-collapse:separate!important;
    border-spacing:0!important;
  }
  .wvr-ibc-table thead{
    display:none!important;
  }
  .wvr-ibc-table tbody{
    display:block!important;
    width:100%!important;
  }
  .wvr-ibc-table tbody tr{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    margin:0 0 14px!important;
    padding:14px 14px!important;
    background:#fff!important;
    border:1px solid #dbe5f0!important;
    border-radius:16px!important;
    box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
  }
  .wvr-ibc-table tbody tr td{
    display:grid!important;
    grid-template-columns:minmax(96px, 38%) minmax(0, 1fr)!important;
    align-items:start!important;
    gap:12px!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:8px 0!important;
    border:0!important;
    font-size:14px!important;
    line-height:1.35!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    color:#0f172a!important;
  }
  .wvr-ibc-table tbody tr td::before{
    content:attr(data-label);
    display:block!important;
    font-size:12px!important;
    font-weight:850!important;
    line-height:1.2!important;
    letter-spacing:.04em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
    white-space:nowrap!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
  }
  .wvr-ibc-table tbody tr td:nth-child(1){
    font-weight:850!important;
  }
  .wvr-ibc-table tbody tr td:nth-child(2){
    font-size:13px!important;
    color:#334155!important;
  }
  .wvr-ibc-table tbody tr td.num{
    text-align:right!important;
    justify-items:end!important;
  }
  .wvr-ibc-table tbody tr td.num::before{
    justify-self:start!important;
  }
  .wvr-ibc-table tbody tr td[data-label="Email"]{
    word-break:normal!important;
    overflow-wrap:anywhere!important;
  }
  .wvr-ibc-table tbody tr.total-row{
    padding:14px!important;
    background:#f8fbff!important;
  }
  .wvr-ibc-table tbody tr.total-row td{
    grid-template-columns:minmax(110px, 44%) minmax(0, 1fr)!important;
    font-weight:900!important;
    padding:7px 0!important;
  }
  .wvr-ibc-table tbody tr.total-row td:first-child{
    display:block!important;
    padding:0 0 10px!important;
    border-bottom:1px solid #e2e8f0!important;
  }
  .wvr-ibc-table tbody tr.total-row td:first-child::before{
    content:''!important;
    display:none!important;
  }
  .wvr-ibc-table tbody tr.total-row td.num{
    display:grid!important;
    grid-template-columns:minmax(110px, 44%) minmax(0, 1fr)!important;
  }
  .wvr-ibc-table tbody tr.total-row td.num::before{
    text-align:left!important;
  }
  .wvr-ibc-table tbody tr.total-row td.num{
    text-align:right!important;
  }
}

@media (max-width: 420px){
  .wvr-ibc-table tbody tr td,
  .wvr-ibc-table tbody tr.total-row td,
  .wvr-ibc-table tbody tr.total-row td.num{
    grid-template-columns:minmax(88px, 36%) minmax(0, 1fr)!important;
    gap:10px!important;
  }
  .wvr-ibc-table tbody tr td::before{
    font-size:11.5px!important;
  }
}

/* ---------- Create/Edit Bill: mobile-friendly form and bill items editor ---------- */
@media (max-width: 768px){
  .wave-main:has(.wave-bill-items-editor),
  .wave-portal-page:has(.wave-bill-items-editor){
    overflow-x:hidden!important;
  }
  .wave-form-grid:has(.wave-bill-items-editor){
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:16px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  .wave-form-grid:has(.wave-bill-items-editor) label,
  .wave-form-grid:has(.wave-bill-items-editor) .wave-col-2,
  .wave-form-grid:has(.wave-bill-items-editor) .wave-actions{
    grid-column:1 / -1!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .wave-form-grid:has(.wave-bill-items-editor) input,
  .wave-form-grid:has(.wave-bill-items-editor) select,
  .wave-form-grid:has(.wave-bill-items-editor) textarea{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .wave-bill-items-head{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    gap:12px!important;
  }
  .wave-bill-items-head .wave-btn,
  #wave-add-bill-row{
    width:auto!important;
    min-width:150px!important;
    align-self:center!important;
  }
  .wave-bill-items-editor .wave-table-wrap{
    overflow-x:hidden!important;
    width:100%!important;
    max-width:100%!important;
  }
  .wave-bill-items-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
  }
  .wave-bill-items-table thead{
    display:none!important;
  }
  .wave-bill-items-table tbody{
    display:block!important;
    width:100%!important;
  }
  .wave-bill-items-table tr.wave-bill-item-row{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:14px!important;
    margin:0 0 14px!important;
    background:#fff!important;
    border:1px solid #dbe5f0!important;
    border-radius:16px!important;
    box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
  }
  .wave-bill-items-table tr.wave-bill-item-row td{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:0 0 12px!important;
    border:0!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
  }
  .wave-bill-items-table tr.wave-bill-item-row td:last-child{
    padding-bottom:0!important;
    text-align:right!important;
  }
  .wave-bill-items-table tr.wave-bill-item-row td::before{
    display:block!important;
    margin:0 0 6px!important;
    font-size:12px!important;
    font-weight:850!important;
    letter-spacing:.04em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
    line-height:1.2!important;
  }
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(1)::before{content:'Saved item';}
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(2)::before{content:'Name';}
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(3)::before{content:'Description';}
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(4)::before{content:'Qty';}
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(5)::before{content:'Cost';}
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(6)::before{content:'Tax %';}
  .wave-bill-items-table tr.wave-bill-item-row td:nth-child(7)::before{content:'';display:none!important;}
  .wave-bill-items-table input,
  .wave-bill-items-table select,
  .wave-bill-items-table textarea{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .wave-add-expense-product-inline{
    display:inline-block!important;
    margin-top:8px!important;
    max-width:100%!important;
    white-space:normal!important;
    text-align:left!important;
  }
  .wave-remove-bill-row{
    width:40px!important;
    height:40px!important;
  }
  .wave-form-help{
    font-size:13px!important;
    line-height:1.45!important;
    overflow-wrap:break-word!important;
  }
  .wave-actions:has(button[type="submit"]){
    position:sticky!important;
    bottom:0!important;
    z-index:20!important;
    padding:12px 0 0!important;
    background:linear-gradient(to top,#fff 70%,rgba(255,255,255,.85))!important;
  }
  .wave-actions button[type="submit"],
  .wave-form-grid:has(.wave-bill-items-editor) .wave-actions .wave-btn-primary{
    width:100%!important;
    max-width:100%!important;
  }
}

/* Dark mode for the new mobile cards */
@media (max-width: 768px){
  .wave-portal-shell[data-theme="dark"] .wvr-ibc-table tbody tr,
  body.ca-dark-page .wvr-ibc-table tbody tr,
  .ca-dark .wvr-ibc-table tbody tr,
  .wave-portal-shell[data-theme="dark"] .wave-bill-items-table tr.wave-bill-item-row,
  body.ca-dark-page .wave-bill-items-table tr.wave-bill-item-row,
  .ca-dark .wave-bill-items-table tr.wave-bill-item-row{
    background:#111827!important;
    border-color:#334155!important;
    color:#f8fafc!important;
  }
  .wave-portal-shell[data-theme="dark"] .wvr-ibc-table tbody tr td,
  body.ca-dark-page .wvr-ibc-table tbody tr td,
  .ca-dark .wvr-ibc-table tbody tr td,
  .wave-portal-shell[data-theme="dark"] .wave-bill-items-table tr.wave-bill-item-row td,
  body.ca-dark-page .wave-bill-items-table tr.wave-bill-item-row td,
  .ca-dark .wave-bill-items-table tr.wave-bill-item-row td{
    color:#f8fafc!important;
  }
  .wave-portal-shell[data-theme="dark"] .wvr-ibc-table tbody tr td::before,
  body.ca-dark-page .wvr-ibc-table tbody tr td::before,
  .ca-dark .wvr-ibc-table tbody tr td::before,
  .wave-portal-shell[data-theme="dark"] .wave-bill-items-table tr.wave-bill-item-row td::before,
  body.ca-dark-page .wave-bill-items-table tr.wave-bill-item-row td::before,
  .ca-dark .wave-bill-items-table tr.wave-bill-item-row td::before{
    color:#94a3b8!important;
  }
  .wave-portal-shell[data-theme="dark"] .wave-actions:has(button[type="submit"]),
  body.ca-dark-page .wave-actions:has(button[type="submit"]),
  .ca-dark .wave-actions:has(button[type="submit"]){
    background:linear-gradient(to top,#0f172a 70%,rgba(15,23,42,.85))!important;
  }
}


/* =========================================================
   v2.14.4 - Income by Customer mobile cards definitive fix
   Scope: Income by Customer only
   Fixes old table width rules overriding mobile cards and causing emails to wrap letter-by-letter.
   ========================================================= */
@media (max-width: 768px){
  .wvr-page .wvr-ibc-table-wrap{
    overflow-x:hidden!important;
    width:100%!important;
    max-width:100%!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table,
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody,
  .wvr-page table.wvr-report-table.wvr-ibc-table tr{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
    box-sizing:border-box!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table thead{
    display:none!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr{
    margin:0 0 14px!important;
    padding:14px!important;
    border:1px solid #dbe5f0!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
    overflow:hidden!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td,
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:first-child,
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(2),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(3),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(4),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(5),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(6){
    display:grid!important;
    grid-template-columns:112px minmax(0,1fr)!important;
    gap:12px!important;
    align-items:start!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:8px 0!important;
    border:0!important;
    box-sizing:border-box!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    text-align:left!important;
    font-size:14px!important;
    line-height:1.35!important;
    color:#0f172a!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td::before{
    content:attr(data-label)!important;
    display:block!important;
    grid-column:1!important;
    justify-self:start!important;
    align-self:start!important;
    font-size:12px!important;
    font-weight:850!important;
    line-height:1.2!important;
    letter-spacing:.04em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
    white-space:nowrap!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td[data-label="Customer"]{
    font-weight:850!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td[data-label="Email"]{
    font-size:13px!important;
    color:#334155!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:anywhere!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td.num{
    text-align:right!important;
    justify-items:end!important;
    font-variant-numeric:tabular-nums!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td.num::before{
    justify-self:start!important;
    text-align:left!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row{
    background:#f8fbff!important;
    border-color:#cfe0f2!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row td:first-child{
    display:block!important;
    width:100%!important;
    padding:0 0 10px!important;
    margin:0 0 6px!important;
    border-bottom:1px solid #e2e8f0!important;
    font-weight:900!important;
    text-align:left!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row td:first-child::before{
    display:none!important;
    content:''!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row td.num{
    grid-template-columns:112px minmax(0,1fr)!important;
    font-weight:900!important;
  }
}
@media (max-width: 420px){
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td,
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:first-child,
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(2),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(3),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(4),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(5),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td:nth-child(6),
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row td.num{
    grid-template-columns:104px minmax(0,1fr)!important;
    gap:10px!important;
  }
  .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td::before{
    font-size:11.5px!important;
  }
}
.wave-portal-shell[data-theme="dark"] .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr,
body.ca-dark-page .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr,
.ca-dark .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr{
  background:#0f172a!important;
  border-color:#334155!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row,
body.ca-dark-page .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row,
.ca-dark .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr.total-row{
  background:#111c2f!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td,
body.ca-dark-page .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td,
.ca-dark .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td{
  color:#e5e7eb!important;
}
.wave-portal-shell[data-theme="dark"] .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td::before,
body.ca-dark-page .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td::before,
.ca-dark .wvr-page table.wvr-report-table.wvr-ibc-table tbody tr td::before{
  color:#94a3b8!important;
}

/* v2.14.6 Aged Receivables mobile card override */


/* v2.14.6 DEFINITIVE: Aged Receivables mobile cards (override generic report table rules) */
@media (max-width: 980px){
  .wvr-page .wvr-report-wrap{overflow-x:hidden!important;max-width:100%!important;width:100%!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
    table-layout:auto!important;border-collapse:separate!important;border-spacing:0!important;overflow:visible!important;
  }
  .wvr-page table.wvr-report-table.wvr-aged-table thead,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table thead{display:none!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table tbody,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody{display:block!important;width:100%!important;max-width:100%!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
    background:#fff!important;border:1px solid #dbe5f0!important;border-radius:16px!important;padding:13px 15px!important;margin:0 0 13px!important;
    box-shadow:0 1px 3px rgba(15,23,42,.06)!important;
  }
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td,
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td:first-child,
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td:nth-child(2),
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td:nth-child(3),
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td:nth-child(4),
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td:nth-child(5),
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td:first-child,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td:nth-child(2),
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td:nth-child(3){
    display:grid!important;grid-template-columns:minmax(115px,38%) minmax(0,1fr)!important;align-items:start!important;gap:10px!important;
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
    border:0!important;border-bottom:0!important;padding:7px 0!important;margin:0!important;
    white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;text-align:left!important;line-height:1.35!important;
  }
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td::before,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td::before{
    content:attr(data-label)!important;font-size:12px!important;font-weight:850!important;color:#5d6b82!important;
    text-transform:uppercase!important;letter-spacing:.02em!important;white-space:nowrap!important;text-align:left!important;
  }
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td.num,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td.num{text-align:right!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td.num > *,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td.num > *{justify-self:end!important;text-align:right!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td[data-label="Outstanding"],
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td[data-label="Total Outstanding"]{font-weight:900!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td[data-label="Outstanding"]::after,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td[data-label="Total Outstanding"]::after{justify-self:end!important;text-align:right!important;}
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr.total-row{background:#f8fbff!important;border-color:#bfd6ee!important;}
}
@media (prefers-color-scheme: dark) and (max-width: 980px){
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr{background:#111827!important;border-color:#334155!important;box-shadow:none!important;}
  .wvr-page table.wvr-report-table.wvr-aged-table tbody tr td::before,
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr td::before{color:#9ca3af!important;}
  .wvr-page table.wvr-report-table.wvr-aged-summary-table tbody tr.total-row{background:#0f172a!important;border-color:#475569!important;}
}

/* v2.16.2 scoped email send notices */
.ca-email-send-notice-success {
  background:#ecfdf5 !important;
  border-color:#86efac !important;
  color:#166534 !important;
}
.ca-email-send-notice-error {
  background:#fef2f2 !important;
  border-color:#fecaca !important;
  color:#991b1b !important;
}
.wave-portal-shell[data-theme="dark"] .ca-email-send-notice-success,
body.ca-dark-page .ca-email-send-notice-success {
  background:rgba(22,101,52,.18) !important;
  border-color:rgba(34,197,94,.45) !important;
  color:#bbf7d0 !important;
}
.wave-portal-shell[data-theme="dark"] .ca-email-send-notice-error,
body.ca-dark-page .ca-email-send-notice-error {
  background:rgba(127,29,29,.24) !important;
  border-color:rgba(248,113,113,.45) !important;
  color:#fecaca !important;
}
.ca-email-sending { opacity:.75; cursor:wait !important; }

/* v2.16.8: keep receipt view consistent with the portal font and spacing */
.wave-receipt-page,
.wave-receipt-page *,
.wave-receipt-sheet,
.wave-receipt-sheet * {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}
.wave-receipt-sheet h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}
.wave-receipt-subtitle,
.wave-receipt-customer,
.wave-receipt-business-block,
.wave-receipt-money-line,
.wave-receipt-method-line,
.wave-receipt-footer-note {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* v2.16.19 - Customer Statement preview + flat calendar icons + visible share estimate */
.wvst-date-field input[type="date"]::-webkit-calendar-picker-indicator,
.wvst-filter-bar input[type="date"]::-webkit-calendar-picker-indicator{
  opacity:0 !important;
  display:none !important;
  -webkit-appearance:none !important;
}
.wvst-date-field input[type="date"]{
  appearance:none !important;
  -webkit-appearance:none !important;
  background:#fff !important;
}
.wvst-cal-btn{
  color:#64748b !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  font-size:0 !important;
}
.wvst-cal-btn::before{
  content:"";
  width:16px;
  height:16px;
  display:block;
  background-color:#64748b;
  -webkit-mask:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1.5A2.5 2.5 0 0 1 22 6.5v12A2.5 2.5 0 0 1 19.5 21h-15A2.5 2.5 0 0 1 2 18.5v-12A2.5 2.5 0 0 1 4.5 4H6V3a1 1 0 0 1 1-1Zm12.5 8h-15v8.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5V10ZM5 6a.5.5 0 0 0-.5.5V8h15V6.5A.5.5 0 0 0 19 6H5Z'/%3E%3C/svg%3E") center/16px 16px no-repeat;
  mask:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1.5A2.5 2.5 0 0 1 22 6.5v12A2.5 2.5 0 0 1 19.5 21h-15A2.5 2.5 0 0 1 2 18.5v-12A2.5 2.5 0 0 1 4.5 4H6V3a1 1 0 0 1 1-1Zm12.5 8h-15v8.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5V10ZM5 6a.5.5 0 0 0-.5.5V8h15V6.5A.5.5 0 0 0 19 6H5Z'/%3E%3C/svg%3E") center/16px 16px no-repeat;
}
.wvst-cal-btn:hover::before{background-color:#0f172a !important;}
.ca-share-estimate-list-btn{margin-left:6px;background:#fff!important;}
@media(max-width:760px){.ca-share-estimate-list-btn{display:none!important;}}
body.wvst-customer-preview-body .wvst-page,
body .wvst-customer-preview-body .wvst-page{
  width:calc(100vw - 40px)!important;
  max-width:980px!important;
  margin:32px auto!important;
}


/* v2.16.27 - Customer Statement dark mode + mobile no-horizontal-scroll polish */
.wave-portal-shell[data-theme="dark"] .wvst-page,
html.ca-dark .wvst-page {
  color: #f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar,
html.ca-dark .wvst-filter-bar {
  background: #111827 !important;
  border-color: #334155 !important;
  box-shadow: none !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar label,
html.ca-dark .wvst-filter-bar label {
  color: #dbeafe !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar select,
.wave-portal-shell[data-theme="dark"] .wvst-filter-bar input[type="date"],
html.ca-dark .wvst-filter-bar select,
html.ca-dark .wvst-filter-bar input[type="date"] {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-date-field,
html.ca-dark .wvst-date-field {
  background: #1e293b !important;
  border-color: #475569 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-cal-btn::before,
html.ca-dark .wvst-cal-btn::before { background-color: #94a3b8 !important; }
.wave-portal-shell[data-theme="dark"] .wvst-action-buttons .wave-btn-secondary,
html.ca-dark .wvst-action-buttons .wave-btn-secondary {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-action-buttons .wave-btn-primary,
html.ca-dark .wvst-action-buttons .wave-btn-primary {
  background: #38bdf8 !important;
  border-color: #38bdf8 !important;
  color: #082f49 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc,
html.ca-dark .wvst-doc {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-doc *:not(.wave-btn):not(input):not(select):not(option),
html.ca-dark .wvst-doc *:not(.wave-btn):not(input):not(select):not(option) {
  color: inherit;
}
.wave-portal-shell[data-theme="dark"] .wvst-ledger-table th,
.wave-portal-shell[data-theme="dark"] .wvst-table th,
html.ca-dark .wvst-ledger-table th,
html.ca-dark .wvst-table th {
  color: #93a4b8 !important;
  border-color: #64748b !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-ledger-table td,
.wave-portal-shell[data-theme="dark"] .wvst-table td,
html.ca-dark .wvst-ledger-table td,
html.ca-dark .wvst-table td {
  color: #f8fafc !important;
  border-color: #334155 !important;
}
.wave-portal-shell[data-theme="dark"] .wvst-ledger-table tr,
.wave-portal-shell[data-theme="dark"] .wvst-table tr,
html.ca-dark .wvst-ledger-table tr,
html.ca-dark .wvst-table tr { background: transparent !important; }
.wave-portal-shell[data-theme="dark"] .wvst-aging table,
html.ca-dark .wvst-aging table { border-color:#64748b !important; }
.wave-portal-shell[data-theme="dark"] .wvst-aging th,
.wave-portal-shell[data-theme="dark"] .wvst-aging td,
html.ca-dark .wvst-aging th,
html.ca-dark .wvst-aging td {
  background:#0f172a !important;
  border-color:#64748b !important;
  color:#f8fafc !important;
}

@media (max-width: 760px) {
  html, body,
  .wave-portal-shell,
  .wave-main,
  .wave-portal-page,
  .wvst-page {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .wvst-page {
    width: 100% !important;
    padding: 0 12px 24px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  .wvst-filter-bar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    padding: 14px !important;
    box-sizing: border-box !important;
  }
  .wvst-filter-bar label,
  .wvst-filter-bar select,
  .wvst-filter-bar input[type="date"],
  .wvst-refresh {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .wvst-date-wrap {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .wvst-date-wrap > span:not(.wvst-date-field) {
    display: none !important;
  }
  .wvst-date-field {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  .wvst-date-field input[type="date"] {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .wvst-action-buttons,
  .wvst-action-bar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 14px 0 16px !important;
  }
  .wvst-action-buttons form,
  .wvst-action-buttons .wave-btn,
  .wvst-action-bar form,
  .wvst-action-bar .wave-btn {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  .wvst-doc {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 18px 14px 22px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    border-radius: 12px !important;
  }
  .wvst-doc-header,
  .wvst-doc-meta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    width: 100% !important;
  }
  .wvst-doc-title,
  .wvst-doc-title h2,
  .wvst-doc-title p,
  .wvst-doc-meta .dates-summary {
    text-align: left !important;
  }
  .wvst-doc-header .biz-info,
  .wvst-doc-meta .bill-to,
  .wvst-doc-meta .dates-summary {
    width: 100% !important;
    max-width: 100% !important;
  }
  .wvst-doc-header .biz-logo,
  .wvst-doc img.biz-logo {
    max-width: 126px !important;
    height: auto !important;
  }
  .wvst-summary,
  .wvst-doc-meta .dates-summary .row {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .wvst-table,
  .wvst-ledger-table,
  .wvst-doc table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }
  .wvst-table th,
  .wvst-table td,
  .wvst-ledger-table th,
  .wvst-ledger-table td,
  .wvst-doc table th,
  .wvst-doc table td {
    padding: 7px 4px !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }
  .wvst-table th:nth-child(2),
  .wvst-table td:nth-child(2),
  .wvst-ledger-table th:nth-child(2),
  .wvst-ledger-table td:nth-child(2) { display:none !important; }
  .wvst-table th:nth-child(1), .wvst-table td:nth-child(1),
  .wvst-ledger-table th:nth-child(1), .wvst-ledger-table td:nth-child(1) { width: 18% !important; }
  .wvst-table th:nth-child(3), .wvst-table td:nth-child(3),
  .wvst-ledger-table th:nth-child(3), .wvst-ledger-table td:nth-child(3) { width: 32% !important; }
  .wvst-table th:nth-child(4), .wvst-table td:nth-child(4),
  .wvst-table th:nth-child(5), .wvst-table td:nth-child(5),
  .wvst-table th:nth-child(6), .wvst-table td:nth-child(6),
  .wvst-ledger-table th:nth-child(4), .wvst-ledger-table td:nth-child(4),
  .wvst-ledger-table th:nth-child(5), .wvst-ledger-table td:nth-child(5),
  .wvst-ledger-table th:nth-child(6), .wvst-ledger-table td:nth-child(6) { width: 16% !important; text-align:right !important; }
  .wvst-aging,
  .wvst-aging table {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  .wvst-aging th,
  .wvst-aging td {
    padding: 6px 2px !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  .wave-header-card,
  .wave-card {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
}

/* v2.17.0 Project Foundation */
.wave-side-subnav a[href*="tab=projects"] { font-weight: 600; }
.ca-project-select + small { display:block; margin-top:6px; color:#64748b; font-size:12px; }
[data-theme="dark"] .ca-project-select + small, .ca-dark-page .ca-project-select + small { color:#93a4b8; }
@media (max-width: 760px) {
  .wave-form-grid .ca-project-select { width:100%; }
  .wave-table td[data-label="Project"] { white-space: normal; }
}

/* v2.17.1 - Projects filters, actions, dark mode and mobile polish */
.ca-projects-page .wave-list-head{gap:16px;}
.ca-project-filter-card{margin-bottom:16px;}
.ca-project-filter-bar{display:grid;grid-template-columns:minmax(180px,1.2fr) minmax(180px,1fr) minmax(150px,.8fr) auto;gap:12px;align-items:end;}
.ca-project-filter-bar label{display:flex;flex-direction:column;gap:6px;margin:0;}
.ca-project-filter-bar label span{font-size:12px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.04em;}
.ca-project-filter-bar input,.ca-project-filter-bar select{width:100%;min-height:40px;border:1px solid #dbe3ef;border-radius:10px;background:#fff;color:#0f172a;padding:8px 11px;font-size:14px;box-sizing:border-box;}
.ca-project-filter-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;}
.ca-project-actions{display:flex!important;align-items:center;gap:8px;flex-wrap:wrap;}
.ca-project-actions .wave-inline-form{display:inline-flex;margin:0;}
.wave-btn.wave-btn-danger{background:#fee2e2!important;border:1px solid #fecaca!important;color:#991b1b!important;box-shadow:none!important;}
.wave-btn.wave-btn-danger:hover{background:#fecaca!important;color:#7f1d1d!important;}
.ca-projects-table-wrap{width:100%;overflow-x:auto;}
.wave-public-flat-project-line{margin-top:10px;padding-top:10px;border-top:1px solid #e5e7eb;color:#334155;font-size:13px;line-height:1.4;}
.wave-public-flat-project-line span{font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.04em;font-size:11px;margin-right:4px;}
.wave-portal-shell[data-theme="dark"] .ca-project-filter-bar label span,
body.ca-dark-page .ca-project-filter-bar label span{color:#94a3b8!important;}
.wave-portal-shell[data-theme="dark"] .ca-project-filter-bar input,
.wave-portal-shell[data-theme="dark"] .ca-project-filter-bar select,
body.ca-dark-page .ca-project-filter-bar input,
body.ca-dark-page .ca-project-filter-bar select{background:#0f172a!important;border-color:#334155!important;color:#e5e7eb!important;}
.wave-portal-shell[data-theme="dark"] .ca-project-filter-card,
body.ca-dark-page .ca-project-filter-card{background:#111827!important;border-color:#334155!important;}
.wave-portal-shell[data-theme="dark"] .wave-btn.wave-btn-danger,
body.ca-dark-page .wave-btn.wave-btn-danger{background:#3f1d1d!important;border-color:#7f1d1d!important;color:#fecaca!important;}
.wave-portal-shell[data-theme="dark"] .wave-btn.wave-btn-danger:hover,
body.ca-dark-page .wave-btn.wave-btn-danger:hover{background:#5f2020!important;color:#fff!important;}
.wave-portal-shell[data-theme="dark"] .ca-projects-table small,
body.ca-dark-page .ca-projects-table small{color:#94a3b8!important;}
@media (max-width: 760px){
  .ca-projects-page .wave-list-head{display:flex!important;flex-direction:column!important;align-items:stretch!important;}
  .ca-projects-page .wave-list-head .wave-btn{width:100%!important;justify-content:center!important;}
  .ca-project-filter-bar{grid-template-columns:1fr!important;gap:10px!important;}
  .ca-project-filter-actions{width:100%;display:grid!important;grid-template-columns:1fr 1fr;gap:8px;}
  .ca-project-filter-actions .wave-btn{width:100%!important;justify-content:center!important;}
  .ca-projects-table-wrap{overflow-x:hidden!important;}
  .ca-projects-table thead{display:none!important;}
  .ca-projects-table,.ca-projects-table tbody,.ca-projects-table tr,.ca-projects-table td{display:block!important;width:100%!important;box-sizing:border-box!important;}
  .ca-projects-table tr{margin:0 0 12px 0!important;padding:12px!important;border:1px solid #e5e7eb!important;border-radius:14px!important;background:#fff!important;}
  .ca-projects-table td{border:0!important;padding:7px 0!important;display:flex!important;justify-content:space-between!important;gap:12px!important;text-align:right!important;}
  .ca-projects-table td::before{content:attr(data-label);font-weight:800;color:#64748b;text-align:left!important;min-width:92px;}
  .ca-projects-table td[data-label="Project"]{display:block!important;text-align:left!important;}
  .ca-projects-table td[data-label="Project"]::before{display:block;margin-bottom:4px;}
  .ca-project-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;}
  .ca-project-actions::before{grid-column:1/-1;}
  .ca-project-actions .wave-btn,.ca-project-actions .wave-inline-form,.ca-project-actions .wave-inline-form button{width:100%!important;justify-content:center!important;}
  .wave-portal-shell[data-theme="dark"] .ca-projects-table tr,
  body.ca-dark-page .ca-projects-table tr{background:#0f172a!important;border-color:#334155!important;}
}

/* v2.17.2 Projects icon actions + invoice project line polish */
.ca-project-actions,
.wave-table td.ca-project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  min-width: 116px;
}
.ca-project-actions .wave-inline-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.ca-project-icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #d8e3f0;
  background: #ffffff;
  color: #536783;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.ca-project-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  text-decoration: none;
}
.ca-project-icon-edit:hover { color: #0ea5e9; border-color: rgba(14, 165, 233, .45); }
.ca-project-icon-delete { color: #dc2626; border-color: #f3c6c6; background: #fffafa; }
.ca-project-icon-delete:hover { background: #fff1f1; border-color: #ef4444; color: #b91c1c; }
.wave-public-flat-project-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 8px;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.35;
}
.wave-public-flat-project-line span {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #334155;
}
.wave-public-flat-project-line strong {
  font-weight: 700;
  color: #0f172a;
}
[data-theme="dark"] .ca-project-icon-btn,
.ca-dark-page .ca-project-icon-btn,
.wave-portal-shell[data-theme="dark"] .ca-project-icon-btn {
  background: rgba(15, 23, 42, .85);
  border-color: rgba(148, 163, 184, .35);
  color: #cbd5e1;
  box-shadow: none;
}
[data-theme="dark"] .ca-project-icon-edit:hover,
.ca-dark-page .ca-project-icon-edit:hover,
.wave-portal-shell[data-theme="dark"] .ca-project-icon-edit:hover {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, .55);
  background: rgba(14, 165, 233, .12);
}
[data-theme="dark"] .ca-project-icon-delete,
.ca-dark-page .ca-project-icon-delete,
.wave-portal-shell[data-theme="dark"] .ca-project-icon-delete {
  color: #f87171;
  border-color: rgba(248, 113, 113, .45);
  background: rgba(127, 29, 29, .14);
}
[data-theme="dark"] .ca-project-icon-delete:hover,
.ca-dark-page .ca-project-icon-delete:hover,
.wave-portal-shell[data-theme="dark"] .ca-project-icon-delete:hover {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, .65);
  background: rgba(127, 29, 29, .24);
}
[data-theme="dark"] .wave-public-flat-project-line span,
.ca-dark-page .wave-public-flat-project-line span,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-project-line span { color: #93c5fd; }
[data-theme="dark"] .wave-public-flat-project-line strong,
.ca-dark-page .wave-public-flat-project-line strong,
.wave-portal-shell[data-theme="dark"] .wave-public-flat-project-line strong { color: #e2e8f0; }
@media (max-width: 760px) {
  .ca-project-actions,
  .wave-table td.ca-project-actions {
    justify-content: flex-end;
    width: 100%;
  }
  .ca-project-icon-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }
  .wave-public-flat-project-line {
    display: flex;
    white-space: normal;
  }
}
@media print {
  .wave-public-flat-project-line {
    display: inline-flex !important;
    white-space: nowrap !important;
    margin-top: 6px !important;
  }
}

/* v2.17.3 Projects auto-filter, multiselect bulk actions, date picker buttons */
.ca-project-filter-bar.ca-project-auto-filter-form{
  grid-template-columns:minmax(220px,1.2fr) minmax(220px,1fr) minmax(180px,.85fr)!important;
  align-items:end!important;
}
.ca-project-bulk-toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 12px 0;
  flex-wrap:wrap;
}
.ca-project-bulk-toolbar select{
  min-height:38px;
  border:1px solid #dbe3ef;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  padding:7px 11px;
  font-size:13px;
  min-width:170px;
}
.ca-project-select-col{width:42px!important;min-width:42px!important;text-align:center!important;}
.ca-project-check-cell{width:42px!important;min-width:42px!important;text-align:center!important;}
.ca-project-select-all,.ca-project-row-check{width:16px;height:16px;accent-color:#0ea5e9;cursor:pointer;}
.ca-projects-table th:last-child,
.ca-projects-table td.ca-project-actions{width:128px!important;min-width:128px!important;}
.ca-project-actions,.wave-table td.ca-project-actions{flex-wrap:nowrap!important;white-space:nowrap!important;gap:10px!important;}
.ca-date-picker-wrap{position:relative;display:flex;align-items:center;width:100%;}
.ca-date-picker-wrap input[type="date"]{width:100%!important;padding-right:48px!important;min-height:42px;box-sizing:border-box;}
.ca-date-picker-btn{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:34px;height:34px;border:1px solid #d8e3f0;border-radius:10px;background:#fff;color:#536783;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 6px rgba(15,23,42,.06);}
.ca-date-picker-btn:hover{color:#0ea5e9;border-color:rgba(14,165,233,.45);}
.wave-portal-shell[data-theme="dark"] .ca-project-bulk-toolbar select,
body.ca-dark-page .ca-project-bulk-toolbar select{background:#0f172a!important;border-color:#334155!important;color:#e5e7eb!important;}
.wave-portal-shell[data-theme="dark"] .ca-date-picker-btn,
body.ca-dark-page .ca-date-picker-btn{background:#0f172a!important;border-color:#334155!important;color:#cbd5e1!important;box-shadow:none!important;}
.wave-portal-shell[data-theme="dark"] .ca-date-picker-btn:hover,
body.ca-dark-page .ca-date-picker-btn:hover{color:#7dd3fc!important;border-color:rgba(125,211,252,.55)!important;background:rgba(14,165,233,.12)!important;}
@media (max-width:760px){
  .ca-project-filter-bar.ca-project-auto-filter-form{grid-template-columns:1fr!important;}
  .ca-project-bulk-toolbar{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%;gap:8px;}
  .ca-project-bulk-toolbar select,.ca-project-bulk-toolbar .wave-btn{width:100%!important;justify-content:center!important;}
  .ca-projects-table td.ca-project-check-cell{display:flex!important;justify-content:space-between!important;align-items:center!important;}
  .ca-projects-table td.ca-project-check-cell::before{content:attr(data-label);font-weight:800;color:#64748b;text-align:left!important;min-width:92px;}
  .ca-project-actions,.wave-table td.ca-project-actions{display:flex!important;justify-content:flex-end!important;flex-wrap:nowrap!important;gap:10px!important;}
  .ca-project-actions::before{content:attr(data-label)!important;margin-right:auto;font-weight:800;color:#64748b;text-align:left!important;}
}

/* v2.18.1 Dashboard + Create menu: blue category headings */
.wave-dashboard-create-menu .wave-create-dropdown-all{
  width: 260px !important;
  max-height: min(72vh, 560px) !important;
  overflow-y: auto !important;
  padding: 8px !important;
}
.wave-dashboard-create-menu .wave-create-dropdown-all .wave-create-menu-section{
  padding: 8px 10px 6px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  font-weight: 850 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
}
.wave-dashboard-create-menu .wave-create-dropdown-all a{
  border-bottom: 0 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin: 1px 0 !important;
  font-weight: 650 !important;
}
.wave-dashboard-create-menu .wave-create-dropdown-all a:hover{
  background: #eef6ff !important;
  color: #0f4fd6 !important;
}
@media (max-width: 700px){
  .wave-dashboard-create-menu .wave-create-dropdown-all{
    width: 100% !important;
    max-height: 68vh !important;
  }
}
.wave-portal-shell[data-theme="dark"] .wave-dashboard-create-menu .wave-create-dropdown-all .wave-create-menu-section,
body.dark-mode .wave-dashboard-create-menu .wave-create-dropdown-all .wave-create-menu-section{
  color: #38bdf8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-dashboard-create-menu .wave-create-dropdown-all a:hover,
body.dark-mode .wave-dashboard-create-menu .wave-create-dropdown-all a:hover{
  background: rgba(59,130,246,.15) !important;
  color: #93c5fd !important;
}

/* v2.18.1 verified override - dashboard create dropdown category headings blue */
.wave-dashboard-create-menu .wave-create-dropdown-all .wave-create-menu-section{
  color:#0ea5e9!important;
}
.wave-portal-shell[data-theme="dark"] .wave-dashboard-create-menu .wave-create-dropdown-all .wave-create-menu-section,
body.dark-mode .wave-dashboard-create-menu .wave-create-dropdown-all .wave-create-menu-section{
  color:#38bdf8!important;
}

/* v2.18.2 Project date fields: single custom calendar icon + dd/mm/yyyy text input */
.ca-project-date-wrap{position:relative;display:flex;align-items:center;width:100%;}
.ca-project-date-wrap .ca-project-date-input{width:100%;padding-right:48px!important;}
.ca-project-date-wrap .ca-date-picker-btn{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:transparent;border:1px solid rgba(148,163,184,.35);color:inherit;cursor:pointer;}
.ca-project-date-wrap input[type="date"]::-webkit-calendar-picker-indicator{display:none!important;-webkit-appearance:none!important;opacity:0!important;}
.ca-project-date-wrap input[type="date"]::-webkit-inner-spin-button,.ca-project-date-wrap input[type="date"]::-webkit-clear-button{display:none!important;}
.ca-dark .ca-project-date-wrap .ca-date-picker-btn,.dark .ca-project-date-wrap .ca-date-picker-btn{background:rgba(15,23,42,.45);border-color:rgba(148,163,184,.35);color:#cbd5e1;}
.ca-dark .ca-project-date-wrap .ca-date-picker-btn:hover,.dark .ca-project-date-wrap .ca-date-picker-btn:hover{background:rgba(56,189,248,.12);border-color:rgba(56,189,248,.45);color:#38bdf8;}

/* v2.18.4 Bills polish + mobile filters */
.wave-list-filters.ca-bills-auto-filters{
  display:grid!important;grid-template-columns:1.15fr .8fr .9fr .9fr .8fr .8fr!important;gap:12px!important;align-items:end!important;margin:0 0 18px!important;padding:0!important;
}
.wave-list-filters.ca-bills-auto-filters label{display:flex!important;flex-direction:column!important;gap:7px!important;margin:0!important;min-width:0!important;}
.wave-list-filters.ca-bills-auto-filters label span{text-transform:uppercase!important;letter-spacing:.04em!important;font-size:12px!important;font-weight:800!important;color:#64748b!important;}
.wave-list-filters.ca-bills-auto-filters input,.wave-list-filters.ca-bills-auto-filters select{width:100%!important;min-height:44px!important;border:1px solid #dbe4ee!important;border-radius:12px!important;background:#fff!important;color:#0f172a!important;padding:0 13px!important;box-sizing:border-box!important;font-size:14px!important;}
.wave-list-filters.ca-bills-auto-filters .wave-date-picker-wrap{position:relative!important;display:flex!important;align-items:center!important;width:100%!important;}
.wave-list-filters.ca-bills-auto-filters .wave-date-picker-wrap .wave-date-ddmmyyyy{padding-right:44px!important;}
.wave-list-filters.ca-bills-auto-filters .wave-native-date-picker{position:absolute!important;right:0!important;bottom:0!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;}
.wave-list-filters.ca-bills-auto-filters .wave-date-picker-btn{position:absolute!important;right:7px!important;top:50%!important;transform:translateY(-50%)!important;width:32px!important;height:32px!important;border:1px solid #dbe4ee!important;border-radius:10px!important;background:#f8fafc!important;color:#64748b!important;padding:0!important;}
.wave-list-filters.ca-bills-auto-filters .wave-date-picker-btn:before{content:"";display:block;width:16px;height:16px;margin:7px auto;background:currentColor;mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M7 2h2v2h6V2h2v2h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V6H4v2Z"/></svg>') center/contain no-repeat;}
.wave-bill-view-page .ca-doc-toolbar-bill{width:100%!important;max-width:1120px!important;margin:0 auto 16px!important;box-sizing:border-box!important;}
.wave-bill-view-page .wave-public-invoice-card{width:100%!important;max-width:1120px!important;margin:0 auto!important;padding:44px 48px!important;border-radius:18px!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;box-sizing:border-box!important;}
.wave-bill-view-page .wave-public-invoice-top{display:grid!important;grid-template-columns:1fr 1fr!important;gap:36px!important;align-items:start!important;border-bottom:1px solid #e5edf6!important;padding-bottom:26px!important;margin-bottom:28px!important;}
.wave-bill-view-page .wave-public-doc-title{font-size:34px!important;font-weight:900!important;letter-spacing:.02em!important;color:#0f172a!important;margin:0 0 18px!important;}
.wave-bill-view-page .wave-public-meta-row{display:grid!important;grid-template-columns:140px 1fr!important;gap:12px!important;font-size:14px!important;line-height:1.6!important;}
.wave-bill-view-page .wave-public-meta-row span,.wave-bill-view-page .wave-public-section-label{text-transform:uppercase!important;letter-spacing:.04em!important;font-size:12px!important;font-weight:800!important;color:#64748b!important;}
.wave-bill-view-page .wave-public-party-right{text-align:right!important;font-size:14px!important;line-height:1.6!important;color:#334155!important;}
.wave-bill-view-page .wave-public-party-right strong{font-size:18px!important;color:#0f172a!important;}
.wave-bill-view-page .wave-public-flat-project-line{margin-top:12px!important;display:inline-flex!important;gap:6px!important;align-items:center!important;border-radius:10px!important;background:#eff6ff!important;color:#1d4ed8!important;padding:7px 10px!important;font-weight:800!important;}
.wave-bill-view-page .wave-table th{text-transform:uppercase!important;letter-spacing:.04em!important;font-size:12px!important;color:#64748b!important;background:#f8fafc!important;}
.wave-bill-view-page .wave-table td{font-size:14px!important;padding:14px 12px!important;}
.wave-bill-view-page .wave-public-totals-wrap{display:flex!important;justify-content:flex-end!important;margin-top:24px!important;}
.wave-bill-view-page .wave-public-totals{width:min(360px,100%)!important;}
.wave-bill-view-page .wave-public-total-row{display:flex!important;justify-content:space-between!important;gap:16px!important;border-top:1px solid #e5edf6!important;padding:10px 0!important;font-size:15px!important;}
.wave-bill-view-page .wave-public-grand-total{font-size:18px!important;font-weight:900!important;color:#0f172a!important;}
.wave-bill-view-page .wave-public-notes{margin-top:30px!important;border-top:1px solid #e5edf6!important;padding-top:18px!important;}
body.ca-dark-mode .wave-list-filters.ca-bills-auto-filters input,body.ca-dark-mode .wave-list-filters.ca-bills-auto-filters select,body.dark-mode .wave-list-filters.ca-bills-auto-filters input,body.dark-mode .wave-list-filters.ca-bills-auto-filters select{background:#0f172a!important;border-color:#334155!important;color:#e5edf6!important;}
body.ca-dark-mode .wave-list-filters.ca-bills-auto-filters label span,body.dark-mode .wave-list-filters.ca-bills-auto-filters label span{color:#cbd5e1!important;}
body.ca-dark-mode .wave-list-filters.ca-bills-auto-filters .wave-date-picker-btn,body.dark-mode .wave-list-filters.ca-bills-auto-filters .wave-date-picker-btn{background:#111827!important;border-color:#334155!important;color:#cbd5e1!important;}
body.ca-dark-mode .wave-bill-view-page .wave-public-invoice-card,body.dark-mode .wave-bill-view-page .wave-public-invoice-card{background:#1e293b!important;border-color:#334155!important;color:#e5edf6!important;}
body.ca-dark-mode .wave-bill-view-page .wave-public-doc-title,body.ca-dark-mode .wave-bill-view-page .wave-public-party-right strong,body.ca-dark-mode .wave-bill-view-page .wave-public-grand-total,body.dark-mode .wave-bill-view-page .wave-public-doc-title,body.dark-mode .wave-bill-view-page .wave-public-party-right strong,body.dark-mode .wave-bill-view-page .wave-public-grand-total{color:#f8fafc!important;}
body.ca-dark-mode .wave-bill-view-page .wave-table th,body.dark-mode .wave-bill-view-page .wave-table th{background:#0f172a!important;color:#cbd5e1!important;}
body.ca-dark-mode .wave-bill-view-page .wave-public-meta-row span,body.ca-dark-mode .wave-bill-view-page .wave-public-section-label,body.dark-mode .wave-bill-view-page .wave-public-meta-row span,body.dark-mode .wave-bill-view-page .wave-public-section-label{color:#cbd5e1!important;}
@media(max-width:1100px){.wave-list-filters.ca-bills-auto-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:760px){.wave-list-filters.ca-bills-auto-filters{grid-template-columns:1fr!important;gap:10px!important}.wave-list-filters.ca-bills-auto-filters input,.wave-list-filters.ca-bills-auto-filters select{width:100%!important}.wave-bill-view-page .wave-public-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}.wave-bill-view-page .wave-public-toolbar .wave-public-toolbtn{width:100%!important}.wave-bill-view-page .wave-public-invoice-card{padding:24px 18px!important}.wave-bill-view-page .wave-public-invoice-top{grid-template-columns:1fr!important;gap:18px!important}.wave-bill-view-page .wave-public-party-right{text-align:left!important}.wave-bill-view-page .wave-public-meta-row{grid-template-columns:1fr!important;gap:2px!important}.wave-bill-view-page .wave-table-wrap{overflow-x:auto!important}.wave-bill-view-page .wave-table{min-width:680px!important}.ca-project-filter-bar{grid-template-columns:1fr!important}.ca-project-filter-bar label,.ca-project-filter-bar input,.ca-project-filter-bar select{width:100%!important}.ca-project-bulk-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}.ca-project-bulk-toolbar select,.ca-project-bulk-toolbar button{width:100%!important}}
body.ca-dark-page .wave-list-filters.ca-bills-auto-filters input,body.ca-dark-page .wave-list-filters.ca-bills-auto-filters select{background:#0f172a!important;border-color:#334155!important;color:#e5edf6!important;}
body.ca-dark-page .wave-list-filters.ca-bills-auto-filters label span{color:#cbd5e1!important;}
body.ca-dark-page .wave-list-filters.ca-bills-auto-filters .wave-date-picker-btn{background:#111827!important;border-color:#334155!important;color:#cbd5e1!important;}
body.ca-dark-page .wave-bill-view-page .wave-public-invoice-card{background:#1e293b!important;border-color:#334155!important;color:#e5edf6!important;}
body.ca-dark-page .wave-bill-view-page .wave-public-doc-title,body.ca-dark-page .wave-bill-view-page .wave-public-party-right strong,body.ca-dark-page .wave-bill-view-page .wave-public-grand-total{color:#f8fafc!important;}
body.ca-dark-page .wave-bill-view-page .wave-table th{background:#0f172a!important;color:#cbd5e1!important;}
body.ca-dark-page .wave-bill-view-page .wave-public-meta-row span,body.ca-dark-page .wave-bill-view-page .wave-public-section-label{color:#cbd5e1!important;}


/* ===== v2.18.7 Integrated Estimate View Fix (formerly separate plugin) ===== */
.ca-invoicing-content .wave-main.wave-portal-page {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}
.ca-invoicing-content .wave-public-invoice-flat {
    max-width: 1400px !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}
.ca-invoicing-content .wave-public-sheet-flat {
    width: 100% !important;
    max-width: none !important;
}
.ca-invoicing-content .wave-public-toolbar {
    max-width: 1400px !important;
    margin-left: 0 !important;
}

/* v2.18.9 Project Reports - chart + mobile card layout */
.wvr-project-chart-card{margin-bottom:18px!important;}
.wvr-project-chart-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:14px!important;margin-bottom:10px!important;}
.wvr-project-chart-head h3{margin:0 0 4px!important;font-size:18px!important;font-weight:850!important;}
.wvr-project-chart-head p{margin:0!important;color:#64748b!important;font-size:13px!important;}
.wvr-project-chart-legend{display:flex!important;flex-wrap:wrap!important;gap:10px 16px!important;margin:10px 0 16px!important;font-size:12px!important;font-weight:800!important;color:#64748b!important;text-transform:uppercase!important;letter-spacing:.03em!important;}
.wvr-project-chart-legend span{display:inline-flex!important;align-items:center!important;gap:6px!important;}
.wvr-dot{width:10px!important;height:10px!important;border-radius:999px!important;display:inline-block!important;background:#38bdf8!important;}
.wvr-dot.total{background:#38bdf8!important}.wvr-dot.paid{background:#22c55e!important}.wvr-dot.unpaid{background:#f59e0b!important}.wvr-dot.expenses{background:#ef4444!important}.wvr-dot.profit{background:#8b5cf6!important}
.wvr-project-chart{display:flex!important;flex-direction:column!important;gap:12px!important;}
.wvr-project-chart-row{display:grid!important;grid-template-columns:minmax(180px,260px) 1fr!important;gap:14px!important;align-items:center!important;padding:12px!important;border:1px solid #e2e8f0!important;border-radius:16px!important;background:#f8fbff!important;}
.wvr-project-chart-label{font-weight:850!important;color:#0f172a!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.25!important;}
.wvr-project-chart-bars{display:grid!important;gap:6px!important;}
.wvr-project-chart-bar-line{display:grid!important;grid-template-columns:minmax(0,1fr) 90px!important;gap:10px!important;align-items:center!important;}
.wvr-project-chart-bar{height:11px!important;border-radius:999px!important;display:block!important;background:#38bdf8!important;min-width:4px!important;}
.wvr-project-chart-bar.total{background:#38bdf8!important}.wvr-project-chart-bar.paid{background:#22c55e!important}.wvr-project-chart-bar.unpaid{background:#f59e0b!important}.wvr-project-chart-bar.expenses{background:#ef4444!important}.wvr-project-chart-bar.profit{background:#8b5cf6!important}.wvr-project-chart-bar.negative{background:#ef4444!important;}
.wvr-project-chart-value{font-size:12px!important;font-weight:800!important;text-align:right!important;color:#334155!important;white-space:nowrap!important;}
.wave-portal-shell[data-theme="dark"] .wvr-project-chart-head p,body.ca-dark-page .wvr-project-chart-head p,.ca-dark .wvr-project-chart-head p{color:#94a3b8!important;}
.wave-portal-shell[data-theme="dark"] .wvr-project-chart-legend,body.ca-dark-page .wvr-project-chart-legend,.ca-dark .wvr-project-chart-legend{color:#cbd5e1!important;}
.wave-portal-shell[data-theme="dark"] .wvr-project-chart-row,body.ca-dark-page .wvr-project-chart-row,.ca-dark .wvr-project-chart-row{background:#111827!important;border-color:#334155!important;}
.wave-portal-shell[data-theme="dark"] .wvr-project-chart-label,body.ca-dark-page .wvr-project-chart-label,.ca-dark .wvr-project-chart-label{color:#f8fafc!important;}
.wave-portal-shell[data-theme="dark"] .wvr-project-chart-value,body.ca-dark-page .wvr-project-chart-value,.ca-dark .wvr-project-chart-value{color:#e5e7eb!important;}
@media (max-width: 768px){
  .wvr-project-report-page .wvr-kpi-row{grid-template-columns:1fr!important;gap:10px!important;}
  .wvr-project-chart-row{grid-template-columns:1fr!important;gap:10px!important;padding:12px!important;}
  .wvr-project-chart-bar-line{grid-template-columns:minmax(0,1fr) 76px!important;}
  .wvr-project-chart-value{font-size:11px!important;}
  .wvr-project-chart-legend{gap:8px 10px!important;font-size:11px!important;}
  .wvr-project-report-table-wrap{overflow-x:hidden!important;width:100%!important;max-width:100%!important;}
  .wvr-project-report-table{display:block!important;width:100%!important;min-width:0!important;border-collapse:separate!important;border-spacing:0!important;table-layout:auto!important;}
  .wvr-project-report-table thead{display:none!important;}
  .wvr-project-report-table tbody{display:block!important;width:100%!important;}
  .wvr-project-report-table tbody tr{display:block!important;width:100%!important;box-sizing:border-box!important;margin:0 0 12px!important;padding:12px 14px!important;border:1px solid #dbe5f0!important;border-radius:16px!important;background:#fff!important;box-shadow:0 1px 3px rgba(15,23,42,.06)!important;}
  .wvr-project-report-table tbody tr td,
  .wvr-project-report-table tbody tr td:first-child,
  .wvr-project-report-table tbody tr td:nth-child(n){display:grid!important;grid-template-columns:minmax(105px,38%) minmax(0,1fr)!important;gap:10px!important;align-items:start!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:7px 0!important;border:0!important;text-align:left!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;line-height:1.35!important;}
  .wvr-project-report-table tbody tr td::before{content:attr(data-label)!important;font-size:11px!important;font-weight:900!important;color:#64748b!important;text-transform:uppercase!important;letter-spacing:.03em!important;white-space:nowrap!important;}
  .wvr-project-report-table tbody tr td strong{word-break:normal!important;overflow-wrap:break-word!important;}
  .wave-portal-shell[data-theme="dark"] .wvr-project-report-table tbody tr,body.ca-dark-page .wvr-project-report-table tbody tr,.ca-dark .wvr-project-report-table tbody tr{background:#111827!important;border-color:#334155!important;box-shadow:none!important;}
  .wave-portal-shell[data-theme="dark"] .wvr-project-report-table tbody tr td::before,body.ca-dark-page .wvr-project-report-table tbody tr td::before,.ca-dark .wvr-project-report-table tbody tr td::before{color:#94a3b8!important;}
}

/* v2.19.3 Bill Payments UX + multiple bill payments */
.ca-bill-payments-page .wave-breadcrumbs,
.ca-pay-bills-page .wave-breadcrumbs{font-size:12px;font-weight:800;color:#64748b;margin-bottom:8px;display:flex;gap:8px;align-items:center}
.ca-bill-payments-page .ca-payment-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:18px 0 20px}
.ca-bill-payments-page .wave-stat-card{display:flex;align-items:center;gap:16px;min-height:92px;padding:20px;border-radius:18px}
.ca-bill-payments-page .wave-stat-icon{width:50px;height:50px;border-radius:18px;display:flex;align-items:center;justify-content:center;background:#eaf2ff;color:#1d4ed8;font-size:22px;font-weight:900}
.ca-bill-payments-page .wave-stat-card span{display:block;color:#64748b;font-size:12px;font-weight:800;margin-bottom:4px}
.ca-bill-payments-page .wave-stat-card strong{display:block;color:#0f172a;font-size:22px;font-weight:900;line-height:1.1}
.ca-bill-payments-page .wave-stat-card small{display:block;color:#64748b;font-size:12px;margin-top:4px}
.ca-bill-payments-page .wave-list-filters{display:grid;grid-template-columns:1.5fr 1fr 1fr 1fr 0.9fr 0.9fr;gap:12px;align-items:end;margin-bottom:14px}
.ca-bill-payments-page .wave-list-filters label>span{display:none}
.ca-bill-payments-page .wave-list-filters input,.ca-bill-payments-page .wave-list-filters select,.ca-pay-bills-page input,.ca-pay-bills-page select,.ca-pay-bills-page textarea{min-height:42px;border-radius:10px;border:1px solid #d8e2ef;background:#fff;color:#0f172a;padding:0 12px;font-size:14px;width:100%;box-sizing:border-box}
.ca-pay-bills-page textarea{min-height:76px;padding-top:10px}
.ca-bill-payments-page .wave-bulk-toolbar{margin:8px 0 12px;gap:10px;align-items:center;flex-wrap:wrap}
.ca-bill-payments-page .wave-table-wrap{border:1px solid #e2e8f0;border-radius:14px;overflow:auto;background:#fff}
.ca-bill-payments-page .wave-table-wrap table{margin:0;min-width:1040px}
.ca-bill-payments-page .wave-money-allocated,.ca-bill-payments-page .wave-money-owed,.ca-pay-bills-page .wave-money-allocated,.ca-pay-bills-page .wave-money-owed{font-weight:850}
.ca-bill-payments-table td:nth-child(5),.ca-bill-payments-table td:nth-child(6),.ca-bill-payments-table td:nth-child(7){white-space:nowrap;text-align:right}
.ca-bill-payments-page .wave-table-footer-note{font-size:13px;color:#64748b;margin-top:14px}
.ca-pay-bills-page .wave-card{border-radius:18px}
.ca-pay-bills-page .ca-pay-bills-tools{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:12px 14px;margin-top:4px}
.ca-pay-bills-page .ca-pay-bills-table input[type="number"]{max-width:150px;min-height:36px}
.ca-pay-bills-page .ca-pay-bills-table tfoot td{background:#f8fafc;font-weight:800}
.ca-pay-bills-page .wave-actions .wave-btn{min-width:150px}
html.wave-dark .ca-bill-payments-page .wave-stat-card,
body.wave-dark .ca-bill-payments-page .wave-stat-card,
html.wave-dark .ca-bill-payments-page .wave-table-wrap,
body.wave-dark .ca-bill-payments-page .wave-table-wrap,
html.wave-dark .ca-pay-bills-page .ca-pay-bills-tools,
body.wave-dark .ca-pay-bills-page .ca-pay-bills-tools{background:#111827!important;border-color:#263548!important;color:#e5eefc!important}
html.wave-dark .ca-bill-payments-page .wave-stat-card strong,
body.wave-dark .ca-bill-payments-page .wave-stat-card strong{color:#f8fafc!important}
html.wave-dark .ca-bill-payments-page .wave-stat-card span,
html.wave-dark .ca-bill-payments-page .wave-stat-card small,
html.wave-dark .ca-bill-payments-page .wave-table-footer-note,
body.wave-dark .ca-bill-payments-page .wave-stat-card span,
body.wave-dark .ca-bill-payments-page .wave-stat-card small,
body.wave-dark .ca-bill-payments-page .wave-table-footer-note{color:#a9b6ca!important}
html.wave-dark .ca-bill-payments-page .wave-list-filters input,
html.wave-dark .ca-bill-payments-page .wave-list-filters select,
html.wave-dark .ca-pay-bills-page input,
html.wave-dark .ca-pay-bills-page select,
html.wave-dark .ca-pay-bills-page textarea,
body.wave-dark .ca-bill-payments-page .wave-list-filters input,
body.wave-dark .ca-bill-payments-page .wave-list-filters select,
body.wave-dark .ca-pay-bills-page input,
body.wave-dark .ca-pay-bills-page select,
body.wave-dark .ca-pay-bills-page textarea{background:#0b1220!important;border-color:#334155!important;color:#f8fafc!important}
@media(max-width:1100px){.ca-bill-payments-page .ca-payment-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.ca-bill-payments-page .wave-list-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.ca-bill-payments-page .wave-header-card,.ca-pay-bills-page .wave-header-card{align-items:flex-start}.ca-bill-payments-page .wave-header-card .wave-btn,.ca-pay-bills-page .wave-header-card .wave-btn,.ca-pay-bills-page .wave-actions .wave-btn{width:100%;min-height:46px;justify-content:center}.ca-bill-payments-page .ca-payment-stats{grid-template-columns:1fr;gap:12px}.ca-bill-payments-page .wave-list-filters{grid-template-columns:1fr!important}.ca-bill-payments-page .wave-list-filters label,.ca-bill-payments-page .wave-list-filters input,.ca-bill-payments-page .wave-list-filters select,.ca-bill-payments-page .wave-date-picker-wrap{width:100%}.ca-bill-payments-page .wave-table-wrap{border:0;background:transparent;overflow:visible}.ca-bill-payments-page .ca-bill-payments-table,.ca-bill-payments-page .ca-bill-payments-table thead,.ca-bill-payments-page .ca-bill-payments-table tbody,.ca-bill-payments-page .ca-bill-payments-table tr,.ca-bill-payments-page .ca-bill-payments-table td{display:block;min-width:0!important;width:100%!important}.ca-bill-payments-page .ca-bill-payments-table thead{display:none}.ca-bill-payments-page .ca-bill-payments-table tr{border:1px solid #e2e8f0;border-radius:16px;margin:0 0 12px;padding:12px;background:#fff;box-sizing:border-box}.ca-bill-payments-page .ca-bill-payments-table td{border:0!important;padding:7px 0!important;text-align:left!important}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(2){font-size:15px;font-weight:900}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(n+3):nth-child(-n+7)::before{content:attr(data-mobile-label);display:block;font-size:11px;text-transform:uppercase;color:#64748b;font-weight:800;margin-bottom:2px}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(3)::before{content:'Date'}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(4)::before{content:'Vendor'}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(5)::before{content:'Paid'}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(6)::before{content:'Status'}.ca-bill-payments-page .ca-bill-payments-table td:nth-child(7)::before{content:'Actions'}html.wave-dark .ca-bill-payments-page .ca-bill-payments-table tr,body.wave-dark .ca-bill-payments-page .ca-bill-payments-table tr{background:#111827!important;border-color:#263548!important}.ca-pay-bills-page .wave-table-wrap{overflow-x:auto}.ca-pay-bills-page .ca-pay-bills-table{min-width:760px}.ca-pay-bills-page .ca-pay-bills-tools{align-items:flex-start;flex-direction:column}.ca-pay-bills-page .ca-pay-bills-tools .wave-btn{width:100%}}

/* v2.19.4 Bill Payments Polish */
.ca-bill-payments-table-wrap,
.wave-bill-payments-table-wrap,
.ca-pay-bills-table-wrap{
 overflow-x: visible !important;
}

.ca-bill-payments-table,
.wave-bill-payments-table,
.ca-pay-bills-table{
 width:100% !important;
 min-width:0 !important;
 table-layout:auto !important;
}

.ca-bill-payments-table td,
.ca-bill-payments-table th{
 white-space:nowrap;
}

.ca-bill-payment-summary,
.ca-bill-allocation-summary{
 display:flex !important;
 align-items:center !important;
 gap:18px !important;
 flex-wrap:wrap !important;
 padding:18px 0 !important;
}

.ca-bill-payment-summary .allocated-label,
.ca-bill-allocation-summary .allocated-label{
 display:flex !important;
 align-items:center !important;
 gap:10px !important;
 font-size:18px !important;
 font-weight:700 !important;
}

.ca-bill-payment-summary .allocated-amount,
.ca-bill-allocation-summary .allocated-amount{
 font-size:18px !important;
 font-weight:800 !important;
 line-height:1 !important;
}

.ca-bill-payment-summary .total-owing,
.ca-bill-allocation-summary .total-owing{
 display:none !important;
}

.ca-bill-checkbox input[type="checkbox"],
.ca-bill-allocation-table input[type="checkbox"]{
 width:18px !important;
 height:18px !important;
 min-width:18px !important;
 min-height:18px !important;
 border-radius:4px !important;
}

.ca-bill-allocation-table .allocate-input{
 max-width:140px !important;
 height:42px !important;
 border-radius:14px !important;
}

@media (max-width: 768px){
 .ca-bill-payment-summary,
 .ca-bill-allocation-summary{
   align-items:flex-start !important;
   gap:12px !important;
 }

 .ca-bill-payments-filters{
   display:grid !important;
   grid-template-columns:1fr !important;
 }

 .ca-bill-payments-table{
   display:block !important;
   overflow-x:auto !important;
 }

 .ca-bill-payments-table th,
 .ca-bill-payments-table td{
   font-size:13px !important;
   padding:10px 8px !important;
 }
}

body.ca-dark-mode .ca-bill-payment-summary,
body.ca-dark-mode .ca-bill-allocation-summary{
 color:#fff !important;
}

body.ca-dark-mode .ca-bill-payments-table-wrap{
 background:#07101f !important;
 border-color:#1e293b !important;
}

/* v2.19.6 Bill Payments clean columns + actions */
.ca-bill-payments-clean-wrap {
  overflow-x: visible !important;
}
.ca-bill-payments-clean-table {
  min-width: 0 !important;
  width: 100%;
  table-layout: auto;
}
.ca-bill-payments-clean-table th,
.ca-bill-payments-clean-table td {
  white-space: nowrap;
}
.ca-bill-payment-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.wave-inline-delete-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.wave-icon-danger,
.wave-icon-danger .wave-action-svg {
  color: #dc2626;
  stroke: #dc2626;
}
.ca-dark .ca-bill-payments-clean-wrap,
body.ca-dark .ca-bill-payments-clean-wrap,
.ca-dark-mode .ca-bill-payments-clean-wrap {
  overflow-x: visible !important;
}
@media (max-width: 768px) {
  .ca-bill-payments-clean-wrap { overflow-x: visible !important; }
  .ca-bill-payments-clean-table,
  .ca-bill-payments-clean-table thead,
  .ca-bill-payments-clean-table tbody,
  .ca-bill-payments-clean-table tr,
  .ca-bill-payments-clean-table th,
  .ca-bill-payments-clean-table td {
    display: block;
    width: 100%;
  }
  .ca-bill-payments-clean-table thead { display: none; }
  .ca-bill-payments-clean-table tr {
    border: 1px solid rgba(148,163,184,.28);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
  }
  .ca-bill-payments-clean-table td {
    border: 0 !important;
    padding: 5px 0 !important;
    white-space: normal;
  }
  .ca-bill-payments-clean-table td.wave-bulk-col { width: auto; }
  .ca-bill-payment-actions { justify-content: flex-start; margin-top: 8px; }
}

/* v2.19.7 Bills payment flow polish */
.ca-bills-page .wave-payment-helper{display:block;font-size:12px;font-weight:700;color:#5f6f89;text-align:right;margin-top:4px;}
.ca-single-pay-bill-card{margin-bottom:18px;}
.ca-pay-bills-tools-clean{display:flex!important;align-items:center!important;gap:18px!important;justify-content:flex-start!important;background:#f7faff;border:1px solid #dbe7f5;border-radius:18px;padding:18px 20px;margin:8px 0 18px;}
.ca-pay-bills-tools-clean .wave-payment-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:999px;background:#f4f8fd;}
.ca-pay-bills-table input[type="checkbox"], .ca-bills-list input[type="checkbox"]{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;border-radius:4px!important;}
.ca-pay-bills-table .ca-bill-alloc-amount{max-width:180px;}
body.ca-dark-mode .ca-pay-bills-tools-clean,.ca-dark-mode .ca-pay-bills-tools-clean{background:#101b2b!important;border-color:#26384f!important;}
body.ca-dark-mode .ca-pay-bills-tools-clean .wave-payment-pill,.ca-dark-mode .ca-pay-bills-tools-clean .wave-payment-pill{background:#132235!important;color:#e5eefc!important;}
@media(max-width:760px){.ca-bills-page .wave-balance-actions{display:grid!important;grid-template-columns:1fr!important;width:100%;gap:8px}.ca-bills-page .wave-payment-helper{text-align:left}.ca-pay-bills-tools-clean{flex-wrap:wrap;padding:14px}.ca-pay-bills-table .ca-bill-alloc-amount{max-width:100%;width:100%;}.ca-single-pay-bill-card .wave-form-grid,.ca-pay-bills-form.wave-form-grid{grid-template-columns:1fr!important}.ca-single-pay-bill-card .wave-col-2,.ca-pay-bills-form .wave-col-2{grid-column:1!important}}

/* v2.19.8 Bill Payments: payments tab owns all payment actions */
.ca-bill-payments-page .ca-payment-stats{display:none!important}
.ca-single-pay-bill-in-payments{margin:18px 0 18px}
.ca-bill-payment-actions .wave-icon-link,
.ca-bills-page .ca-flat-pay-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid #d8e2ef;border-radius:10px;color:#64748b;background:#fff;text-decoration:none;line-height:1;box-shadow:none}
.ca-bills-page .ca-flat-pay-icon svg{width:18px;height:18px;display:block}
.ca-bills-page .ca-flat-pay-icon:hover{background:#f8fafc;color:#475569;border-color:#cbd5e1}
html.wave-dark .ca-bills-page .ca-flat-pay-icon,body.wave-dark .ca-bills-page .ca-flat-pay-icon{background:#0f172a!important;border-color:#334155!important;color:#94a3b8!important}
html.wave-dark .ca-bills-page .ca-flat-pay-icon:hover,body.wave-dark .ca-bills-page .ca-flat-pay-icon:hover{background:#111827!important;color:#cbd5e1!important}
@media(max-width:760px){
  .ca-bill-payments-page .ca-single-pay-bill-in-payments{margin:12px 0}
  .ca-bill-payments-page .ca-bill-payments-table td:nth-child(3)::before{content:'Payment date'!important}
  .ca-bill-payments-page .ca-bill-payments-table td:nth-child(4)::before{content:'Vendor'!important}
  .ca-bill-payments-page .ca-bill-payments-table td:nth-child(5)::before{content:'Paid'!important}
  .ca-bill-payments-page .ca-bill-payments-table td:nth-child(6)::before{content:'Status'!important}
  .ca-bill-payments-page .ca-bill-payments-table td:nth-child(7)::before{content:'Actions'!important}
}

/* v2.20.0 Vendor filters + multiple bill payments polish */
.ca-vendors-page .ca-vendor-filters,
.ca-pay-bills-page .ca-pay-bills-form .ca-pay-bills-tools{
  display:grid;
  grid-template-columns: minmax(220px,1.3fr) minmax(150px,.7fr) minmax(150px,.7fr) auto;
  gap:12px;
  align-items:end;
  margin:12px 0 16px;
}
.ca-vendors-page .ca-vendor-filters label{display:flex;flex-direction:column;gap:6px;margin:0;}
.ca-vendors-page .ca-vendor-filters label span{font-size:12px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.04em;}
.ca-vendors-page .ca-vendor-filters input,
.ca-vendors-page .ca-vendor-filters select{width:100%;min-height:42px;}
.ca-payment-helper-small{font-size:11px!important;line-height:1.15!important;font-weight:700!important;color:#64748b!important;}
.ca-pay-bills-page .wave-money-input-wrap.ca-euro-input{position:relative;display:flex;width:100%;align-items:center;}
.ca-pay-bills-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix{position:absolute;left:14px;top:50%;transform:translateY(-50%);z-index:2;font-weight:900;color:#087b5a;pointer-events:none;line-height:1;}
.ca-pay-bills-page .wave-money-input-wrap.ca-euro-input input{width:100%;padding-left:34px!important;}
.ca-pay-bills-page .ca-pay-bills-table .wave-money-owed,
.ca-pay-bills-page .ca-pay-bills-table .ca-total-due strong,
.ca-pay-bills-page .ca-pay-bills-table .ca-total-remaining strong{color:#c62828!important;font-weight:900;}
.ca-pay-bills-page .ca-pay-bills-table .ca-total-allocated strong,
.ca-pay-bills-page #ca-bills-allocated-total,
.ca-pay-bills-page .ca-bill-alloc-amount{color:#087b5a!important;font-weight:900;}
.ca-pay-bills-page .ca-pay-bills-table tfoot td{vertical-align:middle;padding:18px 14px!important;background:#f8fbff;border-top:2px solid #dbe5f0;white-space:nowrap;}
.ca-pay-bills-page .ca-pay-bills-table tfoot small{font-size:11px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.03em;}
.ca-pay-bills-page .ca-pay-bills-table tfoot strong{font-size:15px;line-height:1.1;}
.ca-dark .ca-vendors-page .ca-vendor-filters label span,
body.ca-dark .ca-vendors-page .ca-vendor-filters label span,
.ca-dark .ca-pay-bills-page .ca-pay-bills-table tfoot small,
body.ca-dark .ca-pay-bills-page .ca-pay-bills-table tfoot small{color:#94a3b8!important;}
.ca-dark .ca-pay-bills-page .ca-pay-bills-table tfoot td,
body.ca-dark .ca-pay-bills-page .ca-pay-bills-table tfoot td{background:#111827!important;border-color:#273449!important;}
.ca-dark .ca-pay-bills-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix,
body.ca-dark .ca-pay-bills-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix{color:#34d399!important;}
.ca-dark .ca-pay-bills-page .ca-pay-bills-table .ca-total-allocated strong,
.ca-dark .ca-pay-bills-page #ca-bills-allocated-total,
.ca-dark .ca-pay-bills-page .ca-bill-alloc-amount,
body.ca-dark .ca-pay-bills-page .ca-pay-bills-table .ca-total-allocated strong,
body.ca-dark .ca-pay-bills-page #ca-bills-allocated-total,
body.ca-dark .ca-pay-bills-page .ca-bill-alloc-amount{color:#34d399!important;}
.ca-dark .ca-pay-bills-page .ca-pay-bills-table .wave-money-owed,
.ca-dark .ca-pay-bills-page .ca-pay-bills-table .ca-total-due strong,
.ca-dark .ca-pay-bills-page .ca-pay-bills-table .ca-total-remaining strong,
body.ca-dark .ca-pay-bills-page .ca-pay-bills-table .wave-money-owed,
body.ca-dark .ca-pay-bills-page .ca-pay-bills-table .ca-total-due strong,
body.ca-dark .ca-pay-bills-page .ca-pay-bills-table .ca-total-remaining strong{color:#f87171!important;}
@media(max-width:900px){
  .ca-vendors-page .ca-vendor-filters{grid-template-columns:1fr 1fr;}
  .ca-vendors-page .ca-vendor-filters #ca-vendor-clear-filters{width:100%;}
  .ca-pay-bills-page .ca-pay-bills-table td .ca-euro-input{min-width:130px;}
}
@media(max-width:640px){
  .ca-vendors-page .ca-vendor-filters{grid-template-columns:1fr;}
  .ca-vendors-page .ca-vendor-filters input,
  .ca-vendors-page .ca-vendor-filters select,
  .ca-vendors-page .ca-vendor-filters button{width:100%;min-height:46px;}
  .ca-bill-payments-hero .wave-balance-actions{align-items:stretch!important;width:100%;margin:10px 0 0!important;}
  .ca-bill-payments-hero .wave-balance-actions .wave-btn{width:100%;justify-content:center;}
  .ca-payment-helper-small{text-align:center;display:block;width:100%;font-size:10.5px!important;}
  .ca-pay-bills-page .wave-form-grid label,
  .ca-pay-bills-page .wave-form-grid .wave-money-input-wrap.ca-euro-input,
  .ca-pay-bills-page .wave-form-grid input,
  .ca-pay-bills-page .wave-form-grid select,
  .ca-pay-bills-page .wave-form-grid textarea,
  .ca-pay-bills-page .wave-form-grid button{width:100%;}
  .ca-pay-bills-page .ca-pay-bills-table tfoot td{display:block!important;text-align:right!important;width:100%!important;box-sizing:border-box;}
  .ca-pay-bills-page .ca-pay-bills-table tfoot td:first-child{text-align:left!important;}
}
.ca-bill-payments-page .wave-money-input-wrap.ca-euro-input,
.wave-bill-view-page .wave-money-input-wrap.ca-euro-input{position:relative;display:flex;width:100%;align-items:center;}
.ca-bill-payments-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix,
.wave-bill-view-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix{position:absolute;left:14px;top:50%;transform:translateY(-50%);z-index:2;font-weight:900;color:#087b5a;pointer-events:none;}
.ca-bill-payments-page .wave-money-input-wrap.ca-euro-input input,
.wave-bill-view-page .wave-money-input-wrap.ca-euro-input input{width:100%;padding-left:34px!important;}
.ca-dark .ca-bill-payments-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix,
body.ca-dark .ca-bill-payments-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix,
.ca-dark .wave-bill-view-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix,
body.ca-dark .wave-bill-view-page .wave-money-input-wrap.ca-euro-input .wave-money-prefix{color:#34d399!important;}


/* Connect Accounting v2.20.7 — Dashboard spacing + global dark-mode surface/button fix */
.wave-dashboard-page .wave-grid.single-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:30px!important;
  row-gap:30px!important;
}
.wave-dashboard-page .wave-grid.single-grid > .wave-card{
  margin:0!important;
}
.wave-dashboard-page .wave-grid.single-grid > .wave-card + .wave-card{
  margin-top:30px!important;
}
.wave-dashboard-page .wave-dashboard-recent,
.wave-dashboard-page .ca-dashboard-recent-bills,
.wave-dashboard-page .wave-card{
  margin-bottom:0!important;
}
.wave-dashboard-page .ca-dashboard-workspace-links{
  gap:14px!important;
}

/* Make all white controls dark when the portal is in dark mode */
.wave-portal-shell[data-theme="dark"] .wave-card,
.wave-portal-shell[data-theme="dark"] .wave-enhanced-list,
.wave-portal-shell[data-theme="dark"] .wave-list-tools,
.wave-portal-shell[data-theme="dark"] .wave-table-wrap,
.wave-portal-shell[data-theme="dark"] .wave-quick-link,
.wave-portal-shell[data-theme="dark"] .wave-form-card,
.wave-portal-shell[data-theme="dark"] .wave-form-section,
.wave-portal-shell[data-theme="dark"] .wave-payment-manage-card,
.wave-portal-shell[data-theme="dark"] .wave-public-sheet-flat,
.wave-portal-shell[data-theme="dark"] .ca-expense-products-filters,
body.ca-dark-page .wave-card,
body.ca-dark-page .wave-enhanced-list,
body.ca-dark-page .wave-list-tools,
body.ca-dark-page .wave-table-wrap,
body.ca-dark-page .wave-quick-link,
body.ca-dark-page .wave-form-card,
body.ca-dark-page .wave-form-section,
body.ca-dark-page .wave-payment-manage-card,
body.ca-dark-page .ca-expense-products-filters{
  background:#1e293b!important;
  border-color:#334155!important;
  color:#e5edf7!important;
}

.wave-portal-shell[data-theme="dark"] .wave-table thead th,
.wave-portal-shell[data-theme="dark"] .wave-table thead,
body.ca-dark-page .wave-table thead th,
body.ca-dark-page .wave-table thead{
  background:#0f172a!important;
  color:#9fb2cc!important;
  border-color:#334155!important;
}
.wave-portal-shell[data-theme="dark"] .wave-table tbody tr,
.wave-portal-shell[data-theme="dark"] .wave-table td,
body.ca-dark-page .wave-table tbody tr,
body.ca-dark-page .wave-table td{
  background:transparent!important;
  border-color:#334155!important;
  color:#dbe7f6!important;
}

.wave-portal-shell[data-theme="dark"] input,
.wave-portal-shell[data-theme="dark"] select,
.wave-portal-shell[data-theme="dark"] textarea,
.wave-portal-shell[data-theme="dark"] .wave-input,
body.ca-dark-page input,
body.ca-dark-page select,
body.ca-dark-page textarea,
body.ca-dark-page .wave-input{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#e5edf7!important;
  box-shadow:none!important;
}
.wave-portal-shell[data-theme="dark"] input::placeholder,
.wave-portal-shell[data-theme="dark"] textarea::placeholder,
body.ca-dark-page input::placeholder,
body.ca-dark-page textarea::placeholder{
  color:#6f8199!important;
}
.wave-portal-shell[data-theme="dark"] input[type="checkbox"],
body.ca-dark-page input[type="checkbox"]{
  background:#0f172a!important;
  border:1px solid #64748b!important;
  accent-color:#38bdf8!important;
}

.wave-portal-shell[data-theme="dark"] button:not(.wave-btn-primary):not(.ca-theme-btn),
.wave-portal-shell[data-theme="dark"] .wave-btn:not(.wave-btn-primary),
.wave-portal-shell[data-theme="dark"] .wave-link-btn,
.wave-portal-shell[data-theme="dark"] .wave-icon-action,
.wave-portal-shell[data-theme="dark"] .wave-icon-btn,
body.ca-dark-page button:not(.wave-btn-primary):not(.ca-theme-btn),
body.ca-dark-page .wave-btn:not(.wave-btn-primary),
body.ca-dark-page .wave-link-btn,
body.ca-dark-page .wave-icon-action,
body.ca-dark-page .wave-icon-btn{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#cbd5e1!important;
  box-shadow:none!important;
}
.wave-portal-shell[data-theme="dark"] button:not(.wave-btn-primary):not(.ca-theme-btn):hover,
.wave-portal-shell[data-theme="dark"] .wave-btn:not(.wave-btn-primary):hover,
.wave-portal-shell[data-theme="dark"] .wave-link-btn:hover,
.wave-portal-shell[data-theme="dark"] .wave-icon-action:hover,
.wave-portal-shell[data-theme="dark"] .wave-icon-btn:hover,
body.ca-dark-page button:not(.wave-btn-primary):not(.ca-theme-btn):hover,
body.ca-dark-page .wave-btn:not(.wave-btn-primary):hover,
body.ca-dark-page .wave-link-btn:hover,
body.ca-dark-page .wave-icon-action:hover,
body.ca-dark-page .wave-icon-btn:hover{
  background:#162238!important;
  border-color:#38bdf8!important;
  color:#e0f2fe!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-danger,
body.ca-dark-page .wave-icon-danger{
  color:#f87171!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-danger:hover,
body.ca-dark-page .wave-icon-danger:hover{
  background:#2a1220!important;
  border-color:#ef4444!important;
  color:#fecaca!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-payment,
body.ca-dark-page .wave-icon-payment{
  color:#a7f3d0!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-payment:hover,
body.ca-dark-page .wave-icon-payment:hover{
  background:#0f2f26!important;
  border-color:#10b981!important;
  color:#d1fae5!important;
}

@media(max-width:760px){
  .wave-dashboard-page .wave-grid.single-grid{gap:20px!important;row-gap:20px!important;}
  .wave-dashboard-page .wave-grid.single-grid > .wave-card + .wave-card{margin-top:20px!important;}
}

/* Connect Accounting v2.20.6 — consistent dark mode buttons/surfaces for Expenses */
.wave-portal-shell[data-theme="dark"] {
  --ca-dark-bg:#07111f;
  --ca-dark-card:#1e293b;
  --ca-dark-card-2:#111c2f;
  --ca-dark-field:#0b1324;
  --ca-dark-border:#334155;
  --ca-dark-border-strong:#475569;
  --ca-dark-text:#f1f5f9;
  --ca-dark-muted:#b6c5d8;
  --ca-brand:#0ea5e9;
  --ca-brand-2:#38bdf8;
}

.wave-portal-shell[data-theme="dark"] .wave-card,
.wave-portal-shell[data-theme="dark"] .wave-header-card,
.wave-portal-shell[data-theme="dark"] .wave-list-head,
.wave-portal-shell[data-theme="dark"] .wave-enhanced-list,
.wave-portal-shell[data-theme="dark"] .wave-form-card,
.wave-portal-shell[data-theme="dark"] .wave-form-section,
.wave-portal-shell[data-theme="dark"] .wave-table-wrap,
.wave-portal-shell[data-theme="dark"] .wave-list-tools,
.wave-portal-shell[data-theme="dark"] .wave-filters,
.wave-portal-shell[data-theme="dark"] .wave-bulk-actions,
.wave-portal-shell[data-theme="dark"] .ca-expense-products-filters,
.wave-portal-shell[data-theme="dark"] .ca-single-pay-bill-card,
.wave-portal-shell[data-theme="dark"] .ca-bill-payments-clean-wrap,
.wave-portal-shell[data-theme="dark"] .ca-payment-allocation-card,
.wave-portal-shell[data-theme="dark"] .ca-vendor-summary-card,
body.ca-dark-page .wave-card,
body.ca-dark-page .wave-header-card,
body.ca-dark-page .wave-list-head,
body.ca-dark-page .wave-enhanced-list,
body.ca-dark-page .wave-form-card,
body.ca-dark-page .wave-form-section,
body.ca-dark-page .wave-table-wrap,
body.ca-dark-page .wave-list-tools,
body.ca-dark-page .wave-filters,
body.ca-dark-page .wave-bulk-actions,
body.ca-dark-page .ca-expense-products-filters,
body.ca-dark-page .ca-single-pay-bill-card,
body.ca-dark-page .ca-bill-payments-clean-wrap,
body.ca-dark-page .ca-payment-allocation-card,
body.ca-dark-page .ca-vendor-summary-card{
  background:var(--ca-dark-card)!important;
  border-color:var(--ca-dark-border)!important;
  color:var(--ca-dark-text)!important;
  box-shadow:0 10px 28px rgba(0,0,0,.35)!important;
}

.wave-portal-shell[data-theme="dark"] .wave-card h1,
.wave-portal-shell[data-theme="dark"] .wave-card h2,
.wave-portal-shell[data-theme="dark"] .wave-card h3,
.wave-portal-shell[data-theme="dark"] .wave-header-card h1,
.wave-portal-shell[data-theme="dark"] .wave-section-head h2,
.wave-portal-shell[data-theme="dark"] label span,
.wave-portal-shell[data-theme="dark"] .wave-table td,
.wave-portal-shell[data-theme="dark"] .wave-link-strong,
body.ca-dark-page .wave-card h1,
body.ca-dark-page .wave-card h2,
body.ca-dark-page .wave-card h3,
body.ca-dark-page .wave-header-card h1,
body.ca-dark-page .wave-section-head h2,
body.ca-dark-page label span,
body.ca-dark-page .wave-table td,
body.ca-dark-page .wave-link-strong{
  color:var(--ca-dark-text)!important;
}
.wave-portal-shell[data-theme="dark"] .wave-card p,
.wave-portal-shell[data-theme="dark"] .wave-section-head span,
.wave-portal-shell[data-theme="dark"] .wave-muted,
.wave-portal-shell[data-theme="dark"] .wave-small,
body.ca-dark-page .wave-card p,
body.ca-dark-page .wave-section-head span,
body.ca-dark-page .wave-muted,
body.ca-dark-page .wave-small{
  color:var(--ca-dark-muted)!important;
}

/* Top header CTAs must stay brand blue, not black */
.wave-portal-shell[data-theme="dark"] .wave-header-card .wave-balance-actions .wave-btn,
.wave-portal-shell[data-theme="dark"] .wave-list-head .wave-balance-actions .wave-btn,
.wave-portal-shell[data-theme="dark"] .wave-header-card a[href*="invoice-edit"]:not(.wave-create-dropdown-all > a),
.wave-portal-shell[data-theme="dark"] .wave-header-card a[href*="expense-bill-edit"]:not(.wave-create-dropdown-all > a),
.wave-portal-shell[data-theme="dark"] .wave-header-card a[href*="expense-product-service-edit"]:not(.wave-create-dropdown-all > a),
.wave-portal-shell[data-theme="dark"] .wave-header-card a[href*="customer-edit"]:not(.wave-create-dropdown-all > a),
.wave-portal-shell[data-theme="dark"] .wave-header-card a[href*="vendor-edit"]:not(.wave-create-dropdown-all > a),
body.ca-dark-page .wave-header-card .wave-balance-actions .wave-btn,
body.ca-dark-page .wave-list-head .wave-balance-actions .wave-btn,
body.ca-dark-page .wave-header-card a[href*="invoice-edit"]:not(.wave-create-dropdown-all > a),
body.ca-dark-page .wave-header-card a[href*="expense-bill-edit"]:not(.wave-create-dropdown-all > a),
body.ca-dark-page .wave-header-card a[href*="expense-product-service-edit"]:not(.wave-create-dropdown-all > a),
body.ca-dark-page .wave-header-card a[href*="customer-edit"]:not(.wave-create-dropdown-all > a),
body.ca-dark-page .wave-header-card a[href*="vendor-edit"]:not(.wave-create-dropdown-all > a){
  background:linear-gradient(135deg,var(--ca-brand),var(--ca-brand-2))!important;
  border-color:rgba(56,189,248,.65)!important;
  color:#fff!important;
  box-shadow:0 8px 20px rgba(14,165,233,.28)!important;
}
.wave-portal-shell[data-theme="dark"] .wave-header-card .wave-balance-actions .wave-btn:hover,
.wave-portal-shell[data-theme="dark"] .wave-list-head .wave-balance-actions .wave-btn:hover,
body.ca-dark-page .wave-header-card .wave-balance-actions .wave-btn:hover,
body.ca-dark-page .wave-list-head .wave-balance-actions .wave-btn:hover{
  filter:brightness(1.08)!important;
}

/* Never leave white action buttons in dark mode */
.wave-portal-shell[data-theme="dark"] .wave-icon-action,
.wave-portal-shell[data-theme="dark"] .wave-icon-link,
.wave-portal-shell[data-theme="dark"] .ca-flat-pay-icon,
.wave-portal-shell[data-theme="dark"] .wave-action-btn,
.wave-portal-shell[data-theme="dark"] .wave-customer-actions a,
.wave-portal-shell[data-theme="dark"] .wave-customer-actions button,
.wave-portal-shell[data-theme="dark"] .wave-inline-delete-form button,
.wave-portal-shell[data-theme="dark"] .wave-icon-action-form button,
body.ca-dark-page .wave-icon-action,
body.ca-dark-page .wave-icon-link,
body.ca-dark-page .ca-flat-pay-icon,
body.ca-dark-page .wave-action-btn,
body.ca-dark-page .wave-customer-actions a,
body.ca-dark-page .wave-customer-actions button,
body.ca-dark-page .wave-inline-delete-form button,
body.ca-dark-page .wave-icon-action-form button{
  background:#0b1324!important;
  border:1px solid var(--ca-dark-border)!important;
  color:#c7d2e5!important;
  box-shadow:none!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-action:hover,
.wave-portal-shell[data-theme="dark"] .wave-icon-link:hover,
.wave-portal-shell[data-theme="dark"] .ca-flat-pay-icon:hover,
.wave-portal-shell[data-theme="dark"] .wave-customer-actions a:hover,
.wave-portal-shell[data-theme="dark"] .wave-customer-actions button:hover,
body.ca-dark-page .wave-icon-action:hover,
body.ca-dark-page .wave-icon-link:hover,
body.ca-dark-page .ca-flat-pay-icon:hover,
body.ca-dark-page .wave-customer-actions a:hover,
body.ca-dark-page .wave-customer-actions button:hover{
  background:#12213a!important;
  border-color:var(--ca-brand-2)!important;
  color:#e0f2fe!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-danger,
.wave-portal-shell[data-theme="dark"] .wave-customer-actions .wave-icon-danger,
.wave-portal-shell[data-theme="dark"] .wave-inline-delete-form .wave-icon-danger,
.wave-portal-shell[data-theme="dark"] .wave-icon-action-form .wave-icon-danger,
body.ca-dark-page .wave-icon-danger,
body.ca-dark-page .wave-customer-actions .wave-icon-danger,
body.ca-dark-page .wave-inline-delete-form .wave-icon-danger,
body.ca-dark-page .wave-icon-action-form .wave-icon-danger{
  color:#fb7185!important;
}
.wave-portal-shell[data-theme="dark"] .wave-icon-payment,
.wave-portal-shell[data-theme="dark"] .ca-flat-pay-icon,
body.ca-dark-page .wave-icon-payment,
body.ca-dark-page .ca-flat-pay-icon{
  color:#93c5fd!important;
}

/* Dark checkboxes / selections */
.wave-portal-shell[data-theme="dark"] input[type="checkbox"],
body.ca-dark-page input[type="checkbox"]{
  appearance:none!important;
  -webkit-appearance:none!important;
  width:18px!important;
  height:18px!important;
  border-radius:4px!important;
  background:#0b1324!important;
  border:1px solid #64748b!important;
  display:inline-grid!important;
  place-content:center!important;
}
.wave-portal-shell[data-theme="dark"] input[type="checkbox"]:checked,
body.ca-dark-page input[type="checkbox"]:checked{
  background:var(--ca-brand)!important;
  border-color:var(--ca-brand-2)!important;
}
.wave-portal-shell[data-theme="dark"] input[type="checkbox"]:checked::after,
body.ca-dark-page input[type="checkbox"]:checked::after{
  content:"";
  width:9px;
  height:5px;
  border:solid #fff;
  border-width:0 0 2px 2px;
  transform:rotate(-45deg);
  margin-top:-1px;
}

.wave-portal-shell[data-theme="dark"] input,
.wave-portal-shell[data-theme="dark"] select,
.wave-portal-shell[data-theme="dark"] textarea,
.wave-portal-shell[data-theme="dark"] .wave-money-input-wrap,
.wave-portal-shell[data-theme="dark"] .ca-euro-input,
body.ca-dark-page input,
body.ca-dark-page select,
body.ca-dark-page textarea,
body.ca-dark-page .wave-money-input-wrap,
body.ca-dark-page .ca-euro-input{
  background:var(--ca-dark-field)!important;
  color:var(--ca-dark-text)!important;
  border-color:var(--ca-dark-border)!important;
}
.wave-portal-shell[data-theme="dark"] .wave-table thead,
.wave-portal-shell[data-theme="dark"] .wave-table thead th,
body.ca-dark-page .wave-table thead,
body.ca-dark-page .wave-table thead th{
  background:#0b1324!important;
  color:#b9c8dd!important;
  border-color:var(--ca-dark-border)!important;
}
.wave-portal-shell[data-theme="dark"] .wave-table tbody tr:hover td,
body.ca-dark-page .wave-table tbody tr:hover td{
  background:rgba(56,189,248,.05)!important;
}

/* Dashboard card gaps */
.wave-dashboard-page .wave-grid.single-grid,
.wave-dashboard-page .wave-dashboard-stack,
.wave-dashboard-page .wave-main-stack{
  gap:24px!important;
  row-gap:24px!important;
}
.wave-dashboard-page .wave-grid.single-grid > .wave-card,
.wave-dashboard-page .wave-card + .wave-card,
.wave-dashboard-page section.wave-card + section.wave-card{
  margin-top:24px!important;
}


/* Connect Accounting v2.20.7 — forced dashboard section gaps */
.ca-dashboard-page > .wave-card,
.wave-main.wave-dashboard-page > .wave-card,
.wave-main.ca-dashboard-page > .wave-card,
.ca-dashboard-page > .wave-metrics,
.wave-main.wave-dashboard-page > .wave-metrics,
.wave-main.ca-dashboard-page > .wave-metrics{
  margin-bottom:30px!important;
}
.ca-dashboard-page > .wave-card + .wave-card,
.wave-main.wave-dashboard-page > .wave-card + .wave-card,
.wave-main.ca-dashboard-page > .wave-card + .wave-card{
  margin-top:30px!important;
}
.ca-dashboard-page > .wave-grid.single-grid,
.wave-main.wave-dashboard-page > .wave-grid.single-grid,
.wave-main.ca-dashboard-page > .wave-grid.single-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:30px!important;
  row-gap:30px!important;
  margin-top:30px!important;
}
.ca-dashboard-page > .wave-grid.single-grid > section.wave-card,
.wave-main.wave-dashboard-page > .wave-grid.single-grid > section.wave-card,
.wave-main.ca-dashboard-page > .wave-grid.single-grid > section.wave-card{
  margin:0!important;
}
.ca-dashboard-page > .wave-grid.single-grid > section.wave-card + section.wave-card,
.wave-main.wave-dashboard-page > .wave-grid.single-grid > section.wave-card + section.wave-card,
.wave-main.ca-dashboard-page > .wave-grid.single-grid > section.wave-card + section.wave-card{
  margin-top:0!important;
}
@media(max-width:760px){
  .ca-dashboard-page > .wave-card,
  .wave-main.wave-dashboard-page > .wave-card,
  .wave-main.ca-dashboard-page > .wave-card,
  .ca-dashboard-page > .wave-metrics,
  .wave-main.wave-dashboard-page > .wave-metrics,
  .wave-main.ca-dashboard-page > .wave-metrics{margin-bottom:20px!important;}
  .ca-dashboard-page > .wave-grid.single-grid,
  .wave-main.wave-dashboard-page > .wave-grid.single-grid,
  .wave-main.ca-dashboard-page > .wave-grid.single-grid{gap:20px!important;row-gap:20px!important;margin-top:20px!important;}
}


/* v2.20.8 - Auto filters + consistent blue top CTAs */
.ca-vendors-page .ca-vendor-filters{
  grid-template-columns:minmax(220px,1.4fr) minmax(150px,.8fr) minmax(150px,.8fr)!important;
  gap:12px!important;
}
.ca-vendors-page .ca-vendor-filters label span{
  font-size:12px!important;
  font-weight:800!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
  color:var(--ds-text-3,#64748b)!important;
}
.wave-list-head .wave-balance-actions .wave-btn-primary,
.ca-top-create-btn,
.wave-header-card .wave-btn-primary{
  background:#0ea5e9!important;
  color:#ffffff!important;
  border:1px solid #0ea5e9!important;
  box-shadow:0 8px 18px rgba(14,165,233,.28)!important;
}
.wave-list-head .wave-balance-actions .wave-btn-primary:hover,
.ca-top-create-btn:hover,
.wave-header-card .wave-btn-primary:hover{
  background:#0284c7!important;
  border-color:#0284c7!important;
  color:#ffffff!important;
}
.wave-portal-shell[data-theme="dark"] .wave-list-head .wave-balance-actions .wave-btn-primary,
.wave-portal-shell[data-theme="dark"] .ca-top-create-btn,
.wave-portal-shell[data-theme="dark"] .wave-header-card .wave-btn-primary,
body.ca-dark-page .wave-list-head .wave-balance-actions .wave-btn-primary,
body.ca-dark-page .ca-top-create-btn,
body.ca-dark-page .wave-header-card .wave-btn-primary{
  background:#0ea5e9!important;
  color:#ffffff!important;
  border-color:#38bdf8!important;
  box-shadow:0 8px 22px rgba(14,165,233,.35)!important;
}
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters label span,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters label span{
  color:#bfdbfe!important;
}
@media(max-width:760px){
  .ca-vendors-page .ca-vendor-filters{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .ca-vendors-page .ca-vendor-filters input,
  .ca-vendors-page .ca-vendor-filters select{
    width:100%!important;
    min-height:46px!important;
  }
  .wave-list-head .wave-balance-actions,
  .wave-header-card .wave-balance-actions{
    width:100%!important;
    justify-content:stretch!important;
  }
  .wave-list-head .wave-balance-actions .wave-btn,
  .wave-header-card .wave-balance-actions .wave-btn{
    width:100%!important;
  }
}

/* v2.21.0 Reports Integration */
.wvr-project-kpis.ca-project-report-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
@media (min-width: 900px){.wvr-project-kpis.ca-project-report-kpis{grid-template-columns:repeat(6,minmax(0,1fr));}}
.wvr-project-report-table th,.wvr-project-report-table td{white-space:nowrap;}
@media (max-width:700px){.wvr-project-report-table th,.wvr-project-report-table td{white-space:normal;}}


/* v2.21.1 - Vendor filters match the rest of the app */
.ca-vendors-page .ca-vendor-filters{
  display:grid!important;
  grid-template-columns:minmax(240px,1.4fr) minmax(160px,.8fr) minmax(160px,.8fr)!important;
  gap:12px!important;
  align-items:end!important;
  margin:14px 0 16px!important;
}
.ca-vendors-page .ca-vendor-filters label{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  margin:0!important;
}
.ca-vendors-page .ca-vendor-filters label span{
  font-size:12px!important;
  line-height:1.15!important;
  font-weight:800!important;
  color:#64748b!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
}
.ca-vendors-page .ca-vendor-filters input,
.ca-vendors-page .ca-vendor-filters select{
  width:100%!important;
  min-height:48px!important;
  height:48px!important;
  box-sizing:border-box!important;
  border:1px solid #d8e2ef!important;
  border-radius:12px!important;
  background:#ffffff!important;
  color:#0f172a!important;
  padding:0 14px!important;
  font-size:14px!important;
  line-height:1.2!important;
  box-shadow:none!important;
  outline:none!important;
  appearance:auto!important;
}
.ca-vendors-page .ca-vendor-filters input::placeholder{color:#64748b!important;opacity:.9!important;}
.ca-vendors-page .ca-vendor-filters input:focus,
.ca-vendors-page .ca-vendor-filters select:focus{
  border-color:#93c5fd!important;
  box-shadow:0 0 0 3px rgba(14,165,233,.12)!important;
}
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters label span,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters label span,
html.wave-dark .ca-vendors-page .ca-vendor-filters label span,
body.wave-dark .ca-vendors-page .ca-vendor-filters label span{
  color:#bfdbfe!important;
}
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters input,
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters select,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters input,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters select,
html.wave-dark .ca-vendors-page .ca-vendor-filters input,
html.wave-dark .ca-vendors-page .ca-vendor-filters select,
body.wave-dark .ca-vendors-page .ca-vendor-filters input,
body.wave-dark .ca-vendors-page .ca-vendor-filters select{
  background:#0f172a!important;
  color:#e5eefb!important;
  border-color:#334155!important;
  box-shadow:none!important;
}
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters input::placeholder,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters input::placeholder,
html.wave-dark .ca-vendors-page .ca-vendor-filters input::placeholder,
body.wave-dark .ca-vendors-page .ca-vendor-filters input::placeholder{
  color:#94a3b8!important;
}
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters input:focus,
.wave-portal-shell[data-theme="dark"] .ca-vendors-page .ca-vendor-filters select:focus,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters input:focus,
body.ca-dark-page .ca-vendors-page .ca-vendor-filters select:focus,
html.wave-dark .ca-vendors-page .ca-vendor-filters input:focus,
html.wave-dark .ca-vendors-page .ca-vendor-filters select:focus,
body.wave-dark .ca-vendors-page .ca-vendor-filters input:focus,
body.wave-dark .ca-vendors-page .ca-vendor-filters select:focus{
  border-color:#38bdf8!important;
  box-shadow:0 0 0 3px rgba(56,189,248,.16)!important;
}
@media(max-width:760px){
  .ca-vendors-page .ca-vendor-filters{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .ca-vendors-page .ca-vendor-filters input,
  .ca-vendors-page .ca-vendor-filters select{
    min-height:46px!important;
    height:46px!important;
  }
}


/* v2.22.8 Import Wizard UI */
.wave-balance-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.ca-import-wizard-note{margin:10px 0 16px;padding:12px 14px;border:1px solid #bfdbfe;background:#eff6ff;color:#1e3a8a;border-radius:14px;font-size:13px;line-height:1.45;}
body.wave-dark .ca-import-wizard-note,.wave-dark .ca-import-wizard-note{background:#0f172a;border-color:#334155;color:#dbeafe;}
.ca-bills-import-btn,.ca-bills-template-btn{white-space:nowrap;}
@media(max-width:720px){.wave-balance-actions{width:100%;}.wave-balance-actions .wave-btn{width:100%;justify-content:center;}.ca-import-wizard-note{font-size:12px;}}

/* v2.22.9 cleanup: Bills header only keeps primary Create New Bill action */
.ca-bills-import-btn,
.ca-bills-template-btn{display:none!important;}
.wvr-cyvat-tabs span:not(.active){display:none!important;}
.wvr-cyvat-tabs{gap:0!important;}

/* v2.23.0 Smart Import Mapper */
.ca-smart-import-card{border-radius:18px!important}
.ca-smart-import-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 16px}
.ca-smart-import-tabs button{border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:12px;padding:9px 14px;font-weight:800;cursor:pointer}
.ca-smart-import-tabs button.active{background:#0ea5e9;color:#fff;border-color:#0ea5e9;box-shadow:0 8px 18px rgba(14,165,233,.22)}
.ca-smart-import-grid,.ca-map-fields{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:14px;margin:12px 0}
.ca-smart-import-grid label,.ca-map-fields label{display:flex;flex-direction:column;gap:7px;font-weight:800;color:#334155}
.ca-smart-import-grid input,.ca-smart-import-grid select,.ca-map-fields select{height:42px;border:1px solid #cfe0f4;border-radius:12px;background:#fff;color:#0f172a;padding:0 12px;font-size:14px;box-sizing:border-box}
.ca-map-type-help{background:#eef6ff;border:1px solid #bfdbfe;color:#1e3a8a;border-radius:14px;padding:12px 14px;font-weight:650;line-height:1.45;margin:12px 0}
.ca-map-actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}.ca-map-preview-box{margin-top:12px;overflow:auto;border:1px solid #e2e8f0;border-radius:14px;background:#fff}.ca-map-preview-box strong{display:block;padding:12px 14px}.ca-map-preview table{width:100%;border-collapse:collapse;font-size:12px}.ca-map-preview th,.ca-map-preview td{padding:8px 10px;border-top:1px solid #edf2f7;white-space:nowrap;text-align:left}
html.ca-dark .ca-smart-import-card,body[data-theme="dark"] .ca-smart-import-card{background:#1e293b!important;border-color:#334155!important}html.ca-dark .ca-map-type-help,body[data-theme="dark"] .ca-map-type-help{background:#0f172a!important;border-color:#334155!important;color:#dbeafe!important}html.ca-dark .ca-smart-import-grid input,html.ca-dark .ca-smart-import-grid select,html.ca-dark .ca-map-fields select,body[data-theme="dark"] .ca-smart-import-grid input,body[data-theme="dark"] .ca-smart-import-grid select,body[data-theme="dark"] .ca-map-fields select{background:#0f172a!important;border-color:#334155!important;color:#f8fafc!important}html.ca-dark .ca-map-preview-box,body[data-theme="dark"] .ca-map-preview-box{background:#0f172a!important;border-color:#334155!important;color:#f8fafc!important}.ca-map-preview th{background:#f8fafc}html.ca-dark .ca-map-preview th,body[data-theme="dark"] .ca-map-preview th{background:#111827!important;color:#f8fafc!important}
@media(max-width:760px){.ca-smart-import-grid,.ca-map-fields{grid-template-columns:1fr}.ca-smart-import-tabs button{flex:1 1 45%}}


/* v2.23.1 Business Settings / Import Mapper polish */
#ca-import-export.ca-import-wizard-card{
  padding:26px 28px!important;
  border-radius:24px!important;
  border:1px solid #dbe7f5!important;
  box-shadow:0 10px 28px rgba(15,23,42,.06)!important;
  background:#fff!important;
}
#ca-import-export .wave-section-head{
  margin-bottom:20px!important;
  padding-bottom:16px!important;
  border-bottom:1px solid #e8eef7!important;
}
#ca-import-export .wave-section-head h2,
#ca-import-export .wave-section-head h3,
#ca-import-export h3{
  font-size:24px!important;
  line-height:1.18!important;
  letter-spacing:-.02em!important;
  font-weight:850!important;
  color:#0f172a!important;
  margin:0 0 6px!important;
}
#ca-import-export .wave-section-head span,
#ca-import-export .wave-form-help,
#ca-import-export p{
  color:#64748b!important;
  font-size:14px!important;
  line-height:1.55!important;
}
#ca-import-export .ca-import-wizard-note{
  margin:16px 0 22px!important;
  padding:14px 16px!important;
  border-radius:16px!important;
  border:1px solid #bfdbfe!important;
  background:linear-gradient(180deg,#eff6ff,#f8fbff)!important;
  color:#1e3a8a!important;
  font-size:14px!important;
}
#ca-import-export form.wave-form-grid,
#ca-import-export .ca-smart-import-grid,
#ca-import-export .ca-map-fields{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(260px,1fr))!important;
  gap:18px 22px!important;
  align-items:end!important;
}
#ca-import-export label,
#ca-import-export .ca-smart-import-grid label,
#ca-import-export .ca-map-fields label{
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
  color:#475569!important;
  font-size:13px!important;
  font-weight:800!important;
  letter-spacing:.01em!important;
}
#ca-import-export label span,
#ca-import-export .ca-smart-import-grid label span,
#ca-import-export .ca-map-fields label span{
  min-height:18px!important;
}
#ca-import-export input[type="text"],
#ca-import-export input[type="file"],
#ca-import-export select,
#ca-import-export .ca-smart-import-grid input,
#ca-import-export .ca-smart-import-grid select,
#ca-import-export .ca-map-fields select{
  width:100%!important;
  min-height:48px!important;
  border:1px solid #cfe0f4!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#0f172a!important;
  padding:0 14px!important;
  font-size:15px!important;
  box-sizing:border-box!important;
  box-shadow:0 1px 0 rgba(15,23,42,.02)!important;
}
#ca-import-export input[type="file"]{
  padding:11px 14px!important;
  line-height:24px!important;
}
#ca-import-export input:focus,
#ca-import-export select:focus{
  outline:none!important;
  border-color:#38bdf8!important;
  box-shadow:0 0 0 4px rgba(14,165,233,.14)!important;
}
#ca-import-export .wave-actions{
  gap:12px!important;
  margin-top:6px!important;
}
#ca-import-export .wave-btn,
#ca-import-export button.wave-btn,
#ca-import-export input[type="submit"]{
  min-height:44px!important;
  border-radius:14px!important;
  font-size:14px!important;
  font-weight:850!important;
  padding:0 18px!important;
}
#ca-import-export .ca-smart-import-card,
#ca-import-export .ca-advanced-reset-card,
#ca-import-export .wave-card:not(.ca-import-wizard-card){
  margin-top:24px!important;
  padding:22px 24px!important;
  border-radius:22px!important;
  box-shadow:none!important;
}
#ca-import-export .ca-smart-import-card{
  background:#f8fbff!important;
  border:1px solid #dbeafe!important;
}
#ca-import-export .ca-smart-import-tabs{
  display:flex!important;
  gap:10px!important;
  flex-wrap:wrap!important;
  margin:18px 0 20px!important;
}
#ca-import-export .ca-smart-import-tabs button{
  min-height:38px!important;
  border-radius:999px!important;
  padding:0 16px!important;
  border:1px solid #bfdbfe!important;
  background:#eff6ff!important;
  color:#1d4ed8!important;
  font-size:13px!important;
  font-weight:850!important;
}
#ca-import-export .ca-smart-import-tabs button.active{
  background:#0ea5e9!important;
  color:#fff!important;
  border-color:#0ea5e9!important;
  box-shadow:0 10px 20px rgba(14,165,233,.22)!important;
}
#ca-import-export .ca-map-type-help{
  margin:16px 0 22px!important;
  padding:13px 15px!important;
  border-radius:14px!important;
  border:1px solid #bfdbfe!important;
  background:#eff6ff!important;
  color:#1e3a8a!important;
  font-weight:750!important;
  line-height:1.45!important;
}
#ca-import-export .ca-map-area h4{
  margin:26px 0 16px!important;
  font-size:22px!important;
  font-weight:850!important;
  color:#0f172a!important;
}
#ca-import-export .ca-map-actions{
  display:flex!important;
  gap:12px!important;
  flex-wrap:wrap!important;
  margin:16px 0!important;
}
#ca-import-export .ca-map-preview-box{
  margin-top:18px!important;
  border:1px solid #dbe7f5!important;
  border-radius:18px!important;
  padding:16px!important;
  overflow:auto!important;
  background:#fff!important;
}
#ca-import-export .ca-map-preview table{
  width:100%!important;
  border-collapse:collapse!important;
  font-size:13px!important;
}
#ca-import-export .ca-map-preview th{
  background:#f1f5f9!important;
  color:#475569!important;
  text-align:left!important;
  font-size:12px!important;
  text-transform:uppercase!important;
  letter-spacing:.03em!important;
}
#ca-import-export .ca-map-preview th,
#ca-import-export .ca-map-preview td{
  padding:10px 12px!important;
  border-bottom:1px solid #e8eef7!important;
  white-space:nowrap!important;
}
#ca-import-export hr{
  margin:28px 0!important;
}

html.ca-dark #ca-import-export.ca-import-wizard-card,
body[data-theme="dark"] #ca-import-export.ca-import-wizard-card,
body.wave-dark #ca-import-export.ca-import-wizard-card,
.wave-dark #ca-import-export.ca-import-wizard-card{
  background:#1e293b!important;
  border-color:#334155!important;
  box-shadow:0 12px 28px rgba(0,0,0,.18)!important;
}
html.ca-dark #ca-import-export .wave-section-head,
body[data-theme="dark"] #ca-import-export .wave-section-head,
body.wave-dark #ca-import-export .wave-section-head,
.wave-dark #ca-import-export .wave-section-head{
  border-bottom-color:#334155!important;
}
html.ca-dark #ca-import-export h2,
html.ca-dark #ca-import-export h3,
html.ca-dark #ca-import-export h4,
body[data-theme="dark"] #ca-import-export h2,
body[data-theme="dark"] #ca-import-export h3,
body[data-theme="dark"] #ca-import-export h4,
body.wave-dark #ca-import-export h2,
body.wave-dark #ca-import-export h3,
body.wave-dark #ca-import-export h4,
.wave-dark #ca-import-export h2,
.wave-dark #ca-import-export h3,
.wave-dark #ca-import-export h4{
  color:#f8fafc!important;
}
html.ca-dark #ca-import-export .wave-section-head span,
html.ca-dark #ca-import-export .wave-form-help,
html.ca-dark #ca-import-export p,
html.ca-dark #ca-import-export label,
body[data-theme="dark"] #ca-import-export .wave-section-head span,
body[data-theme="dark"] #ca-import-export .wave-form-help,
body[data-theme="dark"] #ca-import-export p,
body[data-theme="dark"] #ca-import-export label,
body.wave-dark #ca-import-export .wave-section-head span,
body.wave-dark #ca-import-export .wave-form-help,
body.wave-dark #ca-import-export p,
body.wave-dark #ca-import-export label,
.wave-dark #ca-import-export .wave-section-head span,
.wave-dark #ca-import-export .wave-form-help,
.wave-dark #ca-import-export p,
.wave-dark #ca-import-export label{
  color:#cbd5e1!important;
}
html.ca-dark #ca-import-export input[type="text"],
html.ca-dark #ca-import-export input[type="file"],
html.ca-dark #ca-import-export select,
body[data-theme="dark"] #ca-import-export input[type="text"],
body[data-theme="dark"] #ca-import-export input[type="file"],
body[data-theme="dark"] #ca-import-export select,
body.wave-dark #ca-import-export input[type="text"],
body.wave-dark #ca-import-export input[type="file"],
body.wave-dark #ca-import-export select,
.wave-dark #ca-import-export input[type="text"],
.wave-dark #ca-import-export input[type="file"],
.wave-dark #ca-import-export select{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#f8fafc!important;
}
html.ca-dark #ca-import-export .ca-import-wizard-note,
html.ca-dark #ca-import-export .ca-map-type-help,
body[data-theme="dark"] #ca-import-export .ca-import-wizard-note,
body[data-theme="dark"] #ca-import-export .ca-map-type-help,
body.wave-dark #ca-import-export .ca-import-wizard-note,
body.wave-dark #ca-import-export .ca-map-type-help,
.wave-dark #ca-import-export .ca-import-wizard-note,
.wave-dark #ca-import-export .ca-map-type-help{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#dbeafe!important;
}
html.ca-dark #ca-import-export .ca-smart-import-card,
html.ca-dark #ca-import-export .ca-map-preview-box,
body[data-theme="dark"] #ca-import-export .ca-smart-import-card,
body[data-theme="dark"] #ca-import-export .ca-map-preview-box,
body.wave-dark #ca-import-export .ca-smart-import-card,
body.wave-dark #ca-import-export .ca-map-preview-box,
.wave-dark #ca-import-export .ca-smart-import-card,
.wave-dark #ca-import-export .ca-map-preview-box{
  background:#172033!important;
  border-color:#334155!important;
}
html.ca-dark #ca-import-export .ca-smart-import-tabs button,
body[data-theme="dark"] #ca-import-export .ca-smart-import-tabs button,
body.wave-dark #ca-import-export .ca-smart-import-tabs button,
.wave-dark #ca-import-export .ca-smart-import-tabs button{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#bfdbfe!important;
}
html.ca-dark #ca-import-export .ca-smart-import-tabs button.active,
body[data-theme="dark"] #ca-import-export .ca-smart-import-tabs button.active,
body.wave-dark #ca-import-export .ca-smart-import-tabs button.active,
.wave-dark #ca-import-export .ca-smart-import-tabs button.active{
  background:#0ea5e9!important;
  border-color:#0ea5e9!important;
  color:#fff!important;
}
html.ca-dark #ca-import-export .ca-map-preview th,
body[data-theme="dark"] #ca-import-export .ca-map-preview th,
body.wave-dark #ca-import-export .ca-map-preview th,
.wave-dark #ca-import-export .ca-map-preview th{
  background:#0f172a!important;
  color:#cbd5e1!important;
}
html.ca-dark #ca-import-export .ca-map-preview td,
body[data-theme="dark"] #ca-import-export .ca-map-preview td,
body.wave-dark #ca-import-export .ca-map-preview td,
.wave-dark #ca-import-export .ca-map-preview td{
  color:#f8fafc!important;
  border-bottom-color:#334155!important;
}
html.ca-dark #ca-import-export .ca-advanced-reset-card,
body[data-theme="dark"] #ca-import-export .ca-advanced-reset-card,
body.wave-dark #ca-import-export .ca-advanced-reset-card,
.wave-dark #ca-import-export .ca-advanced-reset-card{
  background:#2a1720!important;
  border-color:#7f1d1d!important;
}
@media(max-width:900px){
  #ca-import-export.ca-import-wizard-card{padding:22px 18px!important;border-radius:20px!important;}
  #ca-import-export form.wave-form-grid,
  #ca-import-export .ca-smart-import-grid,
  #ca-import-export .ca-map-fields{grid-template-columns:1fr!important;gap:14px!important;}
  #ca-import-export .wave-col-2{grid-column:auto!important;}
  #ca-import-export .wave-actions{width:100%!important;}
  #ca-import-export .wave-actions .wave-btn,
  #ca-import-export .ca-map-actions .wave-btn{width:100%!important;justify-content:center!important;}
  #ca-import-export .ca-smart-import-tabs button{flex:1 1 calc(50% - 8px)!important;}
  #ca-import-export .wave-section-head h2,
  #ca-import-export .wave-section-head h3,
  #ca-import-export h3{font-size:22px!important;}
}
@media(max-width:520px){
  #ca-import-export.ca-import-wizard-card{padding:18px 14px!important;margin-left:0!important;margin-right:0!important;}
  #ca-import-export .ca-smart-import-card,
  #ca-import-export .ca-advanced-reset-card,
  #ca-import-export .wave-card:not(.ca-import-wizard-card){padding:18px 14px!important;border-radius:18px!important;}
  #ca-import-export .ca-smart-import-tabs button{flex:1 1 100%!important;}
  #ca-import-export input[type="file"]{font-size:13px!important;}
}


/* v2.23.2 Business Settings UI Polish - smaller text and clearer section spacing */
#ca-import-export,
#ca-import-export *{
  font-size:13px;
  line-height:1.45;
}
#ca-import-export.ca-import-wizard-card{
  padding:28px!important;
}
#ca-import-export .wave-section-head,
#ca-import-export .ca-settings-section,
#ca-import-export .ca-import-section,
#ca-import-export .ca-smart-import-card,
#ca-import-export .ca-advanced-reset-card,
#ca-import-export .wave-card:not(.ca-import-wizard-card){
  margin-top:28px!important;
  margin-bottom:28px!important;
}
#ca-import-export .ca-smart-import-card,
#ca-import-export .ca-advanced-reset-card,
#ca-import-export .wave-card:not(.ca-import-wizard-card){
  padding:24px!important;
  border-radius:18px!important;
}
#ca-import-export .wave-form-grid,
#ca-import-export .ca-smart-import-grid,
#ca-import-export .ca-map-fields{
  gap:18px 22px!important;
  margin-top:18px!important;
  margin-bottom:20px!important;
}
#ca-import-export label,
#ca-import-export .wave-field label,
#ca-import-export .ca-field-label{
  font-size:12px!important;
  font-weight:700!important;
  letter-spacing:.015em!important;
  color:#475569!important;
  margin-bottom:7px!important;
}
#ca-import-export input,
#ca-import-export select,
#ca-import-export textarea,
#ca-import-export button{
  font-size:13px!important;
}
#ca-import-export input,
#ca-import-export select,
#ca-import-export textarea{
  min-height:42px!important;
  padding:9px 12px!important;
  border-radius:12px!important;
}
#ca-import-export input[type="file"]{
  padding:8px 12px!important;
}
#ca-import-export .wave-btn,
#ca-import-export button,
#ca-import-export .button{
  min-height:38px!important;
  padding:8px 15px!important;
  border-radius:12px!important;
  font-weight:700!important;
}
#ca-import-export .wave-section-head h2,
#ca-import-export h2{
  font-size:24px!important;
  line-height:1.2!important;
  margin-bottom:8px!important;
}
#ca-import-export .wave-section-head h3,
#ca-import-export h3{
  font-size:19px!important;
  line-height:1.25!important;
  margin-bottom:10px!important;
}
#ca-import-export .wave-muted,
#ca-import-export p,
#ca-import-export .ca-help-text,
#ca-import-export .ca-import-wizard-note,
#ca-import-export .ca-map-type-help{
  font-size:12px!important;
}
#ca-import-export .ca-import-wizard-note,
#ca-import-export .ca-map-type-help{
  padding:13px 15px!important;
  margin:18px 0 22px!important;
  border-radius:14px!important;
}
#ca-import-export .ca-smart-import-tabs{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:10px!important;
  margin:16px 0 20px!important;
}
#ca-import-export .ca-smart-import-tabs button{
  font-size:12px!important;
  padding:7px 13px!important;
  min-height:34px!important;
}
#ca-import-export .ca-map-actions,
#ca-import-export .wave-actions{
  display:flex!important;
  gap:12px!important;
  flex-wrap:wrap!important;
  margin-top:18px!important;
  margin-bottom:20px!important;
}
#ca-import-export .ca-map-preview-box{
  margin-top:26px!important;
  padding:20px!important;
  border-radius:18px!important;
}
#ca-import-export .ca-map-preview th,
#ca-import-export .ca-map-preview td{
  font-size:12px!important;
  padding:10px 12px!important;
}
html.ca-dark #ca-import-export label,
body[data-theme="dark"] #ca-import-export label,
body.wave-dark #ca-import-export label,
.wave-dark #ca-import-export label{
  color:#cbd5e1!important;
}
html.ca-dark #ca-import-export input,
html.ca-dark #ca-import-export select,
html.ca-dark #ca-import-export textarea,
body[data-theme="dark"] #ca-import-export input,
body[data-theme="dark"] #ca-import-export select,
body[data-theme="dark"] #ca-import-export textarea,
body.wave-dark #ca-import-export input,
body.wave-dark #ca-import-export select,
body.wave-dark #ca-import-export textarea,
.wave-dark #ca-import-export input,
.wave-dark #ca-import-export select,
.wave-dark #ca-import-export textarea{
  background:#0f172a!important;
  color:#f8fafc!important;
  border-color:#334155!important;
}
html.ca-dark #ca-import-export .wave-btn:not(.wave-btn-primary),
html.ca-dark #ca-import-export button:not(.wave-btn-primary),
body[data-theme="dark"] #ca-import-export .wave-btn:not(.wave-btn-primary),
body[data-theme="dark"] #ca-import-export button:not(.wave-btn-primary),
body.wave-dark #ca-import-export .wave-btn:not(.wave-btn-primary),
body.wave-dark #ca-import-export button:not(.wave-btn-primary),
.wave-dark #ca-import-export .wave-btn:not(.wave-btn-primary),
.wave-dark #ca-import-export button:not(.wave-btn-primary){
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
@media(max-width:900px){
  #ca-import-export.ca-import-wizard-card{padding:20px 16px!important;}
  #ca-import-export .ca-smart-import-card,
  #ca-import-export .ca-advanced-reset-card,
  #ca-import-export .wave-card:not(.ca-import-wizard-card){padding:18px!important;margin-top:22px!important;margin-bottom:22px!important;}
  #ca-import-export .wave-section-head h2,#ca-import-export h2{font-size:21px!important;}
  #ca-import-export .wave-section-head h3,#ca-import-export h3{font-size:17px!important;}
}


/* v2.23.4 Business Settings nested cards polish */
#ca-import-export.wave-card{
  display:block;
}
#ca-import-export .ca-settings-inner-card{
  margin:18px 0 22px;
  padding:20px 22px;
  border:1px solid #dbe7f3;
  border-radius:18px;
  background:#f8fbff;
  box-shadow:none;
}
#ca-import-export .ca-settings-inner-card + .ca-settings-inner-card,
#ca-import-export .ca-settings-inner-card + .ca-smart-import-card,
#ca-import-export .ca-smart-import-card + .wave-card,
#ca-import-export .wave-card + .ca-settings-inner-card{
  margin-top:22px!important;
}
#ca-import-export .ca-settings-inner-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
#ca-import-export .ca-settings-inner-head h3,
#ca-import-export .ca-settings-inner-card h3{
  margin:0;
  font-size:15px;
  line-height:1.25;
  font-weight:700;
  color:#0f172a;
}
#ca-import-export .ca-settings-inner-head .wave-form-help,
#ca-import-export .ca-settings-inner-card .wave-form-help{
  margin:6px 0 0;
  font-size:12px;
  line-height:1.45;
  color:#64748b;
}
#ca-import-export .ca-settings-inner-card .wave-form-grid{
  margin-top:14px;
}
#ca-import-export .ca-import-wizard-note{
  margin:12px 0 14px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#334155;
  font-size:12px;
  line-height:1.45;
}
.ca-dark-page #ca-import-export .ca-settings-inner-card,
[data-theme="dark"] #ca-import-export .ca-settings-inner-card,
.wave-portal-shell[data-theme="dark"] #ca-import-export .ca-settings-inner-card{
  background:#0f172a!important;
  border-color:#263449!important;
  color:#e5edf7!important;
}
.ca-dark-page #ca-import-export .ca-settings-inner-head h3,
.ca-dark-page #ca-import-export .ca-settings-inner-card h3,
[data-theme="dark"] #ca-import-export .ca-settings-inner-head h3,
[data-theme="dark"] #ca-import-export .ca-settings-inner-card h3,
.wave-portal-shell[data-theme="dark"] #ca-import-export .ca-settings-inner-head h3,
.wave-portal-shell[data-theme="dark"] #ca-import-export .ca-settings-inner-card h3{
  color:#f8fafc!important;
}
.ca-dark-page #ca-import-export .ca-settings-inner-head .wave-form-help,
.ca-dark-page #ca-import-export .ca-settings-inner-card .wave-form-help,
[data-theme="dark"] #ca-import-export .ca-settings-inner-head .wave-form-help,
[data-theme="dark"] #ca-import-export .ca-settings-inner-card .wave-form-help,
.wave-portal-shell[data-theme="dark"] #ca-import-export .ca-settings-inner-head .wave-form-help,
.wave-portal-shell[data-theme="dark"] #ca-import-export .ca-settings-inner-card .wave-form-help{
  color:#9fb0c7!important;
}
.ca-dark-page #ca-import-export .ca-import-wizard-note,
[data-theme="dark"] #ca-import-export .ca-import-wizard-note,
.wave-portal-shell[data-theme="dark"] #ca-import-export .ca-import-wizard-note{
  background:#0b1220!important;
  border-color:#263449!important;
  color:#cbd5e1!important;
}
@media (max-width: 760px){
  #ca-import-export .ca-settings-inner-card{
    padding:16px 14px;
    border-radius:16px;
    margin:16px 0 20px;
  }
  #ca-import-export .ca-settings-inner-head{
    display:block;
    margin-bottom:12px;
  }
  #ca-import-export .ca-settings-inner-head h3,
  #ca-import-export .ca-settings-inner-card h3{
    font-size:14px;
  }
  #ca-import-export .ca-settings-inner-card .wave-form-grid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  #ca-import-export .ca-settings-inner-card .wave-col-2,
  #ca-import-export .ca-settings-inner-card .wave-actions{
    grid-column:auto!important;
    width:100%!important;
  }
  #ca-import-export .ca-settings-inner-card button,
  #ca-import-export .ca-settings-inner-card .wave-btn{
    width:100%;
    justify-content:center;
  }
}

/* v2.24.0 Pagination Foundation */
.ca-pagination-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:14px 0 4px;padding:12px 14px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;color:#334155;font-size:13px;flex-wrap:wrap}.ca-pagination-left{font-weight:700;color:#475569}.ca-pagination-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ca-page-size-label{display:flex!important;align-items:center!important;gap:8px!important;margin:0!important;font-size:12px!important;font-weight:700!important;color:#475569!important}.ca-page-size{height:34px!important;min-height:34px!important;border:1px solid #cbd5e1!important;border-radius:8px!important;background:#fff!important;color:#0f172a!important;padding:0 26px 0 10px!important;font-size:13px!important}.ca-page-prev,.ca-page-next,.ca-page-number{height:34px;min-width:34px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#0f172a;font-size:13px;font-weight:700;cursor:pointer;padding:0 10px}.ca-page-prev:disabled,.ca-page-next:disabled{opacity:.45;cursor:not-allowed}.ca-page-numbers{display:flex;align-items:center;gap:6px}.ca-page-number.is-active{background:#2f80ed;border-color:#2f80ed;color:#fff}.ca-page-dots{padding:0 2px;color:#64748b;font-weight:700}.wave-portal-shell[data-theme="dark"] .ca-pagination-bar,body[data-theme="dark"] .ca-pagination-bar{background:#111827!important;border-color:#334155!important;color:#cbd5e1!important}.wave-portal-shell[data-theme="dark"] .ca-pagination-left,body[data-theme="dark"] .ca-pagination-left,.wave-portal-shell[data-theme="dark"] .ca-page-size-label,body[data-theme="dark"] .ca-page-size-label{color:#cbd5e1!important}.wave-portal-shell[data-theme="dark"] .ca-page-size,body[data-theme="dark"] .ca-page-size,.wave-portal-shell[data-theme="dark"] .ca-page-prev,body[data-theme="dark"] .ca-page-prev,.wave-portal-shell[data-theme="dark"] .ca-page-next,body[data-theme="dark"] .ca-page-next,.wave-portal-shell[data-theme="dark"] .ca-page-number,body[data-theme="dark"] .ca-page-number{background:#0f172a!important;border-color:#475569!important;color:#e5e7eb!important}.wave-portal-shell[data-theme="dark"] .ca-page-number.is-active,body[data-theme="dark"] .ca-page-number.is-active{background:#38bdf8!important;border-color:#38bdf8!important;color:#082f49!important}@media(max-width:760px){.ca-pagination-bar{align-items:stretch}.ca-pagination-left,.ca-pagination-right{width:100%;justify-content:space-between}.ca-page-numbers{order:3;width:100%;overflow-x:auto;padding-bottom:2px}.ca-page-prev,.ca-page-next{flex:1}.ca-page-size-label{width:100%;justify-content:space-between}.ca-page-size{flex:1}}

/* v2.24.1 Mobile Pagination Fix */
@media (max-width: 760px){
  .ca-pagination-bar{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
    width:100%!important;
    margin:12px 0 8px!important;
    padding:12px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }
  .ca-pagination-left,
  .ca-pagination-right{
    width:100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    flex-wrap:wrap!important;
    box-sizing:border-box!important;
  }
  .ca-pagination-info{
    display:block!important;
    width:100%!important;
    text-align:center!important;
    font-size:12px!important;
    line-height:1.35!important;
  }
  .ca-page-size-label{
    width:100%!important;
    display:flex!important;
    justify-content:space-between!important;
    align-items:center!important;
    gap:10px!important;
    font-size:12px!important;
  }
  .ca-page-size{
    width:auto!important;
    min-width:96px!important;
    max-width:140px!important;
    flex:0 0 auto!important;
  }
  .ca-page-prev,
  .ca-page-next{
    flex:1 1 0!important;
    min-width:0!important;
    height:40px!important;
    padding:0 10px!important;
    font-size:12px!important;
    touch-action:manipulation!important;
  }
  .ca-page-numbers{
    order:2!important;
    width:100%!important;
    display:flex!important;
    justify-content:center!important;
    align-items:center!important;
    overflow:visible!important;
    padding:0!important;
    margin:0!important;
  }
  .ca-mobile-page-status{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:34px!important;
    width:100%!important;
    border:1px solid #cbd5e1!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#0f172a!important;
    font-size:12px!important;
    font-weight:700!important;
  }
  .wave-portal-shell[data-theme="dark"] .ca-mobile-page-status,
  body[data-theme="dark"] .ca-mobile-page-status{
    background:#0f172a!important;
    border-color:#475569!important;
    color:#e5e7eb!important;
  }
}


/* v2.24.2 Mobile Pagination Hard Fix - hide paginated rows even when mobile card/table CSS uses display:block!important */
.wave-table tbody tr.ca-page-hidden,
.wave-grid .wave-table tbody tr.ca-page-hidden,
.wave-enhanced-list .wave-table tbody tr.ca-page-hidden{
  display:none!important;
}
@media (max-width: 760px){
  .wave-table tbody tr.ca-page-hidden,
  .wave-grid .wave-table tbody tr.ca-page-hidden,
  .wave-enhanced-list .wave-table tbody tr.ca-page-hidden{
    display:none!important;
  }
}

/* v2.25.1d Taxes polish: standalone taxes layout spacing, compact EU VAT toggle, mobile/dark support */
.ca-taxes-page .ca-taxes-header {
  margin-bottom: 22px !important;
  align-items: center !important;
  gap: 16px !important;
}
.ca-taxes-page .ca-tax-create-top {
  white-space: nowrap !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18) !important;
}
.ca-taxes-page .ca-taxes-grid,
.ca-taxes-page .taxes-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 22px !important;
}
.ca-taxes-page .wave-card {
  margin: 0 !important;
  border-radius: 18px !important;
}
.ca-taxes-page .ca-tax-rates-card .wave-table-wrap,
.ca-taxes-page .ca-eu-vat-card .wave-table-wrap {
  margin-top: 10px !important;
}
.ca-taxes-page .ca-eu-vat-form {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  width: 100% !important;
  padding: 14px 16px !important;
  margin: 18px 0 14px !important;
  border: 1px solid #dbe7f4 !important;
  border-radius: 14px !important;
  background: #f8fbff !important;
  box-sizing: border-box !important;
}
.ca-taxes-page .ca-eu-vat-toggle {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  cursor: pointer !important;
}
.ca-taxes-page .ca-eu-vat-toggle input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 2px 0 0 !important;
  accent-color: #2563eb !important;
}
.ca-taxes-page .ca-eu-vat-toggle span {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  line-height: 1.35 !important;
}
.ca-taxes-page .ca-eu-vat-toggle small {
  color: #64748b !important;
  font-size: 13px !important;
}
.ca-taxes-page .ca-eu-vat-form .wave-btn {
  flex: 0 0 auto !important;
}
.ca-taxes-page .ca-eu-vat-table {
  margin-top: 14px !important;
}
.ca-taxes-page .wave-actions-cell .wave-customer-actions {
  justify-content: flex-end !important;
}
@media (max-width: 768px) {
  .ca-taxes-page .ca-taxes-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .ca-taxes-page .ca-tax-create-top,
  .ca-taxes-page .ca-eu-vat-form .wave-btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .ca-taxes-page .ca-eu-vat-form {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 14px !important;
  }
  .ca-taxes-page .ca-eu-vat-toggle {
    width: 100% !important;
  }
}
body.ca-dark-mode .ca-taxes-page .ca-eu-vat-form,
.ca-dark-mode .ca-taxes-page .ca-eu-vat-form,
[data-theme="dark"] .ca-taxes-page .ca-eu-vat-form {
  background: #111827 !important;
  border-color: #334155 !important;
}
body.ca-dark-mode .ca-taxes-page .ca-eu-vat-toggle small,
.ca-dark-mode .ca-taxes-page .ca-eu-vat-toggle small,
[data-theme="dark"] .ca-taxes-page .ca-eu-vat-toggle small {
  color: #94a3b8 !important;
}

/* v2.25.1e - EU VAT line item polish: message -> treatment -> tax, mobile/dark friendly */
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  display: grid !important;
  grid-template-columns: minmax(230px, 1fr) minmax(300px, 1.55fr) minmax(180px, .85fr) minmax(90px, .45fr) !important;
  gap: 18px !important;
  align-items: end !important;
  width: 100% !important;
  padding-top: 18px !important;
  margin-top: 10px !important;
  border-top: 1px solid #e6edf5 !important;
}
html body .wave-invoice-form .wave-vat-treatment-help {
  order: 1 !important;
  min-height: 56px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  border: 1px solid #dbe7f3 !important;
  border-radius: 12px !important;
  background: #f8fbff !important;
  color: #426182 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere !important;
}
html body .wave-invoice-form .wave-vat-treatment-help .dashicons {
  color: #0b7bdc !important;
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  margin-top: 1px !important;
  flex: 0 0 18px !important;
}
html body .wave-invoice-form .wave-vat-treatment-help-text {
  display: block !important;
}
html body .wave-invoice-form .wave-vat-treatment-field {
  order: 2 !important;
  min-width: 0 !important;
  width: 100% !important;
}
html body .wave-invoice-form .wave-tax-field {
  order: 3 !important;
  min-width: 0 !important;
  width: 100% !important;
}
html body .wave-invoice-form .wave-item-tax-amount {
  order: 4 !important;
  min-width: 90px !important;
  justify-self: end !important;
  align-self: end !important;
  text-align: right !important;
  padding: 0 0 12px 0 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
  display: inline-block !important;
  width: 100% !important;
  text-align: right !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}
html body .wave-invoice-form .wave-vat-treatment-field select,
html body .wave-invoice-form .wave-tax-field select,
html body .wave-invoice-form .wave-vat-treatment-select,
html body .wave-invoice-form .wave-item-tax-select {
  width: 100% !important;
  min-height: 46px !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 1100px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.4fr) minmax(170px, .8fr) minmax(85px, .35fr) !important;
    gap: 14px !important;
  }
}
@media (max-width: 768px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding-top: 14px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help,
  html body .wave-invoice-form .wave-vat-treatment-field,
  html body .wave-invoice-form .wave-tax-field,
  html body .wave-invoice-form .wave-item-tax-amount {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-self: stretch !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount {
    text-align: right !important;
    padding: 0 !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
    text-align: right !important;
  }
}

.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  border-top-color: rgba(148, 163, 184, .22) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-help {
  background: rgba(15, 23, 42, .62) !important;
  border-color: rgba(96, 165, 250, .28) !important;
  color: #bfdbfe !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-help .dashicons {
  color: #60a5fa !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
  color: #f8fafc !important;
}


/* v2.25.1f - EU VAT line items final polish: contained help card, stacked labels, larger fields, mobile + dark */
html body .wave-invoice-form .wave-item-row {
  overflow: visible !important;
}
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  position: static !important;
  display: grid !important;
  grid-template-columns: minmax(210px, .9fr) minmax(320px, 1.45fr) minmax(230px, 1fr) minmax(96px, .38fr) !important;
  column-gap: 28px !important;
  row-gap: 12px !important;
  align-items: end !important;
  justify-content: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 22px 8px 20px !important;
  margin: 12px 0 0 !important;
  border-top: 1px solid #e6edf5 !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-vat-treatment-help {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  order: 1 !important;
  grid-column: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 86px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  padding: 14px 16px !important;
  margin: 0 !important;
  border: 1px solid #dbe7f3 !important;
  border-radius: 12px !important;
  background: #f8fbff !important;
  color: #0f2544 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-vat-treatment-help .dashicons {
  color: #0b7bdc !important;
  font-size: 19px !important;
  width: 19px !important;
  height: 19px !important;
  line-height: 19px !important;
  flex: 0 0 19px !important;
  margin-top: 1px !important;
}
html body .wave-invoice-form .wave-vat-treatment-help-text {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}
html body .wave-invoice-form .wave-item-tax-label,
html body .wave-invoice-form .wave-vat-treatment-field,
html body .wave-invoice-form .wave-tax-field {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}
html body .wave-invoice-form .wave-vat-treatment-field { order: 2 !important; }
html body .wave-invoice-form .wave-tax-field { order: 3 !important; }
html body .wave-invoice-form .wave-item-tax-label > span,
html body .wave-invoice-form .wave-vat-treatment-field > span,
html body .wave-invoice-form .wave-tax-field > span {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  color: #8da0bd !important;
  white-space: nowrap !important;
}
html body .wave-invoice-form .wave-vat-treatment-field select,
html body .wave-invoice-form .wave-tax-field select,
html body .wave-invoice-form .wave-vat-treatment-select,
html body .wave-invoice-form .wave-item-tax-select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 52px !important;
  height: 52px !important;
  padding: 0 42px 0 16px !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
html body .wave-invoice-form .wave-item-tax-amount {
  order: 4 !important;
  min-width: 92px !important;
  max-width: 110px !important;
  width: 100% !important;
  justify-self: end !important;
  align-self: end !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  text-align: right !important;
  padding: 0 0 15px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax],
html body .wave-invoice-form .wave-item-tax-amount strong {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
}
@media (max-width: 1180px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: minmax(190px, .85fr) minmax(260px, 1.35fr) minmax(190px, .9fr) minmax(86px, .35fr) !important;
    column-gap: 18px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help {
    font-size: 13px !important;
    padding: 12px 14px !important;
  }
}
@media (max-width: 900px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr 1fr !important;
    column-gap: 14px !important;
    row-gap: 14px !important;
    padding: 18px 0 !important;
    overflow: visible !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help {
    grid-column: 1 / -1 !important;
    min-height: auto !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field,
  html body .wave-invoice-form .wave-tax-field {
    grid-column: span 1 !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount {
    grid-column: 1 / -1 !important;
    justify-self: end !important;
    max-width: none !important;
    padding: 0 !important;
  }
}
@media (max-width: 640px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr !important;
    padding: 16px 0 !important;
    gap: 12px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help,
  html body .wave-invoice-form .wave-vat-treatment-field,
  html body .wave-invoice-form .wave-tax-field,
  html body .wave-invoice-form .wave-item-tax-amount {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field select,
  html body .wave-invoice-form .wave-tax-field select,
  html body .wave-invoice-form .wave-vat-treatment-select,
  html body .wave-invoice-form .wave-item-tax-select {
    min-height: 46px !important;
    height: 46px !important;
    font-size: 14px !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount {
    justify-content: flex-end !important;
    text-align: right !important;
    padding-top: 2px !important;
  }
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-row > .wave-item-tax-row,
body.ca-dark-mode .wave-invoice-form .wave-item-row > .wave-item-tax-row,
.ca-dark-mode .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  border-top-color: rgba(148, 163, 184, .22) !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-help,
body.ca-dark-mode .wave-invoice-form .wave-vat-treatment-help,
.ca-dark-mode .wave-invoice-form .wave-vat-treatment-help {
  background: rgba(15, 23, 42, .7) !important;
  border-color: rgba(96, 165, 250, .3) !important;
  color: #dbeafe !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-tax-label > span,
body.ca-dark-mode .wave-invoice-form .wave-item-tax-label > span,
.ca-dark-mode .wave-invoice-form .wave-item-tax-label > span {
  color: #94a3b8 !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-field select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-tax-field select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-tax-select,
body.ca-dark-mode .wave-invoice-form .wave-vat-treatment-field select,
body.ca-dark-mode .wave-invoice-form .wave-tax-field select,
body.ca-dark-mode .wave-invoice-form .wave-vat-treatment-select,
body.ca-dark-mode .wave-invoice-form .wave-item-tax-select,
.ca-dark-mode .wave-invoice-form .wave-vat-treatment-field select,
.ca-dark-mode .wave-invoice-form .wave-tax-field select,
.ca-dark-mode .wave-invoice-form .wave-vat-treatment-select,
.ca-dark-mode .wave-invoice-form .wave-item-tax-select {
  background: #0b1220 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-tax-amount strong[data-line-tax],
body.ca-dark-mode .wave-invoice-form .wave-item-tax-amount strong[data-line-tax],
.ca-dark-mode .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
  color: #f8fafc !important;
}

/* v2.25.1g - Compact EU VAT line controls: keep everything inside the line item card */
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  display: grid !important;
  grid-template-columns: 300px minmax(260px, 1fr) 250px 92px !important;
  gap: 14px 20px !important;
  align-items: end !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 18px 12px 18px !important;
  margin: 12px 0 0 !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-vat-treatment-help {
  grid-column: 1 !important;
  order: 1 !important;
  width: 100% !important;
  max-width: 300px !important;
  min-height: 64px !important;
  padding: 12px 14px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-vat-treatment-field {
  grid-column: 2 !important;
  order: 2 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
html body .wave-invoice-form .wave-tax-field {
  grid-column: 3 !important;
  order: 3 !important;
  width: 100% !important;
  max-width: 250px !important;
  min-width: 0 !important;
}
html body .wave-invoice-form .wave-vat-treatment-field select,
html body .wave-invoice-form .wave-tax-field select,
html body .wave-invoice-form .wave-vat-treatment-select,
html body .wave-invoice-form .wave-item-tax-select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 36px 0 14px !important;
  font-size: 15px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
html body .wave-invoice-form .wave-item-tax-label > span,
html body .wave-invoice-form .wave-vat-treatment-field > span,
html body .wave-invoice-form .wave-tax-field > span {
  margin-bottom: 7px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
}
html body .wave-invoice-form .wave-item-tax-amount {
  grid-column: 4 !important;
  order: 4 !important;
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  justify-self: end !important;
  align-self: end !important;
  padding: 0 0 11px 0 !important;
  margin: 0 !important;
  text-align: right !important;
  box-sizing: border-box !important;
}
html body .wave-invoice-form .wave-item-tax-amount strong,
html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
  font-size: 17px !important;
  line-height: 1.15 !important;
}
@media (max-width: 1200px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 250px minmax(230px, 1fr) 210px 86px !important;
    gap: 14px 16px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help { max-width: 250px !important; font-size: 12.5px !important; }
  html body .wave-invoice-form .wave-tax-field { max-width: 210px !important; }
  html body .wave-invoice-form .wave-item-tax-amount { width: 86px !important; min-width: 86px !important; max-width: 86px !important; }
}
@media (max-width: 980px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr 1fr !important;
    overflow: visible !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
    min-height: auto !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field {
    grid-column: 1 !important;
  }
  html body .wave-invoice-form .wave-tax-field {
    grid-column: 2 !important;
    max-width: 100% !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
  }
}
@media (max-width: 640px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr !important;
    padding: 14px 0 !important;
    gap: 12px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help,
  html body .wave-invoice-form .wave-vat-treatment-field,
  html body .wave-invoice-form .wave-tax-field,
  html body .wave-invoice-form .wave-item-tax-amount {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field select,
  html body .wave-invoice-form .wave-tax-field select,
  html body .wave-invoice-form .wave-vat-treatment-select,
  html body .wave-invoice-form .wave-item-tax-select {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }
}


/* v2.25.1h - HARD FIX: contained EU VAT controls inside line item card */
html body .wave-invoice-form .wave-item-row,
html body .wave-invoice-form .wave-item-card,
html body .wave-invoice-form .wave-line-item,
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  box-sizing: border-box !important;
  max-width: 100% !important;
}
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  display: grid !important;
  grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr) minmax(200px, 240px) minmax(82px, 92px) !important;
  column-gap: 16px !important;
  row-gap: 10px !important;
  align-items: end !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 18px 12px 18px !important;
  margin: 12px 0 0 !important;
  overflow: hidden !important;
  border-top: 1px solid #e6edf5 !important;
}
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row > * {
  min-width: 0 !important;
  box-sizing: border-box !important;
}
html body .wave-invoice-form .wave-vat-treatment-help {
  grid-column: 1 !important;
  order: 1 !important;
  width: 100% !important;
  max-width: 280px !important;
  min-width: 0 !important;
  min-height: 64px !important;
  height: auto !important;
  padding: 12px 14px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-vat-treatment-help-text {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}
html body .wave-invoice-form .wave-vat-treatment-field,
html body .wave-invoice-form .wave-tax-field,
html body .wave-invoice-form .wave-item-tax-label.wave-vat-treatment-field,
html body .wave-invoice-form .wave-item-tax-label.wave-tax-field {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}
html body .wave-invoice-form .wave-vat-treatment-field { grid-column: 2 !important; order: 2 !important; }
html body .wave-invoice-form .wave-tax-field { grid-column: 3 !important; order: 3 !important; }
html body .wave-invoice-form .wave-item-tax-label > span,
html body .wave-invoice-form .wave-vat-treatment-field > span,
html body .wave-invoice-form .wave-tax-field > span {
  display: block !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
  color: #8da0bd !important;
  white-space: nowrap !important;
}
html body .wave-invoice-form .wave-vat-treatment-field select,
html body .wave-invoice-form .wave-tax-field select,
html body .wave-invoice-form .wave-vat-treatment-select,
html body .wave-invoice-form .wave-item-tax-select {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 34px 0 14px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
html body .wave-invoice-form .wave-item-tax-amount {
  grid-column: 4 !important;
  order: 4 !important;
  width: 92px !important;
  min-width: 82px !important;
  max-width: 92px !important;
  justify-self: end !important;
  align-self: end !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 0 0 10px 0 !important;
  margin: 0 !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-item-tax-amount strong,
html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
}
@media (max-width: 1180px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: minmax(190px, 240px) minmax(230px, 1fr) minmax(180px, 210px) minmax(78px, 86px) !important;
    column-gap: 12px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help { max-width: 240px !important; font-size: 12.5px !important; padding: 11px 12px !important; }
  html body .wave-invoice-form .wave-vat-treatment-field select,
  html body .wave-invoice-form .wave-tax-field select,
  html body .wave-invoice-form .wave-vat-treatment-select,
  html body .wave-invoice-form .wave-item-tax-select { font-size: 14px !important; padding-left: 12px !important; padding-right: 30px !important; }
  html body .wave-invoice-form .wave-item-tax-amount { width: 86px !important; max-width: 86px !important; }
}
@media (max-width: 980px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr 1fr !important;
    overflow: visible !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help { grid-column: 1 / -1 !important; max-width: 100% !important; min-height: auto !important; }
  html body .wave-invoice-form .wave-vat-treatment-field { grid-column: 1 !important; }
  html body .wave-invoice-form .wave-tax-field { grid-column: 2 !important; }
  html body .wave-invoice-form .wave-item-tax-amount { grid-column: 1 / -1 !important; width: 100% !important; max-width: none !important; padding: 0 !important; }
}
@media (max-width: 640px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 14px 0 !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help,
  html body .wave-invoice-form .wave-vat-treatment-field,
  html body .wave-invoice-form .wave-tax-field,
  html body .wave-invoice-form .wave-item-tax-amount {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field select,
  html body .wave-invoice-form .wave-tax-field select,
  html body .wave-invoice-form .wave-vat-treatment-select,
  html body .wave-invoice-form .wave-item-tax-select {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-row > .wave-item-tax-row,
body.ca-dark-mode .wave-invoice-form .wave-item-row > .wave-item-tax-row,
.ca-dark-mode .wave-invoice-form .wave-item-row > .wave-item-tax-row { border-top-color: rgba(148, 163, 184, .22) !important; }
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-help,
body.ca-dark-mode .wave-invoice-form .wave-vat-treatment-help,
.ca-dark-mode .wave-invoice-form .wave-vat-treatment-help {
  background: rgba(15, 23, 42, .72) !important;
  border-color: rgba(96, 165, 250, .30) !important;
  color: #dbeafe !important;
}
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-field select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-tax-field select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-vat-treatment-select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-tax-select,
body.ca-dark-mode .wave-invoice-form .wave-vat-treatment-field select,
body.ca-dark-mode .wave-invoice-form .wave-tax-field select,
body.ca-dark-mode .wave-invoice-form .wave-vat-treatment-select,
body.ca-dark-mode .wave-invoice-form .wave-item-tax-select,
.ca-dark-mode .wave-invoice-form .wave-vat-treatment-field select,
.ca-dark-mode .wave-invoice-form .wave-tax-field select,
.ca-dark-mode .wave-invoice-form .wave-vat-treatment-select,
.ca-dark-mode .wave-invoice-form .wave-item-tax-select {
  background: #0b1220 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* v2.25.1k - EU VAT compact width fit
   Makes the VAT treatment/tax controls slightly smaller so the tax amount fits cleanly on the right. */
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
  grid-template-columns: minmax(185px, 230px) minmax(220px, 1fr) minmax(165px, 200px) minmax(68px, 76px) !important;
  column-gap: 12px !important;
  row-gap: 9px !important;
  padding: 16px 10px 16px !important;
  overflow: hidden !important;
}
html body .wave-invoice-form .wave-item-row > .wave-item-tax-row > * {
  min-width: 0 !important;
  box-sizing: border-box !important;
}
html body .wave-invoice-form .wave-vat-treatment-help {
  max-width: 230px !important;
  min-height: 58px !important;
  padding: 10px 12px !important;
  font-size: 12px !important;
  line-height: 1.32 !important;
  border-radius: 11px !important;
}
html body .wave-invoice-form .wave-vat-treatment-help .dashicons {
  font-size: 17px !important;
  width: 17px !important;
  height: 17px !important;
  line-height: 17px !important;
  flex-basis: 17px !important;
}
html body .wave-invoice-form .wave-vat-treatment-field,
html body .wave-invoice-form .wave-tax-field,
html body .wave-invoice-form .wave-item-tax-label.wave-vat-treatment-field,
html body .wave-invoice-form .wave-item-tax-label.wave-tax-field {
  gap: 6px !important;
}
html body .wave-invoice-form .wave-item-tax-label > span,
html body .wave-invoice-form .wave-vat-treatment-field > span,
html body .wave-invoice-form .wave-tax-field > span {
  font-size: 11px !important;
  letter-spacing: .045em !important;
}
html body .wave-invoice-form .wave-vat-treatment-field select,
html body .wave-invoice-form .wave-tax-field select,
html body .wave-invoice-form .wave-vat-treatment-select,
html body .wave-invoice-form .wave-item-tax-select {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 30px 0 12px !important;
  font-size: 13px !important;
  border-radius: 9px !important;
}
html body .wave-invoice-form .wave-item-tax-amount {
  width: 76px !important;
  min-width: 68px !important;
  max-width: 76px !important;
  padding: 0 0 8px 0 !important;
  overflow: visible !important;
}
html body .wave-invoice-form .wave-item-tax-amount strong,
html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
  font-size: 16px !important;
  line-height: 1.1 !important;
}
@media (max-width: 1180px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: minmax(165px, 210px) minmax(200px, 1fr) minmax(150px, 180px) minmax(62px, 70px) !important;
    column-gap: 10px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help {
    max-width: 210px !important;
    font-size: 11.5px !important;
    padding: 9px 10px !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field select,
  html body .wave-invoice-form .wave-tax-field select,
  html body .wave-invoice-form .wave-vat-treatment-select,
  html body .wave-invoice-form .wave-item-tax-select {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 12.5px !important;
    padding-left: 10px !important;
    padding-right: 28px !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount {
    width: 70px !important;
    max-width: 70px !important;
  }
  html body .wave-invoice-form .wave-item-tax-amount strong,
  html body .wave-invoice-form .wave-item-tax-amount strong[data-line-tax] {
    font-size: 15px !important;
  }
}
@media (max-width: 980px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr 1fr !important;
    overflow: visible !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-help { max-width: 100% !important; }
  html body .wave-invoice-form .wave-item-tax-amount {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0 !important;
  }
}
@media (max-width: 640px) {
  html body .wave-invoice-form .wave-item-row > .wave-item-tax-row {
    grid-template-columns: 1fr !important;
    gap: 11px !important;
    padding: 13px 0 !important;
  }
  html body .wave-invoice-form .wave-vat-treatment-field select,
  html body .wave-invoice-form .wave-tax-field select,
  html body .wave-invoice-form .wave-vat-treatment-select,
  html body .wave-invoice-form .wave-item-tax-select {
    height: 40px !important;
    min-height: 40px !important;
    font-size: 13px !important;
  }
}

/* v2.25.2 - Unified VAT treatment compact fit for bills/estimates */
.wave-bill-items-table .ca-bill-vat-treatment-select,
.wave-bill-items-table .ca-bill-tax-select {
  width: 100%;
  min-width: 0;
  font-size: 13px;
  padding: 8px 10px;
}
.wave-bill-items-table th,
.wave-bill-items-table td {
  vertical-align: middle;
}
@media (max-width: 760px) {
  .wave-bill-items-table .ca-bill-vat-treatment-select,
  .wave-bill-items-table .ca-bill-tax-select {
    font-size: 13px;
    min-height: 40px;
  }
}

/* v2.27.1 - Invoicing header business identity + switcher */
.wave-business-switch-form{
  padding:12px 16px;
  border-bottom:1px solid #f1f5f9;
  background:#fff;
}
.wave-business-switch-form label{
  display:block;
  margin:0 0 8px;
  font-size:12px;
  font-weight:800;
  color:#64748b;
}
.wave-business-switch-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
}
.wave-business-switch-row select{
  width:100%;
  min-width:0;
  height:38px;
  border:1px solid #dbe4f0;
  border-radius:10px;
  padding:0 10px;
  background:#f8fafc;
  color:#0f172a;
  font-size:12px;
}
.wave-business-switch-row button{
  height:38px!important;
  padding:0 12px!important;
  border-radius:10px!important;
  background:#4aa3f0!important;
  color:#fff!important;
  border:0!important;
  font-weight:800!important;
  text-align:center!important;
}
.wave-business-switch-row button:hover{background:#2563eb!important;}
.wave-portal-shell[data-theme="dark"] .wave-business-switch-form{
  background:#1e293b!important;
  border-bottom-color:#334155!important;
}
.wave-portal-shell[data-theme="dark"] .wave-business-switch-form label{color:#94a3b8!important;}
.wave-portal-shell[data-theme="dark"] .wave-business-switch-row select{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}
@media(max-width:760px){
  .wave-business-switch-row{grid-template-columns:1fr!important;}
  .wave-business-switch-row select,.wave-business-switch-row button{width:100%!important;}
}


/* v2.27.3 - EU VAT help text polish: smaller text and no left icon box */
html body .wave-invoice-form .wave-vat-treatment-help {
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  min-height: 52px !important;
  padding: 10px 12px !important;
  gap: 0 !important;
}
html body .wave-invoice-form .wave-vat-treatment-help .dashicons {
  display: none !important;
}
html body .wave-invoice-form .wave-vat-treatment-help-text {
  font-size: 11.5px !important;
  line-height: 1.3 !important;
}
@media (max-width: 640px) {
  html body .wave-invoice-form .wave-vat-treatment-help,
  html body .wave-invoice-form .wave-vat-treatment-help-text {
    font-size: 11px !important;
  }
}


/* v2.27.6 — Mobile header logo size polish
   Larger Connect Apps logo only on mobile invoicing screens. */
@media (max-width: 680px) {
  html body .wave-mobile-topbar {
    min-height: 86px !important;
    padding: 14px 18px !important;
  }
  html body .wave-mobile-topbar .wave-mobile-logo,
  html body .wave-mobile-logo {
    width: 205px !important;
    height: auto !important;
    max-width: calc(100vw - 112px) !important;
    object-fit: contain !important;
  }
  html body .wave-hamburger {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 380px) {
  html body .wave-mobile-topbar .wave-mobile-logo,
  html body .wave-mobile-logo {
    width: 185px !important;
    max-width: calc(100vw - 104px) !important;
  }
}


/* v2.27.7 Auth: forgot password + optional Cloudflare Turnstile */
.wave-auth-forgot{margin-top:-6px;text-align:right;font-size:13px;font-weight:700}
.wave-auth-forgot a{color:#0ea5e9;text-decoration:none}
.wave-auth-forgot a:hover{text-decoration:underline}
.ca-turnstile-wrap{margin:2px 0 8px;min-height:65px;display:flex;align-items:center;justify-content:center}


/* v2.27.8 PDF export hotfix: clean PDF edges and protect bottom totals from cropping. */
.wave-pdf-export-clone,
.wave-pdf-export-clone.wave-public-sheet-flat,
.wave-pdf-export-clone .wave-public-sheet-flat{
  border:0!important;
  box-shadow:none!important;
  outline:0!important;
  border-radius:0!important;
  overflow:visible!important;
  padding-bottom:90px!important;
}

/* v2.28.3 — stable PDF notes + print/footer final hotfix
   Base: v2.27.8 stable. Keep document body unchanged; only footer, PDF safe area,
   and header vertical alignment are tightened. */
html body .wave-public-invoice-flat .wave-public-flat-head,
html body .wave-pdf-export-clone .wave-public-flat-head{
  align-items:start!important;
}
html body .wave-public-invoice-flat .wave-public-flat-brand,
html body .wave-pdf-export-clone .wave-public-flat-brand,
html body .wave-public-invoice-flat .wave-public-flat-titlebox,
html body .wave-pdf-export-clone .wave-public-flat-titlebox{
  padding-top:0!important;
  margin-top:0!important;
}
html body .wave-public-invoice-flat .wave-public-document-footer,
html body .wave-pdf-export-clone .wave-public-document-footer{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  background:#fff!important;
  overflow:visible!important;
  page-break-inside:avoid!important;
  break-inside:avoid!important;
}
html body .wave-public-invoice-flat .wave-public-flat-notes-below,
html body .wave-pdf-export-clone .wave-public-flat-notes-below{
  margin-top:14px!important;
  overflow:visible!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
html body .wave-pdf-export-clone .wave-public-flat-notes-below{
  padding-bottom:26mm!important;
}
html body .wave-pdf-export-clone .wave-public-note-text{
  display:block!important;
  min-height:1.8em!important;
  padding-bottom:8px!important;
  overflow:visible!important;
}
html body .wave-pdf-export-clone .wave-pdf-source-footer-hidden{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
}

@media print{
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-sheet-flat,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-sheet-flat,
  html body .wave-public-invoice-flat .wave-public-sheet-flat{
    padding-bottom:40mm!important;
    overflow:visible!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-flat-head,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-flat-head,
  html body .wave-public-invoice-flat .wave-public-flat-head{
    align-items:start!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-flat-brand,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-flat-brand,
  html body .wave-public-invoice-flat .wave-public-flat-brand,
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-flat-titlebox,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-flat-titlebox,
  html body .wave-public-invoice-flat .wave-public-flat-titlebox{
    padding-top:0!important;
    margin-top:0!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer{
    position:fixed!important;
    left:18mm!important;
    right:18mm!important;
    bottom:7mm!important;
    z-index:999999!important;
    display:block!important;
    visibility:visible!important;
    background:#fff!important;
    color:#64748b!important;
    overflow:visible!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer{
    position:relative!important;
    display:block!important;
    visibility:visible!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:7px 0 0!important;
    border-top:1px solid #e2e8f0!important;
    background:#fff!important;
    text-align:center!important;
    overflow:visible!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank{
    display:block!important;
    width:100%!important;
    text-align:center!important;
    font-size:9.5px!important;
    line-height:1.55!important;
    color:#64748b!important;
    white-space:normal!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank strong,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank strong,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank strong{
    color:#334155!important;
    font-weight:700!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    transform:none!important;
    display:flex!important;
    visibility:visible!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:6px auto 0!important;
    padding:6px 0 0!important;
    border-top:1px solid #e2e8f0!important;
    background:#fff!important;
    overflow:visible!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-text,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-text,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-text{
    display:inline-flex!important;
    visibility:visible!important;
    font-size:10px!important;
    font-weight:700!important;
    color:#64748b!important;
    line-height:1!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-logo,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-logo,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-logo{
    display:block!important;
    visibility:visible!important;
    width:100px!important;
    max-width:100px!important;
    height:auto!important;
    max-height:26px!important;
    object-fit:contain!important;
  }
}


/* v2.28.4 — targeted final PDF/print polish
   1) PDF only: bring invoice/business header up to logo line and lower Notes/Terms slightly.
   2) Print only: keep bank footer + Powered by centered and safely inside the bottom of every page. */
html body .wave-pdf-export-clone .wave-public-flat-head{
  align-items:start!important;
  padding-bottom:22px!important;
}
html body .wave-pdf-export-clone .wave-public-flat-titlebox{
  padding-top:0!important;
  margin-top:-42px!important;
  align-self:start!important;
}
html body .wave-pdf-export-clone .wave-public-flat-notes-below{
  margin-top:32px!important;
  padding-bottom:30mm!important;
  overflow:visible!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
@media print{
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer{
    position:fixed!important;
    left:10mm!important;
    right:10mm!important;
    bottom:12mm!important;
    width:auto!important;
    max-width:calc(210mm - 20mm)!important;
    margin:0 auto!important;
    transform:none!important;
    text-align:center!important;
    overflow:visible!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer,
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer{
    width:100%!important;
    max-width:100%!important;
    margin-left:auto!important;
    margin-right:auto!important;
    text-align:center!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    max-width:100%!important;
    text-align:center!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-print-footer{
    padding-top:5px!important;
    margin-top:5px!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-logo,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-logo,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-powered-by-logo{
    width:92px!important;
    max-width:92px!important;
    max-height:24px!important;
  }
}

/* v2.28.5 — targeted polish requested after v2.28.4
   Keep stable v2.27.8/v2.28.x layout intact. Only:
   - move Notes / Terms lower, just above the fixed footer, in print and generated PDF;
   - move the PDF header business info/INVOICE block further up to align with the logo;
   - keep the fixed print footer truly centered on every page. */
html body .wave-pdf-export-clone .wave-public-flat-titlebox{
  padding-top:0!important;
  margin-top:-86px!important;
  align-self:start!important;
}
html body .wave-pdf-export-clone .wave-public-flat-notes-below{
  margin-top:52mm!important;
  padding-bottom:12mm!important;
  overflow:visible!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
@media print{
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-flat-notes-below,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-flat-notes-below,
  html body .wave-public-invoice-flat .wave-public-flat-notes-below{
    margin-top:46mm!important;
    margin-bottom:16mm!important;
    overflow:visible!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer{
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    bottom:10mm!important;
    width:190mm!important;
    max-width:190mm!important;
    margin:0!important;
    transform:translateX(-50%)!important;
    text-align:center!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank,
  html body .wave-public-invoice-flat .wave-public-document-footer .wave-public-flat-footer-bank{
    justify-content:center!important;
    text-align:center!important;
  }
}


/* v2.28.6 — final targeted fix from stable v2.28.5
   - Print: Notes/Terms stays on the same page, just above the fixed footer.
   - PDF: Notes/Terms is anchored above the generated footer without clipping.
   - PDF: business info / INVOICE block is lifted to the logo line. */
html body .wave-pdf-export-clone.wave-public-sheet-flat,
html body .wave-pdf-export-clone .wave-public-sheet-flat{
  position:relative!important;
  box-sizing:border-box!important;
  min-height:1122px!important;
  overflow:visible!important;
}
html body .wave-pdf-export-clone .wave-public-flat-titlebox,
html body .wave-pdf-export-clone.wave-public-sheet-flat .wave-public-flat-titlebox{
  padding-top:0!important;
  margin-top:-124px!important;
  align-self:start!important;
}
html body .wave-pdf-export-clone .wave-public-flat-notes-below,
html body .wave-pdf-export-clone.wave-public-sheet-flat .wave-public-flat-notes-below{
  position:absolute!important;
  left:46px!important;
  right:46px!important;
  bottom:170px!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  max-height:120px!important;
  overflow:visible!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
@media print{
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-sheet-flat,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-sheet-flat,
  html body .wave-public-invoice-flat .wave-public-sheet-flat{
    position:relative!important;
    box-sizing:border-box!important;
    min-height:273mm!important;
    padding-bottom:42mm!important;
    page-break-after:avoid!important;
    break-after:avoid!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-flat-notes-below,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-flat-notes-below,
  html body .wave-public-invoice-flat .wave-public-flat-notes-below{
    position:absolute!important;
    left:10mm!important;
    right:10mm!important;
    bottom:47mm!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    max-height:28mm!important;
    overflow:visible!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  html body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-document-footer,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat .wave-public-document-footer,
  html body .wave-public-invoice-flat .wave-public-document-footer{
    left:50%!important;
    right:auto!important;
    width:190mm!important;
    max-width:190mm!important;
    transform:translateX(-50%)!important;
    bottom:10mm!important;
    margin:0!important;
  }
}


/* v2.29.0 Step 1 — shared invoice document template foundation
   This is intentionally scoped to invoice documents only (.ca-doc-v2290) so it does not
   change estimates/bills while we stabilize the shared header/footer system. */
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet{
  position:relative!important;
  box-sizing:border-box!important;
  width:794px!important;
  max-width:794px!important;
  min-height:1123px!important;
  margin:0 auto!important;
  padding:48px 46px 156px!important;
  background:#fff!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
  color:#0f172a!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 295px!important;
  gap:26px!important;
  align-items:start!important;
  margin:0 0 30px!important;
  padding:0 0 26px!important;
  border-bottom:1px solid #e2e8f0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-brand,
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-titlebox,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-brand,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-titlebox{
  align-self:start!important;
  padding-top:0!important;
  margin-top:0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-logo{
  display:block!important;
  width:auto!important;
  max-width:170px!important;
  max-height:70px!important;
  object-fit:contain!important;
  margin:0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-kicker,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-kicker{
  margin:0 0 8px!important;
  padding:0!important;
  line-height:1!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-titlebox,
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-titlebox,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-business-lines{
  text-align:right!important;
  justify-items:end!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-notes-below,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-notes-below{
  position:absolute!important;
  left:46px!important;
  right:46px!important;
  bottom:148px!important;
  width:auto!important;
  max-height:92px!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-note-text,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-note-text{
  display:block!important;
  overflow:visible!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-document-footer{
  position:absolute!important;
  left:46px!important;
  right:46px!important;
  bottom:36px!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  text-align:center!important;
  background:#fff!important;
  color:#64748b!important;
  overflow:visible!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-flat-footer,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-document-footer .wave-public-flat-footer{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:9px 0 0!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
  text-align:center!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-flat-footer-bank,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-document-footer .wave-public-flat-footer-bank{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  width:100%!important;
  text-align:center!important;
  font-size:10px!important;
  line-height:1.55!important;
  color:#64748b!important;
  white-space:normal!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-print-footer,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-document-footer .wave-public-print-footer{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  width:100%!important;
  max-width:100%!important;
  margin:7px auto 0!important;
  padding:7px 0 0!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
  text-align:center!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-text,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-powered-by-text{
  display:inline-flex!important;
  align-items:center!important;
  font-size:10px!important;
  font-weight:700!important;
  color:#64748b!important;
  line-height:1!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-logo,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-powered-by-logo{
  display:block!important;
  width:96px!important;
  max-width:96px!important;
  height:auto!important;
  max-height:25px!important;
  object-fit:contain!important;
}
@media print{
  @page{size:A4 portrait;margin:0;}
  html,body{width:210mm!important;min-height:297mm!important;background:#fff!important;}
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290,
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet{
    width:210mm!important;
    max-width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    margin:0 auto!important;
    box-shadow:none!important;
    border:0!important;
    border-radius:0!important;
    overflow:hidden!important;
    page-break-after:avoid!important;
    break-after:avoid!important;
  }
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet{
    padding:12mm 12mm 44mm!important;
  }
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head{
    grid-template-columns:minmax(0,1fr) 78mm!important;
    gap:10mm!important;
    margin:0 0 10mm!important;
    padding:0 0 8mm!important;
  }
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo{
    max-width:52mm!important;
    max-height:20mm!important;
  }
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-notes-below{
    position:absolute!important;
    left:12mm!important;
    right:12mm!important;
    bottom:42mm!important;
    max-height:25mm!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer{
    position:fixed!important;
    left:12mm!important;
    right:12mm!important;
    bottom:8mm!important;
    width:auto!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    text-align:center!important;
  }
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-flat-footer,
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-print-footer{
    margin-left:auto!important;
    margin-right:auto!important;
    text-align:center!important;
  }
}


/* v2.29.1 — remove the duplicate upper horizontal divider in the shared invoice template.
   Keep the header bottom divider only; do not change spacing/footer behavior. */
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-meta-row{
  border-top:0!important;
}
@media print{
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row{
    border-top:0!important;
  }
}


/* v2.29.2 — keep Download PDF on the same shared desktop/A4 invoice template.
   The html2canvas iframe can trigger <=900px responsive rules at A4 pixel width;
   these scoped overrides force the v2.29 document sheet back to the same layout
   used by View Invoice and Print Invoice without affecting portal/mobile screens. */
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 78mm!important;
  gap:10mm!important;
  align-items:start!important;
  margin:0 0 10mm!important;
  padding:0 0 8mm!important;
  border-bottom:1px solid #e2e8f0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-titlebox,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-titlebox{
  text-align:right!important;
  align-self:start!important;
  margin-top:0!important;
  padding-top:0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-business-lines{
  text-align:right!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-meta-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 320px!important;
  gap:24px!important;
  padding:24px 0 20px!important;
  border-top:0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-meta-box{
  text-align:left!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box > div,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-meta-box > div{
  display:grid!important;
  grid-template-columns:1fr auto!important;
  gap:14px!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-items-head,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 90px 130px 130px!important;
  gap:16px!important;
  align-items:start!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-items-head{
  padding:10px 0 10px!important;
  border-bottom:1px solid #e2e8f0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row{
  padding:13px 0!important;
  border-bottom:1px solid #f1f5f9!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row > div{
  width:auto!important;
  min-width:0!important;
  text-align:left!important;
  margin-right:0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head > div:nth-child(n+2),
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(n+2),
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-items-head > div:nth-child(n+2),
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row > div:nth-child(n+2){
  text-align:right!important;
  justify-self:end!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(2)::before,
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(3)::before,
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(4)::before,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row > div:nth-child(2)::before,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row > div:nth-child(3)::before,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-item-row > div:nth-child(4)::before{
  content:none!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-bottom,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-bottom{
  display:block!important;
  grid-template-columns:none!important;
  gap:0!important;
  padding-top:8px!important;
  margin-top:6px!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-totals{
  width:auto!important;
  max-width:96mm!important;
  margin-left:auto!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-footer-bank{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px 12px!important;
  text-align:center!important;
}

/* v2.30.0 Step 2 — Estimates now use the same shared A4 document template foundation.
   The estimate markup carries the same ca-doc-v2290 / ca-doc-v2290-sheet classes as invoices,
   so view, print, and Download PDF remain on one consistent header/body/footer system. */
html body .wave-public-invoice-flat.ca-doc-v2290-estimate .wave-public-flat-meta-row,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-meta-row{
  border-top:0!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290-estimate .wave-public-document-footer{
  text-align:center!important;
}
@media print{
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290-estimate .wave-public-document-footer{
    text-align:center!important;
  }
}


/* v2.30.1 — Step 2 Estimates shared template polish.
   Scope only to estimates so the stabilized invoice template remains untouched.
   Fixes: View Estimate visible sheet/card boundary, Print Estimate stays on one A4 page. */
@media screen{
  html body .wave-main.wave-portal-page > .wave-public-invoice-flat.ca-doc-v2290-estimate{
    display:block!important;
    width:fit-content!important;
    max-width:calc(100vw - 48px)!important;
    margin:26px auto 0!important;
    padding:18px!important;
    background:#f8fafc!important;
    border:1px solid #e2e8f0!important;
    border-radius:20px!important;
    box-shadow:0 18px 45px rgba(15,23,42,.08)!important;
    box-sizing:border-box!important;
  }
  html body .wave-main.wave-portal-page > .wave-public-invoice-flat.ca-doc-v2290-estimate .wave-public-sheet-flat.ca-doc-v2290-sheet{
    border:1px solid #dbe5ef!important;
    box-shadow:0 10px 30px rgba(15,23,42,.10)!important;
    border-radius:0!important;
    background:#fff!important;
  }
}

@media print{
  @page{size:A4 portrait;margin:0;}
  html:has(.wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print),
  body:has(.wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print){
    width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    max-height:297mm!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    background:#fff!important;
  }
  html body .wave-main.wave-portal-page:has(.wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print){
    display:block!important;
    width:210mm!important;
    max-width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    max-height:297mm!important;
    margin:0 auto!important;
    padding:0!important;
    overflow:hidden!important;
    background:#fff!important;
    box-sizing:border-box!important;
    page-break-after:avoid!important;
    break-after:avoid!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print{
    display:block!important;
    width:210mm!important;
    max-width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    max-height:297mm!important;
    margin:0 auto!important;
    padding:0!important;
    overflow:hidden!important;
    background:#fff!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    box-sizing:border-box!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-sheet-flat.ca-doc-v2290-sheet{
    position:relative!important;
    display:block!important;
    width:210mm!important;
    max-width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    max-height:297mm!important;
    margin:0 auto!important;
    padding:12mm 12mm 44mm!important;
    overflow:hidden!important;
    background:#fff!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    box-sizing:border-box!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
    break-inside:avoid!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-head{
    grid-template-columns:minmax(0,1fr) 78mm!important;
    gap:10mm!important;
    margin:0 0 10mm!important;
    padding:0 0 8mm!important;
    border-bottom:1px solid #e2e8f0!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-logo{
    max-width:52mm!important;
    max-height:20mm!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-meta-row{
    padding:10mm 0 7mm!important;
    border-top:0!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-items{
    margin-top:0!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-items-head{
    padding:3mm 0 3mm!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-item-row{
    padding:4mm 0!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-bottom{
    margin-top:2mm!important;
    padding-top:0!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-flat-notes-below{
    position:absolute!important;
    left:12mm!important;
    right:12mm!important;
    bottom:42mm!important;
    width:auto!important;
    max-height:24mm!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-estimate.estimate-print .wave-public-document-footer{
    position:absolute!important;
    left:12mm!important;
    right:12mm!important;
    bottom:8mm!important;
    width:auto!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    text-align:center!important;
    background:#fff!important;
    overflow:visible!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
}


/* v2.30.2 — Step 2 Estimate view polish.
   Remove only the extra outer wrapper frame/shadow added around the shared estimate sheet.
   Keep the actual white document sheet styling intact. */
@media screen{
  html body .wave-main.wave-portal-page > .wave-public-invoice-flat.ca-doc-v2290-estimate{
    padding:0!important;
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
}


/* v2.30.3 — Stable rollback foundation.
   Base: v2.30.2. Keeps Invoices/Estimates on shared template.
   Statements and Receipts remain on their previous designs. */


/* v2.30.4 — View Invoice background polish.
   Keep the stable shared document template unchanged, but remove the light grey
   application background around the invoice preview on logged-in invoice/public views.
   Dark mode remains untouched. */
@media screen{
  body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]),
  body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]) .wave-public-view-shell.wave-portal-shell,
  body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]) .wave-public-view-shell.wave-wave-shell,
  body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]) .wave-public-view-layout,
  body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]) .wave-public-view-main,
  body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]) .wave-public-view-topbar{
    background:#ffffff!important;
  }
}


/* v2.30.5 — View Invoice sheet frame polish.
   Keep the v2.30.4 white page background, but restore the same subtle document
   border/shadow used by View Estimate. Screen-only; print and PDF output are untouched. */
@media screen{
  html body.wave-public-body.wave-public-view-with-sidebar:not(.ca-dark-page):not([data-theme="dark"]) .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-doc-v2290-sheet{
    border:1px solid #dbe5ef!important;
    box-shadow:0 10px 30px rgba(15,23,42,.10)!important;
    background:#fff!important;
  }
}


/* v2.30.20 — Public actions cleanup.
   Scope: invoice/estimate public document action bars only.
   Keeps Statements and Receipts untouched. Does not change document sheet/print/PDF spacing. */
@media screen{
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print,
  html body .ca-public-document-actions.no-print,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex-wrap:wrap!important;
    gap:10px!important;
    max-width:960px!important;
    margin:28px auto 12px!important;
    padding:0 18px!important;
    box-sizing:border-box!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  html body .ca-public-document-actions.no-print .wave-public-toolbtn,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print .wave-public-toolbtn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:40px!important;
    padding:10px 16px!important;
    border-radius:10px!important;
    border:1px solid #dce6f2!important;
    background:#ffffff!important;
    color:#12213f!important;
    text-decoration:none!important;
    font:600 14px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;
    box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
    cursor:pointer!important;
    white-space:nowrap!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn:hover,
  html body .ca-public-document-actions.no-print .wave-public-toolbtn:hover,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print .wave-public-toolbtn:hover{
    border-color:#bcd0e8!important;
    background:#f8fbff!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn-primary,
  html body .ca-public-document-actions.no-print .wave-public-toolbtn-primary,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print .wave-public-toolbtn-primary{
    border-color:#16a7e9!important;
    background:#16a7e9!important;
    color:#ffffff!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn-primary:hover,
  html body .ca-public-document-actions.no-print .wave-public-toolbtn-primary:hover,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print .wave-public-toolbtn-primary:hover{
    border-color:#1198d8!important;
    background:#1198d8!important;
    color:#ffffff!important;
  }
}
@media (max-width:640px){
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print,
  html body .ca-public-document-actions.no-print,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print{
    justify-content:stretch!important;
    margin:16px auto 10px!important;
    padding:0 14px!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  html body .ca-public-document-actions.no-print .wave-public-toolbtn,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print .wave-public-toolbtn{
    flex:1 1 100%!important;
    width:100%!important;
  }
}
@media print{
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print,
  html body .ca-public-document-actions.no-print,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print{
    display:none!important;
  }
}


/* v2.30.22 — View Invoice / View Estimate mobile + dark view polish.
   Scope: shared invoice/estimate document views only (private + public).
   Print/PDF rules are intentionally untouched because these rules are screen-only. */
@media screen {
  html body .wave-public-body,
  html body.wave-public-body {
    overflow-x: hidden !important;
  }

  html body .wave-main.wave-portal-page > .wave-public-invoice-flat.ca-doc-v2290,
  html body .wave-public-view-main .wave-public-invoice-flat.ca-doc-v2290,
  html body.wave-public-body .wave-public-invoice-flat.ca-doc-v2290 {
    width: 100% !important;
    max-width: 1040px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print,
  html body .ca-public-document-actions.no-print,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print {
    width: 100% !important;
    max-width: 1040px !important;
    margin: 18px auto 14px !important;
    padding-left: 0 !important;
    padding-right: 2mm !important;
  }

  html body .wave-public-toolbar-form,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print form {
    margin: 0 !important;
    display: inline-flex !important;
    min-width: 0 !important;
  }

  html body .wave-payment-manage-card.no-print {
    width: 100% !important;
    max-width: 1040px !important;
    margin: 0 auto 14px !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-flat-head,
  html body .wave-public-flat-meta-row,
  html body .wave-public-flat-items,
  html body .wave-public-flat-bottom,
  html body .wave-public-flat-notes-below,
  html body .wave-public-document-footer {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-flat-business-lines,
  html body .wave-public-flat-billto,
  html body .wave-public-flat-meta-box,
  html body .wave-public-note-text,
  html body .wave-public-flat-footer-note {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body .wave-public-logo-wrap,
  html body .wave-public-logo {
    max-width: 100% !important;
  }
}

@media screen and (max-width: 1024px) {
  html body.wave-public-body .wave-main.wave-portal-page,
  html body .wave-public-view-main {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row {
    grid-template-columns: minmax(0,1fr) minmax(260px, 340px) !important;
    gap: 18px !important;
  }
}

@media screen and (max-width: 760px) {
  html body.wave-public-body,
  html body.wave-estimate-public-body,
  html body .wave-public-view-main,
  html body .wave-main.wave-portal-page {
    padding-left: 0 !important;
    padding-right: 2mm !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 10px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print,
  html body .ca-public-document-actions.no-print,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 10px !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print form,
  html body .wave-public-toolbar-form,
  html body .ca-public-document-actions.no-print form {
    display: block !important;
    width: 100% !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  html body .ca-public-document-actions.no-print .wave-public-toolbtn,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print .wave-public-toolbtn {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  html body .wave-payment-manage-card.no-print {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: auto !important;
    margin: 0 10px 10px !important;
    padding: 14px !important;
    border-radius: 14px !important;
  }

  html body .wave-payment-manage-card.no-print .wave-btn,
  html body .wave-payment-manage-card.no-print .wave-payment-history-actions {
    width: 100% !important;
    justify-content: center !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px 14px 18px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding-bottom: 18px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-titlebox,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-titlebox[style],
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines[style] {
    text-align: left !important;
    justify-items: start !important;
    justify-self: stretch !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-brand {
    min-height: 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo {
    max-width: 210px !important;
    max-height: 72px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo-text {
    font-size: 22px !important;
    line-height: 1.15 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-kicker {
    font-size: 24px !important;
    line-height: 1.1 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box > div,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals > div,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line {
    grid-template-columns: minmax(0,1fr) auto !important;
    gap: 10px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head {
    display: none !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid var(--ds-border) !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div {
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
    justify-self: stretch !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(n+2) {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 12px !important;
    align-items: center !important;
    color: var(--ds-text) !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(2)::before { content: "Quantity" !important; }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(3)::before { content: "Price" !important; }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(4)::before { content: "Amount" !important; }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row > div:nth-child(n+2)::before {
    display: block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .05em !important;
    text-transform: uppercase !important;
    color: var(--ds-text-3) !important;
    text-align: left !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank {
    display: block !important;
    text-align: left !important;
    line-height: 1.65 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-footer-sep {
    display: none !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer {
    margin-top: 16px !important;
    padding-top: 10px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-logo {
    width: 130px !important;
  }
}

@media screen and (max-width: 420px) {
  html body .wave-public-invoice-flat.ca-doc-v2290 {
    padding: 0 8px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet {
    padding: 18px 12px 16px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box > div,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals > div,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line {
    grid-template-columns: 1fr !important;
    gap: 3px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box strong,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals strong,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line strong {
    text-align: left !important;
  }
}

@media screen {
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 {
    --ds-text: #f8fafc;
    --ds-text-2: #dbeafe;
    --ds-text-3: #9fb4cf;
    --ds-border: rgba(148,163,184,.24);
    --ds-border-2: rgba(148,163,184,.36);
  }

  body.ca-dark-page.wave-public-body,
  body[data-theme="dark"].wave-public-body,
  html[data-ca-theme="dark"] body.wave-public-body,
  body.ca-dark-page.wave-estimate-public-body,
  body[data-theme="dark"].wave-estimate-public-body,
  html[data-ca-theme="dark"] body.wave-estimate-public-body {
    background: #07101f !important;
    color: #f8fafc !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet {
    background: #0f1b2d !important;
    border-color: rgba(148,163,184,.24) !important;
    box-shadow: 0 18px 48px rgba(0,0,0,.45) !important;
    color: #f8fafc !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due {
    background: rgba(56,189,248,.10) !important;
    border: 1px solid rgba(56,189,248,.20) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row {
    border-bottom-color: rgba(148,163,184,.18) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head {
    border-bottom-color: rgba(148,163,184,.30) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer {
    background: transparent !important;
    border-top-color: rgba(148,163,184,.24) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-text,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-text,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-text,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-powered-by-text {
    color: #93c5fd !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  .wave-portal-shell[data-theme="dark"] .ca-public-document-actions.no-print .wave-public-toolbtn,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  body.ca-dark-page .ca-public-document-actions.no-print .wave-public-toolbtn,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  body[data-theme="dark"] .ca-public-document-actions.no-print .wave-public-toolbtn,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn,
  html[data-ca-theme="dark"] body .ca-public-document-actions.no-print .wave-public-toolbtn {
    background: #132238 !important;
    border-color: rgba(148,163,184,.28) !important;
    color: #eaf2ff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.30) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn:hover,
  .wave-portal-shell[data-theme="dark"] .ca-public-document-actions.no-print .wave-public-toolbtn:hover,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn:hover,
  body.ca-dark-page .ca-public-document-actions.no-print .wave-public-toolbtn:hover,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn:hover,
  body[data-theme="dark"] .ca-public-document-actions.no-print .wave-public-toolbtn:hover,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn:hover,
  html[data-ca-theme="dark"] body .ca-public-document-actions.no-print .wave-public-toolbtn:hover {
    background: #1d3150 !important;
    border-color: rgba(125,211,252,.42) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn-primary,
  .wave-portal-shell[data-theme="dark"] .ca-public-document-actions.no-print .wave-public-toolbtn-primary,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn-primary,
  body.ca-dark-page .ca-public-document-actions.no-print .wave-public-toolbtn-primary,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn-primary,
  body[data-theme="dark"] .ca-public-document-actions.no-print .wave-public-toolbtn-primary,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print .wave-public-toolbtn-primary,
  html[data-ca-theme="dark"] body .ca-public-document-actions.no-print .wave-public-toolbtn-primary {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-payment-manage-card.no-print,
  body.ca-dark-page .wave-payment-manage-card.no-print,
  body[data-theme="dark"] .wave-payment-manage-card.no-print,
  html[data-ca-theme="dark"] body .wave-payment-manage-card.no-print {
    background: #0f1b2d !important;
    border-color: rgba(148,163,184,.24) !important;
    color: #eaf2ff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-payment-manage-card.no-print div[style],
  .wave-portal-shell[data-theme="dark"] .wave-payment-manage-card.no-print strong[style],
  body.ca-dark-page .wave-payment-manage-card.no-print div[style],
  body.ca-dark-page .wave-payment-manage-card.no-print strong[style],
  body[data-theme="dark"] .wave-payment-manage-card.no-print div[style],
  body[data-theme="dark"] .wave-payment-manage-card.no-print strong[style],
  html[data-ca-theme="dark"] body .wave-payment-manage-card.no-print div[style],
  html[data-ca-theme="dark"] body .wave-payment-manage-card.no-print strong[style] {
    color: #f8fafc !important;
  }

  body.ca-dark-page .ca-public-estimate-actions.no-print .wave-public-toolbtn,
  body[data-theme="dark"] .ca-public-estimate-actions.no-print .wave-public-toolbtn,
  html[data-ca-theme="dark"] body .ca-public-estimate-actions.no-print .wave-public-toolbtn {
    background: #132238 !important;
    border-color: rgba(148,163,184,.28) !important;
    color: #eaf2ff !important;
  }

  body.ca-dark-page .ca-public-estimate-actions.no-print .wave-public-toolbtn-primary,
  body[data-theme="dark"] .ca-public-estimate-actions.no-print .wave-public-toolbtn-primary,
  html[data-ca-theme="dark"] body .ca-public-estimate-actions.no-print .wave-public-toolbtn-primary {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
    color: #fff !important;
  }
}


/* v2.30.23 — Mobile document footer flow fix.
   Fixes View Invoice / View Estimate on private + public mobile screens where
   Notes/Terms + bank footer could overlap totals because the A4 footer was
   absolutely positioned for the desktop/print document template. Screen-only;
   print/PDF rules remain untouched. */
@media screen and (max-width: 760px) {
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 18px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-notes-below {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 18px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 0 !important;
    padding: 0 !important;
    transform: none !important;
    text-align: center !important;
    background: transparent !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-flat-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 0 0 !important;
    border-top: 1px solid var(--ds-border, #e2e8f0) !important;
    background: transparent !important;
    text-align: center !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
    color: var(--ds-text-3, #64748b) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank strong {
    color: var(--ds-text-2, #334155) !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank .wave-footer-sep {
    display: block !important;
    visibility: hidden !important;
    width: 100% !important;
    height: 4px !important;
    min-height: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer .wave-public-print-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px auto 0 !important;
    padding: 10px 0 0 !important;
    border-top: 1px solid var(--ds-border, #e2e8f0) !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals > div,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: start !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals span,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line span {
    min-width: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals strong,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line strong {
    justify-self: end !important;
    text-align: right !important;
    white-space: nowrap !important;
  }
}

@media screen and (max-width: 420px) {
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals > div,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-payment-line {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }
}

/* v2.30.32 — Stable Cleanup: single screen-only document dark-mode layer.
   Keeps v2.30.22 mobile layout + v2.30.23 mobile footer flow intact.
   This replaces the stacked v2.30.24–v2.30.31 estimate dark-mode patches.
   Print/PDF rules are intentionally untouched. */
@media screen {
  body.wave-public-body.wave-public-view-with-sidebar.ca-dark-page,
  body.wave-public-body.wave-public-view-with-sidebar[data-theme="dark"],
  body.ca-dark-page.wave-public-view-with-sidebar,
  body[data-theme="dark"].wave-public-view-with-sidebar,
  .wave-portal-shell[data-theme="dark"] .wave-public-view-layout,
  .wave-portal-shell[data-theme="dark"] .wave-public-view-main,
  .wave-portal-shell[data-theme="dark"] .wave-main.wave-portal-page,
  html.ca-estimate-dark-active body .wave-main.wave-portal-page {
    background: #07101f !important;
    background-color: #07101f !important;
    color: #eaf2ff !important;
  }

  body.wave-public-body.wave-public-view-with-sidebar.ca-dark-page .wave-public-view-shell.wave-portal-shell,
  body.wave-public-body.wave-public-view-with-sidebar[data-theme="dark"] .wave-public-view-shell.wave-portal-shell,
  body.wave-public-body.wave-public-view-with-sidebar.ca-dark-page .wave-public-view-layout,
  body.wave-public-body.wave-public-view-with-sidebar[data-theme="dark"] .wave-public-view-layout,
  body.wave-public-body.wave-public-view-with-sidebar.ca-dark-page .wave-public-view-main,
  body.wave-public-body.wave-public-view-with-sidebar[data-theme="dark"] .wave-public-view-main,
  body.wave-public-body.wave-public-view-with-sidebar.ca-dark-page .wave-public-view-topbar,
  body.wave-public-body.wave-public-view-with-sidebar[data-theme="dark"] .wave-public-view-topbar,
  .wave-portal-shell[data-theme="dark"] .wave-public-view-topbar {
    background: #07101f !important;
    background-color: #07101f !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate,
  html.ca-estimate-dark-active body .wave-main.wave-portal-page > .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #eaf2ff !important;
    --ds-text: #f8fafc !important;
    --ds-text-2: #dbeafe !important;
    --ds-text-3: #9fb4cf !important;
    --ds-border: rgba(148,163,184,.24) !important;
    --ds-border-2: rgba(148,163,184,.36) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  html[data-ca-theme="dark"] body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-sheet-flat.ca-doc-v2290-sheet,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-sheet-flat,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-sheet-flat.ca-doc-v2290-sheet,
  html.ca-estimate-dark-active body .wave-main.wave-portal-page > .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-sheet-flat.ca-doc-v2290-sheet {
    background: #0f1b2d !important;
    background-color: #0f1b2d !important;
    color: #eaf2ff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-total,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-head,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-row,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-total,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-head,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-meta-row,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-items-head,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-item-row,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-total,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-totals {
    border-color: rgba(148,163,184,.24) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-kicker,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 strong,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-total span,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-total strong,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-kicker,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 strong,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-total span,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-total strong,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-kicker,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active strong,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-total span,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-total strong {
    color: #ffffff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-label,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-vat,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines span,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-billto-line,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-billto span,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box span,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head div,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row div,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-item-description,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-note-text,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-label,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-vat,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-business-lines span,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-billto-line,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-billto span,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-meta-box span,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-items-head div,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-item-row div,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-item-description,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-note-text,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-label,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-vat,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-business-lines,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-business-lines span,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-billto-line,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-billto span,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-meta-box span,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-items-head div,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-item-row div,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-item-description,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-note-text {
    color: #cbd5e1 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-due {
    background: rgba(56,189,248,.10) !important;
    background-color: rgba(56,189,248,.10) !important;
    border: 1px solid rgba(56,189,248,.25) !important;
    color: #eaf2ff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank,
  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-document-footer,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-print-footer,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-document-footer,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-footer,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-footer-bank,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-print-footer {
    background: #0f1b2d !important;
    background-color: #0f1b2d !important;
    border: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    color: #cbd5e1 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank strong,
  body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-footer-bank strong,
  html.ca-estimate-dark-active body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-estimate.ca-estimate-dark-active .wave-public-flat-footer-bank strong {
    color: #f8fafc !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-toolbar,
  body.ca-dark-page .wave-public-toolbar,
  body[data-theme="dark"] .wave-public-toolbar,
  .wave-portal-shell[data-theme="dark"] .ca-public-estimate-actions.no-print,
  body.ca-dark-page .ca-public-estimate-actions.no-print,
  body[data-theme="dark"] .ca-public-estimate-actions.no-print {
    background: #07101f !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-toolbtn,
  body.ca-dark-page .wave-public-toolbtn,
  body[data-theme="dark"] .wave-public-toolbtn,
  .wave-portal-shell[data-theme="dark"] .ca-public-estimate-actions.no-print .wave-public-toolbtn,
  body.ca-dark-page .ca-public-estimate-actions.no-print .wave-public-toolbtn,
  body[data-theme="dark"] .ca-public-estimate-actions.no-print .wave-public-toolbtn {
    background: #0f1b2d !important;
    border-color: rgba(148,163,184,.28) !important;
    color: #eaf2ff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-public-toolbtn-primary,
  .wave-portal-shell[data-theme="dark"] .wave-public-toolbtn-send,
  body.ca-dark-page .wave-public-toolbtn-primary,
  body.ca-dark-page .wave-public-toolbtn-send,
  body[data-theme="dark"] .wave-public-toolbtn-primary,
  body[data-theme="dark"] .wave-public-toolbtn-send {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-payment-manage-card.no-print,
  body.ca-dark-page .wave-payment-manage-card.no-print,
  body[data-theme="dark"] .wave-payment-manage-card.no-print {
    background: #0f1b2d !important;
    border-color: rgba(148,163,184,.24) !important;
    color: #eaf2ff !important;
    box-shadow: none !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-payment-manage-card.no-print div[style],
  .wave-portal-shell[data-theme="dark"] .wave-payment-manage-card.no-print strong[style],
  body.ca-dark-page .wave-payment-manage-card.no-print div[style],
  body.ca-dark-page .wave-payment-manage-card.no-print strong[style],
  body[data-theme="dark"] .wave-payment-manage-card.no-print div[style],
  body[data-theme="dark"] .wave-payment-manage-card.no-print strong[style] {
    color: #f8fafc !important;
  }
}

/* v2.30.37 — Invoicing account dropdown dark-mode cleanup
   This is scoped to the Invoicing portal account/business menu only.
   Core remains the theme source; this CSS only fixes leftover light surfaces. */
@media screen {
  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown,
  body.ca-dark-page .wave-account-dropdown,
  body[data-theme="dark"] .wave-account-dropdown,
  html[data-ca-theme="dark"] body .wave-account-dropdown,
  html.ca-theme-dark body .wave-account-dropdown {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border-color: rgba(148,163,184,.24) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,.45) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown-head,
  body.ca-dark-page .wave-account-dropdown-head,
  body[data-theme="dark"] .wave-account-dropdown-head,
  html[data-ca-theme="dark"] body .wave-account-dropdown-head,
  html.ca-theme-dark body .wave-account-dropdown-head {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border-bottom-color: rgba(148,163,184,.24) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown-head strong,
  body.ca-dark-page .wave-account-dropdown-head strong,
  body[data-theme="dark"] .wave-account-dropdown-head strong,
  html[data-ca-theme="dark"] body .wave-account-dropdown-head strong,
  html.ca-theme-dark body .wave-account-dropdown-head strong {
    color: #f8fafc !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown-head span,
  body.ca-dark-page .wave-account-dropdown-head span,
  body[data-theme="dark"] .wave-account-dropdown-head span,
  html[data-ca-theme="dark"] body .wave-account-dropdown-head span,
  html.ca-theme-dark body .wave-account-dropdown-head span {
    color: #94a3b8 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown a,
  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown button,
  body.ca-dark-page .wave-account-dropdown a,
  body.ca-dark-page .wave-account-dropdown button,
  body[data-theme="dark"] .wave-account-dropdown a,
  body[data-theme="dark"] .wave-account-dropdown button,
  html[data-ca-theme="dark"] body .wave-account-dropdown a,
  html[data-ca-theme="dark"] body .wave-account-dropdown button,
  html.ca-theme-dark body .wave-account-dropdown a,
  html.ca-theme-dark body .wave-account-dropdown button {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border-bottom-color: rgba(148,163,184,.24) !important;
    color: #e2e8f0 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown a:hover,
  .wave-portal-shell[data-theme="dark"] .wave-account-dropdown button:hover,
  body.ca-dark-page .wave-account-dropdown a:hover,
  body.ca-dark-page .wave-account-dropdown button:hover,
  body[data-theme="dark"] .wave-account-dropdown a:hover,
  body[data-theme="dark"] .wave-account-dropdown button:hover,
  html[data-ca-theme="dark"] body .wave-account-dropdown a:hover,
  html[data-ca-theme="dark"] body .wave-account-dropdown button:hover,
  html.ca-theme-dark body .wave-account-dropdown a:hover,
  html.ca-theme-dark body .wave-account-dropdown button:hover {
    background: #172338 !important;
    background-color: #172338 !important;
    color: #ffffff !important;
  }
}


/* v2.30.38 — Mobile dark-mode topbar/account strip cleanup
   Fixes the remaining white strip around the mobile theme button and
   business/account selector inside the Invoicing portal only. */
@media (max-width: 900px) {
  .wave-portal-shell[data-theme="dark"] .wave-portal-content,
  .wave-portal-shell[data-theme="dark"] .wave-main,
  .wave-portal-shell[data-theme="dark"] .wave-portal-topbar,
  body.ca-dark-page .wave-portal-content,
  body.ca-dark-page .wave-main,
  body.ca-dark-page .wave-portal-topbar,
  body[data-theme="dark"] .wave-portal-content,
  body[data-theme="dark"] .wave-main,
  body[data-theme="dark"] .wave-portal-topbar,
  html[data-ca-theme="dark"] body .wave-portal-content,
  html[data-ca-theme="dark"] body .wave-main,
  html[data-ca-theme="dark"] body .wave-portal-topbar,
  html.ca-theme-dark body .wave-portal-content,
  html.ca-theme-dark body .wave-main,
  html.ca-theme-dark body .wave-portal-topbar {
    background: #07101f !important;
    background-color: #07101f !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-portal-topbar,
  body.ca-dark-page .wave-portal-topbar,
  body[data-theme="dark"] .wave-portal-topbar,
  html[data-ca-theme="dark"] body .wave-portal-topbar,
  html.ca-theme-dark body .wave-portal-topbar {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-account-menu,
  body.ca-dark-page .wave-account-menu,
  body[data-theme="dark"] .wave-account-menu,
  html[data-ca-theme="dark"] body .wave-account-menu,
  html.ca-theme-dark body .wave-account-menu {
    background: transparent !important;
    background-color: transparent !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-mobile-topbar,
  body.ca-dark-page .wave-mobile-topbar,
  body[data-theme="dark"] .wave-mobile-topbar,
  html[data-ca-theme="dark"] body .wave-mobile-topbar,
  html.ca-theme-dark body .wave-mobile-topbar {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border-bottom-color: rgba(148,163,184,.18) !important;
  }

  .wave-portal-shell[data-theme="dark"] .wave-hamburger span,
  body.ca-dark-page .wave-hamburger span,
  body[data-theme="dark"] .wave-hamburger span,
  html[data-ca-theme="dark"] body .wave-hamburger span,
  html.ca-theme-dark body .wave-hamburger span {
    background: #94a3b8 !important;
  }
}


/* v2.31.12 recurring actions hardening asset */
.ca-rec-row-actions a.ca-mini-btn,
.ca-rec-row-actions button.ca-mini-btn,
.ca-rec-row-actions form,
.ca-rec-row-actions form button{cursor:pointer!important;}
.ca-rec-editor .ca-product-picker.is-open{z-index:2147483600!important;}
.ca-rec-editor .ca-product-dropdown{position:fixed!important;z-index:2147483647!important;max-height:320px!important;overflow:auto!important;}


/* v2.31.16 recurring editor activate + product dropdown hardening */
.ca-rec-actions .ca-rec-activate-submit{cursor:pointer!important;border-color:#0ea5e9!important;color:#0ea5e9!important;background:#eff6ff!important}
.ca-rec-actions .ca-rec-activate-submit:hover{background:#dff3ff!important}
.ca-rec-editor .ca-product-picker{position:relative!important;z-index:20!important}
.ca-rec-editor .ca-product-picker.is-open{z-index:2147483640!important}
.ca-rec-editor .ca-product-dropdown{display:none;position:fixed!important;z-index:2147483647!important;max-height:340px!important;overflow:auto!important;background:#fff!important;border:1px solid #cfe0ef!important;border-radius:12px!important;box-shadow:0 18px 40px rgba(15,23,42,.22)!important;padding:6px!important;min-width:260px!important;color:#0f172a!important}
.ca-rec-editor .ca-product-picker.is-open .ca-product-dropdown{display:block!important}
.ca-rec-editor .ca-product-option{display:block!important;padding:10px 12px!important;border-radius:10px!important;cursor:pointer!important;background:#fff!important;color:#0f172a!important}
.ca-rec-editor .ca-product-option:hover{background:#e8f4ff!important}
.ca-rec-editor .ca-product-option strong{display:block!important;font-size:13px!important;font-weight:900!important;color:#0f172a!important}
.ca-rec-editor .ca-product-option small{display:block!important;font-size:12px!important;color:#64748b!important;margin-top:3px!important}
body.ca-theme-dark .ca-rec-editor .ca-product-dropdown,.ca-theme-dark .ca-rec-editor .ca-product-dropdown{background:#0f172a!important;border-color:#334155!important;color:#e5edf7!important}
body.ca-theme-dark .ca-rec-editor .ca-product-option,.ca-theme-dark .ca-rec-editor .ca-product-option{background:#0f172a!important;color:#e5edf7!important}
body.ca-theme-dark .ca-rec-editor .ca-product-option:hover,.ca-theme-dark .ca-rec-editor .ca-product-option:hover{background:#1e293b!important}
body.ca-theme-dark .ca-rec-editor .ca-product-option strong,.ca-theme-dark .ca-rec-editor .ca-product-option strong{color:#f8fafc!important}

/* v2.31.16: smaller recurring saved product dropdown text */
.ca-product-dropdown-portal .ca-product-option{padding:8px 11px!important;line-height:1.25!important;}
.ca-product-dropdown-portal .ca-product-option strong{font-size:14px!important;line-height:1.25!important;font-weight:850!important;}
.ca-product-dropdown-portal .ca-product-option small{font-size:13px!important;line-height:1.35!important;}

/* v2.31.18 recurring UI compact typography */
.ca-rec-editor .ca-rec-step-head h2,
.ca-rec-editor .ca-rec-panel > h2{
  font-size:20px!important;
  line-height:1.25!important;
  font-weight:800!important;
  margin:0 0 8px!important;
}
.ca-rec-editor .ca-rec-step-head p,
.ca-rec-editor .ca-rec-card p,
.ca-rec-editor .ca-rec-panel p{
  font-size:13px!important;
  line-height:1.35!important;
}
.ca-rec-editor .ca-rec-step-num{
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  font-size:18px!important;
  line-height:1!important;
}
.ca-rec-editor .ca-rec-grid label span,
.ca-rec-editor .wave-form-grid label span,
.ca-rec-editor .ca-rec-standard-item span{
  font-size:11px!important;
}
.ca-rec-tabs{
  margin:14px 0 22px!important;
}
.ca-rec-tabs a{
  padding:8px 14px!important;
  font-size:14px!important;
  line-height:1.15!important;
  font-weight:800!important;
  border-radius:0!important;
}
.ca-rec-tabs a:first-child{border-radius:10px 0 0 10px!important;}
.ca-rec-tabs a:last-child{border-radius:0 10px 10px 0!important;}
.ca-rec-tabs a.is-active{box-shadow:0 2px 8px rgba(15,23,42,.14)!important;}
@media(max-width:760px){
  .ca-rec-tabs a{font-size:13px!important;padding:8px 12px!important;white-space:nowrap!important;}
  .ca-rec-editor .ca-rec-step-head h2,
  .ca-rec-editor .ca-rec-panel > h2{font-size:19px!important;}
}


/* v2.31.19 recurring UI: match normal Create Invoice compact typography */
.ca-rec-editor .ca-rec-step-head h2,.ca-rec-editor .ca-rec-panel>h2{font-size:18px!important;line-height:1.22!important;font-weight:800!important;margin:0 0 8px!important}
.ca-rec-editor .ca-rec-step-head p,.ca-rec-editor .ca-rec-card p,.ca-rec-editor .ca-rec-panel p{font-size:12px!important;line-height:1.32!important}
.ca-rec-editor .ca-rec-step-num{width:36px!important;height:36px!important;min-width:36px!important;font-size:16px!important;line-height:1!important}
.ca-rec-editor .ca-rec-grid label span,.ca-rec-editor .wave-form-grid label span,.ca-rec-editor .ca-rec-standard-item span,.ca-rec-editor .ca-rec-top-grid span,.ca-rec-editor .ca-rec-notes span{font-size:10.5px!important;line-height:1.1!important}
.ca-rec-editor .ca-rec-top-grid input,.ca-rec-editor .ca-rec-top-grid select,.ca-rec-editor .ca-rec-standard-item input,.ca-rec-editor .ca-rec-standard-item select,.ca-rec-editor .ca-rec-grid input,.ca-rec-editor .ca-rec-grid select,.ca-rec-editor .ca-rec-notes textarea{font-size:14px!important;line-height:1.2!important;font-weight:500!important}
.ca-rec-editor .ca-vat-help{font-size:12px!important;line-height:1.22!important;font-weight:500!important}
.ca-rec-editor .ca-rec-line-total{font-size:16px!important;font-weight:800!important}
.ca-rec-editor .ca-rec-total-card{font-size:13px!important;line-height:1.25!important;padding:12px 16px!important}
.ca-rec-editor .ca-rec-total-card>div{font-size:13px!important;padding:7px 0!important}
.ca-rec-editor .ca-rec-total-card span{font-size:13px!important;font-weight:700!important}
.ca-rec-editor .ca-rec-total-card strong{font-size:15px!important;font-weight:800!important}
.ca-rec-editor .ca-rec-total-card>div:last-child span,.ca-rec-editor .ca-rec-total-card>div:last-child strong{font-size:15px!important;font-weight:800!important}
.ca-rec-editor .ca-rec-discount-panel input,.ca-rec-editor .ca-rec-discount-panel select,.ca-rec-editor [data-rec-discount-panel] input,.ca-rec-editor [data-rec-discount-panel] select{font-size:13px!important;font-weight:500!important}
.ca-rec-tabs{margin:12px 0 20px!important}
.ca-rec-tabs a{padding:7px 12px!important;font-size:13px!important;line-height:1.1!important;font-weight:800!important;border-radius:0!important}
.ca-rec-tabs a:first-child{border-radius:9px 0 0 9px!important}.ca-rec-tabs a:last-child{border-radius:0 9px 9px 0!important}.ca-rec-tabs a.is-active{box-shadow:0 2px 8px rgba(15,23,42,.14)!important}
@media(max-width:760px){.ca-rec-tabs a{font-size:12px!important;padding:7px 10px!important;white-space:nowrap!important}.ca-rec-editor .ca-rec-step-head h2,.ca-rec-editor .ca-rec-panel>h2{font-size:17px!important}}


/* v2.31.22 recurring/dashboard polish */
.ca-rec-list-page .wave-list-head .wave-btn-primary{min-width:128px!important;padding:10px 18px!important;font-size:13px!important;border-radius:14px!important;white-space:nowrap!important}
.ca-dashboard-page .wave-metrics.wave-metrics-4{align-items:stretch!important;grid-auto-rows:1fr!important}
.ca-dashboard-page .wave-metrics.wave-metrics-4>.metric{height:132px!important;min-height:132px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;box-sizing:border-box!important}
.ca-dashboard-page .wave-metrics.wave-metrics-4>.metric span{margin-bottom:8px!important}
.ca-dashboard-page .wave-metrics.wave-metrics-4>.metric strong{line-height:1.05!important}
.wave-dashboard-create-menu .wave-create-dropdown-all a[href*="recurring-invoice-edit"]{font-weight:800!important}

/* Recurring list dark mode */
body.ca-dark .ca-rec-list-page .wave-card,
body.ca-theme-dark .ca-rec-list-page .wave-card,
html.ca-theme-dark body .ca-rec-list-page .wave-card,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-card{background:#101d2d!important;border-color:#27384e!important;color:#e5f2ff!important;box-shadow:none!important}
body.ca-dark .ca-rec-list-page .wave-table th,
body.ca-theme-dark .ca-rec-list-page .wave-table th,
html.ca-theme-dark body .ca-rec-list-page .wave-table th,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-table th{background:#0f172a!important;color:#9fb6d8!important;border-color:#27384e!important}
body.ca-dark .ca-rec-list-page .wave-table td,
body.ca-theme-dark .ca-rec-list-page .wave-table td,
html.ca-theme-dark body .ca-rec-list-page .wave-table td,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-table td{background:#101d2d!important;color:#e5f2ff!important;border-color:#27384e!important}
body.ca-dark .ca-rec-list-page .ca-rec-tabs,
body.ca-theme-dark .ca-rec-list-page .ca-rec-tabs,
html.ca-theme-dark body .ca-rec-list-page .ca-rec-tabs,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-rec-tabs{border-top-color:#27384e!important}
body.ca-dark .ca-rec-list-page .ca-rec-tabs a,
body.ca-theme-dark .ca-rec-list-page .ca-rec-tabs a,
html.ca-theme-dark body .ca-rec-list-page .ca-rec-tabs a,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-rec-tabs a{background:#132238!important;color:#bfe3ff!important;border-color:#26364b!important}
body.ca-dark .ca-rec-list-page .ca-rec-tabs a.is-active,
body.ca-theme-dark .ca-rec-list-page .ca-rec-tabs a.is-active,
html.ca-theme-dark body .ca-rec-list-page .ca-rec-tabs a.is-active,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-rec-tabs a.is-active{background:#1e293b!important;color:#fff!important;box-shadow:0 2px 10px rgba(0,0,0,.35)!important}
body.ca-dark .ca-rec-list-page .ca-rec-schedule,
body.ca-theme-dark .ca-rec-list-page .ca-rec-schedule,
html.ca-theme-dark body .ca-rec-list-page .ca-rec-schedule,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-rec-schedule{color:#fff!important}
body.ca-dark .ca-rec-list-page .ca-rec-muted,
body.ca-theme-dark .ca-rec-list-page .ca-rec-muted,
html.ca-theme-dark body .ca-rec-list-page .ca-rec-muted,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-rec-muted{color:#94a3b8!important}
body.ca-dark .ca-rec-list-page .ca-mini-btn,
body.ca-theme-dark .ca-rec-list-page .ca-mini-btn,
html.ca-theme-dark body .ca-rec-list-page .ca-mini-btn,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-mini-btn{background:#0f172a!important;border-color:#334155!important;color:#e5f2ff!important}
body.ca-dark .ca-rec-list-page .ca-mini-primary,
body.ca-theme-dark .ca-rec-list-page .ca-mini-primary,
html.ca-theme-dark body .ca-rec-list-page .ca-mini-primary,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-mini-primary{background:#0ea5e9!important;border-color:#0ea5e9!important;color:#fff!important}
body.ca-dark .ca-rec-list-page .ca-mini-danger,
body.ca-theme-dark .ca-rec-list-page .ca-mini-danger,
html.ca-theme-dark body .ca-rec-list-page .ca-mini-danger,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .ca-mini-danger{color:#f87171!important}

/* Recurring editor stronger dark mode */
body.ca-dark .ca-rec-editor .ca-rec-panel,
body.ca-theme-dark .ca-rec-editor .ca-rec-panel,
html.ca-theme-dark body .ca-rec-editor .ca-rec-panel,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-panel{background:#101d2d!important;border-color:#27384e!important;color:#e5f2ff!important;box-shadow:none!important}
body.ca-dark .ca-rec-editor .ca-rec-step-head h2,
body.ca-theme-dark .ca-rec-editor .ca-rec-step-head h2,
html.ca-theme-dark body .ca-rec-editor .ca-rec-step-head h2,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-step-head h2{color:#f8fafc!important}
body.ca-dark .ca-rec-editor .ca-rec-step-head p,
body.ca-theme-dark .ca-rec-editor .ca-rec-step-head p,
html.ca-theme-dark body .ca-rec-editor .ca-rec-step-head p,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-step-head p{color:#9fb6d8!important}
body.ca-dark .ca-rec-editor .ca-rec-line-items,
body.ca-theme-dark .ca-rec-editor .ca-rec-line-items,
html.ca-theme-dark body .ca-rec-editor .ca-rec-line-items,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-line-items{background:#0f1a2a!important;border-color:#26364b!important;color:#e5f2ff!important}

@media(max-width:900px){
  .ca-dashboard-page .wave-metrics.wave-metrics-4>.metric{height:118px!important;min-height:118px!important;padding:16px!important}
  .ca-rec-list-page .wave-list-head{align-items:flex-start!important;gap:14px!important}
  .ca-rec-list-page .wave-list-head .wave-btn-primary{width:100%!important;min-height:44px!important}
  .ca-rec-list-page .ca-rec-tabs{justify-content:flex-start!important;overflow-x:auto!important;max-width:100%!important;margin:10px 0 16px!important;padding-top:8px!important}
  .ca-rec-list-page .ca-rec-tabs a{font-size:12px!important;padding:8px 10px!important;white-space:nowrap!important}
  .ca-rec-list-page .wave-table thead{display:none!important}
  .ca-rec-list-page .wave-table,
  .ca-rec-list-page .wave-table tbody,
  .ca-rec-list-page .wave-table tr,
  .ca-rec-list-page .wave-table td{display:block!important;width:100%!important;box-sizing:border-box!important}
  .ca-rec-list-page .wave-table tr{border:1px solid #dbe7f2!important;border-radius:14px!important;margin:0 0 14px!important;padding:12px!important;background:#fff!important}
  .ca-rec-list-page .wave-table td{border:0!important;padding:8px 0!important;text-align:left!important;display:flex!important;justify-content:space-between!important;gap:14px!important;align-items:flex-start!important}
  .ca-rec-list-page .wave-table td:nth-child(1)::before{content:"Status"}
  .ca-rec-list-page .wave-table td:nth-child(2)::before{content:"Customer"}
  .ca-rec-list-page .wave-table td:nth-child(3)::before{content:"Schedule"}
  .ca-rec-list-page .wave-table td:nth-child(4)::before{content:"Previous invoice"}
  .ca-rec-list-page .wave-table td:nth-child(5)::before{content:"Next invoice"}
  .ca-rec-list-page .wave-table td:nth-child(6)::before{content:"Invoice amount"}
  .ca-rec-list-page .wave-table td::before{font-size:11px!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.04em!important;color:#64748b!important;min-width:110px!important;flex:0 0 110px!important}
  .ca-rec-list-page .wave-table td:nth-child(7){display:block!important;padding-top:12px!important}
  .ca-rec-list-page .wave-table td:nth-child(7)::before{display:none!important}
  .ca-rec-list-page .ca-rec-row-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;width:100%!important;justify-content:stretch!important}
  .ca-rec-list-page .ca-rec-row-actions form{width:100%!important;display:block!important}
  .ca-rec-list-page .ca-rec-row-actions .ca-mini-btn,.ca-rec-list-page .ca-rec-row-actions button.ca-mini-btn{width:100%!important;min-width:0!important;height:40px!important}
  body.ca-dark .ca-rec-list-page .wave-table tr,body.ca-theme-dark .ca-rec-list-page .wave-table tr,html.ca-theme-dark body .ca-rec-list-page .wave-table tr,.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-table tr{background:#101d2d!important;border-color:#27384e!important}
  body.ca-dark .ca-rec-list-page .wave-table td::before,body.ca-theme-dark .ca-rec-list-page .wave-table td::before,html.ca-theme-dark body .ca-rec-list-page .wave-table td::before,.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-table td::before{color:#94a3b8!important}
  .ca-rec-editor.wave-main.wave-portal-page{padding:0 12px!important}
  .ca-rec-editor .ca-rec-panel{padding:18px!important;border-radius:16px!important}
  .ca-rec-editor .ca-rec-standard-invoice-form{padding:14px!important}
}
@media(max-width:560px){
  .ca-dashboard-page .wave-metrics.wave-metrics-4{grid-template-columns:1fr!important}
  .ca-dashboard-page .wave-metrics.wave-metrics-4>.metric{height:auto!important;min-height:104px!important}
  .ca-rec-list-page .ca-rec-row-actions{grid-template-columns:1fr!important}
  .ca-rec-list-page .wave-table td{flex-direction:column!important;gap:4px!important}
  .ca-rec-list-page .wave-table td::before{min-width:0!important;flex:auto!important}
}


/* v2.31.23 — invoice/recurring dark-mode completion + dashboard metric alignment */
@media (min-width: 901px){
  .ca-dashboard-page .wave-metrics.wave-metrics-4 > .metric:first-child{
    transform: translateY(18px) !important;
  }
}

/* Dark mode: normal Create Invoice / Edit Invoice / Invoices screens */
body.ca-dark .wave-main .wave-card,
body.ca-theme-dark .wave-main .wave-card,
html.ca-theme-dark body .wave-main .wave-card,
.wave-portal-shell[data-theme="dark"] .wave-main .wave-card{
  background:#101d2d !important;
  border-color:#27384e !important;
  color:#e5f2ff !important;
  box-shadow:none !important;
}
body.ca-dark .wave-main h1,
body.ca-dark .wave-main h2,
body.ca-dark .wave-main h3,
body.ca-theme-dark .wave-main h1,
body.ca-theme-dark .wave-main h2,
body.ca-theme-dark .wave-main h3,
html.ca-theme-dark body .wave-main h1,
html.ca-theme-dark body .wave-main h2,
html.ca-theme-dark body .wave-main h3,
.wave-portal-shell[data-theme="dark"] .wave-main h1,
.wave-portal-shell[data-theme="dark"] .wave-main h2,
.wave-portal-shell[data-theme="dark"] .wave-main h3{
  color:#f8fafc !important;
}
body.ca-dark .wave-main p,
body.ca-dark .wave-main small,
body.ca-theme-dark .wave-main p,
body.ca-theme-dark .wave-main small,
html.ca-theme-dark body .wave-main p,
html.ca-theme-dark body .wave-main small,
.wave-portal-shell[data-theme="dark"] .wave-main p,
.wave-portal-shell[data-theme="dark"] .wave-main small{
  color:#9fb6d8 !important;
}

body.ca-dark .wave-invoice-form,
body.ca-theme-dark .wave-invoice-form,
html.ca-theme-dark body .wave-invoice-form,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form,
body.ca-dark .ca-rec-editor .ca-rec-standard-invoice-form,
body.ca-theme-dark .ca-rec-editor .ca-rec-standard-invoice-form,
html.ca-theme-dark body .ca-rec-editor .ca-rec-standard-invoice-form,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-standard-invoice-form{
  background:#101d2d !important;
  color:#e5f2ff !important;
}
body.ca-dark .wave-invoice-form label > span,
body.ca-dark .wave-invoice-form .wave-label,
body.ca-dark .ca-rec-editor label > span,
body.ca-theme-dark .wave-invoice-form label > span,
body.ca-theme-dark .wave-invoice-form .wave-label,
body.ca-theme-dark .ca-rec-editor label > span,
html.ca-theme-dark body .wave-invoice-form label > span,
html.ca-theme-dark body .wave-invoice-form .wave-label,
html.ca-theme-dark body .ca-rec-editor label > span,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form label > span,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-label,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor label > span{
  color:#7dd3fc !important;
}
body.ca-dark .wave-invoice-form input[type=text],
body.ca-dark .wave-invoice-form input[type=number],
body.ca-dark .wave-invoice-form input[type=date],
body.ca-dark .wave-invoice-form input[type=email],
body.ca-dark .wave-invoice-form select,
body.ca-dark .wave-invoice-form textarea,
body.ca-theme-dark .wave-invoice-form input[type=text],
body.ca-theme-dark .wave-invoice-form input[type=number],
body.ca-theme-dark .wave-invoice-form input[type=date],
body.ca-theme-dark .wave-invoice-form input[type=email],
body.ca-theme-dark .wave-invoice-form select,
body.ca-theme-dark .wave-invoice-form textarea,
html.ca-theme-dark body .wave-invoice-form input[type=text],
html.ca-theme-dark body .wave-invoice-form input[type=number],
html.ca-theme-dark body .wave-invoice-form input[type=date],
html.ca-theme-dark body .wave-invoice-form input[type=email],
html.ca-theme-dark body .wave-invoice-form select,
html.ca-theme-dark body .wave-invoice-form textarea,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form input[type=text],
.wave-portal-shell[data-theme="dark"] .wave-invoice-form input[type=number],
.wave-portal-shell[data-theme="dark"] .wave-invoice-form input[type=date],
.wave-portal-shell[data-theme="dark"] .wave-invoice-form input[type=email],
.wave-portal-shell[data-theme="dark"] .wave-invoice-form select,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form textarea,
body.ca-dark .ca-rec-editor input,
body.ca-dark .ca-rec-editor select,
body.ca-dark .ca-rec-editor textarea,
body.ca-theme-dark .ca-rec-editor input,
body.ca-theme-dark .ca-rec-editor select,
body.ca-theme-dark .ca-rec-editor textarea,
html.ca-theme-dark body .ca-rec-editor input,
html.ca-theme-dark body .ca-rec-editor select,
html.ca-theme-dark body .ca-rec-editor textarea,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor input,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor select,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor textarea{
  background:#0f172a !important;
  border-color:#334155 !important;
  color:#f8fafc !important;
  caret-color:#f8fafc !important;
}
body.ca-dark .wave-invoice-form input::placeholder,
body.ca-dark .wave-invoice-form textarea::placeholder,
body.ca-dark .ca-rec-editor input::placeholder,
body.ca-dark .ca-rec-editor textarea::placeholder,
body.ca-theme-dark .wave-invoice-form input::placeholder,
body.ca-theme-dark .wave-invoice-form textarea::placeholder,
body.ca-theme-dark .ca-rec-editor input::placeholder,
body.ca-theme-dark .ca-rec-editor textarea::placeholder,
html.ca-theme-dark body .wave-invoice-form input::placeholder,
html.ca-theme-dark body .wave-invoice-form textarea::placeholder,
html.ca-theme-dark body .ca-rec-editor input::placeholder,
html.ca-theme-dark body .ca-rec-editor textarea::placeholder,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form input::placeholder,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form textarea::placeholder,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor input::placeholder,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor textarea::placeholder{
  color:#94a3b8 !important;
}
body.ca-dark .wave-invoice-form input:focus,
body.ca-dark .wave-invoice-form select:focus,
body.ca-dark .wave-invoice-form textarea:focus,
body.ca-dark .ca-rec-editor input:focus,
body.ca-dark .ca-rec-editor select:focus,
body.ca-dark .ca-rec-editor textarea:focus,
body.ca-theme-dark .wave-invoice-form input:focus,
body.ca-theme-dark .wave-invoice-form select:focus,
body.ca-theme-dark .wave-invoice-form textarea:focus,
body.ca-theme-dark .ca-rec-editor input:focus,
body.ca-theme-dark .ca-rec-editor select:focus,
body.ca-theme-dark .ca-rec-editor textarea:focus,
html.ca-theme-dark body .wave-invoice-form input:focus,
html.ca-theme-dark body .wave-invoice-form select:focus,
html.ca-theme-dark body .wave-invoice-form textarea:focus,
html.ca-theme-dark body .ca-rec-editor input:focus,
html.ca-theme-dark body .ca-rec-editor select:focus,
html.ca-theme-dark body .ca-rec-editor textarea:focus,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form input:focus,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form select:focus,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form textarea:focus,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor input:focus,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor select:focus,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor textarea:focus{
  border-color:#38bdf8 !important;
  box-shadow:0 0 0 2px rgba(56,189,248,.22) !important;
}

body.ca-dark .wave-invoice-form .wave-item-row,
body.ca-theme-dark .wave-invoice-form .wave-item-row,
html.ca-theme-dark body .wave-invoice-form .wave-item-row,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-item-row,
body.ca-dark .ca-rec-editor .ca-rec-line-items,
body.ca-theme-dark .ca-rec-editor .ca-rec-line-items,
html.ca-theme-dark body .ca-rec-editor .ca-rec-line-items,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-line-items{
  background:#0f1a2a !important;
  border-color:#26364b !important;
  color:#e5f2ff !important;
}
body.ca-dark .wave-invoice-form .wave-summary-box-vertical,
body.ca-theme-dark .wave-invoice-form .wave-summary-box-vertical,
html.ca-theme-dark body .wave-invoice-form .wave-summary-box-vertical,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-box-vertical,
body.ca-dark .ca-rec-editor .ca-rec-total-card,
body.ca-theme-dark .ca-rec-editor .ca-rec-total-card,
html.ca-theme-dark body .ca-rec-editor .ca-rec-total-card,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-total-card{
  background:#101d2d !important;
  border-color:#27384e !important;
  color:#e5f2ff !important;
}
body.ca-dark .wave-invoice-form .wave-summary-row,
body.ca-theme-dark .wave-invoice-form .wave-summary-row,
html.ca-theme-dark body .wave-invoice-form .wave-summary-row,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-row,
body.ca-dark .ca-rec-editor .ca-rec-total-card > div,
body.ca-theme-dark .ca-rec-editor .ca-rec-total-card > div,
html.ca-theme-dark body .ca-rec-editor .ca-rec-total-card > div,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-total-card > div{
  border-color:#27384e !important;
  color:#e5f2ff !important;
}
body.ca-dark .wave-invoice-form .wave-summary-row strong,
body.ca-dark .wave-invoice-form .wave-summary-row span,
body.ca-dark .ca-rec-editor .ca-rec-total-card strong,
body.ca-dark .ca-rec-editor .ca-rec-total-card span,
body.ca-theme-dark .wave-invoice-form .wave-summary-row strong,
body.ca-theme-dark .wave-invoice-form .wave-summary-row span,
body.ca-theme-dark .ca-rec-editor .ca-rec-total-card strong,
body.ca-theme-dark .ca-rec-editor .ca-rec-total-card span,
html.ca-theme-dark body .wave-invoice-form .wave-summary-row strong,
html.ca-theme-dark body .wave-invoice-form .wave-summary-row span,
html.ca-theme-dark body .ca-rec-editor .ca-rec-total-card strong,
html.ca-theme-dark body .ca-rec-editor .ca-rec-total-card span,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-row strong,
.wave-portal-shell[data-theme="dark"] .wave-invoice-form .wave-summary-row span,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-total-card strong,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-total-card span{
  color:#f8fafc !important;
}
body.ca-dark .wave-table,
body.ca-dark .wave-table th,
body.ca-dark .wave-table td,
body.ca-theme-dark .wave-table,
body.ca-theme-dark .wave-table th,
body.ca-theme-dark .wave-table td,
html.ca-theme-dark body .wave-table,
html.ca-theme-dark body .wave-table th,
html.ca-theme-dark body .wave-table td,
.wave-portal-shell[data-theme="dark"] .wave-table,
.wave-portal-shell[data-theme="dark"] .wave-table th,
.wave-portal-shell[data-theme="dark"] .wave-table td{
  border-color:#27384e !important;
}
body.ca-dark .wave-table th,
body.ca-theme-dark .wave-table th,
html.ca-theme-dark body .wave-table th,
.wave-portal-shell[data-theme="dark"] .wave-table th{
  background:#0f172a !important;
  color:#9fb6d8 !important;
}
body.ca-dark .wave-table td,
body.ca-theme-dark .wave-table td,
html.ca-theme-dark body .wave-table td,
.wave-portal-shell[data-theme="dark"] .wave-table td{
  background:#101d2d !important;
  color:#e5f2ff !important;
}

/* v2.31.25 — dashboard draft exact alignment + recurring subtitle cleanup */
@media (min-width: 901px){
  html body .ca-dashboard-page .wave-metrics.wave-metrics-4 > .metric:first-child{
    transform: translateY(25px) !important;
  }
}

/* Recurring editor: keep all circled dark-mode areas dark and readable */
body.ca-dark .ca-rec-editor .ca-rec-inline-customer,
body.ca-theme-dark .ca-rec-editor .ca-rec-inline-customer,
html.ca-theme-dark body .ca-rec-editor .ca-rec-inline-customer,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-inline-customer,
body.ca-dark .ca-rec-editor .ca-new-customer-box,
body.ca-theme-dark .ca-rec-editor .ca-new-customer-box,
html.ca-theme-dark body .ca-rec-editor .ca-new-customer-box,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-new-customer-box{
  background:#101d2d !important;
  background-color:#101d2d !important;
  border-color:#38bdf8 !important;
  color:#eaf2ff !important;
  box-shadow:none !important;
}

body.ca-dark .ca-rec-editor .ca-rec-inline-customer *,
body.ca-theme-dark .ca-rec-editor .ca-rec-inline-customer *,
html.ca-theme-dark body .ca-rec-editor .ca-rec-inline-customer *,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-inline-customer *,
body.ca-dark .ca-rec-editor .ca-new-customer-box *,
body.ca-theme-dark .ca-rec-editor .ca-new-customer-box *,
html.ca-theme-dark body .ca-rec-editor .ca-new-customer-box *,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-new-customer-box *{
  color:#eaf2ff !important;
}

body.ca-dark .ca-rec-editor .ca-rec-inline-customer label span,
body.ca-theme-dark .ca-rec-editor .ca-rec-inline-customer label span,
html.ca-theme-dark body .ca-rec-editor .ca-rec-inline-customer label span,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-inline-customer label span{
  color:#7dd3fc !important;
}

body.ca-dark .ca-rec-editor .ca-vat-help,
body.ca-theme-dark .ca-rec-editor .ca-vat-help,
html.ca-theme-dark body .ca-rec-editor .ca-vat-help,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-vat-help{
  background:#0b1322 !important;
  background-color:#0b1322 !important;
  border-color:#334155 !important;
  color:#dbeafe !important;
}

body.ca-dark .ca-rec-editor .ca-rec-line-total,
body.ca-theme-dark .ca-rec-editor .ca-rec-line-total,
html.ca-theme-dark body .ca-rec-editor .ca-rec-line-total,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-line-total,
body.ca-dark .ca-rec-editor .ca-rec-tax-row .ca-rec-line-total,
body.ca-theme-dark .ca-rec-editor .ca-rec-tax-row .ca-rec-line-total,
html.ca-theme-dark body .ca-rec-editor .ca-rec-tax-row .ca-rec-line-total,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-tax-row .ca-rec-line-total{
  color:#f8fafc !important;
  opacity:1 !important;
  text-shadow:none !important;
}

body.ca-dark .ca-rec-editor .ca-rec-actions .wave-btn,
body.ca-theme-dark .ca-rec-editor .ca-rec-actions .wave-btn,
html.ca-theme-dark body .ca-rec-editor .ca-rec-actions .wave-btn,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-actions .wave-btn{
  background:#0f172a !important;
  border-color:#334155 !important;
  color:#eaf2ff !important;
  box-shadow:none !important;
}

body.ca-dark .ca-rec-editor .ca-rec-actions .wave-btn-primary,
body.ca-theme-dark .ca-rec-editor .ca-rec-actions .wave-btn-primary,
html.ca-theme-dark body .ca-rec-editor .ca-rec-actions .wave-btn-primary,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-actions .wave-btn-primary{
  background:#0ea5e9 !important;
  border-color:#0ea5e9 !important;
  color:#ffffff !important;
  box-shadow:0 8px 20px rgba(14,165,233,.22) !important;
}

body.ca-dark .ca-rec-editor .ca-rec-actions .ca-rec-activate-submit,
body.ca-theme-dark .ca-rec-editor .ca-rec-actions .ca-rec-activate-submit,
html.ca-theme-dark body .ca-rec-editor .ca-rec-actions .ca-rec-activate-submit,
.wave-portal-shell[data-theme="dark"] .ca-rec-editor .ca-rec-actions .ca-rec-activate-submit{
  background:#132238 !important;
  border-color:#3b82f6 !important;
  color:#eaf2ff !important;
}

/* v2.31.33 Server-side pager restored to previous full pager UI */
.ca-server-pagination-bar{margin:14px 0 4px!important;padding:12px 14px!important;border:1px solid #e2e8f0!important;border-radius:12px!important;background:#f8fafc!important;box-sizing:border-box!important;}
.ca-server-pagination-bar .ca-page-size-form{margin:0!important;padding:0!important;display:flex!important;align-items:center!important;}
.ca-server-pagination-bar .ca-page-prev,
.ca-server-pagination-bar .ca-page-next,
.ca-server-pagination-bar .ca-page-number{display:inline-flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important;line-height:1!important;}
.ca-server-pagination-bar .ca-page-prev.is-disabled,
.ca-server-pagination-bar .ca-page-next.is-disabled{opacity:.45!important;pointer-events:none!important;cursor:not-allowed!important;}
.ca-server-pagination-bar .ca-page-prev:hover,
.ca-server-pagination-bar .ca-page-next:hover,
.ca-server-pagination-bar .ca-page-number:hover{text-decoration:none!important;background:#f8fafc!important;}
.ca-server-pagination-bar .ca-page-number.is-active:hover{background:#2f80ed!important;color:#fff!important;}
.wave-portal-shell[data-theme="dark"] .ca-server-pagination-bar,
body[data-theme="dark"] .ca-server-pagination-bar,
.ca-theme-dark .ca-server-pagination-bar,
html.ca-theme-dark .ca-server-pagination-bar{background:#111827!important;border-color:#334155!important;color:#cbd5e1!important;}
.wave-portal-shell[data-theme="dark"] .ca-server-pagination-bar .ca-page-number.is-active:hover,
body[data-theme="dark"] .ca-server-pagination-bar .ca-page-number.is-active:hover,
.ca-theme-dark .ca-server-pagination-bar .ca-page-number.is-active:hover,
html.ca-theme-dark .ca-server-pagination-bar .ca-page-number.is-active:hover{background:#38bdf8!important;color:#082f49!important;}
@media(max-width:760px){
  .ca-server-pagination-bar .ca-page-size-form{width:100%!important;}
  .ca-server-pagination-bar .ca-page-numbers{order:2!important;width:100%!important;justify-content:center!important;overflow-x:auto!important;}
}

/* v2.31.42 Duplicate review badge */
.status-duplicate,
.ca-status-duplicate,
.wave-status-badge.status-duplicate,
.badge.status-duplicate {
    background: #f3e8ff !important;
    color: #6b21a8 !important;
    border: 1px solid #c084fc !important;
}
body.ca-dark .status-duplicate,
body.ca-theme-dark .status-duplicate,
html.ca-dark .status-duplicate,
html.ca-theme-dark .status-duplicate,
body.ca-dark .ca-status-duplicate,
body.ca-theme-dark .ca-status-duplicate {
    background: rgba(168, 85, 247, 0.18) !important;
    color: #e9d5ff !important;
    border-color: rgba(192, 132, 252, 0.65) !important;
}

/* v2.31.43 Cancelled invoice badge */
.status-cancelled,
.ca-status-cancelled,
.wave-status-badge.status-cancelled,
.badge.status-cancelled {
    background: #fff1f2 !important;
    color: #9f1239 !important;
    border: 1px solid #fecdd3 !important;
}
body.ca-dark .status-cancelled,
body.ca-theme-dark .status-cancelled,
body.ca-dark-page .status-cancelled,
body.ca-core-dark .status-cancelled,
html.ca-dark .status-cancelled,
html.ca-theme-dark .status-cancelled,
html[data-theme="dark"] .status-cancelled,
html[data-ca-theme="dark"] .status-cancelled,
body.ca-dark .ca-status-cancelled,
body.ca-theme-dark .ca-status-cancelled,
body.ca-dark .wave-status-badge.status-cancelled,
body.ca-theme-dark .wave-status-badge.status-cancelled,
body.ca-dark-page .wave-status-badge.status-cancelled,
body.ca-core-dark .wave-status-badge.status-cancelled,
html[data-theme="dark"] .wave-status-badge.status-cancelled,
html[data-ca-theme="dark"] .wave-status-badge.status-cancelled {
    background: rgba(190, 24, 93, 0.16) !important;
    color: #fecdd3 !important;
    border-color: rgba(251, 113, 133, 0.55) !important;
}

/* v2.31.56 Auth Turnstile: retry loader + visible non-blocking status */
.ca-turnstile-wrap{
  position:relative;
  min-height:72px;
  margin:8px 0 10px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:6px;
}
.ca-turnstile-wrap .ca-turnstile-box{
  min-height:65px;
  width:100%;
}
.ca-turnstile-status{
  font-size:12px;
  line-height:1.35;
  color:#64748b;
  font-weight:700;
}
.ca-turnstile-status[hidden],
.ca-turnstile-reload[hidden]{
  display:none!important;
}
.ca-turnstile-reload{
  border:1px solid #cbd5e1;
  background:#fff;
  color:#2563eb;
  border-radius:999px;
  padding:6px 12px;
  font-size:12px;
  line-height:1;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(15,23,42,.08);
}
.ca-turnstile-reload:hover{
  background:#eff6ff;
  border-color:#93c5fd;
}
html.ca-dark .ca-turnstile-status,
body.ca-dark .ca-turnstile-status,
.wave-dark .ca-turnstile-status{
  color:#cbd5e1;
}
html.ca-dark .ca-turnstile-reload,
body.ca-dark .ca-turnstile-reload,
.wave-dark .ca-turnstile-reload{
  background:#0f172a;
  border-color:#334155;
  color:#93c5fd;
}

/* v2.31.70 - Wave-style Account Balances report */
.wvr-account-balances-report .wave-list-head {
  align-items: flex-start;
  margin-bottom: 18px;
}
.wvr-account-balances-report .wvr-wave-filter.wvr-no-project {
  grid-template-columns: minmax(160px, .8fr) minmax(190px, 1fr) minmax(190px, 1fr) auto;
  align-items: end;
  max-width: 980px;
}
.wvr-account-balances-report .wvr-wave-filter.wvr-no-project .wvr-update-btn {
  min-width: 170px;
  height: 50px;
}
.wvr-account-balances-report .wvr-ab-table-card {
  background: #fff;
  border: 0;
  box-shadow: none;
  overflow-x: auto;
  padding: 0;
}
.wvr-account-balances-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}
.wvr-account-balances-table th {
  padding: 13px 14px 11px;
  border-bottom: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}
.wvr-account-balances-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #d7e0ea;
  color: #0f172a;
  vertical-align: middle;
}
.wvr-account-balances-table .num,
.wvr-account-balances-table .amount {
  text-align: right;
  white-space: nowrap;
}
.wvr-account-balances-table .wvr-ab-section td {
  background: #d8e3ea;
  border-bottom: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
}
.wvr-account-balances-table .wvr-ab-account span {
  color: #1155cc;
  font-weight: 700;
}
.wvr-account-balances-table .wvr-ab-total td {
  font-weight: 800;
  border-top: 1px solid #cbd5e1;
}
.wvr-account-balances-table .wvr-ab-spacer td {
  height: 18px;
  padding: 0;
  border-bottom: 0;
}
.wvr-account-balances-table .wvr-ab-grand-total td {
  border-top: 2px solid #0f172a;
  border-bottom: 0;
  font-weight: 900;
  padding-top: 14px;
}
.wvr-account-balances-report .wvr-no-data {
  color: #64748b;
  text-align: center;
  padding: 24px !important;
}
.ca-dark .wvr-account-balances-report .wvr-ab-table-card,
.ca-dark .wvr-account-balances-table {
  background: #0f172a;
}
.ca-dark .wvr-account-balances-table th,
.ca-dark .wvr-account-balances-table td {
  border-color: #334155;
  color: #e5e7eb;
}
.ca-dark .wvr-account-balances-table .wvr-ab-section td {
  background: #1f2937;
  color: #f8fafc;
}
.ca-dark .wvr-account-balances-table .wvr-ab-account span {
  color: #93c5fd;
}
.ca-dark .wvr-account-balances-table .wvr-ab-grand-total td {
  border-top-color: #f8fafc;
}
@media (max-width: 900px) {
  .wvr-account-balances-report .wvr-wave-filter.wvr-no-project {
    grid-template-columns: 1fr 1fr;
    max-width: none;
  }
  .wvr-account-balances-report .wvr-wave-filter.wvr-no-project .wvr-update-btn {
    width: 100%;
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .wvr-account-balances-report .wvr-wave-filter.wvr-no-project {
    grid-template-columns: 1fr;
  }
  .wvr-account-balances-table {
    min-width: 760px;
    font-size: 12px;
  }
  .wvr-account-balances-table th,
  .wvr-account-balances-table td {
    padding: 9px 10px;
  }
}


/* v2.31.101 Project Reports mobile card layout fix */
@media(max-width:900px){
  .wvr-project-report-page,
  .wvr-project-report-page *{box-sizing:border-box!important;}
  .wvr-project-report-page{max-width:100%!important;overflow-x:hidden!important;}
  .wvr-project-report-page .wvr-wave-filter{grid-template-columns:1fr!important;gap:10px!important;max-width:100%!important;}
  .wvr-project-report-page .wvr-wave-filter label,
  .wvr-project-report-page .wvr-wave-filter input,
  .wvr-project-report-page .wvr-wave-filter select,
  .wvr-project-report-page .wvr-wave-filter .wave-btn,
  .wvr-project-report-page .wvr-wave-filter .wvr-update-btn{width:100%!important;max-width:100%!important;}
  .wvr-project-report-page .wvr-kpi-row{grid-template-columns:1fr!important;gap:10px!important;}
  .wvr-project-report-page .wvr-project-chart-card,
  .wvr-project-report-page .wvr-project-report-table-card{width:100%!important;max-width:100%!important;overflow:hidden!important;padding:14px!important;}
  .wvr-project-report-page .wvr-project-chart-head{display:block!important;margin-bottom:10px!important;}
  .wvr-project-report-page .wvr-project-chart-head h3,
  .wvr-project-report-page .wvr-project-report-table-card h3{font-size:15px!important;line-height:1.25!important;margin-bottom:6px!important;}
  .wvr-project-report-page .wvr-project-chart-head p{font-size:12px!important;line-height:1.35!important;}
  .wvr-project-report-page .wvr-project-chart-legend{font-size:10.5px!important;gap:7px 9px!important;margin:8px 0 12px!important;}
  .wvr-project-report-page .wvr-project-chart-row{display:block!important;width:100%!important;max-width:100%!important;padding:12px!important;border-radius:14px!important;}
  .wvr-project-report-page .wvr-project-chart-label{font-size:14px!important;line-height:1.2!important;margin-bottom:10px!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;}
  .wvr-project-report-page .wvr-project-chart-bar-line{display:grid!important;grid-template-columns:minmax(0,1fr) 74px!important;gap:8px!important;align-items:center!important;width:100%!important;}
  .wvr-project-report-page .wvr-project-chart-value{font-size:11px!important;white-space:nowrap!important;text-align:right!important;}
  .wvr-project-report-page .wvr-project-report-table-wrap,
  .wvr-project-report-page .wave-table-wrap.wvr-project-report-table-wrap{display:block!important;width:100%!important;max-width:100%!important;overflow-x:hidden!important;overflow-y:visible!important;border:0!important;background:transparent!important;}
  .wvr-project-report-page .wvr-project-report-table{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;table-layout:auto!important;border-collapse:separate!important;border-spacing:0!important;}
  .wvr-project-report-page .wvr-project-report-table thead{display:none!important;}
  .wvr-project-report-page .wvr-project-report-table tbody{display:block!important;width:100%!important;max-width:100%!important;}
  .wvr-project-report-page .wvr-project-report-table tbody tr{display:block!important;width:100%!important;max-width:100%!important;margin:0 0 12px!important;padding:12px 13px!important;border:1px solid #dbe5f0!important;border-radius:15px!important;background:#fff!important;box-shadow:0 1px 3px rgba(15,23,42,.06)!important;}
  .wvr-project-report-page .wvr-project-report-table tbody tr td,
  .wvr-project-report-page .wvr-project-report-table tbody tr td:first-child,
  .wvr-project-report-page .wvr-project-report-table tbody tr td:nth-child(n){display:grid!important;grid-template-columns:minmax(92px,34%) minmax(0,1fr)!important;gap:10px!important;align-items:start!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:7px 0!important;border:0!important;border-bottom:1px solid #eef2f7!important;text-align:left!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;font-size:12px!important;line-height:1.35!important;}
  .wvr-project-report-page .wvr-project-report-table tbody tr td:last-child{border-bottom:0!important;}
  .wvr-project-report-page .wvr-project-report-table tbody tr td::before{content:attr(data-label)!important;display:block!important;font-size:10.5px!important;font-weight:900!important;color:#64748b!important;text-transform:uppercase!important;letter-spacing:.03em!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;}
  .wvr-project-report-page .wvr-project-report-table tbody tr td strong{max-width:100%!important;white-space:normal!important;word-break:normal!important;overflow-wrap:anywhere!important;}
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Total"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Invoice paid"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Invoice unpaid"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Bill expenses"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Bill paid"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Bill unpaid"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Profitability"],
  .wvr-project-report-page .wvr-project-report-table tbody tr td[data-label="Cash profit"]{font-variant-numeric:tabular-nums!important;}
  .wvr-project-report-page .wvr-note{font-size:11px!important;line-height:1.35!important;margin-top:10px!important;}
  .wave-portal-shell[data-theme="dark"] .wvr-project-report-page .wvr-project-report-table tbody tr,
  body.ca-dark-page .wvr-project-report-page .wvr-project-report-table tbody tr,
  .ca-dark .wvr-project-report-page .wvr-project-report-table tbody tr{background:#111827!important;border-color:#334155!important;box-shadow:none!important;}
  .wave-portal-shell[data-theme="dark"] .wvr-project-report-page .wvr-project-report-table tbody tr td,
  body.ca-dark-page .wvr-project-report-page .wvr-project-report-table tbody tr td,
  .ca-dark .wvr-project-report-page .wvr-project-report-table tbody tr td{border-bottom-color:#334155!important;color:#e5e7eb!important;}
  .wave-portal-shell[data-theme="dark"] .wvr-project-report-page .wvr-project-report-table tbody tr td::before,
  body.ca-dark-page .wvr-project-report-page .wvr-project-report-table tbody tr td::before,
  .ca-dark .wvr-project-report-page .wvr-project-report-table tbody tr td::before{color:#94a3b8!important;}
}

/* v2.31.107 Recurring invoices: schedule UI, icon actions, mobile + dark polish */
.ca-rec-editor .ca-rec-schedule-grid{
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:18px 24px!important;
  align-items:end!important;
}
.ca-rec-editor .ca-rec-schedule-right{
  display:grid!important;
  grid-template-columns:minmax(72px,.55fr) minmax(120px,1fr) minmax(110px,.85fr)!important;
  gap:12px!important;
  align-items:end!important;
  min-width:0!important;
}
.ca-rec-editor .ca-rec-schedule-right label,
.ca-rec-editor .ca-rec-schedule-right input,
.ca-rec-editor .ca-rec-schedule-right select{
  min-width:0!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.ca-rec-editor .ca-rec-schedule-grid[data-frequency="daily"] .ca-rec-month-field,
.ca-rec-editor .ca-rec-schedule-grid[data-frequency="daily"] .ca-rec-day-field,
.ca-rec-editor .ca-rec-schedule-grid[data-frequency="weekly"] .ca-rec-month-field,
.ca-rec-editor .ca-rec-schedule-grid[data-frequency="weekly"] .ca-rec-day-field{
  opacity:.58!important;
}
.ca-rec-list-page .ca-rec-row-actions{
  gap:8px!important;
  flex-wrap:nowrap!important;
}
.ca-rec-list-page .ca-rec-row-actions .ca-icon-btn,
.ca-rec-list-page .ca-rec-row-actions button.ca-icon-btn,
.ca-rec-list-page .ca-rec-row-actions a.ca-icon-btn{
  width:42px!important;
  min-width:42px!important;
  height:38px!important;
  padding:0!important;
  border-radius:12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.ca-rec-list-page .ca-rec-row-actions .ca-icon-btn svg{
  width:18px!important;
  height:18px!important;
  display:block!important;
  fill:currentColor!important;
}
.ca-rec-list-page .ca-rec-row-actions .ca-mini-primary.ca-icon-btn{
  color:#fff!important;
}
.ca-rec-list-page .ca-rec-row-actions .ca-mini-danger.ca-icon-btn{
  color:#ef4444!important;
}
.ca-rec-list-page .screen-reader-text{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
body.ca-theme-dark .ca-rec-list-page .wave-card,
body.ca-dark .ca-rec-list-page .wave-card,
.ca-theme-dark .ca-rec-list-page .wave-card,
body.ca-theme-dark .ca-rec-editor .ca-rec-panel,
body.ca-dark .ca-rec-editor .ca-rec-panel,
.ca-theme-dark .ca-rec-editor .ca-rec-panel{
  background:#111827!important;
  border-color:#26364b!important;
  color:#e5edf7!important;
}
body.ca-theme-dark .ca-rec-editor input,
body.ca-theme-dark .ca-rec-editor select,
body.ca-theme-dark .ca-rec-editor textarea,
body.ca-dark .ca-rec-editor input,
body.ca-dark .ca-rec-editor select,
body.ca-dark .ca-rec-editor textarea,
.ca-theme-dark .ca-rec-editor input,
.ca-theme-dark .ca-rec-editor select,
.ca-theme-dark .ca-rec-editor textarea{
  background:#0b1322!important;
  border-color:#334155!important;
  color:#e5edf7!important;
}
body.ca-theme-dark .ca-rec-list-page .wave-table,
body.ca-dark .ca-rec-list-page .wave-table,
.ca-theme-dark .ca-rec-list-page .wave-table{
  color:#e5edf7!important;
}
body.ca-theme-dark .ca-rec-list-page .wave-table thead th,
body.ca-dark .ca-rec-list-page .wave-table thead th,
.ca-theme-dark .ca-rec-list-page .wave-table thead th{
  background:#1e293b!important;
  color:#bcd0ee!important;
}
body.ca-theme-dark .ca-rec-list-page .wave-table tbody td,
body.ca-dark .ca-rec-list-page .wave-table tbody td,
.ca-theme-dark .ca-rec-list-page .wave-table tbody td{
  border-color:#26364b!important;
}
body.ca-theme-dark .ca-rec-list-page .ca-mini-btn,
body.ca-dark .ca-rec-list-page .ca-mini-btn,
.ca-theme-dark .ca-rec-list-page .ca-mini-btn{
  background:#0b1322!important;
  border-color:#334155!important;
  color:#e5edf7!important;
}
body.ca-theme-dark .ca-rec-list-page .ca-mini-primary,
body.ca-dark .ca-rec-list-page .ca-mini-primary,
.ca-theme-dark .ca-rec-list-page .ca-mini-primary{
  background:#0ea5e9!important;
  border-color:#0ea5e9!important;
  color:#fff!important;
}
@media(max-width:980px){
  .ca-rec-editor .ca-rec-schedule-grid{
    grid-template-columns:1fr!important;
  }
  .ca-rec-editor .ca-rec-schedule-right{
    grid-template-columns:1fr 1fr 1fr!important;
  }
}
@media(max-width:760px){
  .ca-rec-list-page .wave-table-wrap{
    overflow:visible!important;
  }
  .ca-rec-list-page table.wave-table,
  .ca-rec-list-page .wave-table thead,
  .ca-rec-list-page .wave-table tbody,
  .ca-rec-list-page .wave-table tr,
  .ca-rec-list-page .wave-table th,
  .ca-rec-list-page .wave-table td{
    display:block!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  .ca-rec-list-page .wave-table thead{
    display:none!important;
  }
  .ca-rec-list-page .wave-table tbody tr{
    margin:0 0 14px!important;
    padding:14px!important;
    border:1px solid #dbe7f2!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:0 8px 22px rgba(15,23,42,.06)!important;
  }
  .ca-rec-list-page .wave-table tbody td{
    display:grid!important;
    grid-template-columns:118px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:start!important;
    padding:9px 0!important;
    border:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .ca-rec-list-page .wave-table tbody td::before{
    font-size:11px!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    letter-spacing:.04em!important;
    color:#64748b!important;
  }
  .ca-rec-list-page .wave-table tbody td:nth-child(1)::before{content:"Select";}
  .ca-rec-list-page .wave-table tbody td:nth-child(2)::before{content:"Status";}
  .ca-rec-list-page .wave-table tbody td:nth-child(3)::before{content:"Customer";}
  .ca-rec-list-page .wave-table tbody td:nth-child(4)::before{content:"Schedule";}
  .ca-rec-list-page .wave-table tbody td:nth-child(5)::before{content:"Previous";}
  .ca-rec-list-page .wave-table tbody td:nth-child(6)::before{content:"Next";}
  .ca-rec-list-page .wave-table tbody td:nth-child(7)::before{content:"Amount";}
  .ca-rec-list-page .wave-table tbody td:nth-child(8)::before{content:"Actions";}
  .ca-rec-list-page .ca-rec-row-actions{
    justify-content:flex-start!important;
    flex-wrap:wrap!important;
  }
  .ca-rec-list-page .ca-rec-tabs{
    justify-content:flex-start!important;
    overflow-x:auto!important;
    padding-bottom:8px!important;
  }
  .ca-rec-editor{
    padding:0 10px!important;
  }
  .ca-rec-editor .ca-rec-schedule-right{
    grid-template-columns:1fr!important;
  }
  .ca-rec-editor .ca-rec-grid,
  .ca-rec-editor .ca-rec-schedule-grid{
    grid-template-columns:1fr!important;
  }
  .ca-rec-editor .ca-rec-actions{
    flex-direction:column!important;
    align-items:stretch!important;
  }
  .ca-rec-editor .ca-rec-actions .wave-btn,
  .ca-rec-editor .ca-rec-actions a.wave-btn{
    width:100%!important;
    justify-content:center!important;
  }
  body.ca-theme-dark .ca-rec-list-page .wave-table tbody tr,
  body.ca-dark .ca-rec-list-page .wave-table tbody tr,
  .ca-theme-dark .ca-rec-list-page .wave-table tbody tr{
    background:#111827!important;
    border-color:#26364b!important;
  }
  body.ca-theme-dark .ca-rec-list-page .wave-table tbody td::before,
  body.ca-dark .ca-rec-list-page .wave-table tbody td::before,
  .ca-theme-dark .ca-rec-list-page .wave-table tbody td::before{
    color:#93a4ba!important;
  }
}


/* v2.31.110 — Wave-style compact centered tabs for Invoices + Recurring Invoices */
.ca-invoice-tabs,
.ca-rec-tabs{
    position:relative!important;
    display:flex!important;
    justify-content:center!important;
    align-items:center!important;
    gap:0!important;
    margin:14px 0 18px!important;
    padding:0!important;
    border-top:0!important;
    min-height:36px!important;
    overflow:visible!important;
    isolation:isolate!important;
}
.ca-invoice-tabs::before,
.ca-rec-tabs::before{
    content:""!important;
    position:absolute!important;
    left:0!important;
    right:0!important;
    top:50%!important;
    height:1px!important;
    background:#dbe7f2!important;
    transform:translateY(-50%)!important;
    z-index:0!important;
    pointer-events:none!important;
}
.ca-invoice-tabs a,
.ca-rec-tabs a{
    position:relative!important;
    z-index:1!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:34px!important;
    padding:7px 14px!important;
    font-size:14px!important;
    line-height:1.15!important;
    font-weight:800!important;
    white-space:nowrap!important;
    text-decoration:none!important;
    border-right:1px solid rgba(37,99,235,.08)!important;
    background:#e5f3ff!important;
    color:#064b86!important;
    box-shadow:none!important;
}
.ca-invoice-tabs a:first-child,
.ca-rec-tabs a:first-child{
    border-radius:12px 0 0 12px!important;
}
.ca-invoice-tabs a:last-child,
.ca-rec-tabs a:last-child{
    border-radius:0 12px 12px 0!important;
    border-right:0!important;
}
.ca-invoice-tabs a.is-active,
.ca-rec-tabs a.is-active{
    background:#fff!important;
    color:#0f172a!important;
    box-shadow:0 2px 10px rgba(15,23,42,.16)!important;
}
.ca-invoice-tabs .badge{
    min-width:17px!important;
    height:17px!important;
    padding:0 5px!important;
    margin-left:5px!important;
    font-size:10px!important;
    line-height:17px!important;
    border-radius:999px!important;
    background:#dbeafe!important;
    color:#2563eb!important;
}
.dark .ca-invoice-tabs::before,
.ca-theme-dark .ca-invoice-tabs::before,
html.ca-theme-dark .ca-invoice-tabs::before,
.dark .ca-rec-tabs::before,
.ca-theme-dark .ca-rec-tabs::before,
html.ca-theme-dark .ca-rec-tabs::before{
    background:#334155!important;
}
.dark .ca-invoice-tabs a,
.ca-theme-dark .ca-invoice-tabs a,
html.ca-theme-dark .ca-invoice-tabs a,
.dark .ca-rec-tabs a,
.ca-theme-dark .ca-rec-tabs a,
html.ca-theme-dark .ca-rec-tabs a{
    background:#102036!important;
    color:#cfe8ff!important;
    border-color:#1e3a5f!important;
}
.dark .ca-invoice-tabs a.is-active,
.ca-theme-dark .ca-invoice-tabs a.is-active,
html.ca-theme-dark .ca-invoice-tabs a.is-active,
.dark .ca-rec-tabs a.is-active,
.ca-theme-dark .ca-rec-tabs a.is-active,
html.ca-theme-dark .ca-rec-tabs a.is-active{
    background:#1e293b!important;
    color:#fff!important;
}
.dark .ca-invoice-tabs .badge,
.ca-theme-dark .ca-invoice-tabs .badge,
html.ca-theme-dark .ca-invoice-tabs .badge{
    background:#1d4ed8!important;
    color:#dbeafe!important;
}
@media(max-width:760px){
    .ca-invoice-tabs,
    .ca-rec-tabs{
        justify-content:flex-start!important;
        overflow-x:auto!important;
        overflow-y:hidden!important;
        -webkit-overflow-scrolling:touch!important;
        padding-bottom:2px!important;
        scrollbar-width:none!important;
    }
    .ca-invoice-tabs::-webkit-scrollbar,
    .ca-rec-tabs::-webkit-scrollbar{
        display:none!important;
    }
    .ca-invoice-tabs a,
    .ca-rec-tabs a{
        flex:0 0 auto!important;
        font-size:13px!important;
        padding:7px 12px!important;
        min-height:32px!important;
    }
}

/* v2.31.111 — Invoices + Recurring Invoices dark/mobile contrast polish */
/* Dark-mode invoice overview and list cards */
body.ca-theme-dark .wave-list-page .ca-invoice-overview,
body.ca-dark .wave-list-page .ca-invoice-overview,
body.ca-dark-page .wave-list-page .ca-invoice-overview,
html.ca-theme-dark .wave-list-page .ca-invoice-overview,
html.ca-dark .wave-list-page .ca-invoice-overview,
.ca-theme-dark .wave-list-page .ca-invoice-overview,
.ca-dark .wave-list-page .ca-invoice-overview,
.wave-portal-shell[data-theme="dark"] .wave-list-page .ca-invoice-overview{
  background:#111c2d!important;
  border-color:#2b3b52!important;
  box-shadow:0 12px 30px rgba(0,0,0,.22)!important;
}
body.ca-theme-dark .wave-list-page .ca-invoice-overview-card strong,
body.ca-dark .wave-list-page .ca-invoice-overview-card strong,
body.ca-dark-page .wave-list-page .ca-invoice-overview-card strong,
html.ca-theme-dark .wave-list-page .ca-invoice-overview-card strong,
html.ca-dark .wave-list-page .ca-invoice-overview-card strong,
.ca-theme-dark .wave-list-page .ca-invoice-overview-card strong,
.ca-dark .wave-list-page .ca-invoice-overview-card strong,
.wave-portal-shell[data-theme="dark"] .wave-list-page .ca-invoice-overview-card strong{
  color:#a8bdd8!important;
}
body.ca-theme-dark .wave-list-page .ca-invoice-overview-card .amount,
body.ca-dark .wave-list-page .ca-invoice-overview-card .amount,
body.ca-dark-page .wave-list-page .ca-invoice-overview-card .amount,
html.ca-theme-dark .wave-list-page .ca-invoice-overview-card .amount,
html.ca-dark .wave-list-page .ca-invoice-overview-card .amount,
.ca-theme-dark .wave-list-page .ca-invoice-overview-card .amount,
.ca-dark .wave-list-page .ca-invoice-overview-card .amount,
.wave-portal-shell[data-theme="dark"] .wave-list-page .ca-invoice-overview-card .amount{
  color:#f8fbff!important;
}
body.ca-theme-dark .wave-list-page .ca-invoice-overview-card .muted,
body.ca-dark .wave-list-page .ca-invoice-overview-card .muted,
body.ca-dark-page .wave-list-page .ca-invoice-overview-card .muted,
html.ca-theme-dark .wave-list-page .ca-invoice-overview-card .muted,
html.ca-dark .wave-list-page .ca-invoice-overview-card .muted,
.ca-theme-dark .wave-list-page .ca-invoice-overview-card .muted,
.ca-dark .wave-list-page .ca-invoice-overview-card .muted,
.wave-portal-shell[data-theme="dark"] .wave-list-page .ca-invoice-overview-card .muted{
  color:#9db2d1!important;
}

/* Dark-mode shared Wave tabs — no white active tab in dark mode */
body.ca-theme-dark .ca-invoice-tabs::before,
body.ca-dark .ca-invoice-tabs::before,
body.ca-dark-page .ca-invoice-tabs::before,
html.ca-theme-dark .ca-invoice-tabs::before,
html.ca-dark .ca-invoice-tabs::before,
.ca-theme-dark .ca-invoice-tabs::before,
.ca-dark .ca-invoice-tabs::before,
.wave-portal-shell[data-theme="dark"] .ca-invoice-tabs::before,
body.ca-theme-dark .ca-rec-tabs::before,
body.ca-dark .ca-rec-tabs::before,
body.ca-dark-page .ca-rec-tabs::before,
html.ca-theme-dark .ca-rec-tabs::before,
html.ca-dark .ca-rec-tabs::before,
.ca-theme-dark .ca-rec-tabs::before,
.ca-dark .ca-rec-tabs::before,
.wave-portal-shell[data-theme="dark"] .ca-rec-tabs::before{
  background:#53657d!important;
  opacity:.8!important;
}
body.ca-theme-dark .ca-invoice-tabs a,
body.ca-dark .ca-invoice-tabs a,
body.ca-dark-page .ca-invoice-tabs a,
html.ca-theme-dark .ca-invoice-tabs a,
html.ca-dark .ca-invoice-tabs a,
.ca-theme-dark .ca-invoice-tabs a,
.ca-dark .ca-invoice-tabs a,
.wave-portal-shell[data-theme="dark"] .ca-invoice-tabs a,
body.ca-theme-dark .ca-rec-tabs a,
body.ca-dark .ca-rec-tabs a,
body.ca-dark-page .ca-rec-tabs a,
html.ca-theme-dark .ca-rec-tabs a,
html.ca-dark .ca-rec-tabs a,
.ca-theme-dark .ca-rec-tabs a,
.ca-dark .ca-rec-tabs a,
.wave-portal-shell[data-theme="dark"] .ca-rec-tabs a{
  background:#16263d!important;
  color:#d6e9ff!important;
  border-color:#294567!important;
  box-shadow:none!important;
}
body.ca-theme-dark .ca-invoice-tabs a.is-active,
body.ca-dark .ca-invoice-tabs a.is-active,
body.ca-dark-page .ca-invoice-tabs a.is-active,
html.ca-theme-dark .ca-invoice-tabs a.is-active,
html.ca-dark .ca-invoice-tabs a.is-active,
.ca-theme-dark .ca-invoice-tabs a.is-active,
.ca-dark .ca-invoice-tabs a.is-active,
.wave-portal-shell[data-theme="dark"] .ca-invoice-tabs a.is-active,
body.ca-theme-dark .ca-rec-tabs a.is-active,
body.ca-dark .ca-rec-tabs a.is-active,
body.ca-dark-page .ca-rec-tabs a.is-active,
html.ca-theme-dark .ca-rec-tabs a.is-active,
html.ca-dark .ca-rec-tabs a.is-active,
.ca-theme-dark .ca-rec-tabs a.is-active,
.ca-dark .ca-rec-tabs a.is-active,
.wave-portal-shell[data-theme="dark"] .ca-rec-tabs a.is-active{
  background:#2b4f7d!important;
  color:#ffffff!important;
  box-shadow:0 4px 14px rgba(14,165,233,.22)!important;
}
body.ca-theme-dark .ca-invoice-tabs .badge,
body.ca-dark .ca-invoice-tabs .badge,
body.ca-dark-page .ca-invoice-tabs .badge,
html.ca-theme-dark .ca-invoice-tabs .badge,
html.ca-dark .ca-invoice-tabs .badge,
.ca-theme-dark .ca-invoice-tabs .badge,
.ca-dark .ca-invoice-tabs .badge,
.wave-portal-shell[data-theme="dark"] .ca-invoice-tabs .badge{
  background:#0b63ce!important;
  color:#eaf4ff!important;
}

/* Dark-mode list panels / table contrast for invoice + recurring list pages */
body.ca-theme-dark .wave-list-page .wave-card,
body.ca-dark .wave-list-page .wave-card,
body.ca-dark-page .wave-list-page .wave-card,
html.ca-theme-dark .wave-list-page .wave-card,
html.ca-dark .wave-list-page .wave-card,
.ca-theme-dark .wave-list-page .wave-card,
.ca-dark .wave-list-page .wave-card,
.wave-portal-shell[data-theme="dark"] .wave-list-page .wave-card,
body.ca-theme-dark .ca-rec-list-page .wave-card,
body.ca-dark .ca-rec-list-page .wave-card,
body.ca-dark-page .ca-rec-list-page .wave-card,
html.ca-theme-dark .ca-rec-list-page .wave-card,
html.ca-dark .ca-rec-list-page .wave-card,
.ca-theme-dark .ca-rec-list-page .wave-card,
.ca-dark .ca-rec-list-page .wave-card,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-card{
  background:#111c2d!important;
  border-color:#2b3b52!important;
}
body.ca-theme-dark .wave-list-page .wave-card input,
body.ca-theme-dark .wave-list-page .wave-card select,
body.ca-dark .wave-list-page .wave-card input,
body.ca-dark .wave-list-page .wave-card select,
body.ca-dark-page .wave-list-page .wave-card input,
body.ca-dark-page .wave-list-page .wave-card select,
html.ca-theme-dark .wave-list-page .wave-card input,
html.ca-theme-dark .wave-list-page .wave-card select,
html.ca-dark .wave-list-page .wave-card input,
html.ca-dark .wave-list-page .wave-card select,
.ca-theme-dark .wave-list-page .wave-card input,
.ca-theme-dark .wave-list-page .wave-card select,
.ca-dark .wave-list-page .wave-card input,
.ca-dark .wave-list-page .wave-card select,
.wave-portal-shell[data-theme="dark"] .wave-list-page .wave-card input,
.wave-portal-shell[data-theme="dark"] .wave-list-page .wave-card select,
body.ca-theme-dark .ca-rec-list-page .wave-card input,
body.ca-theme-dark .ca-rec-list-page .wave-card select,
body.ca-dark .ca-rec-list-page .wave-card input,
body.ca-dark .ca-rec-list-page .wave-card select,
body.ca-dark-page .ca-rec-list-page .wave-card input,
body.ca-dark-page .ca-rec-list-page .wave-card select,
html.ca-theme-dark .ca-rec-list-page .wave-card input,
html.ca-theme-dark .ca-rec-list-page .wave-card select,
html.ca-dark .ca-rec-list-page .wave-card input,
html.ca-dark .ca-rec-list-page .wave-card select,
.ca-theme-dark .ca-rec-list-page .wave-card input,
.ca-theme-dark .ca-rec-list-page .wave-card select,
.ca-dark .ca-rec-list-page .wave-card input,
.ca-dark .ca-rec-list-page .wave-card select,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-card input,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-card select{
  background:#0d1828!important;
  border-color:#31425a!important;
  color:#eef6ff!important;
}
body.ca-theme-dark .wave-list-page .wave-card input::placeholder,
body.ca-dark .wave-list-page .wave-card input::placeholder,
body.ca-dark-page .wave-list-page .wave-card input::placeholder,
html.ca-theme-dark .wave-list-page .wave-card input::placeholder,
html.ca-dark .wave-list-page .wave-card input::placeholder,
.ca-theme-dark .wave-list-page .wave-card input::placeholder,
.ca-dark .wave-list-page .wave-card input::placeholder,
.wave-portal-shell[data-theme="dark"] .wave-list-page .wave-card input::placeholder{
  color:#7f94b2!important;
}
body.ca-theme-dark .wave-list-page .wave-table thead th,
body.ca-dark .wave-list-page .wave-table thead th,
body.ca-dark-page .wave-list-page .wave-table thead th,
html.ca-theme-dark .wave-list-page .wave-table thead th,
html.ca-dark .wave-list-page .wave-table thead th,
.ca-theme-dark .wave-list-page .wave-table thead th,
.ca-dark .wave-list-page .wave-table thead th,
.wave-portal-shell[data-theme="dark"] .wave-list-page .wave-table thead th,
body.ca-theme-dark .ca-rec-list-page .wave-table thead th,
body.ca-dark .ca-rec-list-page .wave-table thead th,
body.ca-dark-page .ca-rec-list-page .wave-table thead th,
html.ca-theme-dark .ca-rec-list-page .wave-table thead th,
html.ca-dark .ca-rec-list-page .wave-table thead th,
.ca-theme-dark .ca-rec-list-page .wave-table thead th,
.ca-dark .ca-rec-list-page .wave-table thead th,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-table thead th{
  background:#172337!important;
  color:#bcd0ee!important;
}
body.ca-theme-dark .wave-list-page .wave-table tbody td,
body.ca-dark .wave-list-page .wave-table tbody td,
body.ca-dark-page .wave-list-page .wave-table tbody td,
html.ca-theme-dark .wave-list-page .wave-table tbody td,
html.ca-dark .wave-list-page .wave-table tbody td,
.ca-theme-dark .wave-list-page .wave-table tbody td,
.ca-dark .wave-list-page .wave-table tbody td,
.wave-portal-shell[data-theme="dark"] .wave-list-page .wave-table tbody td,
body.ca-theme-dark .ca-rec-list-page .wave-table tbody td,
body.ca-dark .ca-rec-list-page .wave-table tbody td,
body.ca-dark-page .ca-rec-list-page .wave-table tbody td,
html.ca-theme-dark .ca-rec-list-page .wave-table tbody td,
html.ca-dark .ca-rec-list-page .wave-table tbody td,
.ca-theme-dark .ca-rec-list-page .wave-table tbody td,
.ca-dark .ca-rec-list-page .wave-table tbody td,
.wave-portal-shell[data-theme="dark"] .ca-rec-list-page .wave-table tbody td{
  color:#e7f0fb!important;
  border-color:#26364b!important;
}

/* Mobile: invoice and recurring tab bars take the full width of the phone */
@media(max-width:760px){
  .ca-invoice-tabs,
  .ca-rec-tabs{
    width:100%!important;
    max-width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    justify-content:stretch!important;
    overflow:visible!important;
    margin:14px 0 18px!important;
    min-height:38px!important;
    padding:0!important;
  }
  .ca-invoice-tabs a,
  .ca-rec-tabs a{
    width:100%!important;
    min-width:0!important;
    flex:1 1 0!important;
    white-space:normal!important;
    text-align:center!important;
    padding:8px 5px!important;
    font-size:12px!important;
    line-height:1.12!important;
  }
  .ca-rec-tabs a{font-size:11px!important;}
  .ca-invoice-tabs .badge{
    margin-left:4px!important;
    min-width:16px!important;
    height:16px!important;
    font-size:10px!important;
    line-height:16px!important;
    padding:0 4px!important;
  }

  /* Recurring invoice mobile cards: keep action icons horizontal */
  .ca-rec-list-page .wave-table tbody td{
    grid-template-columns:104px minmax(0,1fr)!important;
  }
  .ca-rec-list-page .ca-rec-row-actions,
  .ca-rec-list-card .ca-rec-row-actions,
  .ca-rec-list-page td .ca-rec-row-actions{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
  }
  .ca-rec-list-page .ca-rec-row-actions form{
    display:inline-flex!important;
    margin:0!important;
    flex:0 0 auto!important;
  }
  .ca-rec-list-page .ca-rec-row-actions .ca-mini-btn,
  .ca-rec-list-page .ca-rec-row-actions button.ca-mini-btn{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    flex:0 0 40px!important;
    padding:0!important;
  }
}
@media(max-width:380px){
  .ca-rec-list-page .wave-table tbody td{
    grid-template-columns:92px minmax(0,1fr)!important;
  }
  .ca-rec-list-page .ca-rec-row-actions{
    gap:6px!important;
  }
  .ca-rec-list-page .ca-rec-row-actions .ca-mini-btn,
  .ca-rec-list-page .ca-rec-row-actions button.ca-mini-btn{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    flex-basis:36px!important;
  }
}



/* v2.31.116 — Recurring line item tax/total alignment polish
   When VAT Treatment is disabled, keep Select Tax and line total as a compact right-aligned group. */
.ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment{
  grid-template-columns:minmax(260px, 340px) max-content!important;
  justify-content:end!important;
  align-items:end!important;
  gap:14px!important;
  width:100%!important;
}
.ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment > label{
  width:100%!important;
  max-width:340px!important;
  justify-self:end!important;
}
.ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment > label select{
  width:100%!important;
}
.ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment .ca-rec-line-total{
  min-width:104px!important;
  justify-self:end!important;
  align-self:end!important;
  text-align:right!important;
  line-height:46px!important;
  padding:0!important;
  margin:0!important;
}
@media(max-width:760px){
  .ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment{
    grid-template-columns:1fr!important;
    justify-content:stretch!important;
    gap:8px!important;
  }
  .ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment > label{
    max-width:none!important;
    justify-self:stretch!important;
  }
  .ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment .ca-rec-line-total{
    width:100%!important;
    min-width:0!important;
    text-align:right!important;
    line-height:1.25!important;
    padding-top:2px!important;
  }
}


/* v2.31.122 — Greek language create-menu translations + dropdown containment fix */
.wave-create-dropdown,
.wave-create-dropdown-all,
.wave-actions-dropdown.wave-create-dropdown{
  min-width:260px!important;
  max-width:min(320px, calc(100vw - 28px))!important;
  width:max-content!important;
  white-space:normal!important;
  overflow:visible!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  z-index:9999!important;
}
.wave-create-dropdown a,
.wave-create-dropdown-all a,
.wave-actions-dropdown.wave-create-dropdown a{
  display:flex!important;
  align-items:center!important;
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  white-space:normal!important;
  line-height:1.25!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
}
.wave-create-menu-section{
  white-space:normal!important;
  overflow-wrap:break-word!important;
}
html[data-ca-lang="el"] .wave-create-dropdown,
html[data-ca-lang="el"] .wave-create-dropdown-all,
html[data-ca-lang="el"] .wave-actions-dropdown.wave-create-dropdown{
  min-width:285px!important;
}
html[data-ca-lang="el"] .wave-create-dropdown a,
html[data-ca-lang="el"] .wave-create-dropdown-all a,
html[data-ca-lang="el"] .wave-actions-dropdown.wave-create-dropdown a{
  font-size:14px!important;
}
@media(max-width:760px){
  .wave-create-menu,
  .wave-dashboard-create-menu{
    position:relative!important;
    max-width:100%!important;
  }
  .wave-create-dropdown,
  .wave-create-dropdown-all,
  .wave-actions-dropdown.wave-create-dropdown{
    left:auto!important;
    right:0!important;
    max-width:calc(100vw - 32px)!important;
    min-width:min(285px, calc(100vw - 32px))!important;
  }
}

/* v2.31.123 Greek translation polish + tax actions alignment */
.ca-taxes-page .ca-tax-rates-card .wave-table th.ta-r,
.ca-taxes-page .ca-tax-rates-card .wave-table th:last-child{
  text-align:right!important;
}
.ca-taxes-page .ca-tax-rates-card .wave-table td.wave-actions-cell,
.ca-taxes-page .ca-tax-rates-card .wave-table td:last-child{
  text-align:right!important;
  justify-content:flex-end!important;
  align-items:center!important;
}
.ca-taxes-page .ca-tax-rates-card .wave-table td.wave-actions-cell{
  display:flex!important;
  width:100%!important;
  min-width:140px!important;
}
.ca-taxes-page .ca-tax-rates-card .wave-table td.wave-actions-cell .wave-customer-actions{
  margin-left:auto!important;
  justify-content:flex-end!important;
  flex-wrap:nowrap!important;
}
html[data-ca-lang="el"] .wave-header-card .wave-btn,
html[data-ca-lang="el"] .wave-list-head .wave-btn{
  white-space:normal!important;
  line-height:1.25!important;
  text-align:center!important;
}
html[data-ca-lang="el"] .wave-header-card .wave-btn.wave-btn-sm,
html[data-ca-lang="el"] .wave-list-head .wave-btn.wave-btn-sm{
  min-height:40px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
@media (max-width: 768px){
  .ca-taxes-page .ca-tax-rates-card .wave-table td.wave-actions-cell{
    width:auto!important;
    min-width:0!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table td.wave-actions-cell .wave-customer-actions{
    margin-left:0!important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   v2.33.01 — Wave-style mobile interface refinements
   Mobile-only app header, bottom navigation sheets and compact invoices.
   Desktop layout remains unchanged.
   ══════════════════════════════════════════════════════════════════ */
.ca-mobile-bottom-nav,
.ca-mobile-nav-sheet,
.ca-mobile-sheet-overlay,
.ca-mobile-more-menu,
.ca-mobile-invoice-filter-toggle,
.ca-mobile-invoice-date,
.ca-mobile-amount-label,
.ca-mobile-recurring-mark { display:none; }
.ca-mobile-create-invoice-label { display:none; }

@media (max-width: 900px) {
  html body .wave-portal-sidebar,
  html body #wave-sidebar,
  html body .wave-mobile-nav-overlay,
  html body #wave-nav-overlay,
  html body .wave-portal-topbar {
    display:none !important;
  }

  html body .wave-portal-shell,
  html body .ca-invoicing-shell {
    padding-bottom:calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body .wave-portal-layout,
  html body .ca-invoicing-layout {
    display:block !important;
    grid-template-columns:none !important;
    gap:0 !important;
  }

  html body .wave-portal-content,
  html body .ca-invoicing-content {
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
  }

  html body .wave-mobile-topbar.ca-wave-mobile-header {
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    min-height:58px !important;
    padding:8px 12px !important;
    background:#fff !important;
    border-bottom:1px solid #dbe4ee !important;
    box-shadow:0 2px 10px rgba(15,23,42,.05) !important;
    position:sticky !important;
    top:0 !important;
    z-index:9200 !important;
  }

  .ca-mobile-header-brand {
    flex:1 1 auto;
    min-width:0;
    display:flex;
    align-items:center;
    gap:10px;
  }
  html body .ca-wave-mobile-header .wave-mobile-logo {
    flex:0 0 104px !important;
    width:104px !important;
    height:31px !important;
    max-width:104px !important;
    object-fit:contain !important;
  }
  .ca-mobile-page-title {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:17px;
    line-height:1.15;
    font-weight:800;
    color:#132238;
  }
  .ca-mobile-header-actions {
    display:flex;
    align-items:center;
    gap:6px;
    flex:0 0 auto;
  }
  .ca-wave-mobile-header .ca-language-switcher {
    min-width:auto !important;
    margin:0 !important;
  }
  .ca-mobile-more-toggle {
    width:38px;
    height:38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:50%;
    background:transparent;
    color:#1e3a5f;
    font-size:15px;
    font-weight:900;
    letter-spacing:1px;
    cursor:pointer;
  }
  .ca-mobile-more-toggle:active,
  .ca-mobile-more-toggle[aria-expanded="true"] { background:#edf5fc; }

  .ca-mobile-more-menu {
    display:block;
    position:fixed;
    top:54px;
    right:10px;
    z-index:9700;
    width:min(330px, calc(100vw - 20px));
    max-height:calc(100vh - 76px);
    overflow:auto;
    padding:10px;
    border:1px solid #d9e4ef;
    border-radius:16px;
    background:#fff;
    box-shadow:0 18px 50px rgba(15,23,42,.2);
  }
  .ca-mobile-more-menu[hidden] { display:none !important; }
  .ca-mobile-account-head {
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 8px 12px;
    margin-bottom:4px;
    border-bottom:1px solid #e5edf5;
  }
  .ca-mobile-account-head > span:last-child { min-width:0; display:flex; flex-direction:column; }
  .ca-mobile-account-head strong { color:#10233e; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .ca-mobile-account-head small { color:#718096; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .ca-mobile-more-menu > a,
  .ca-mobile-menu-action,
  .ca-mobile-signout-form button {
    width:100%;
    display:flex;
    align-items:center;
    gap:10px;
    box-sizing:border-box;
    padding:11px 10px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:#1d3554;
    text-decoration:none;
    text-align:left;
    font:600 14px/1.25 inherit;
    cursor:pointer;
  }
  .ca-mobile-more-menu > a:hover,
  .ca-mobile-menu-action:hover,
  .ca-mobile-signout-form button:hover { background:#f0f6fb; }
  .ca-mobile-signout-form { margin:4px 0 0; padding-top:4px; border-top:1px solid #e5edf5; }
  .ca-mobile-signout-form button { color:#b42318; }
  .ca-mobile-business-switch { margin:8px 4px; padding:10px; border-radius:10px; background:#f6f9fc; }
  .ca-mobile-business-switch > label { display:block; margin-bottom:7px; color:#5d6f84; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }

  .ca-mobile-bottom-nav {
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:9500;
    min-height:66px;
    padding:5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
    border-top:1px solid #d7e2ec;
    background:rgba(255,255,255,.97);
    box-shadow:0 -6px 24px rgba(15,23,42,.10);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }
  .ca-mobile-nav-item {
    appearance:none;
    min-width:0;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#6b7b8f;
    text-decoration:none;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:5px 3px;
    font:700 11px/1.1 inherit;
    cursor:pointer;
  }
  .ca-mobile-nav-item svg {
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
  }
  .ca-mobile-nav-item.is-active,
  .ca-mobile-nav-item[aria-expanded="true"] {
    color:#0873c5;
    background:#eaf5fd;
  }

  .ca-mobile-sheet-overlay {
    display:block;
    pointer-events:none;
    position:fixed;
    inset:0;
    z-index:9350;
    opacity:0;
    background:rgba(15,30,50,.42);
    transition:opacity .2s ease;
  }
  .ca-mobile-sheet-overlay.is-visible { pointer-events:auto; opacity:1; }
  body.ca-mobile-sheet-open { overflow:hidden !important; }
  .ca-mobile-nav-sheet {
    display:block;
    position:fixed;
    left:8px;
    right:8px;
    bottom:calc(68px + env(safe-area-inset-bottom, 0px));
    z-index:9450;
    max-height:min(68vh, 560px);
    overflow:auto;
    padding:8px 12px 18px;
    border:1px solid #d9e4ee;
    border-radius:20px 20px 16px 16px;
    background:#fff;
    box-shadow:0 -16px 50px rgba(15,23,42,.22);
    transform:translateY(calc(100% + 90px));
    visibility:hidden;
    transition:transform .24s cubic-bezier(.2,.8,.2,1), visibility .24s;
  }
  .ca-mobile-nav-sheet.is-open { transform:translateY(0); visibility:visible; }
  .ca-mobile-sheet-handle { width:40px; height:4px; margin:1px auto 7px; border-radius:999px; background:#ccd8e4; }
  .ca-mobile-sheet-head { display:flex; align-items:center; justify-content:space-between; padding:2px 2px 10px; }
  .ca-mobile-sheet-head strong { color:#142944; font-size:18px; }
  .ca-mobile-sheet-close { width:34px; height:34px; border:0; border-radius:50%; background:#edf3f8; color:#52667d; font-size:22px; cursor:pointer; }
  .ca-mobile-sheet-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .ca-mobile-sheet-grid a {
    min-width:0;
    min-height:54px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:9px 10px;
    border:1px solid #e1e9f1;
    border-radius:12px;
    background:#fbfdff;
    color:#1b3553;
    text-decoration:none;
    font-size:13px;
    font-weight:750;
  }
  .ca-mobile-sheet-grid a.is-active { border-color:#a9d5f2; background:#eaf5fd; color:#0869ad; }
  .ca-sheet-icon {
    flex:0 0 34px;
    width:34px;
    height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    background:#eaf2f8;
    color:#0b6fae;
    font-size:19px;
    font-weight:800;
  }
  .ca-mobile-sheet-grid a.is-active .ca-sheet-icon { background:#d6edfb; }

  /* v2.33.03: restore the full pre-v2.33 mobile Invoices title card. */
  html body .ca-invoice-list-header {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    gap:14px !important;
    padding:18px !important;
    margin:0 0 18px !important;
    border:1px solid var(--ds-border, #dbe7f2) !important;
    border-radius:14px !important;
    box-shadow:var(--ds-shadow-sm, 0 2px 8px rgba(15,23,42,.05)) !important;
    background:var(--ds-surface, #fff) !important;
  }
  .ca-invoice-list-header > div { width:100% !important; min-width:0 !important; }
  .ca-invoice-list-header h1 {
    margin:0 0 7px !important;
    font-size:22px !important;
    line-height:1.15 !important;
  }
  .ca-invoice-list-header p {
    display:block !important;
    margin:0 !important;
    color:var(--ds-text-3, #64748b) !important;
    font-size:13px !important;
    line-height:1.45 !important;
  }
  .ca-invoice-list-header .wave-filter-chip { display:block !important; margin-top:10px !important; }
  .ca-invoice-list-header > a.wave-btn {
    flex:none !important;
    width:100% !important;
    min-width:0 !important;
    min-height:46px !important;
    height:auto !important;
    padding:11px 16px !important;
    border-radius:11px !important;
    overflow:visible !important;
    font-size:14px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    box-shadow:none !important;
    white-space:normal !important;
    text-align:center !important;
  }
  .ca-invoice-list-header > a.wave-btn::before { content:none !important; display:none !important; }
  .ca-invoice-list-header .ca-desktop-create-invoice-label { display:none !important; }
  .ca-invoice-list-header .ca-mobile-create-invoice-label { display:inline !important; }

  html body .ca-invoice-overview {
    display:flex !important;
    grid-template-columns:none !important;
    gap:9px !important;
    margin:6px 0 12px !important;
    padding:0 0 4px !important;
    overflow-x:auto !important;
    scroll-snap-type:x proximity;
    background:transparent !important;
    border:0 !important;
    border-radius:0 !important;
    scrollbar-width:none;
  }
  .ca-invoice-overview::-webkit-scrollbar { display:none; }
  .ca-invoice-overview-card {
    flex:0 0 min(47vw, 175px);
    min-height:70px;
    scroll-snap-align:start;
    padding:11px 12px;
    box-sizing:border-box;
    border:1px solid #dce7f0;
    border-radius:12px;
    background:#fff;
  }
  .ca-invoice-overview-card strong { margin-bottom:5px !important; font-size:10px !important; text-transform:uppercase; letter-spacing:.04em; }
  .ca-invoice-overview-card .amount { font-size:18px !important; font-weight:750 !important; white-space:nowrap; }
  .ca-invoice-overview-card .muted { display:none; }

  html body .wave-enhanced-list[data-table-kind="invoices"] {
    padding:10px !important;
    border-radius:14px !important;
  }
  .wave-enhanced-list[data-table-kind="invoices"] > .wave-section-head { margin-bottom:8px !important; }
  .wave-enhanced-list[data-table-kind="invoices"] > .wave-section-head h2 { font-size:15px !important; }

  .ca-invoice-filter-form {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:end !important;
    gap:8px !important;
    padding:0 !important;
    margin:0 0 8px !important;
    background:transparent !important;
    border:0 !important;
  }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
    min-width:0;
  }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices > label { display:none !important; min-width:0; }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices > label:first-child { display:block !important; grid-column:1/-1; }
  .ca-invoice-filter-form.is-expanded .wave-list-tools-grid-invoices > label { display:block !important; }
  .ca-invoice-filter-form label > span { font-size:10px !important; margin-bottom:3px !important; }
  .ca-invoice-filter-form input,
  .ca-invoice-filter-form select { min-height:40px !important; font-size:13px !important; }
  .ca-mobile-invoice-filter-toggle {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:76px;
    min-height:40px;
    padding:0 12px;
    border:1px solid #b7c9d9;
    border-radius:10px;
    background:#fff;
    color:#24425f;
    font:750 13px/1 inherit;
    cursor:pointer;
  }
  .ca-invoice-filter-form.is-expanded .ca-mobile-invoice-filter-toggle { background:#eaf4fb; border-color:#8dbad8; }

  html body .ca-invoice-tabs {
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    justify-content:stretch !important;
    overflow:visible !important;
    margin:8px 0 10px !important;
    border:0 !important;
    border-radius:11px !important;
    background:#eaf3fa !important;
    padding:3px !important;
  }
  html body .ca-invoice-tabs a {
    min-width:0;
    padding:8px 5px !important;
    border:0 !important;
    border-radius:9px !important;
    background:transparent !important;
    text-align:center;
    font-size:11px !important;
    white-space:nowrap;
  }
  html body .ca-invoice-tabs a.is-active { background:#fff !important; box-shadow:0 2px 8px rgba(15,23,42,.12) !important; }
  .ca-invoice-tabs .badge { min-width:17px !important; height:17px !important; margin-left:2px !important; font-size:10px !important; }

  .wave-enhanced-list[data-table-kind="invoices"] .wave-bulk-toolbar {
    gap:6px !important;
    padding:7px !important;
    margin-bottom:8px !important;
    border-radius:10px !important;
  }
  .wave-enhanced-list[data-table-kind="invoices"] .wave-bulk-toolbar select { min-width:110px !important; }
  .wave-enhanced-list[data-table-kind="invoices"] .wave-bulk-count { font-size:11px !important; }

  .wave-enhanced-list[data-table-kind="invoices"] .wave-table-wrap {
    overflow:visible !important;
    margin:0 !important;
    border:0 !important;
  }
  .wave-invoice-list,
  .wave-invoice-list tbody { display:block !important; width:100% !important; }
  .wave-invoice-list thead { display:none !important; }
  /* v2.33.03: reliable visible separation between compact cards on mobile. */
  .wave-invoice-list tbody {
    display:block !important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row {
    width:100% !important;
    min-height:82px !important;
    box-sizing:border-box !important;
    display:grid !important;
    grid-template-columns:22px minmax(0,1fr) auto !important;
    grid-template-rows:auto auto auto !important;
    grid-template-areas:
      "select number due"
      "select customer due"
      "select date status" !important;
    column-gap:8px !important;
    row-gap:2px !important;
    align-items:center !important;
    margin:0 0 12px !important;
    padding:9px 8px !important;
    border:1px solid #dce7f0 !important;
    border-radius:11px !important;
    background:#fff !important;
    box-shadow:0 2px 7px rgba(15,23,42,.035) !important;
    cursor:pointer;
  }
  .wave-invoice-list tbody > tr.ca-mobile-invoice-row:last-child { margin-bottom:0 !important; }
  .wave-invoice-list tr.ca-mobile-invoice-row:active { background:#f4f9fd !important; transform:scale(.997); }
  .wave-invoice-list tr.ca-mobile-invoice-row:focus-visible { outline:2px solid #1783c7 !important; outline-offset:1px; }
  .wave-invoice-list tr.ca-mobile-invoice-row > td {
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    line-height:1.2 !important;
  }
  .ca-invoice-select-cell { grid-area:select; align-self:center; }
  .ca-invoice-number-cell { grid-area:number; font-size:14px; font-weight:850; color:#102a44; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-invoice-number-cell > a { color:inherit; text-decoration:none; }
  .ca-mobile-recurring-mark { display:inline; margin-left:4px; color:#2f86bb; font-size:13px; }
  .ca-desktop-recurring { display:none !important; }
  .ca-invoice-customer-cell { grid-area:customer; color:#51657a !important; font-size:12px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-invoice-date-cell { grid-area:date; color:#74869a !important; font-size:10.5px !important; white-space:nowrap; }
  .ca-desktop-invoice-date { display:none; }
  .ca-mobile-invoice-date { display:inline; }
  .wave-invoice-list tr.ca-mobile-invoice-row > td::before { content:none !important; display:none !important; }
  .wave-invoice-list tr.ca-mobile-invoice-row > td.ca-invoice-project-cell,
  .wave-invoice-list tr.ca-mobile-invoice-row > td.ca-invoice-total-cell,
  .wave-invoice-list tr.ca-mobile-invoice-row > td.ca-invoice-actions-cell { display:none !important; }
  .ca-invoice-due-cell { grid-area:due; justify-self:end; align-self:start; color:#102a44 !important; font-size:14px !important; font-weight:850 !important; white-space:nowrap; }
  .ca-mobile-amount-label { display:inline; margin-right:3px; color:#8a9bae; font-size:9px; font-weight:750; text-transform:uppercase; }
  .ca-invoice-status-cell { grid-area:status; justify-self:end; }
  .ca-invoice-status-cell .wave-status-badge { min-height:18px !important; padding:2px 6px !important; font-size:8.5px !important; line-height:1 !important; }

  /* Dashboard Recent invoices use the same compact mobile card without bulk selection. */
  .ca-dashboard-invoice-list tr.ca-dashboard-mobile-invoice-row {
    grid-template-columns:minmax(0,1fr) auto !important;
    grid-template-areas:
      "number due"
      "customer due"
      "date status" !important;
  }
  .ca-dashboard-invoice-list tr.ca-dashboard-mobile-invoice-row > td.ca-dashboard-mobile-due-only { display:block !important; }
  .wave-invoice-list tbody > tr:not(.ca-mobile-invoice-row) td { display:block !important; padding:18px 10px !important; text-align:center; }

  .wave-enhanced-list[data-table-kind="invoices"] .ca-pagination {
    margin-top:10px !important;
    padding-top:10px !important;
  }
}

@media (max-width: 430px) {
  .ca-mobile-page-title { font-size:16px; }
  .ca-mobile-sheet-grid { gap:7px; }
  .ca-mobile-sheet-grid a { padding:8px; font-size:12px; }
  .ca-sheet-icon { flex-basis:31px; width:31px; height:31px; font-size:17px; }
  .ca-invoice-overview-card { flex-basis:158px; }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices { grid-template-columns:1fr !important; }
  .wave-invoice-list tr.ca-mobile-invoice-row {
    grid-template-columns:20px minmax(0,1fr) auto !important;
    column-gap:6px !important;
    padding:8px 7px !important;
  }
  .ca-dashboard-invoice-list tr.ca-dashboard-mobile-invoice-row {
    grid-template-columns:minmax(0,1fr) auto !important;
  }
}

/* v2.33.01 dark mobile surfaces */
@media (max-width: 900px) {
  html[data-theme="dark"] body .wave-mobile-topbar.ca-wave-mobile-header,
  body.ca-core-dark .wave-mobile-topbar.ca-wave-mobile-header,
  body.ca-dark-page .wave-mobile-topbar.ca-wave-mobile-header,
  html[data-theme="dark"] body .ca-mobile-bottom-nav,
  body.ca-core-dark .ca-mobile-bottom-nav,
  body.ca-dark-page .ca-mobile-bottom-nav,
  html[data-theme="dark"] body .ca-mobile-nav-sheet,
  body.ca-core-dark .ca-mobile-nav-sheet,
  body.ca-dark-page .ca-mobile-nav-sheet,
  html[data-theme="dark"] body .ca-mobile-more-menu,
  body.ca-core-dark .ca-mobile-more-menu,
  body.ca-dark-page .ca-mobile-more-menu,
  html[data-theme="dark"] body .wave-invoice-list tr.ca-mobile-invoice-row,
  body.ca-core-dark .wave-invoice-list tr.ca-mobile-invoice-row,
  body.ca-dark-page .wave-invoice-list tr.ca-mobile-invoice-row,
  html[data-theme="dark"] body .ca-invoice-overview-card,
  body.ca-core-dark .ca-invoice-overview-card,
  body.ca-dark-page .ca-invoice-overview-card {
    background:#121d2d !important;
    border-color:#2d3d52 !important;
    color:#e8eef6 !important;
  }
  html[data-theme="dark"] body .ca-mobile-page-title,
  body.ca-core-dark .ca-mobile-page-title,
  body.ca-dark-page .ca-mobile-page-title,
  html[data-theme="dark"] body .ca-mobile-sheet-head strong,
  body.ca-core-dark .ca-mobile-sheet-head strong,
  body.ca-dark-page .ca-mobile-sheet-head strong,
  html[data-theme="dark"] body .ca-invoice-number-cell,
  body.ca-core-dark .ca-invoice-number-cell,
  body.ca-dark-page .ca-invoice-number-cell,
  html[data-theme="dark"] body .ca-invoice-total-cell,
  body.ca-core-dark .ca-invoice-total-cell,
  body.ca-dark-page .ca-invoice-total-cell,
  html[data-theme="dark"] body .ca-invoice-overview-card .amount,
  body.ca-core-dark .ca-invoice-overview-card .amount,
  body.ca-dark-page .ca-invoice-overview-card .amount { color:#f4f7fb !important; }
  html[data-theme="dark"] body .ca-mobile-nav-item,
  body.ca-core-dark .ca-mobile-nav-item,
  body.ca-dark-page .ca-mobile-nav-item { color:#93a7bd; }
  html[data-theme="dark"] body .ca-mobile-nav-item.is-active,
  body.ca-core-dark .ca-mobile-nav-item.is-active,
  body.ca-dark-page .ca-mobile-nav-item.is-active,
  html[data-theme="dark"] body .ca-mobile-nav-item[aria-expanded="true"],
  body.ca-core-dark .ca-mobile-nav-item[aria-expanded="true"],
  body.ca-dark-page .ca-mobile-nav-item[aria-expanded="true"] { color:#64b9ef; background:#17344c; }
  html[data-theme="dark"] body .ca-mobile-sheet-grid a,
  body.ca-core-dark .ca-mobile-sheet-grid a,
  body.ca-dark-page .ca-mobile-sheet-grid a { background:#182638; border-color:#304158; color:#dce7f3; }
  html[data-theme="dark"] body .ca-mobile-sheet-grid a.is-active,
  body.ca-core-dark .ca-mobile-sheet-grid a.is-active,
  body.ca-dark-page .ca-mobile-sheet-grid a.is-active { background:#173b57; border-color:#326789; color:#83caf5; }
  html[data-theme="dark"] body .ca-sheet-icon,
  body.ca-core-dark .ca-sheet-icon,
  body.ca-dark-page .ca-sheet-icon { background:#21344a; color:#73c1ef; }
  html[data-theme="dark"] body .ca-mobile-invoice-filter-toggle,
  body.ca-core-dark .ca-mobile-invoice-filter-toggle,
  body.ca-dark-page .ca-mobile-invoice-filter-toggle { background:#182638; border-color:#3a4c61; color:#d8e4ef; }
  html[data-theme="dark"] body .ca-invoice-tabs,
  body.ca-core-dark .ca-invoice-tabs,
  body.ca-dark-page .ca-invoice-tabs { background:#182638 !important; }
  html[data-theme="dark"] body .ca-invoice-tabs a.is-active,
  body.ca-core-dark .ca-invoice-tabs a.is-active,
  body.ca-dark-page .ca-invoice-tabs a.is-active { background:#26374b !important; color:#fff !important; }
  html[data-theme="dark"] body .ca-mobile-more-menu > a,
  body.ca-core-dark .ca-mobile-more-menu > a,
  body.ca-dark-page .ca-mobile-more-menu > a,
  html[data-theme="dark"] body .ca-mobile-menu-action,
  body.ca-core-dark .ca-mobile-menu-action,
  body.ca-dark-page .ca-mobile-menu-action { color:#d8e4ef; }
}

/* Preserve the original desktop invoice number cell; switch to the mobile link only in compact rows. */
.ca-mobile-invoice-number-link { display:none; }
@media (max-width:900px) {
  .ca-desktop-invoice-number { display:none; }
  .ca-mobile-invoice-number-link { display:inline; }
}


/* v2.33.01: the Dashboard's extra Amount due column exists only for the compact mobile card. */
@media (min-width: 901px) {
  .ca-dashboard-mobile-due-head,
  .ca-dashboard-mobile-due-only { display:none !important; }
}


/* ══════════════════════════════════════════════════════════════════
   v2.33.04 — Mobile invoice spacing tuning + mobile Estimates cards
   Mobile-only overrides. Desktop layout remains unchanged.
   ══════════════════════════════════════════════════════════════════ */
.ca-mobile-estimate-number-link,
.ca-mobile-estimate-valid-text { display:none; }

@media (max-width:900px) {
  /* Keep a smaller gap between invoice cards, but make each card breathe more internally. */
  .wave-invoice-list tr.ca-mobile-invoice-row {
    min-height:94px !important;
    margin:0 0 8px !important;
    padding:12px 10px !important;
    row-gap:4px !important;
    border-radius:12px !important;
  }

  /* Estimates use the same compact mobile-card system as invoices. */
  .wave-enhanced-list[data-table-kind="estimates"] .wave-table-wrap {
    overflow:visible !important;
    margin:0 !important;
    border:0 !important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] .wave-sortable-table,
  .wave-enhanced-list[data-table-kind="estimates"] .wave-sortable-table tbody {
    display:block !important;
    width:100% !important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] .wave-sortable-table thead {
    display:none !important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row {
    width:100% !important;
    min-height:94px !important;
    box-sizing:border-box !important;
    display:grid !important;
    grid-template-columns:22px minmax(0,1fr) auto !important;
    grid-template-rows:auto auto auto !important;
    grid-template-areas:
      "select number total"
      "select customer total"
      "select valid status" !important;
    column-gap:8px !important;
    row-gap:4px !important;
    align-items:center !important;
    margin:0 0 8px !important;
    padding:12px 10px !important;
    border:1px solid #dce7f0 !important;
    border-radius:12px !important;
    background:#fff !important;
    box-shadow:0 2px 7px rgba(15,23,42,.035) !important;
    cursor:pointer;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tbody > tr.ca-mobile-estimate-row:last-child {
    margin-bottom:0 !important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row:active {
    background:#f4f9fd !important;
    transform:scale(.997);
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row:focus-visible {
    outline:2px solid #1783c7 !important;
    outline-offset:1px;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row > td {
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    line-height:1.2 !important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row > td::before {
    content:none !important;
    display:none !important;
  }
  .ca-estimate-select-cell { grid-area:select; align-self:center; }
  .ca-estimate-status-cell { grid-area:status; justify-self:end; }
  .ca-estimate-status-cell .wave-status-badge { min-height:18px !important; padding:2px 8px !important; font-size:8.5px !important; line-height:1 !important; }
  .ca-estimate-number-cell { grid-area:number; font-size:14px; font-weight:850; color:#102a44; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-estimate-number-cell > a { color:inherit; text-decoration:none; }
  .ca-desktop-estimate-number,
  .ca-desktop-estimate-valid { display:none !important; }
  .ca-mobile-estimate-number-link,
  .ca-mobile-estimate-valid-text { display:inline; }
  .ca-estimate-customer-cell { grid-area:customer; color:#51657a !important; font-size:12px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-estimate-valid-cell { grid-area:valid; color:#74869a !important; font-size:10.5px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-estimate-total-cell { grid-area:total; justify-self:end; align-self:start; color:#102a44 !important; font-size:14px !important; font-weight:850 !important; white-space:nowrap; }
  .ca-estimate-total-cell::before { content:"TOTAL"; display:inline; margin-right:3px; color:#8a9bae; font-size:9px; font-weight:750; text-transform:uppercase; }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row > td.ca-estimate-date-cell,
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row > td.ca-estimate-actions-cell { display:none !important; }
  .wave-enhanced-list[data-table-kind="estimates"] tbody > tr:not(.ca-mobile-estimate-row) td {
    display:block !important;
    padding:18px 10px !important;
    text-align:center;
  }

  html[data-theme="dark"] body .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row,
  body.ca-core-dark .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row,
  body.ca-dark-page .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row {
    background:#121d2d !important;
    border-color:#2d3d52 !important;
    color:#e8eef6 !important;
  }
  html[data-theme="dark"] body .ca-estimate-number-cell,
  body.ca-core-dark .ca-estimate-number-cell,
  body.ca-dark-page .ca-estimate-number-cell,
  html[data-theme="dark"] body .ca-estimate-total-cell,
  body.ca-core-dark .ca-estimate-total-cell,
  body.ca-dark-page .ca-estimate-total-cell {
    color:#f4f7fb !important;
  }
}

@media (max-width:430px) {
  .wave-invoice-list tr.ca-mobile-invoice-row {
    min-height:92px !important;
    margin-bottom:8px !important;
    padding:11px 8px !important;
    row-gap:4px !important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row {
    grid-template-columns:20px minmax(0,1fr) auto !important;
    min-height:92px !important;
    column-gap:6px !important;
    padding:11px 8px !important;
    row-gap:4px !important;
  }
}

/* v2.33.05 — View Invoice / View Estimate document action buttons */
.wave-public-toolbtn.wave-public-toolbtn-danger{
  border-color:#fecaca!important;
  background:#fff7f7!important;
  color:#b91c1c!important;
  font-weight:800!important;
}
.wave-public-toolbtn.wave-public-toolbtn-danger:hover{
  background:#fee2e2!important;
  border-color:#fca5a5!important;
  color:#991b1b!important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn.wave-public-toolbtn-danger,
body.ca-dark-page .wave-public-toolbtn.wave-public-toolbtn-danger,
body[data-theme="dark"] .wave-public-toolbtn.wave-public-toolbtn-danger{
  background:#3f1d1d!important;
  border-color:#7f1d1d!important;
  color:#fecaca!important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbtn.wave-public-toolbtn-danger:hover,
body.ca-dark-page .wave-public-toolbtn.wave-public-toolbtn-danger:hover,
body[data-theme="dark"] .wave-public-toolbtn.wave-public-toolbtn-danger:hover{
  background:#5f2020!important;
  color:#fff!important;
}


/* v2.33.06 — document action refinements */
.wave-public-toolbar .ca-invoice-view-delete-btn,
.wave-public-toolbar .ca-invoice-view-delete-form .wave-public-toolbtn-danger{
  background:#fff7f7!important;
  border:1px solid #fecaca!important;
  color:#b91c1c!important;
  font-weight:800!important;
  box-shadow:none!important;
}
.wave-public-toolbar .ca-invoice-view-delete-btn:hover,
.wave-public-toolbar .ca-invoice-view-delete-form .wave-public-toolbtn-danger:hover{
  background:#fee2e2!important;
  border-color:#fca5a5!important;
  color:#991b1b!important;
}
.wave-public-toolbar .ca-estimate-convert-btn{
  border-color:#bbf7d0!important;
  background:#f0fdf4!important;
  color:#166534!important;
  font-weight:800!important;
}
.wave-public-toolbar .ca-estimate-convert-btn:hover{
  background:#dcfce7!important;
  border-color:#86efac!important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbar .ca-invoice-view-delete-btn,
.wave-portal-shell[data-theme="dark"] .wave-public-toolbar .ca-invoice-view-delete-form .wave-public-toolbtn-danger,
body.ca-dark-page .wave-public-toolbar .ca-invoice-view-delete-btn,
body.ca-dark-page .wave-public-toolbar .ca-invoice-view-delete-form .wave-public-toolbtn-danger{
  background:#3f1d1d!important;
  border-color:#7f1d1d!important;
  color:#fecaca!important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-toolbar .ca-estimate-convert-btn,
body.ca-dark-page .wave-public-toolbar .ca-estimate-convert-btn{
  background:#0f2f1f!important;
  border-color:#166534!important;
  color:#bbf7d0!important;
}


/* v2.33.07 — force View Invoice Delete button danger style */
.wave-public-invoice .wave-public-toolbar .ca-invoice-view-delete-btn,
.wave-public-invoice-flat .wave-public-toolbar .ca-invoice-view-delete-btn,
button.wave-public-toolbtn.wave-public-toolbtn-danger.ca-invoice-view-delete-btn{
  background:#fff7f7!important;
  border:1px solid #fecaca!important;
  color:#b91c1c!important;
  font-weight:800!important;
  box-shadow:none!important;
}
.wave-public-invoice .wave-public-toolbar .ca-invoice-view-delete-btn:hover,
.wave-public-invoice-flat .wave-public-toolbar .ca-invoice-view-delete-btn:hover,
button.wave-public-toolbtn.wave-public-toolbtn-danger.ca-invoice-view-delete-btn:hover{
  background:#fee2e2!important;
  border-color:#fca5a5!important;
  color:#991b1b!important;
}
.wave-portal-shell[data-theme="dark"] .wave-public-invoice .wave-public-toolbar .ca-invoice-view-delete-btn,
body.ca-dark-page .wave-public-invoice .wave-public-toolbar .ca-invoice-view-delete-btn,
body[data-theme="dark"] .wave-public-invoice .wave-public-toolbar .ca-invoice-view-delete-btn{
  background:#3f1d1d!important;
  border-color:#7f1d1d!important;
  color:#fecaca!important;
}

/* v2.33.09 — Payment receipt PAID stamp placement; v2.33.08 business branding */
.wave-receipt-sheet {
  position: relative;
  overflow: hidden;
}
.wave-receipt-paid-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 28px auto 30px;
  padding: 6px 18px;
  border: 7px solid #6fbf2f;
  border-radius: 8px;
  color: #5eaa24;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  transform: rotate(-10deg);
  opacity: 0.88;
}
@media (max-width: 640px) {
  .wave-receipt-paid-stamp {
    margin: 24px auto 26px;
    font-size: 34px;
    border-width: 6px;
    padding: 5px 14px;
  }
}

/* v2.34.03 Credit Notes polish: auto filters, public share/print, visible document outline */
.ca-credit-note-filter-form.ca-auto-filter-row{
  display:grid!important;
  grid-template-columns:minmax(260px,2fr) minmax(170px,1fr) minmax(150px,.85fr) minmax(150px,.85fr)!important;
  gap:12px!important;
  align-items:end!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row label{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  gap:6px!important;
  margin:0!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row input,
.ca-credit-note-filter-form.ca-auto-filter-row select{
  width:100%!important;
  min-height:42px!important;
  border-radius:12px!important;
  box-sizing:border-box!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-date-input{
  padding-right:42px!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-date-icon{
  position:absolute!important;
  right:12px!important;
  bottom:11px!important;
  width:20px!important;
  height:20px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  opacity:.72!important;
  pointer-events:auto!important;
  font-size:15px!important;
}
.ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
.wave-credit-note-public-body .ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
  border:1px solid #d8e6f3!important;
  box-shadow:0 18px 48px rgba(15,23,42,.08)!important;
  background:#fff!important;
}
@media(max-width:900px){
  .ca-credit-note-filter-form.ca-auto-filter-row{grid-template-columns:1fr 1fr!important;}
  .ca-credit-note-filter-form.ca-auto-filter-row label:first-of-type{grid-column:1 / -1!important;}
}
@media(max-width:620px){
  .ca-credit-note-filter-form.ca-auto-filter-row{grid-template-columns:1fr!important;}
  .ca-credit-note-filter-form.ca-auto-filter-row label:first-of-type{grid-column:auto!important;}
}
@media print{
  .ca-public-credit-note-print .ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.wave-invoice-print-body .ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
    border:0!important;
    box-shadow:none!important;
  }
}


/* v2.34.04 Credit Note print/outline/icon fix */
.ca-credit-note-filter-form.ca-auto-filter-row{
  display:grid!important;
  grid-template-columns:minmax(280px,2fr) minmax(160px,.9fr) minmax(150px,.75fr) minmax(150px,.75fr)!important;
  gap:12px!important;
  align-items:end!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-date-icon.ca-date-icon-flat svg{
  width:19px!important;
  height:19px!important;
  display:block!important;
  fill:none!important;
  stroke:#64748b!important;
  stroke-width:2!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-date-icon.ca-date-icon-flat:hover svg{
  stroke:#0ea5e9!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
html body .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
html body.wave-credit-note-public-body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{
  box-sizing:border-box!important;
  border:1px solid #d8e6f3!important;
  box-shadow:0 18px 48px rgba(15,23,42,.08)!important;
  background:#fff!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
html body .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
html body.wave-credit-note-public-body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
  border:1px solid #d8e6f3!important;
  box-shadow:none!important;
  background:#fff!important;
}
@media(max-width:980px){
  .ca-credit-note-filter-form.ca-auto-filter-row{grid-template-columns:1fr 1fr!important;}
  .ca-credit-note-filter-form.ca-auto-filter-row label:first-of-type{grid-column:1 / -1!important;}
}
@media(max-width:620px){
  .ca-credit-note-filter-form.ca-auto-filter-row{grid-template-columns:1fr!important;}
  .ca-credit-note-filter-form.ca-auto-filter-row label:first-of-type{grid-column:auto!important;}
}
@media print{
  @page{size:A4 portrait;margin:0;}
  body.ca-credit-note-print-mode,
  body.ca-public-credit-note-print{background:#fff!important;margin:0!important;padding:0!important;overflow:visible!important;}
  body.ca-credit-note-print-mode .no-print,
  body.ca-credit-note-print-mode .wave-public-toolbar,
  body.ca-credit-note-print-mode .wave-sidebar,
  body.ca-credit-note-print-mode .wave-topbar,
  body.ca-credit-note-print-mode .wave-bottom-nav,
  body.ca-credit-note-print-mode .ca-mobile-bottom-nav,
  body.ca-credit-note-print-mode #wpadminbar,
  body.ca-public-credit-note-print .no-print,
  body.ca-public-credit-note-print .wave-public-toolbar{display:none!important;}
  body.ca-credit-note-print-mode .wave-app-shell,
  body.ca-credit-note-print-mode .wave-main,
  body.ca-credit-note-print-mode .wave-page-content,
  body.ca-credit-note-print-mode .wave-card,
  body.ca-credit-note-print-mode .ca-credit-note-view-page,
  body.ca-public-credit-note-print .wave-main.wave-portal-page{
    display:block!important;margin:0!important;padding:0!important;width:210mm!important;max-width:210mm!important;background:#fff!important;overflow:visible!important;
  }
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{
    display:block!important;position:static!important;margin:0!important;padding:0!important;width:210mm!important;max-width:210mm!important;min-width:210mm!important;border:0!important;box-shadow:none!important;background:#fff!important;overflow:visible!important;
  }
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
    display:flex!important;flex-direction:column!important;width:210mm!important;max-width:210mm!important;min-width:210mm!important;min-height:297mm!important;margin:0!important;padding:18mm 16mm 14mm!important;border:0!important;box-shadow:none!important;border-radius:0!important;background:#fff!important;box-sizing:border-box!important;overflow:visible!important;visibility:visible!important;
  }
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet *,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet *{visibility:visible!important;}
  body.ca-credit-note-print-mode .ca-credit-safe-note,
  body.ca-public-credit-note-print .ca-credit-safe-note{display:none!important;}
}

/* v2.34.05 Credit Notes bulk/public toolbar/filter alignment */
.ca-credit-notes-page .wave-bulk-toolbar{
  margin:0 0 14px!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row{
  display:block!important;
  margin:0 0 16px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid{
  display:grid!important;
  grid-template-columns:minmax(210px,1.6fr) minmax(100px,.75fr) minmax(120px,.9fr) repeat(2,minmax(135px,.95fr))!important;
  gap:8px!important;
  align-items:end!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row label{
  display:block!important;
  min-width:0!important;
  margin:0!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row label span{
  display:block!important;
  font-size:11px!important;
  font-weight:600!important;
  color:var(--ds-text-3)!important;
  margin:0 0 5px!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row input,
.ca-credit-note-filter-form.ca-auto-filter-row select{
  width:100%!important;
  height:38px!important;
  min-height:38px!important;
  padding:0 12px!important;
  font-family:var(--ds-font)!important;
  font-size:13px!important;
  color:var(--ds-text)!important;
  background:var(--ds-surface)!important;
  border:1px solid var(--ds-border-2)!important;
  border-radius:var(--ds-r-md)!important;
  box-sizing:border-box!important;
  box-shadow:none!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row input:focus,
.ca-credit-note-filter-form.ca-auto-filter-row select:focus{
  outline:none!important;
  border-color:var(--ds-primary)!important;
  box-shadow:0 0 0 3px rgba(14,165,233,.15)!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-wrap{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  width:100%!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-wrap .wave-date-ddmmyyyy{
  padding-right:44px!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .wave-native-date-picker{
  position:absolute!important;
  right:0!important;
  bottom:0!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-btn,
.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-flat-calendar{
  position:absolute!important;
  right:7px!important;
  top:50%!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  width:32px!important;
  height:32px!important;
  border:1px solid var(--ds-border-2)!important;
  border-radius:10px!important;
  background:#f8fafc!important;
  color:#64748b!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  opacity:1!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-btn::before,
.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-flat-calendar::before{
  content:""!important;
  display:block!important;
  width:16px!important;
  height:16px!important;
  margin:0!important;
  background:currentColor!important;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M7 2h2v2h6V2h2v2h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V6H4v2Z"/></svg>') center/contain no-repeat!important;
  mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M7 2h2v2h6V2h2v2h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V6H4v2Z"/></svg>') center/contain no-repeat!important;
}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-date-icon{display:none!important;}
body.ca-dark-page .ca-credit-note-filter-form.ca-auto-filter-row input,
body.ca-dark-page .ca-credit-note-filter-form.ca-auto-filter-row select,
body.ca-dark-mode .ca-credit-note-filter-form.ca-auto-filter-row input,
body.ca-dark-mode .ca-credit-note-filter-form.ca-auto-filter-row select,
body.dark-mode .ca-credit-note-filter-form.ca-auto-filter-row input,
body.dark-mode .ca-credit-note-filter-form.ca-auto-filter-row select{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#e5edf6!important;
}
body.ca-dark-page .ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-btn,
body.ca-dark-mode .ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-btn,
body.dark-mode .ca-credit-note-filter-form.ca-auto-filter-row .wave-date-picker-btn{
  background:#111827!important;
  border-color:#334155!important;
  color:#cbd5e1!important;
}
.ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
.wave-credit-note-public-body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{
  border:1px solid #d8e6f3!important;
  outline:1px solid #d8e6f3!important;
  outline-offset:0!important;
  border-radius:0!important;
  box-shadow:0 18px 48px rgba(15,23,42,.08)!important;
  background:#fff!important;
}
.ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
.wave-credit-note-public-body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
  border:1px solid #d8e6f3!important;
  background:#fff!important;
}
.wave-credit-note-public-body .wave-public-toolbar{
  display:flex!important;
  justify-content:flex-end!important;
  gap:10px!important;
  flex-wrap:wrap!important;
}
@media(max-width:980px){
  .ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid{grid-template-columns:1fr 1fr!important;}
  .ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid label:first-child{grid-column:1/-1!important;}
}
@media(max-width:620px){
  .ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid{grid-template-columns:1fr!important;}
  .ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid label:first-child{grid-column:auto!important;}
  .ca-credit-notes-page .wave-bulk-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;}
  .ca-credit-notes-page .wave-bulk-toolbar select,
  .ca-credit-notes-page .wave-bulk-toolbar button{width:100%!important;}
}
@media print{
  .wave-credit-note-public-body .wave-public-toolbar,
  .ca-credit-note-view-page .wave-public-toolbar,
  body.ca-credit-note-print-mode .wave-public-toolbar{display:none!important;}
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{
    outline:0!important;
    border:0!important;
    box-shadow:none!important;
  }
}

/* v2.34.07: Credit Notes should not make a fully credited invoice look like a payment. */
.wave-status-badge.status-credited,
.wave-status-select.status-credited {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.ca-credit-deduction-line strong { color:#047857; }
.ca-credit-history { margin-top:12px; }
.ca-credit-history-row a { color:#0369a1; text-decoration:none; }
.ca-credit-history-row a:hover { text-decoration:underline; }
@media print {
  .ca-credit-history { display:none !important; }
}

/* v2.34.08 — Invoice credit display polish and same-tab view support. */
html body .wave-payment-manage-card .ca-credit-history {
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid #e2e8f0 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #475569 !important;
}
html body .wave-payment-manage-card .ca-credit-history > strong {
  display: block !important;
  margin-bottom: 3px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  color: #0f172a !important;
}
html body .wave-payment-manage-card .ca-credit-history-row,
html body .wave-payment-manage-card .ca-credit-history-row span,
html body .wave-payment-manage-card .ca-credit-history-row strong,
html body .wave-payment-manage-card .ca-credit-history-row a {
  font-size: 12px !important;
  line-height: 1.35 !important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals.ca-has-credit-deductions,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-totals.ca-has-credit-deductions {
  width: 112mm !important;
  max-width: 112mm !important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals.ca-has-credit-deductions .ca-credit-deduction-line,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-totals.ca-has-credit-deductions .ca-credit-deduction-line {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  gap: 18px !important;
  align-items: start !important;
  padding-top: 7px !important;
  margin-top: 2px !important;
  font-size: 11px !important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .ca-credit-deduction-line span,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .ca-credit-deduction-line span {
  min-width: 0 !important;
  max-width: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-align: left !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  color: #64748b !important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .ca-credit-deduction-line strong,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .ca-credit-deduction-line strong {
  justify-self: end !important;
  min-width: 82px !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  color: #047857 !important;
}
@media (max-width: 760px) {
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals.ca-has-credit-deductions,
  html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-totals.ca-has-credit-deductions {
    width: 100% !important;
    max-width: 100% !important;
  }
}
@media print {
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-totals.ca-has-credit-deductions,
  html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-totals.ca-has-credit-deductions {
    width: 112mm !important;
    max-width: 112mm !important;
  }
}

/* v2.34.09 — Credit Note source invoice typography/link polish. */
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line span,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line strong,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line a {
  font-size: 11px !important;
  line-height: 1.25 !important;
}
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line {
  margin-top: 14px !important;
  letter-spacing: .01em !important;
}
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line span {
  color: #64748b !important;
  text-transform: uppercase !important;
  font-weight: 800 !important;
}
html body .ca-doc-v2290-credit-note .ca-credit-note-source-line a,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-meta a {
  color: #075985 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  font-weight: 800 !important;
}
html body .ca-doc-v2290-credit-note .ca-credit-note-source-meta,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-meta span,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-meta strong,
html body .ca-doc-v2290-credit-note .ca-credit-note-source-meta a {
  font-size: 11px !important;
  line-height: 1.25 !important;
}


/* v2.34.15 — Credit Note border aligned with Invoice; print is borderless and A4-fit. */
.ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
.wave-credit-note-public-body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
}
.ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
.wave-credit-note-public-body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
  border:1px solid #dbe5ef!important;
  outline:0!important;
  box-shadow:0 10px 30px rgba(15,23,42,.08)!important;
  background:#fff!important;
}
@media print{
  html body .ca-credit-note-print-isolated-v23413.wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  html body .ca-credit-note-print-isolated-v23413.wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note.ca-print-isolated-document-v23413,
  html body .ca-credit-note-print-isolated-v23413.wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
  html body .ca-credit-note-print-isolated-v23413.wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .ca-doc-v2290-sheet,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
    border:0!important;
    border-left:0!important;
    border-right:0!important;
    border-top:0!important;
    border-bottom:0!important;
    outline:0!important;
    box-shadow:none!important;
    background:#fff!important;
  }
  html body .ca-credit-note-print-isolated-v23413.wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note,
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{
    width:190mm!important;
    max-width:190mm!important;
    min-width:190mm!important;
    margin:0 auto!important;
    padding:0!important;
  }
  html body .ca-credit-note-print-isolated-v23413.wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.ca-public-credit-note-print .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet,
  body.ca-credit-note-print-mode .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{
    width:190mm!important;
    max-width:190mm!important;
    min-width:190mm!important;
    margin:0 auto!important;
    padding:18mm 16mm 14mm!important;
  }
}

/* v2.34.17 — Credit Notes dark mode + mobile list/view/edit polish */
/* Keep the Credit Note document readable in dark mode by treating the document itself like paper. */
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note,
body.dark-mode .ca-credit-note-view-page .ca-doc-v2290-credit-note,
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-sheet-flat,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-sheet-flat,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-sheet-flat,
body.dark-mode .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-sheet-flat {
  background:#fff !important;
  color:#0f172a !important;
}
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note *,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note *,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note *,
body.dark-mode .ca-credit-note-view-page .ca-doc-v2290-credit-note * {
  color:#0f172a !important;
}
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-label,
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-meta-box span,
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-items-head,
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note .ca-credit-note-source-line span,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-label,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-meta-box span,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-items-head,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note .ca-credit-note-source-line span,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-label,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-meta-box span,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-items-head,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note .ca-credit-note-source-line span {
  color:#64748b !important;
}
html[data-theme="dark"] body .ca-credit-note-view-page .ca-doc-v2290-credit-note a,
body.ca-core-dark .ca-credit-note-view-page .ca-doc-v2290-credit-note a,
body.ca-dark-page .ca-credit-note-view-page .ca-doc-v2290-credit-note a,
body.dark-mode .ca-credit-note-view-page .ca-doc-v2290-credit-note a {
  color:#075985 !important;
  text-decoration:underline !important;
}

/* Dark mode: Credit Notes list, filters, bulk toolbar and source invoice links. */
html[data-theme="dark"] body .ca-credit-notes-page .wave-card,
body.ca-core-dark .ca-credit-notes-page .wave-card,
body.ca-dark-page .ca-credit-notes-page .wave-card,
body.dark-mode .ca-credit-notes-page .wave-card,
html[data-theme="dark"] body .ca-credit-notes-page .wave-header-card,
body.ca-core-dark .ca-credit-notes-page .wave-header-card,
body.ca-dark-page .ca-credit-notes-page .wave-header-card,
body.dark-mode .ca-credit-notes-page .wave-header-card {
  background:#121d2d !important;
  border-color:#2d3d52 !important;
  color:#e8eef6 !important;
}
html[data-theme="dark"] body .ca-credit-notes-page h1,
html[data-theme="dark"] body .ca-credit-notes-page h2,
html[data-theme="dark"] body .ca-credit-notes-page .wave-section-head,
body.ca-core-dark .ca-credit-notes-page h1,
body.ca-core-dark .ca-credit-notes-page h2,
body.ca-core-dark .ca-credit-notes-page .wave-section-head,
body.ca-dark-page .ca-credit-notes-page h1,
body.ca-dark-page .ca-credit-notes-page h2,
body.ca-dark-page .ca-credit-notes-page .wave-section-head {
  color:#f4f7fb !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .wave-section-head span,
html[data-theme="dark"] body .ca-credit-notes-page .wave-header-card p,
body.ca-core-dark .ca-credit-notes-page .wave-section-head span,
body.ca-core-dark .ca-credit-notes-page .wave-header-card p,
body.ca-dark-page .ca-credit-notes-page .wave-section-head span,
body.ca-dark-page .ca-credit-notes-page .wave-header-card p {
  color:#9fb2c8 !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .wave-table,
html[data-theme="dark"] body .ca-credit-notes-page .wave-table thead,
html[data-theme="dark"] body .ca-credit-notes-page .wave-table th,
html[data-theme="dark"] body .ca-credit-notes-page .wave-table td,
body.ca-core-dark .ca-credit-notes-page .wave-table,
body.ca-core-dark .ca-credit-notes-page .wave-table thead,
body.ca-core-dark .ca-credit-notes-page .wave-table th,
body.ca-core-dark .ca-credit-notes-page .wave-table td,
body.ca-dark-page .ca-credit-notes-page .wave-table,
body.ca-dark-page .ca-credit-notes-page .wave-table thead,
body.ca-dark-page .ca-credit-notes-page .wave-table th,
body.ca-dark-page .ca-credit-notes-page .wave-table td {
  background:#101b2b !important;
  border-color:#2d3d52 !important;
  color:#e8eef6 !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-note-source-cell a,
body.ca-core-dark .ca-credit-notes-page .ca-credit-note-source-cell a,
body.ca-dark-page .ca-credit-notes-page .ca-credit-note-source-cell a,
body.dark-mode .ca-credit-notes-page .ca-credit-note-source-cell a {
  color:#7dd3fc !important;
  text-decoration:underline !important;
  text-underline-offset:2px !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .wave-bulk-toolbar,
body.ca-core-dark .ca-credit-notes-page .wave-bulk-toolbar,
body.ca-dark-page .ca-credit-notes-page .wave-bulk-toolbar {
  background:#0f172a !important;
  border-color:#334155 !important;
  color:#e8eef6 !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .wave-bulk-toolbar select,
html[data-theme="dark"] body .ca-credit-notes-page .wave-bulk-toolbar button,
body.ca-core-dark .ca-credit-notes-page .wave-bulk-toolbar select,
body.ca-core-dark .ca-credit-notes-page .wave-bulk-toolbar button,
body.ca-dark-page .ca-credit-notes-page .wave-bulk-toolbar select,
body.ca-dark-page .ca-credit-notes-page .wave-bulk-toolbar button {
  background:#111827 !important;
  border-color:#334155 !important;
  color:#e8eef6 !important;
}
html[data-theme="dark"] body .ca-credit-note-filter-form.ca-auto-filter-row label span,
body.ca-core-dark .ca-credit-note-filter-form.ca-auto-filter-row label span,
body.ca-dark-page .ca-credit-note-filter-form.ca-auto-filter-row label span { color:#9fb2c8 !important; }

/* Mobile Credit Notes list card layout */
@media (max-width:900px) {
  .ca-credit-notes-page.wave-list-page {
    padding-bottom:96px !important;
  }
  .ca-credit-notes-page .wave-header-card.wave-list-head {
    display:block !important;
    padding:18px !important;
    margin-bottom:14px !important;
    border-radius:16px !important;
  }
  .ca-credit-notes-page .wave-header-card.wave-list-head h1 { font-size:26px !important; line-height:1.1 !important; margin:0 0 6px !important; }
  .ca-credit-notes-page .wave-header-card.wave-list-head p { font-size:14px !important; margin:0 0 16px !important; }
  .ca-credit-notes-page .wave-header-card.wave-list-head .wave-btn { width:100% !important; justify-content:center !important; min-height:44px !important; }
  .ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid {
    grid-template-columns:1fr !important;
    gap:10px !important;
  }
  .ca-credit-note-filter-form.ca-auto-filter-row input,
  .ca-credit-note-filter-form.ca-auto-filter-row select {
    height:44px !important;
    font-size:14px !important;
  }
  .ca-credit-notes-page .wave-bulk-toolbar {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    padding:12px !important;
    margin:0 0 12px !important;
    border-radius:14px !important;
  }
  .ca-credit-notes-page .wave-bulk-toolbar select,
  .ca-credit-notes-page .wave-bulk-toolbar button { width:100% !important; min-height:42px !important; }
  .wave-enhanced-list[data-table-kind="credit-notes"] .wave-table-wrap {
    overflow:visible !important;
    margin:0 !important;
    border:0 !important;
  }
  .ca-credit-notes-table,
  .ca-credit-notes-table tbody {
    display:block !important;
    width:100% !important;
  }
  .ca-credit-notes-table thead { display:none !important; }
  .ca-credit-notes-table tr.ca-mobile-credit-note-row {
    width:100% !important;
    min-height:98px !important;
    box-sizing:border-box !important;
    display:grid !important;
    grid-template-columns:22px minmax(0,1fr) auto !important;
    grid-template-rows:auto auto auto !important;
    grid-template-areas:
      "select number amount"
      "select customer status"
      "select source date" !important;
    column-gap:8px !important;
    row-gap:4px !important;
    align-items:center !important;
    margin:0 0 8px !important;
    padding:12px 10px !important;
    border:1px solid #dce7f0 !important;
    border-radius:12px !important;
    background:#fff !important;
    box-shadow:0 2px 7px rgba(15,23,42,.035) !important;
    cursor:pointer !important;
  }
  .ca-credit-notes-table tr.ca-mobile-credit-note-row > td {
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    line-height:1.2 !important;
  }
  .ca-credit-notes-table tr.ca-mobile-credit-note-row > td::before { content:none !important; display:none !important; }
  .ca-credit-note-select-cell { grid-area:select; align-self:center; }
  .ca-credit-note-number-cell { grid-area:number; font-size:14px !important; font-weight:850 !important; color:#102a44 !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-credit-note-customer-cell { grid-area:customer; color:#51657a !important; font-size:12px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-credit-note-source-cell { grid-area:source; color:#74869a !important; font-size:10.5px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ca-credit-note-source-cell a { color:#075985 !important; }
  .ca-credit-note-date-cell { grid-area:date; justify-self:end; color:#74869a !important; font-size:10.5px !important; white-space:nowrap; }
  .ca-credit-note-amount-cell { grid-area:amount; justify-self:end; align-self:start; color:#102a44 !important; font-size:14px !important; font-weight:850 !important; white-space:nowrap; }
  .ca-credit-note-amount-cell::before { content:"CREDIT"; display:inline; margin-right:3px; color:#8a9bae; font-size:9px; font-weight:750; text-transform:uppercase; }
  .ca-credit-note-status-cell { grid-area:status; justify-self:end; }
  .ca-credit-note-status-cell .wave-status-badge { min-height:18px !important; padding:2px 8px !important; font-size:8.5px !important; line-height:1 !important; }
  .ca-credit-note-actions-cell { display:none !important; }

  html[data-theme="dark"] body .ca-credit-notes-table tr.ca-mobile-credit-note-row,
  body.ca-core-dark .ca-credit-notes-table tr.ca-mobile-credit-note-row,
  body.ca-dark-page .ca-credit-notes-table tr.ca-mobile-credit-note-row {
    background:#121d2d !important;
    border-color:#2d3d52 !important;
    color:#e8eef6 !important;
  }
  html[data-theme="dark"] body .ca-credit-note-number-cell,
  html[data-theme="dark"] body .ca-credit-note-amount-cell,
  body.ca-core-dark .ca-credit-note-number-cell,
  body.ca-core-dark .ca-credit-note-amount-cell,
  body.ca-dark-page .ca-credit-note-number-cell,
  body.ca-dark-page .ca-credit-note-amount-cell { color:#f4f7fb !important; }
  html[data-theme="dark"] body .ca-credit-note-customer-cell,
  html[data-theme="dark"] body .ca-credit-note-source-cell,
  html[data-theme="dark"] body .ca-credit-note-date-cell,
  body.ca-core-dark .ca-credit-note-customer-cell,
  body.ca-core-dark .ca-credit-note-source-cell,
  body.ca-core-dark .ca-credit-note-date-cell,
  body.ca-dark-page .ca-credit-note-customer-cell,
  body.ca-dark-page .ca-credit-note-source-cell,
  body.ca-dark-page .ca-credit-note-date-cell { color:#9fb2c8 !important; }
  html[data-theme="dark"] body .ca-credit-note-source-cell a,
  body.ca-core-dark .ca-credit-note-source-cell a,
  body.ca-dark-page .ca-credit-note-source-cell a { color:#7dd3fc !important; }

  /* Mobile View Credit Note */
  .ca-credit-note-view-page { padding-bottom:96px !important; }
  .ca-credit-note-view-page .wave-public-toolbar {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    margin:0 0 14px !important;
  }
  .ca-credit-note-view-page .wave-public-toolbar .wave-public-toolbtn,
  .ca-credit-note-view-page .wave-public-toolbar form,
  .ca-credit-note-view-page .wave-public-toolbar form .wave-public-toolbtn {
    width:100% !important;
  }
  .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note {
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    background:transparent !important;
  }
  .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet {
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    padding:24px 18px !important;
    border-radius:14px !important;
  }
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-head,
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-meta-row,
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-bottom {
    grid-template-columns:1fr !important;
    gap:18px !important;
  }
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-titlebox,
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-business-lines {
    text-align:left !important;
    justify-self:start !important;
    justify-items:start !important;
  }
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-kicker { font-size:26px !important; }
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-items-head,
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-item-row {
    grid-template-columns:minmax(0,1fr) 44px 66px 72px !important;
    gap:8px !important;
    font-size:10px !important;
  }
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-totals { width:100% !important; max-width:100% !important; }

  /* Mobile Edit/Create Credit Note */
  .ca-credit-note-create-page .wave-header-card.wave-list-head {
    display:block !important;
    padding:18px !important;
    border-radius:16px !important;
  }
  .ca-credit-note-create-page .wave-header-card.wave-list-head h1 { font-size:24px !important; line-height:1.15 !important; }
  .ca-credit-note-create-page .wave-header-card.wave-list-head .wave-link-btn { width:100% !important; margin-top:12px !important; justify-content:center !important; }
  .ca-credit-note-create-page .wave-card { padding:16px !important; border-radius:16px !important; }
  .ca-credit-note-create-page .wave-form-grid,
  .ca-credit-note-create-page .wave-form-row,
  .ca-credit-note-create-page .wave-col-2,
  .ca-credit-note-create-page .wave-col-3 {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
  }
  .ca-credit-note-create-page input,
  .ca-credit-note-create-page select,
  .ca-credit-note-create-page textarea { width:100% !important; max-width:100% !important; }
  .ca-credit-note-create-page .wave-actions { display:grid !important; grid-template-columns:1fr !important; gap:10px !important; }
  .ca-credit-note-create-page .wave-actions .wave-btn { width:100% !important; justify-content:center !important; }
}

@media (max-width:430px) {
  .ca-credit-notes-table tr.ca-mobile-credit-note-row {
    grid-template-columns:20px minmax(0,1fr) auto !important;
    min-height:96px !important;
    column-gap:6px !important;
    padding:11px 8px !important;
  }
  .ca-credit-note-number-cell,
  .ca-credit-note-amount-cell { font-size:13px !important; }
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-items-head,
  .ca-credit-note-view-page .ca-doc-v2290-credit-note .wave-public-flat-item-row {
    grid-template-columns:minmax(0,1fr) 34px 56px 60px !important;
    gap:6px !important;
  }
}

/* v2.34.19 Credit Notes actions + mobile card final polish */
@media (max-width:900px) {
  .ca-credit-notes-page .wave-card.wave-enhanced-list[data-table-kind="credit-notes"] {
    padding:16px !important;
  }
  .ca-credit-notes-page .wave-card.wave-enhanced-list[data-table-kind="credit-notes"] .wave-table-wrap {
    overflow:visible !important;
    background:transparent !important;
  }
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row {
    min-height:114px !important;
    margin:0 0 12px !important;
    padding:14px 12px !important;
    border-radius:15px !important;
    row-gap:7px !important;
    column-gap:10px !important;
    box-shadow:0 3px 10px rgba(15,23,42,.045) !important;
  }
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row:last-child {
    margin-bottom:0 !important;
  }
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row > td.ca-credit-note-actions-cell,
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row > td[data-label="Actions"],
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row .wave-actions-menu,
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row .wave-link-btn,
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row .wave-actions-trigger {
    display:none !important;
  }
  .ca-credit-notes-page .ca-credit-note-number-cell {
    font-size:15px !important;
    line-height:1.2 !important;
  }
  .ca-credit-notes-page .ca-credit-note-customer-cell {
    font-size:13px !important;
    line-height:1.25 !important;
  }
  .ca-credit-notes-page .ca-credit-note-source-cell,
  .ca-credit-notes-page .ca-credit-note-date-cell {
    font-size:11px !important;
    line-height:1.25 !important;
  }
  .ca-credit-notes-page .ca-credit-note-amount-cell {
    font-size:15px !important;
    line-height:1.2 !important;
  }
  .ca-credit-notes-page .ca-credit-note-status-cell .wave-status-badge {
    min-width:76px !important;
    text-align:center !important;
  }
}
@media (max-width:430px) {
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row {
    min-height:108px !important;
    margin-bottom:10px !important;
    padding:13px 10px !important;
  }
}


/* v2.34.20 — Credit Note issued/applied/refunded status badges */
.wave-status-badge.status-issued,
.badge.status-issued,
.status-issued {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border: 1px solid #93c5fd !important;
}
.wave-status-badge.status-applied,
.badge.status-applied,
.status-applied {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
.wave-status-badge.status-refunded,
.badge.status-refunded,
.status-refunded {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fcd34d !important;
}
body.ca-dark .wave-status-badge.status-issued,
body.ca-theme-dark .wave-status-badge.status-issued,
html.ca-dark .wave-status-badge.status-issued,
html.ca-theme-dark .wave-status-badge.status-issued {
  background: rgba(59, 130, 246, 0.22) !important;
  color: #bfdbfe !important;
  border-color: rgba(147, 197, 253, 0.60) !important;
}
body.ca-dark .wave-status-badge.status-applied,
body.ca-theme-dark .wave-status-badge.status-applied,
html.ca-dark .wave-status-badge.status-applied,
html.ca-theme-dark .wave-status-badge.status-applied {
  background: rgba(34, 197, 94, 0.20) !important;
  color: #bbf7d0 !important;
  border-color: rgba(134, 239, 172, 0.60) !important;
}
body.ca-dark .wave-status-badge.status-refunded,
body.ca-theme-dark .wave-status-badge.status-refunded,
html.ca-dark .wave-status-badge.status-refunded,
html.ca-theme-dark .wave-status-badge.status-refunded {
  background: rgba(245, 158, 11, 0.20) !important;
  color: #fde68a !important;
  border-color: rgba(252, 211, 77, 0.60) !important;
}
.ca-credit-notes-page .ca-credit-note-status-cell .wave-status-badge.status-issued,
.ca-credit-notes-page .ca-credit-note-status-cell .wave-status-badge.status-applied,
.ca-credit-notes-page .ca-credit-note-status-cell .wave-status-badge.status-refunded {
  min-width: 78px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

/* v2.34.22 — Credit Notes stabilization polish */
.ca-credit-notes-page .ca-credit-notes-table tr.status-issued .ca-credit-note-status-cell .wave-status-badge,
.ca-credit-notes-page .ca-credit-notes-table tr.status-applied .ca-credit-note-status-cell .wave-status-badge,
.ca-credit-notes-page .ca-credit-notes-table tr.status-refunded .ca-credit-note-status-cell .wave-status-badge,
.ca-credit-notes-page .ca-credit-notes-table tr.status-draft .ca-credit-note-status-cell .wave-status-badge {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:78px !important;
  min-height:26px !important;
  padding:5px 12px !important;
  border-radius:999px !important;
  font-size:11px !important;
  font-weight:800 !important;
  line-height:1 !important;
  white-space:nowrap !important;
}
.ca-credit-notes-page .ca-credit-notes-table tr.status-draft .ca-credit-note-status-cell .wave-status-badge {
  background:#eef4fb !important;
  color:#486174 !important;
  border:1px solid #d3dfeb !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-note-source-cell a,
html.ca-theme-dark body .ca-credit-notes-page .ca-credit-note-source-cell a,
html[data-ca-theme="dark"] body .ca-credit-notes-page .ca-credit-note-source-cell a,
body.ca-dark-page .ca-credit-notes-page .ca-credit-note-source-cell a,
body.ca-core-dark .ca-credit-notes-page .ca-credit-note-source-cell a,
body.ca-theme-dark .ca-credit-notes-page .ca-credit-note-source-cell a {
  color:#7dd3fc !important;
  text-decoration-color:rgba(125,211,252,.65) !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .wave-status-badge.status-issued,
html.ca-theme-dark body .ca-credit-notes-page .wave-status-badge.status-issued,
html[data-ca-theme="dark"] body .ca-credit-notes-page .wave-status-badge.status-issued,
body.ca-dark-page .ca-credit-notes-page .wave-status-badge.status-issued,
body.ca-core-dark .ca-credit-notes-page .wave-status-badge.status-issued,
body.ca-theme-dark .ca-credit-notes-page .wave-status-badge.status-issued {
  background:rgba(59,130,246,.22) !important;
  color:#bfdbfe !important;
  border-color:rgba(147,197,253,.60) !important;
}
html[data-theme="dark"] body .ca-credit-notes-page .wave-status-badge.status-draft,
html.ca-theme-dark body .ca-credit-notes-page .wave-status-badge.status-draft,
html[data-ca-theme="dark"] body .ca-credit-notes-page .wave-status-badge.status-draft,
body.ca-dark-page .ca-credit-notes-page .wave-status-badge.status-draft,
body.ca-core-dark .ca-credit-notes-page .wave-status-badge.status-draft,
body.ca-theme-dark .ca-credit-notes-page .wave-status-badge.status-draft {
  background:rgba(148,163,184,.16) !important;
  color:#dbeafe !important;
  border-color:rgba(148,163,184,.45) !important;
}
@media (max-width:900px) {
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row {
    cursor:pointer !important;
    margin-bottom:12px !important;
  }
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row > td.ca-credit-note-actions-cell,
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row .wave-actions-menu {
    display:none !important;
  }
}


/* v2.34.23 — Credit Notes: keep status as badge only, never tint issued/applied/refunded rows */
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued > td,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied > td,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded > td {
  background: transparent !important;
}
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued:hover > td,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied:hover > td,
.ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded:hover > td {
  background: rgba(14, 165, 233, 0.04) !important;
}
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued,
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied,
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded,
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued > td,
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied > td,
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded > td,
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued,
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied,
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded,
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-issued > td,
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-applied > td,
html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tbody tr.status-refunded > td {
  background: transparent !important;
}
@media (max-width:900px) {
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-issued,
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-applied,
  .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-refunded {
    background: #fff !important;
  }
  body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-issued,
  body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-applied,
  body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-refunded,
  html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-issued,
  html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-applied,
  html[data-theme="dark"] body .ca-credit-notes-page .ca-credit-notes-table tr.ca-mobile-credit-note-row.status-refunded {
    background: #0f172a !important;
  }
}


/* v2.34.32 - Customer Statement Outstanding print safe right stretch */
@media print {
  .wvst-doc .wvst-outstanding-table {
    width: calc(100% + 2mm) !important;
    min-width: calc(100% + 2mm) !important;
    max-width: calc(100% + 2mm) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 17mm !important;
    table-layout: fixed !important;
  }
  .wvst-doc .wvst-outstanding-table th,
  .wvst-doc .wvst-outstanding-table td {
    display: table-cell !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .wvst-doc .wvst-outstanding-table th:last-child,
  .wvst-doc .wvst-outstanding-table td:last-child {
    text-align: right !important;
    padding-right: 2mm !important;
  }
}

/* v2.34.32 - keep outstanding print right edge safe, no clipping */
@media print {
  .wvst-doc .wvst-outstanding-table col:nth-child(1){width:12% !important;}
  .wvst-doc .wvst-outstanding-table col:nth-child(2){width:15% !important;}
  .wvst-doc .wvst-outstanding-table col:nth-child(3){width:11% !important;}
  .wvst-doc .wvst-outstanding-table col:nth-child(4){width:13% !important;}
  .wvst-doc .wvst-outstanding-table col:nth-child(5){width:10% !important;}
  .wvst-doc .wvst-outstanding-table col:nth-child(6){width:15% !important;}
  .wvst-doc .wvst-outstanding-table col:nth-child(7){width:24% !important;}
  .wvst-doc .wvst-outstanding-table th.wvst-outstanding-head{font-size:6.8px !important;}
}

/* v2.34.33 - Final Credit Notes / Customer Statements stabilization marker. Tested v2.34.32 safe Outstanding print fit retained. */

/* v2.35.00 - Reports Review / Reconciliation baseline marker. Credit Notes + Customer Statements stable from v2.34.33 retained unchanged. */
/* v2.35.01 - Reports label clarity only: no calculation changes. */


/* ══════════════════════════════════════════════════════════════════
   v2.35.09 — Mobile invoice cards: wrap long customer names
   Prevents long customer names from being cut off under the Due/Status area.
   Desktop table layout is unchanged.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .wave-invoice-list tr.ca-mobile-invoice-row {
    align-items:start !important;
    grid-template-rows:auto auto auto !important;
  }

  .wave-invoice-list tr.ca-mobile-invoice-row > td.ca-invoice-customer-cell {
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    overflow-wrap:break-word !important;
    word-break:normal !important;
    line-height:1.25 !important;
    align-self:start !important;
    padding-top:1px !important;
    padding-right:4px !important;
  }

  .wave-invoice-list tr.ca-mobile-invoice-row > td.ca-invoice-due-cell {
    align-self:start !important;
  }

  .wave-invoice-list tr.ca-mobile-invoice-row > td.ca-invoice-status-cell {
    align-self:end !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   v2.35.19 — Invoice Payment Summary + Save & Send polish
   Keeps invoice Total visually separate from post-invoice settlement activity.
   ══════════════════════════════════════════════════════════════════ */
.wave-public-invoice-flat .wave-public-flat-lower-grid {
  display: block !important;
  margin-top: 18px !important;
  padding-top: 0 !important;
}
.wave-public-invoice-flat .wave-public-flat-lower-grid.has-payment-summary {
  display: block !important;
  width: 100% !important;
  max-width: 440px !important;
}
.wave-public-invoice-flat .wave-public-flat-lower-grid .wave-public-flat-notes-below {
  margin-top: 0 !important;
  min-width: 0 !important;
}
.wave-public-invoice-flat .wave-public-payment-summary {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 420px !important;
  margin-top: 12px !important;
  padding: 10px 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  color: #475569 !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
.wave-public-invoice-flat .wave-public-payment-summary > .wave-public-flat-label {
  margin-bottom: 7px !important;
  font-size: 10px !important;
  letter-spacing: .07em !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-body {
  display: grid !important;
  gap: 0 !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-line,
.wave-public-invoice-flat .wave-public-payment-summary-balance {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  gap: 12px !important;
  align-items: start !important;
  padding: 5px 0 !important;
  font-size: 10px !important;
  line-height: 1.32 !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-line span,
.wave-public-invoice-flat .wave-public-payment-summary-balance span {
  min-width: 0 !important;
  color: #64748b !important;
  font-weight: 500 !important;
  overflow-wrap: anywhere !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-line strong {
  color: #334155 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  text-align: right !important;
  white-space: nowrap !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-line.ca-credit-deduction-line strong {
  color: #047857 !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-balance {
  margin-top: 5px !important;
  padding-top: 8px !important;
  border-top: 1px solid #cbd5e1 !important;
}
.wave-public-invoice-flat .wave-public-payment-summary-balance span,
.wave-public-invoice-flat .wave-public-payment-summary-balance strong {
  color: #334155 !important;
  font-size: 10.5px !important;
  font-weight: 650 !important;
}
.wave-invoice-form .wave-actions .ca-save-send-invoice {
  min-width: 160px !important;
  height: 44px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
}

@media (max-width: 900px) {
  .wave-public-invoice-flat .wave-public-flat-lower-grid.has-payment-summary {
    width: 100% !important;
    max-width: none !important;
  }
  .wave-public-invoice-flat .wave-public-payment-summary {
    width: 100% !important;
    max-width: none !important;
  }
}

/* Document dark mode — public and logged-in views. */
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary,
html.ca-theme-dark body .wave-public-invoice-flat .wave-public-payment-summary,
html[data-ca-theme="dark"] body .wave-public-invoice-flat .wave-public-payment-summary,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary {
  background: #111c2e !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary-line span,
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary-balance span,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-line span,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-balance span,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-line span,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-balance span {
  color: #94a3b8 !important;
}
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary-line strong,
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary-balance strong,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-line strong,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-balance strong,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-line strong,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-balance strong {
  color: #e2e8f0 !important;
}
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary-balance,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-balance,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-balance {
  border-top-color: #475569 !important;
}
body.ca-dark-page .wave-public-invoice-flat .wave-public-payment-summary-line.ca-credit-deduction-line strong,
body[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-line.ca-credit-deduction-line strong,
.wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat .wave-public-payment-summary-line.ca-credit-deduction-line strong {
  color: #6ee7b7 !important;
}

@media print {
  .wave-public-invoice-flat .wave-public-flat-lower-grid,
  .wave-public-invoice-flat .wave-public-payment-summary {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .wave-public-invoice-flat .wave-public-flat-lower-grid.has-payment-summary {
    display: block !important;
    width: 80mm !important;
    max-width: 80mm !important;
    margin-top: 8mm !important;
  }
  .wave-public-invoice-flat .wave-public-payment-summary {
    width: 76mm !important;
    max-width: 76mm !important;
    margin-top: 3mm !important;
    background: #fff !important;
    border-color: #e2e8f0 !important;
    padding: 2.2mm 2.8mm !important;
    color: #64748b !important;
  }
  .wave-public-invoice-flat .wave-public-payment-summary > .wave-public-flat-label {
    font-size: 6.5pt !important;
    margin-bottom: 1.5mm !important;
  }
  .wave-public-invoice-flat .wave-public-payment-summary-line,
  .wave-public-invoice-flat .wave-public-payment-summary-balance {
    font-size: 7.2pt !important;
    line-height: 1.25 !important;
    padding: 0.7mm 0 !important;
  }
  .wave-public-invoice-flat .wave-public-payment-summary-line strong {
    font-size: 7.2pt !important;
    font-weight: 600 !important;
  }
  .wave-public-invoice-flat .wave-public-payment-summary-balance span,
  .wave-public-invoice-flat .wave-public-payment-summary-balance strong {
    font-size: 7.5pt !important;
    font-weight: 650 !important;
  }
}

/* PDF clone: keep Notes / Terms and Payment Summary in normal document flow. */
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary,
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin: 24px 0 0 !important;
  padding: 0 !important;
  display: block !important;
  width: 310px !important;
  max-width: 310px !important;
  box-sizing: border-box !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below,
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  max-width: none !important;
  max-height: 92px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary .wave-public-payment-summary,
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary .wave-public-payment-summary {
  position: static !important;
  width: 300px !important;
  max-width: 300px !important;
  margin: 10px 0 0 0 !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  background: #fff !important;
  border: 1px solid #d9e1e8 !important;
  border-radius: 8px !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary > .wave-public-flat-label {
  font-size: 8px !important;
  margin-bottom: 5px !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-line,
html body .wave-pdf-export-clone .wave-public-payment-summary-balance {
  font-size: 9px !important;
  line-height: 1.24 !important;
  padding: 3px 0 !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-line strong {
  font-size: 9px !important;
  font-weight: 600 !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-balance span,
html body .wave-pdf-export-clone .wave-public-payment-summary-balance strong {
  font-size: 9.5px !important;
  font-weight: 650 !important;
}

/* ══════════════════════════════════════════════════════════════════
   v2.35.20 — Payment Summary final placement + print/PDF typography
   Desktop View/Print/PDF: Notes / Terms first, Payment Summary directly below.
   Cache-busted by plugin version 2.35.20 in public invoice document assets.
   ══════════════════════════════════════════════════════════════════ */

/* Desktop / normal View Invoice: keep the combined lower block in document flow. */
@media screen and (min-width: 761px) {
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 370px !important;
    max-width: 370px !important;
    margin: 24px 0 0 !important;
    padding: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    z-index: 2 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary .wave-public-payment-summary {
    position: static !important;
    width: 100% !important;
    max-width: 370px !important;
    margin: 10px 0 0 !important;
    padding: 8px 10px !important;
  }
}

/* Print: keep Notes and payments in flow above the reserved footer region. */
@media print {
  html body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 82mm !important;
    max-width: 82mm !important;
    margin: 6mm 0 0 !important;
    padding: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  html body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary .wave-public-payment-summary {
    position: static !important;
    width: 78mm !important;
    max-width: 78mm !important;
    margin: 2.2mm 0 0 !important;
    padding: 1.8mm 2.3mm !important;
    border-radius: 1.5mm !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary > .wave-public-flat-label {
    font-size: 8.25pt !important;
    letter-spacing: .06em !important;
    margin-bottom: 1mm !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary-line,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary-balance {
    font-size: 7.8pt !important;
    line-height: 1.18 !important;
    padding: .45mm 0 !important;
    gap: 2.2mm !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary-line strong {
    font-size: 7.8pt !important;
    font-weight: 600 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary-balance {
    margin-top: .8mm !important;
    padding-top: 1.1mm !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary-balance span,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary-balance strong {
    font-size: 8pt !important;
    font-weight: 650 !important;
  }
}

/* Generated PDF clone: same order, smaller and more discreet text. */
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary,
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary {
  bottom: 128px !important;
  width: 310px !important;
  max-width: 310px !important;
}

html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below,
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary .wave-public-flat-notes-below {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body .wave-pdf-export-clone .wave-public-payment-summary {
  width: 295px !important;
  max-width: 295px !important;
  margin-top: 8px !important;
  padding: 6px 8px !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary > .wave-public-flat-label {
  font-size: 11px !important;
  letter-spacing: .06em !important;
  margin-bottom: 3px !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-line,
html body .wave-pdf-export-clone .wave-public-payment-summary-balance {
  font-size: 10.25px !important;
  line-height: 1.17 !important;
  padding: 2px 0 !important;
  gap: 7px !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-line strong {
  font-size: 10.25px !important;
  font-weight: 600 !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-balance {
  margin-top: 3px !important;
  padding-top: 4px !important;
}
html body .wave-pdf-export-clone .wave-public-payment-summary-balance span,
html body .wave-pdf-export-clone .wave-public-payment-summary-balance strong {
  font-size: 10.5px !important;
  font-weight: 650 !important;
}

/* Parent receipt allocation detail remains one receipt while explaining each posting. */
.wave-receipt-allocations{display:grid;gap:7px;margin:10px 0 14px;padding:10px 12px;border:1px solid #dbe5f0;border-radius:10px;background:#f8fbff}
.wave-receipt-allocation{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px}
.wave-receipt-allocation a{color:#1457a6;text-decoration:underline;text-underline-offset:2px}
.wave-receipt-allocation strong{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:600px){.wave-receipt-allocation{align-items:flex-start}.wave-receipt-allocations{padding:9px 10px}}
@media print{.wave-receipt-allocations{break-inside:avoid;page-break-inside:avoid;background:#fff}.wave-receipt-allocation a{color:#111;text-decoration:none}}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wave-receipt-allocations{background:#142338;border-color:#334a67;color:#eaf2ff}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wave-receipt-allocation a{color:#93c5fd}


/* v2.35.22 — consistent compact document action system */
.ca-doc-toolbar.wave-public-toolbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;flex-wrap:nowrap!important;width:100%!important;max-width:none!important;padding:14px 16px!important;margin:0 0 16px!important;box-sizing:border-box!important;border:1px solid #e2e8f0!important;border-radius:14px!important;background:#fff!important;box-shadow:0 4px 16px rgba(15,23,42,.05)!important;overflow:visible!important}
.ca-doc-toolbar-group{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important;min-width:0!important}.ca-doc-toolbar-quick{margin-left:auto!important}.ca-doc-toolbar form{margin:0!important;display:inline-flex!important}
.ca-doc-action,.ca-doc-toolbar button.ca-doc-action,.ca-doc-toolbar a.ca-doc-action,.ca-doc-more>summary.ca-doc-action{appearance:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;height:40px!important;min-height:40px!important;padding:0 14px!important;margin:0!important;box-sizing:border-box!important;border:1px solid #dbe5f0!important;border-radius:10px!important;background:#fff!important;color:#0f172a!important;text-decoration:none!important;font-size:14px!important;font-weight:700!important;line-height:1!important;white-space:nowrap!important;cursor:pointer!important;box-shadow:0 1px 2px rgba(15,23,42,.03)!important}
.ca-doc-action:hover{background:#f8fbff!important;border-color:#c7d7e8!important;color:#0f172a!important}.ca-doc-action-icononly{width:42px!important;min-width:42px!important;padding:0!important}.ca-doc-action-svg{width:18px!important;height:18px!important;flex:0 0 18px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.ca-doc-action-approve{color:#15803d!important;border-color:#bbf7d0!important;background:#f0fdf4!important}.ca-doc-action-approve:hover{background:#dcfce7!important;border-color:#86efac!important;color:#166534!important}.ca-doc-action-send{color:#075fc7!important;border-color:#93c5fd!important;background:#f8fbff!important}.ca-doc-action-send:hover{background:#eff6ff!important;border-color:#60a5fa!important;color:#075fc7!important}
.ca-doc-more{position:relative!important;display:inline-flex!important;margin:0!important;padding:0!important;z-index:10000!important}.ca-doc-more>summary{list-style:none!important}.ca-doc-more>summary::-webkit-details-marker{display:none!important}.ca-doc-more-menu{position:absolute!important;top:calc(100% + 8px)!important;right:0!important;z-index:10001!important;width:220px!important;padding:7px!important;border:1px solid #dbe5f0!important;border-radius:12px!important;background:#fff!important;box-shadow:0 16px 34px rgba(15,23,42,.16)!important}.ca-doc-more-menu form{display:block!important;width:100%!important;margin:0!important}.ca-doc-more-menu a,.ca-doc-more-menu button{appearance:none!important;width:100%!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;min-height:40px!important;padding:9px 11px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:#0f172a!important;text-decoration:none!important;font-size:14px!important;font-weight:650!important;text-align:left!important;cursor:pointer!important}.ca-doc-more-menu a:hover,.ca-doc-more-menu button:hover{background:#f8fafc!important}.ca-doc-more-menu .ca-doc-more-danger{color:#dc2626!important}.ca-doc-more-menu .ca-doc-action-svg{width:17px!important;height:17px!important;flex-basis:17px!important}
.ca-doc-editor-back{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;border:1px solid #dbe5f0!important;border-radius:10px!important;background:#fff!important;color:#0f172a!important;text-decoration:none!important;box-shadow:0 1px 2px rgba(15,23,42,.03)!important}.ca-doc-editor-back:hover{background:#f8fbff!important;border-color:#c7d7e8!important;color:#0f172a!important}.ca-doc-editor-back .ca-doc-action-svg{width:19px!important;height:19px!important}
.ca-doc-form-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:9px!important;flex-direction:row!important;flex-wrap:wrap!important}.ca-doc-form-actions .wave-btn{width:auto!important;min-width:0!important;min-height:40px!important;height:40px!important;padding:0 16px!important;border-radius:10px!important;white-space:nowrap!important;justify-content:center!important}
.wave-portal-shell[data-theme="dark"] .ca-doc-toolbar,body.ca-dark-page .ca-doc-toolbar,body[data-theme="dark"] .ca-doc-toolbar{background:#0b1629!important;border-color:#263548!important;box-shadow:none!important}.wave-portal-shell[data-theme="dark"] .ca-doc-action,.wave-portal-shell[data-theme="dark"] .ca-doc-editor-back,body.ca-dark-page .ca-doc-action,body.ca-dark-page .ca-doc-editor-back,body[data-theme="dark"] .ca-doc-action,body[data-theme="dark"] .ca-doc-editor-back{background:#111d31!important;border-color:#314158!important;color:#e5edf7!important}.wave-portal-shell[data-theme="dark"] .ca-doc-action-approve,body.ca-dark-page .ca-doc-action-approve,body[data-theme="dark"] .ca-doc-action-approve{background:#0f2f1f!important;border-color:#166534!important;color:#bbf7d0!important}.wave-portal-shell[data-theme="dark"] .ca-doc-action-send,body.ca-dark-page .ca-doc-action-send,body[data-theme="dark"] .ca-doc-action-send{background:#0d2440!important;border-color:#245a91!important;color:#93c5fd!important}.wave-portal-shell[data-theme="dark"] .ca-doc-more-menu,body.ca-dark-page .ca-doc-more-menu,body[data-theme="dark"] .ca-doc-more-menu{background:#111827!important;border-color:#314158!important}.wave-portal-shell[data-theme="dark"] .ca-doc-more-menu a,.wave-portal-shell[data-theme="dark"] .ca-doc-more-menu button,body.ca-dark-page .ca-doc-more-menu a,body.ca-dark-page .ca-doc-more-menu button,body[data-theme="dark"] .ca-doc-more-menu a,body[data-theme="dark"] .ca-doc-more-menu button{color:#e5edf7!important}.wave-portal-shell[data-theme="dark"] .ca-doc-more-menu a:hover,.wave-portal-shell[data-theme="dark"] .ca-doc-more-menu button:hover,body.ca-dark-page .ca-doc-more-menu a:hover,body.ca-dark-page .ca-doc-more-menu button:hover,body[data-theme="dark"] .ca-doc-more-menu a:hover,body[data-theme="dark"] .ca-doc-more-menu button:hover{background:#1f2937!important}.wave-portal-shell[data-theme="dark"] .ca-doc-more-menu .ca-doc-more-danger,body.ca-dark-page .ca-doc-more-menu .ca-doc-more-danger,body[data-theme="dark"] .ca-doc-more-menu .ca-doc-more-danger{color:#fca5a5!important}
@media(max-width:1100px){.ca-doc-toolbar.wave-public-toolbar{gap:9px!important;padding:12px!important}.ca-doc-toolbar-group{gap:6px!important}.ca-doc-action,.ca-doc-toolbar button.ca-doc-action,.ca-doc-toolbar a.ca-doc-action{padding:0 11px!important;font-size:13px!important}.ca-doc-action-icononly{width:40px!important;min-width:40px!important;padding:0!important}}
@media(max-width:760px){.ca-doc-toolbar.wave-public-toolbar{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;padding:10px!important}.ca-doc-toolbar-main,.ca-doc-toolbar-quick{display:flex!important;width:auto!important;margin:0!important;gap:6px!important}.ca-doc-action,.ca-doc-toolbar button.ca-doc-action,.ca-doc-toolbar a.ca-doc-action{height:38px!important;min-height:38px!important;padding:0 10px!important;font-size:12.5px!important;gap:6px!important;width:auto!important}.ca-doc-action-icononly{width:38px!important;min-width:38px!important;padding:0!important}.ca-doc-action-svg{width:16px!important;height:16px!important;flex-basis:16px!important}.ca-doc-form-actions{display:flex!important;flex-direction:row!important;justify-content:flex-start!important;gap:8px!important}.ca-doc-form-actions .wave-btn{width:auto!important;min-height:40px!important;height:40px!important;padding:0 14px!important}}
@media(max-width:480px){.ca-doc-action-label{display:none!important}.ca-doc-toolbar .ca-doc-action:not(.ca-doc-action-icononly){width:40px!important;min-width:40px!important;padding:0!important}.ca-doc-more-menu .ca-doc-action-label{display:inline!important}.ca-doc-more-menu{right:-4px!important;width:210px!important}.ca-doc-form-actions .wave-btn{font-size:13px!important;padding:0 12px!important}}
@media print{.ca-doc-toolbar{display:none!important}}


/* v2.35.23 — mobile document-action balance + More-menu layering */
@media screen and (max-width:760px){
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print.ca-doc-toolbar,
  html body .wave-public-toolbar.no-print.ca-doc-toolbar,
  html body .ca-public-document-actions.no-print.ca-doc-toolbar,
  html body .wave-estimate-public-body .ca-public-estimate-actions.no-print.ca-doc-toolbar{
    display:flex!important;
    flex-direction:column!important;
    flex-wrap:nowrap!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:8px!important;
    width:calc(100% - 20px)!important;
    max-width:none!important;
    margin:12px 10px 10px!important;
    padding:8px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    position:relative!important;
    z-index:1000000!important;
    isolation:isolate!important;
  }

  html body .ca-doc-toolbar .ca-doc-toolbar-group,
  html body .ca-doc-toolbar .ca-doc-toolbar-main,
  html body .ca-doc-toolbar .ca-doc-toolbar-quick{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print.ca-doc-toolbar form,
  html body .ca-doc-toolbar form,
  html body .ca-doc-toolbar .wave-inline-form,
  html body .ca-doc-toolbar .wave-public-toolbar-form{
    display:inline-flex!important;
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  html body .ca-doc-toolbar .ca-doc-action,
  html body .ca-doc-toolbar button.ca-doc-action,
  html body .ca-doc-toolbar a.ca-doc-action,
  html body .ca-doc-toolbar form .ca-doc-action,
  html body .ca-doc-more>summary.ca-doc-action{
    display:inline-flex!important;
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
    margin:0!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:12px!important;
    box-sizing:border-box!important;
    touch-action:manipulation!important;
  }

  html body .ca-doc-toolbar .ca-doc-action-label{
    display:none!important;
  }
  html body .ca-doc-toolbar .ca-doc-action-svg{
    width:18px!important;
    height:18px!important;
    flex:0 0 18px!important;
  }

  html body .ca-doc-toolbar .ca-doc-more{
    position:relative!important;
    display:inline-flex!important;
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    z-index:1000001!important;
  }
  html body .ca-doc-toolbar .ca-doc-more[open]{
    z-index:1000003!important;
  }
  html body .ca-doc-toolbar .ca-doc-more-menu{
    position:absolute!important;
    top:calc(100% + 8px)!important;
    right:0!important;
    left:auto!important;
    width:220px!important;
    max-width:calc(100vw - 28px)!important;
    max-height:none!important;
    margin:0!important;
    padding:7px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    overscroll-behavior:none!important;
    z-index:1000004!important;
  }
  html body .ca-doc-toolbar .ca-doc-more-menu .ca-doc-action-label{
    display:inline!important;
  }

  /* Keep the action popover above the payment card/document sheet. */
  html body .wave-payment-manage-card.no-print,
  html body .wave-public-sheet-flat.ca-doc-v2290-sheet{
    position:relative!important;
    z-index:1!important;
  }
}

@media screen and (max-width:380px){
  html body .ca-doc-toolbar .ca-doc-toolbar-group,
  html body .ca-doc-toolbar .ca-doc-toolbar-main,
  html body .ca-doc-toolbar .ca-doc-toolbar-quick{
    gap:6px!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-toolbar.no-print.ca-doc-toolbar form,
  html body .ca-doc-toolbar form,
  html body .ca-doc-toolbar .wave-inline-form,
  html body .ca-doc-toolbar .wave-public-toolbar-form,
  html body .ca-doc-toolbar .ca-doc-more{
    flex-basis:42px!important;
    width:42px!important;
    min-width:42px!important;
    max-width:42px!important;
  }
  html body .ca-doc-toolbar .ca-doc-action,
  html body .ca-doc-toolbar button.ca-doc-action,
  html body .ca-doc-toolbar a.ca-doc-action,
  html body .ca-doc-toolbar form .ca-doc-action,
  html body .ca-doc-more>summary.ca-doc-action{
    flex-basis:42px!important;
    width:42px!important;
    min-width:42px!important;
    max-width:42px!important;
    height:42px!important;
    min-height:42px!important;
  }
}


/* v2.35.24 — mobile More menu: force one vertical full-width action per row */
@media screen and (max-width:760px){
  html body .ca-doc-toolbar .ca-doc-more-menu{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-flow:row!important;
    align-items:stretch!important;
    gap:2px!important;
    overflow:visible!important;
  }
  html body .ca-doc-toolbar .ca-doc-more-menu > a,
  html body .ca-doc-toolbar .ca-doc-more-menu > form{
    display:block!important;
    position:static!important;
    float:none!important;
    flex:none!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }
  html body .ca-doc-toolbar .ca-doc-more-menu > a,
  html body .ca-doc-toolbar .ca-doc-more-menu > form > button{
    display:flex!important;
    position:static!important;
    float:none!important;
    flex:none!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:42px!important;
    height:auto!important;
    margin:0!important;
    padding:10px 12px!important;
    box-sizing:border-box!important;
    white-space:nowrap!important;
    line-height:1.25!important;
    text-align:left!important;
  }
  html body .ca-doc-toolbar .ca-doc-more-menu .ca-doc-action-label{
    display:inline!important;
    white-space:nowrap!important;
  }
  html body .ca-doc-toolbar .ca-doc-more-menu .ca-doc-action-svg{
    flex:0 0 18px!important;
    width:18px!important;
    height:18px!important;
  }
}

/* PR #4 Test 10 — customer-facing dark-mode audit compatibility layer.
 * Scoped to established dark roots so light mode and printed documents retain
 * their existing design. Shared tokens cover portal surfaces across modules. */
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark){
  --ca-dark-canvas:#0b1220;--ca-dark-surface:#111c2f;--ca-dark-surface-raised:#1e293b;
  --ca-dark-border:#3b4b63;--ca-dark-text:#f1f5f9;--ca-dark-muted:#b8c7dc;--ca-dark-link:#7dd3fc;
}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-card,.wave-header-card,.wave-mini-panel,.wave-customer-balance-card,.wave-customer-details-card,.wave-customer-workspace,.wave-list-card,.wave-form-card,.wave-table-card,.wave-modal-content,.wave-dialog,.wave-bottom-sheet,.wave-more-menu,.wave-dropdown-menu,.ca-product-dropdown,.ca-product-dropdown-portal,.wvr-card,.wvr-index-card,.wvr-report-wrap){background:var(--ca-dark-surface-raised)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important;box-shadow:none!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-balance-metrics>div,.wave-customer-details-grid>div,.wave-mini-panel){background:var(--ca-dark-surface)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-balance-metrics span,.wave-customer-details-grid span,.wave-eyebrow,.wave-mini-table small,.wave-statement-panel p,.wave-section-head>span,.wave-card p,.wave-card small,.wave-help-text,.description){color:var(--ca-dark-muted)!important}

/* beta.3 dark-mode contrast follow-up: financial emphasis, helper text and editor borders */
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wvst-doc-meta .dates-summary .row:last-child,
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wvst-doc-meta .dates-summary .row:last-child > span{
  color:var(--ca-dark-text)!important;
  border-color:var(--ca-dark-border)!important;
}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wave-payment-header-actions .wave-payment-helper{
  color:var(--ca-dark-muted)!important;
}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-bulk-count,.ca-project-bulk-count){
  color:var(--ca-dark-muted)!important;
}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .ca-rec-editor .ca-rec-standard-invoice-form{
  border-color:var(--ca-dark-border)!important;
  box-shadow:none!important;
}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-balance-metrics strong,.wave-customer-details-grid strong,.wave-mini-panel h3,.wave-section-head h2,.wave-card h1,.wave-card h2,.wave-card h3,.wave-table td,.wave-table td strong){color:var(--ca-dark-text)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background-color:var(--ca-dark-surface)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(input,textarea)::placeholder{color:#94a3b8!important;opacity:1}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-table,.wave-table th,.wave-table td){border-color:var(--ca-dark-border)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .wave-table th{background:var(--ca-dark-surface)!important;color:var(--ca-dark-muted)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-link-btn,.wvst-table a,.wvst-invoice-link){color:var(--ca-dark-link)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .wave-balance-outstanding-badge{background:var(--ca-dark-surface)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .wave-balance-outstanding-badge.is-owed{background:#3b1820!important;border-color:#7f1d1d!important;color:#fecaca!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .wave-balance-outstanding-badge.is-paid{background:#123421!important;border-color:#166534!important;color:#bbf7d0!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wvst-summary,.wvst-table tr.row-open td,.wvst-table tr.row-close td,.wvst-table tr.final-total td){background:var(--ca-dark-surface)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wvst-aging-table,.wvst-aging-table th,.wvst-aging-table td){background:var(--ca-dark-surface)!important;border-color:#64748b!important;color:var(--ca-dark-text)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wvst-table td small,.wvst-empty,.wvst-empty p){color:var(--ca-dark-muted)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wave-front-notice-success{background:#123421!important;border-color:#23834b!important;color:#dcfce7!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .wave-front-notice-error{background:#3b1820!important;border-color:#b91c1c!important;color:#fee2e2!important}
@media screen and (max-width:760px){
  :is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-customer-view-page .wave-card,.wave-balance-metrics>div,.wave-customer-details-grid>div,.wave-customer-activity-grid .wave-mini-panel){background:var(--ca-dark-surface)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important}
  :is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) :is(.wave-mobile-bottom-nav,.wave-mobile-nav,.wave-bottom-sheet){background:var(--ca-dark-surface)!important;border-color:var(--ca-dark-border)!important;color:var(--ca-dark-text)!important}
}
@media print{.wvst-reference a,.wvst-invoice-link{color:#111827!important;text-decoration:underline!important;text-decoration-thickness:.6px!important}}
/* Shared app-styled confirmation for destructive Draft-only invoice actions. */
.ca-app-confirm{width:min(440px,calc(100vw - 32px));max-width:none;padding:0;border:0;border-radius:16px;background:transparent;color:inherit;box-shadow:0 24px 70px rgba(15,23,42,.3)}
.ca-app-confirm::backdrop{background:rgba(15,23,42,.58);backdrop-filter:blur(2px)}
.ca-app-confirm-card{padding:24px;border:1px solid #dbe3ee;border-radius:16px;background:#fff;color:#172033}
.ca-app-confirm-card h2{margin:0 0 10px;font-size:20px;line-height:1.3}.ca-app-confirm-card p{margin:0;color:#526079;line-height:1.55}
.ca-app-confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;flex-wrap:wrap}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-app-confirm-card{background:var(--ca-dark-surface-raised,#182235);border-color:var(--ca-dark-border,#334155);color:var(--ca-dark-text,#f1f5f9)}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-app-confirm-card p{color:var(--ca-dark-muted,#cbd5e1)}
@media (max-width:680px){.ca-app-confirm-card{padding:20px}.ca-app-confirm-actions{flex-direction:column-reverse}.ca-app-confirm-actions .wave-btn{width:100%;justify-content:center}}

/* Document filter cleanup: keep each desktop document filter set on one row. */
.wave-list-tools-grid-invoices.ca-invoice-project-filter-grid{grid-template-columns:minmax(210px,1.6fr) minmax(100px,.75fr) minmax(120px,.9fr) minmax(145px,1.05fr) repeat(2,minmax(135px,.95fr));gap:8px}
.wave-list-tools-grid-invoices.ca-invoice-project-filter-grid>label{min-width:0}
.ca-estimate-filter-grid{grid-template-columns:minmax(210px,1.6fr) minmax(100px,.75fr) minmax(120px,.9fr) repeat(2,minmax(135px,.95fr));gap:8px}
.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid>label,
.ca-estimate-filter-grid>label{min-width:0}
@media(max-width:900px){.wave-list-tools-grid-invoices.ca-invoice-project-filter-grid,.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid,.ca-estimate-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.wave-list-tools-grid-invoices.ca-invoice-project-filter-grid,.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-filter-grid,.ca-estimate-filter-grid{grid-template-columns:1fr}}

/* beta.19 UI/report follow-up: compact responsive cards and document breathing room. */
@media screen and (min-width:761px){
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary{margin-top:38px!important}
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary{margin-top:18px!important}
  .ca-rec-editor .ca-rec-tax-row{grid-template-columns:minmax(0,1fr) minmax(180px,.75fr) minmax(150px,.55fr) max-content!important;justify-content:end!important}
  .ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment{grid-template-columns:minmax(180px,280px) max-content!important;justify-content:end!important}
  .ca-rec-editor .ca-rec-line-total{min-width:105px;text-align:right;padding:0 0 10px!important}
}
.ca-rec-discount-help{display:block;color:#64748b;font-size:11px;line-height:1.35;margin:7px 0 2px}
:is(.ca-dark,body.ca-dark,body.ca-theme-dark,html.ca-theme-dark) .ca-rec-discount-help{color:#aebed2}
@media print{
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary{margin-top:9mm!important}
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-payment-summary{margin-top:3.5mm!important}
}
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary{margin-top:34px!important}
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-payment-summary{margin-top:14px!important}

/* Lower-luminance dark Quick Actions; light mode remains governed by the base palette. */
:is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) .ca-dashboard-quick-action.is-invoice{background:#12233a!important;border-color:#203b5c!important}
:is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) .ca-dashboard-quick-action.is-estimate{background:#211c38!important;border-color:#3a3060!important}
:is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) .ca-dashboard-quick-action.is-receive{background:#102c23!important;border-color:#1d493a!important}
:is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) .ca-dashboard-quick-action.is-bill{background:#302313!important;border-color:#523d20!important}
:is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) .ca-dashboard-quick-action.is-pay-bill{background:#102b2f!important;border-color:#1e4a51!important}

@media(max-width:760px){
  /* Compact single-surface cards for Payments, Projects and Products. */
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page>section.wave-card:not(.ca-project-filter-card)){
    padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;
  }
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page>section.wave-card:not(.ca-project-filter-card))>.wave-section-head{
    margin:0 0 8px!important;padding:0 2px!important;
  }
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"])>.wave-list-tools,
  .wave-enhanced-list[data-table-kind="payments"]>.ca-server-filter-form,
  .ca-projects-page>.ca-project-filter-card{
    margin:0 0 8px!important;padding:10px!important;
  }
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table-wrap{overflow:visible!important;background:transparent!important}
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody tr{display:block!important;margin:0 0 9px!important;padding:10px 12px!important;border:1px solid #dbe5f0!important;border-radius:12px!important;background:#fff!important;box-shadow:none!important}
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody td{display:grid!important;grid-template-columns:minmax(84px,34%) 1fr!important;gap:8px!important;padding:4px 0!important;border:0!important;background:transparent!important;min-height:0!important;line-height:1.3!important}
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody td::before{content:attr(data-label);font-size:10px;font-weight:800;text-transform:uppercase;color:#64748b}
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-actions-cell{display:block!important;padding-top:7px!important}
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-actions-cell::before{display:none!important}
  :is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody tr{background:#101b2b!important;border-color:#2b3d53!important;color:#e8f0fb!important}
  :is(.ca-dark,body.ca-dark,body.ca-dark-page,body.ca-theme-dark,body[data-theme="dark"],html.ca-theme-dark) :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody td{background:transparent!important;color:#e8f0fb!important}

  /* Statement transactions become compact cards; money and dates never split. */
  .wvst-table{display:block!important}.wvst-table thead{display:none!important}.wvst-table tbody{display:block!important}
  .wvst-table tbody tr{display:grid!important;grid-template-columns:1fr auto!important;gap:4px 12px!important;margin:0 0 9px!important;padding:10px 12px!important;border:1px solid #dbe5f0!important;border-radius:11px!important;background:#fff!important}
  .wvst-table tbody td{display:block!important;width:auto!important;padding:2px 0!important;border:0!important;font-size:11px!important;word-break:normal!important;overflow-wrap:normal!important}
  .wvst-table tbody td:nth-child(1),.wvst-table tbody td:nth-child(2),.wvst-table tbody td:nth-child(3){grid-column:1/2!important;text-align:left!important;white-space:normal!important}
  .wvst-table tbody td:nth-child(4),.wvst-table tbody td:nth-child(5),.wvst-table tbody td:nth-child(6){grid-column:2/3!important;text-align:right!important;white-space:nowrap!important;font-variant-numeric:tabular-nums!important}
  .wvst-table tbody td:nth-child(1){white-space:nowrap!important;font-weight:700!important}
  .wvst-table tr.final-total td:first-child{grid-column:1/2!important}.wvst-table tr.final-total td:last-child{grid-column:2/3!important}
  :is(.ca-dark,body.ca-dark,body.ca-theme-dark,html.ca-theme-dark) .wvst-table tbody tr{background:#101b2b!important;border-color:#2b3d53!important;color:#e8f0fb!important}
}
.ca-share-toast{position:fixed!important;z-index:100050!important;top:18px!important;right:18px!important;max-width:min(360px,calc(100vw - 36px))!important;box-shadow:0 12px 30px rgba(15,23,42,.2)!important}
@media(max-width:600px){.ca-share-toast{left:14px!important;right:14px!important;top:14px!important;max-width:none!important}}
.ca-share-copy-fallback{position:fixed;z-index:100060;top:18px;right:18px;display:grid;gap:8px;width:min(440px,calc(100vw - 36px));padding:16px;border:1px solid #cbd5e1;border-radius:14px;background:#fff;color:#0f172a;box-shadow:0 16px 40px rgba(15,23,42,.24)}
.ca-share-copy-fallback span{font-size:13px;color:#475569}.ca-share-copy-fallback input{width:100%;min-width:0;padding:10px 12px;border:1px solid #94a3b8;border-radius:8px;background:#fff;color:#0f172a;font:inherit}.ca-share-copy-fallback button{justify-self:end;padding:8px 14px;border:0;border-radius:8px;background:#2563eb;color:#fff;font-weight:700;cursor:pointer}
:is(.ca-dark,body.ca-dark,body.ca-theme-dark,html.ca-theme-dark) .ca-share-copy-fallback{border-color:#334155;background:#101b2b;color:#e8f0fb}.ca-dark .ca-share-copy-fallback span,body.ca-dark .ca-share-copy-fallback span,body.ca-theme-dark .ca-share-copy-fallback span,html.ca-theme-dark .ca-share-copy-fallback span{color:#cbd5e1}:is(.ca-dark,body.ca-dark,body.ca-theme-dark,html.ca-theme-dark) .ca-share-copy-fallback input{border-color:#475569;background:#172438;color:#f8fafc}
body.ca-dark-page .ca-share-copy-fallback,body[data-theme="dark"] .ca-share-copy-fallback{border-color:#334155;background:#101b2b;color:#e8f0fb}
body.ca-dark-page .ca-share-copy-fallback span,body[data-theme="dark"] .ca-share-copy-fallback span{color:#cbd5e1}
body.ca-dark-page .ca-share-copy-fallback input,body[data-theme="dark"] .ca-share-copy-fallback input{border-color:#475569;background:#172438;color:#f8fafc}
@media(max-width:760px){
  .wvst-ledger-table tbody td,.wvst-outstanding-table tbody td{display:grid!important;grid-template-columns:minmax(92px,38%) minmax(0,1fr)!important;grid-column:1/-1!important;gap:8px!important;text-align:left!important;white-space:normal!important}
  .wvst-ledger-table tbody td::before,.wvst-outstanding-table tbody td::before{content:attr(data-label);display:block;font-size:10px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;color:#64748b}
  .wvst-ledger-table tbody td.num,.wvst-outstanding-table tbody td.num{font-variant-numeric:tabular-nums!important}
  .wvst-ledger-table tbody td.num:not(:empty),.wvst-outstanding-table tbody td.num:not(:empty){white-space:nowrap!important}
  .wvst-outstanding-table tbody tr{grid-template-columns:1fr!important}
  .wvst-outstanding-table tbody td[data-label="Paid"],.wvst-outstanding-table tbody td[data-label="Credit Notes"],.wvst-outstanding-table tbody td[data-label="Outstanding"]{display:grid!important}

  /* Override legacy statement nth-child rules: every labeled field owns one full card row. */
  .wvst-ledger-table tbody td:nth-child(1),.wvst-ledger-table tbody td:nth-child(2),.wvst-ledger-table tbody td:nth-child(3),.wvst-ledger-table tbody td:nth-child(4),.wvst-ledger-table tbody td:nth-child(5),.wvst-ledger-table tbody td:nth-child(6),
  .wvst-outstanding-table tbody td:nth-child(1),.wvst-outstanding-table tbody td:nth-child(2),.wvst-outstanding-table tbody td:nth-child(3),.wvst-outstanding-table tbody td:nth-child(4),.wvst-outstanding-table tbody td:nth-child(5),.wvst-outstanding-table tbody td:nth-child(6),.wvst-outstanding-table tbody td:nth-child(7){display:grid!important;grid-column:1/-1!important;width:auto!important;text-align:left!important}
  .wvst-ledger-table tbody td:nth-child(3)>small{grid-column:2!important;min-width:0!important}
  .wvst-ledger-table tbody td.num:not(:empty),.wvst-outstanding-table tbody td.num:not(:empty){min-width:0!important;overflow:visible!important;white-space:nowrap!important}

  body.ca-dark-page :is(.wvst-ledger-table,.wvst-outstanding-table) tbody td::before,
body[data-theme="dark"] :is(.wvst-ledger-table,.wvst-outstanding-table) tbody td::before{color:#b8c7dc!important}


  /* Final totals also stay in the single-column card flow; override the legacy first/last two-track placement. */
  .wvst-ledger-table tbody tr.final-total td,.wvst-outstanding-table tbody tr.final-total td,
  .wvst-ledger-table tbody tr.final-total td:first-child,.wvst-ledger-table tbody tr.final-total td:last-child,
  .wvst-outstanding-table tbody tr.final-total td:first-child,.wvst-outstanding-table tbody tr.final-total td:last-child{grid-column:1/-1!important;width:auto!important;min-width:0!important}
  .wvst-ledger-table tbody tr.final-total td:last-child,.wvst-outstanding-table tbody tr.final-total td:last-child{white-space:nowrap!important;font-variant-numeric:tabular-nums!important;font-weight:800!important}
}

/* beta.20 runtime acceptance: authoritative rendered-path parity. */
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-actions h2{color:#f8fafc!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action{color:#dbeafe!important;box-shadow:none!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action:hover{box-shadow:0 8px 22px rgba(0,0,0,.24)!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action-icon{background:rgba(15,23,42,.64)!important;color:inherit!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action.is-invoice{color:#9dccff!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action.is-estimate{color:#d0c4ff!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action.is-receive{color:#8ce1bc!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action.is-bill{color:#f4c47f!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-dashboard-quick-action.is-pay-bill{color:#91e0e6!important}

@media(max-width:760px){
  /* Mobile card presentation must never override filter/pagination visibility. */
  :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody tr:is(.wave-filter-hidden,.ca-page-hidden),
  .ca-projects-page .ca-project-no-results:not(.is-visible){display:none!important}
  .ca-projects-page .ca-project-no-results.is-visible{display:block!important}
  :is(body.ca-dark-page,body[data-theme="dark"]) :is(.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody td::before{color:#b8c7dc!important}
  :is(body.ca-dark-page,body[data-theme="dark"]) :is(.wvst-ledger-table,.wvst-outstanding-table) tbody tr{background:#101b2b!important;border-color:#2b3d53!important;color:#e8f0fb!important}
}

/* Match the actual recurring editor row markup, after its legacy inline styles. */
@media screen and (min-width:761px){
  body .ca-rec-editor .ca-rec-tax-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(180px,250px) minmax(180px,250px) minmax(105px,max-content)!important;align-items:end!important;justify-content:stretch!important;gap:12px!important}
  body .ca-rec-editor .ca-rec-tax-row.ca-rec-tax-row-no-treatment{grid-template-columns:minmax(0,1fr) minmax(180px,250px) minmax(105px,max-content)!important}
  body .ca-rec-editor .ca-rec-tax-row>label:last-of-type{justify-self:stretch!important;grid-column:-3/-2!important}
  body .ca-rec-editor .ca-rec-tax-row>label:last-of-type select{width:100%!important}
  body .ca-rec-editor .ca-rec-line-total{grid-column:-2/-1!important;justify-self:end!important;text-align:right!important;margin:0!important;padding:0 0 10px!important}
}
body .ca-rec-editor .ca-rec-discount-help{color:#64748b!important;margin:6px 0 8px!important}
:is(body.ca-dark-page,body[data-theme="dark"]) .ca-rec-editor .ca-rec-discount-help{color:#b8c7dc!important}
@media(max-width:600px){.ca-share-copy-fallback{left:14px;right:14px;top:14px;width:auto}}

/* beta.21 runtime UI follow-ups: actual rendered surfaces and document flow. */
:is(body.ca-dark-page,body[data-theme="dark"]) :is(.wvd-expense-legend span,.wvd-chart-legend span,.wvd-chart-legend div){background:#142338!important;border:1px solid #2b3d53!important;color:#e8f0fb!important}
:is(body.ca-dark-page,body[data-theme="dark"]) :is(.wvd-expense-legend small,.wvd-chart-legend small){color:#b8c7dc!important}

@media(max-width:760px){
  /* Customer, Payment, Project, and Product rows own the only record surface. */
  :is(.wave-enhanced-list[data-table-kind="customers"],.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) :is(.wave-table-card,.wave-list-card,.ca-project-results,.wave-table-wrap){background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
  :is(.wave-enhanced-list[data-table-kind="customers"],.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden):not(.ca-project-no-results){padding:9px 11px!important;margin-bottom:8px!important;background:#fff!important;border:1px solid #dbe5f0!important;border-radius:11px!important;box-shadow:none!important}
  :is(.wave-enhanced-list[data-table-kind="customers"],.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody td{background:transparent!important;padding:3px 0!important;min-height:0!important}
  :is(body.ca-dark-page,body[data-theme="dark"]) :is(.wave-enhanced-list[data-table-kind="customers"],.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden):not(.ca-project-no-results){background:#101b2b!important;border-color:#2b3d53!important;color:#e8f0fb!important}
  :is(body.ca-dark-page,body[data-theme="dark"]) :is(.wave-enhanced-list[data-table-kind="customers"],.wave-enhanced-list[data-table-kind="payments"],.wave-enhanced-list[data-table-kind="products"],.ca-projects-page) .wave-table tbody td{background:transparent!important;color:#e8f0fb!important}
  .ca-projects-page .ca-project-no-results[hidden],.ca-projects-page .ca-project-no-results:not(.is-visible){display:none!important}

  /* One transaction per compact two-column Statement card; blank values disappear. */
  .wvst-ledger-table tbody tr:not(.final-total){grid-template-columns:1fr!important;padding:10px 12px!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td{display:grid!important;grid-template-columns:minmax(82px,34%) minmax(0,1fr)!important;grid-column:1/-1!important;gap:8px!important;align-items:start!important;padding:3px 0!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td:empty{display:none!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td::before{grid-column:1!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td>*{grid-column:2!important;min-width:0!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td:nth-child(1),.wvst-ledger-table tbody tr:not(.final-total)>td:nth-child(2),.wvst-ledger-table tbody tr:not(.final-total)>td:nth-child(3){order:0!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td:nth-child(4),.wvst-ledger-table tbody tr:not(.final-total)>td:nth-child(5),.wvst-ledger-table tbody tr:not(.final-total)>td:nth-child(6){order:1!important;text-align:left!important}
}

/* Keep Notes/Terms and Payment Summary together lower in normal flow. */
@media screen and (min-width:761px){
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary{margin-top:clamp(72px,10vh,118px)!important;break-inside:avoid!important;page-break-inside:avoid!important}
}
@media print{
  html body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary,
  html body.wave-public-view-with-sidebar .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary,
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-lower-grid.has-payment-summary{margin-top:18mm!important;break-inside:avoid!important;page-break-inside:avoid!important}
}
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-lower-grid.has-payment-summary,
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary{position:static!important;bottom:auto!important;margin-top:86px!important;break-inside:avoid!important;page-break-inside:avoid!important}

/* beta.22 acceptance: canonical navigation, mobile states, and light documents. */
.ca-global-app-back{flex:0 0 auto;margin-right:10px}
.ca-projects-page .ca-project-no-results{display:none!important}
.ca-projects-page .ca-project-no-results.is-visible:not([hidden]){display:table-row!important}

@media(max-width:760px){
  .wvst-ledger-table tbody tr:not(.final-total)>td,
  .wvst-ledger-table tbody tr:not(.final-total)>td>*{background:transparent!important;border:0!important;box-shadow:none!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td{border-radius:0!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td:empty{display:none!important}
}

/* A printable accounting document is always a light document, independently
   of the authenticated application's theme roots. This final layer also
   covers Estimate and Credit Note renderers that share the flat template. */
@media print{
  html,body,
  html body .wave-public-invoice-flat,
  html body .wave-public-invoice-flat .wave-public-sheet-flat,
  html body .wave-public-invoice-flat .ca-doc-v2290-sheet{background:#fff!important;color:#172033!important;color-scheme:light!important}
  html body .wave-public-invoice-flat :is(.wave-public-flat-head,.wave-public-flat-meta-row,.wave-public-flat-billto,.wave-public-flat-meta-box,.wave-public-flat-items,.wave-public-flat-item-row,.wave-public-flat-bottom,.wave-public-flat-notes-below,.wave-public-payment-summary,.wave-public-document-footer,.wave-public-print-footer){background-color:transparent!important;color:#172033!important;border-color:#d9e1e8!important}
  html body .wave-public-invoice-flat :is(h1,h2,h3,h4,p,span,small,strong,th,td,div),
  html body.ca-dark-page .wave-public-invoice-flat :is(h1,h2,h3,h4,p,span,small,strong,th,td,div),
  html body[data-theme="dark"] .wave-public-invoice-flat :is(h1,h2,h3,h4,p,span,small,strong,th,td,div){color:#172033!important}
  html body .wave-public-invoice-flat .wave-public-flat-label{color:#526176!important}
  html body .wave-public-invoice-flat .wave-public-flat-amount-due,
  html body .wave-public-invoice-flat .wave-public-amount-due-pill{background:#172033!important;color:#fff!important}
  html body .wave-public-invoice-flat .wave-public-flat-lower-grid.has-payment-summary{margin-top:auto!important;padding-top:6mm!important;break-inside:avoid!important;page-break-inside:avoid!important}
  html body .wave-public-invoice-flat .wave-public-sheet-flat.ca-doc-v2290-sheet{display:flex!important;flex-direction:column!important;min-height:267mm!important}
}

html body .wave-pdf-export-clone,
html body .wave-pdf-export-clone .wave-public-sheet-flat{background:#fff!important;color:#172033!important;color-scheme:light!important}
html body .wave-pdf-export-clone :is(h1,h2,h3,h4,p,span,small,strong,th,td,div){color:#172033!important}
html body .wave-pdf-export-clone .wave-public-flat-label{color:#526176!important}
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary{break-inside:avoid!important;page-break-inside:avoid!important}

/* beta.23 runtime corrections: one header composition, compact cards, and
   theme-independent accounting documents. */
.wave-header-card.wave-list-head.ca-app-page-header{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;justify-content:stretch!important;column-gap:12px!important;row-gap:8px!important;text-align:left!important}
.wave-header-card.wave-list-head.ca-app-page-header>.ca-app-page-heading{grid-column:2!important;min-width:0!important;text-align:left!important;margin:0!important}
.wave-header-card.wave-list-head.ca-app-page-header>:is([data-ca-app-back],.ca-doc-editor-back,.wvr-back-btn){grid-column:1!important;grid-row:1!important;align-self:center!important;justify-self:start!important;position:static!important;margin:0!important;width:38px!important;height:38px!important;min-width:38px!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}
.wave-header-card.wave-list-head.ca-app-page-header>.ca-app-page-actions{grid-column:3!important;grid-row:1!important;justify-self:end!important;display:flex!important;align-items:center!important;gap:8px!important}

@media(max-width:760px){
  .wave-header-card.wave-list-head.ca-app-page-header{grid-template-columns:36px minmax(0,1fr) auto!important;column-gap:8px!important;padding:12px!important}
  .wave-header-card.wave-list-head.ca-app-page-header>:is([data-ca-app-back],.ca-doc-editor-back,.wvr-back-btn){width:36px!important;height:36px!important;min-width:36px!important}
  .wave-header-card.wave-list-head.ca-app-page-header>.ca-app-page-heading h1{font-size:20px!important;line-height:1.15!important;margin:0!important}
  .wave-header-card.wave-list-head.ca-app-page-header>.ca-app-page-heading p{margin:3px 0 0!important;line-height:1.3!important}

  /* Projects use the same dense label/value rhythm as Payments and Products. */
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]{padding:8px 10px!important;display:grid!important;grid-template-columns:1fr!important;gap:0!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td{display:grid!important;grid-template-columns:minmax(78px,32%) minmax(0,1fr)!important;gap:8px!important;align-items:start!important;padding:3px 0!important;background:transparent!important;border:0!important;min-height:0!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td::before{content:attr(data-label);font-size:10px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;color:#64748b}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td>*{grid-column:2!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td>br{display:none!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-check-cell{display:block!important;padding:0 0 5px!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-check-cell::before{content:none!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions{display:flex!important;justify-content:flex-end!important;gap:6px!important;border-top:1px solid #dbe5f0!important;margin-top:4px!important;padding-top:6px!important}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions::before{content:none!important}
  :is(body.ca-dark-page,body[data-theme="dark"]) .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td::before{color:#b8c7dc!important}
  :is(body.ca-dark-page,body[data-theme="dark"]) .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions{border-color:#2b3d53!important}

  /* A Statement transaction owns one surface; label/value rows never become
     nested strips. Every value child stays in the second column. */
  .wvst-ledger-table tbody tr:not(.final-total)>td{background:transparent!important;background-image:none!important;border:0!important;border-radius:0!important;box-shadow:none!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td>*{grid-column:2!important;background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important;margin-top:0!important;margin-bottom:2px!important}
  .wvst-ledger-table tbody tr:not(.final-total)>td::before{grid-column:1!important;background:transparent!important}
}

/* The actual cloned/new-window print document opts into this root before
   print(), so canonical application dark roots cannot win the cascade. */
html.ca-print-light-document,body.ca-print-light-document,
.ca-print-light-document .wave-public-invoice-flat,
.ca-print-light-document .wave-public-sheet-flat,
.ca-light-document,.ca-light-document .wave-public-sheet-flat{background:#fff!important;color:#172033!important;color-scheme:light!important}
.ca-print-light-document .wave-public-invoice-flat :where(*),
.ca-light-document :where(*){color:#172033!important}
.ca-print-light-document :is(.wave-public-flat-label,.wave-public-flat-items-head,.wave-public-payment-summary-label),
.ca-light-document :is(.wave-public-flat-label,.wave-public-flat-items-head,.wave-public-payment-summary-label){color:#526176!important}
.ca-print-light-document :is(.wave-public-flat-due,.wave-public-flat-amount-due,.wave-public-amount-due-pill),
.ca-print-light-document :is(.wave-public-flat-due,.wave-public-flat-amount-due,.wave-public-amount-due-pill) *,
.ca-light-document :is(.wave-public-flat-due,.wave-public-flat-amount-due,.wave-public-amount-due-pill),
.ca-light-document :is(.wave-public-flat-due,.wave-public-flat-amount-due,.wave-public-amount-due-pill) *{background:#172033!important;color:#fff!important}
.ca-print-light-document :is(.wave-public-payment-summary,.wave-public-flat-notes-below,.wave-public-document-footer,.wave-public-flat-footer,.wave-public-print-footer),
.ca-light-document :is(.wave-public-payment-summary,.wave-public-flat-notes-below,.wave-public-document-footer,.wave-public-flat-footer,.wave-public-print-footer){background:#fff!important;border-color:#d9e1e8!important}

/* Report and Customer headers render Back inside their action groups. The
   normalizer extracts it, and this final rule defeats the legacy report hide. */
.wave-header-card.wave-list-head.ca-app-page-header>.wvr-back-btn{display:inline-flex!important}

@media print{
  html.ca-print-light-document body.ca-print-light-document .wave-public-sheet-flat.ca-doc-v2290-sheet{display:flex!important;flex-direction:column!important;min-height:267mm!important;background:#fff!important;color:#172033!important}
  html.ca-print-light-document body.ca-print-light-document .wave-public-flat-lower-grid.has-payment-summary{position:static!important;margin-top:auto!important;padding-top:8mm!important;break-inside:avoid!important;page-break-inside:avoid!important}
}
html body .wave-pdf-export-clone.ca-doc-v2290-sheet{display:flex!important;flex-direction:column!important;min-height:1010px!important}
html body .wave-pdf-export-clone .wave-public-flat-lower-grid.has-payment-summary{margin-top:auto!important;padding-top:28px!important;break-inside:avoid!important;page-break-inside:avoid!important}

/* Short invoices consume the printable document height before the combined
   Notes/Terms + Payment Summary section. Longer invoices grow naturally, so
   the lower section remains in flow and cannot collide with the footer. */
@media screen and (min-width:761px){
  html body .ca-doc-v2290-invoice .wave-public-sheet-flat.ca-invoice-flow-sheet{
    display:flex!important;
    flex-direction:column!important;
    min-height:980px!important;
  }
  html body .ca-doc-v2290-invoice .ca-invoice-flow-sheet>.wave-public-flat-lower-grid.has-payment-summary{
    margin-top:auto!important;
    padding-top:42px!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
}
@media print{
  html.ca-print-light-document body.ca-print-light-document .ca-doc-v2290-invoice .wave-public-sheet-flat.ca-invoice-flow-sheet{
    display:flex!important;
    flex-direction:column!important;
    min-height:267mm!important;
  }
  html.ca-print-light-document body.ca-print-light-document .ca-doc-v2290-invoice .ca-invoice-flow-sheet>.wave-public-flat-lower-grid.has-payment-summary{
    margin-top:auto!important;
    padding-top:8mm!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
}
html body .wave-pdf-export-clone.ca-invoice-flow-sheet{
  display:flex!important;
  flex-direction:column!important;
  min-height:1010px!important;
}
html body .wave-pdf-export-clone.ca-invoice-flow-sheet>.wave-public-flat-lower-grid.has-payment-summary{
  margin-top:auto!important;
  padding-top:28px!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}

/* Keep Invoice Amount Due visually aligned with the light Payment Summary in
   authenticated View, browser Print, and generated PDF, including dark mode. */
html body .ca-doc-v2290-invoice .wave-public-flat-due,
html body.ca-dark-page .ca-doc-v2290-invoice .wave-public-flat-due,
html body[data-theme="dark"] .ca-doc-v2290-invoice .wave-public-flat-due,
html body .wave-pdf-export-clone.ca-doc-v2290-invoice .wave-public-flat-due {
  background:#fff!important;
  border:1px solid #d9e1e8!important;
  color:#172033!important;
}
html body .ca-doc-v2290-invoice .wave-public-flat-due span,
html body.ca-dark-page .ca-doc-v2290-invoice .wave-public-flat-due span,
html body[data-theme="dark"] .ca-doc-v2290-invoice .wave-public-flat-due span,
html body .wave-pdf-export-clone.ca-doc-v2290-invoice .wave-public-flat-due span {
  color:#526176!important;
}
html body .ca-doc-v2290-invoice .wave-public-flat-due strong,
html body.ca-dark-page .ca-doc-v2290-invoice .wave-public-flat-due strong,
html body[data-theme="dark"] .ca-doc-v2290-invoice .wave-public-flat-due strong,
html body .wave-pdf-export-clone.ca-doc-v2290-invoice .wave-public-flat-due strong {
  color:#172033!important;
  font-weight:750!important;
}

/* Document amount summaries share one light, print-safe treatment. This final
   rule also prevents application dark-mode selectors from leaking into PDF. */
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
html body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
html body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-due {
  background:#eef6fc!important;
  background-color:#eef6fc!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  color:#172033!important;
}
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due span,
html body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due span,
html body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due span,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-due span { color:#526176!important; background:transparent!important; }
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due strong,
html body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due strong,
html body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290 .wave-public-flat-due strong,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-flat-due strong { color:#172033!important; background:transparent!important; }

/* Issue #106: printable financial documents always use an opaque light-paper
   palette. These selectors deliberately outrank the later receipt dark-mode
   allocation rules without changing the screen theme. */
@media print {
  html body.wave-receipt-print-body {
    background:#fff!important;
    color:#172033!important;
    color-scheme:light!important;
  }
  html body.wave-receipt-print-body .wave-receipt-page,
  html body.wave-receipt-print-body .wave-receipt-sheet {
    background:#fff!important;
    background-image:none!important;
    color:#172033!important;
    border-color:#d9e1e8!important;
    box-shadow:none!important;
    color-scheme:light!important;
  }
  html body.wave-receipt-print-body .wave-receipt-sheet :is(h1,p,span,strong,div) {
    color:#172033!important;
  }
  html body.wave-receipt-print-body .wave-receipt-sheet :is(.wave-receipt-subtitle,.wave-receipt-customer,.wave-receipt-footer-note) {
    color:#526176!important;
  }
  html body.wave-receipt-print-body .wave-receipt-allocations,
  html body.wave-receipt-print-body .wave-receipt-allocation {
    background:#fff!important;
    background-image:none!important;
    color:#172033!important;
    border-color:#cbd5e1!important;
    box-shadow:none!important;
  }
  html body.wave-receipt-print-body .wave-receipt-allocation :is(a,span,strong) {
    background:transparent!important;
    color:#172033!important;
  }
  html body.wave-receipt-print-body .wave-receipt-allocation a {
    color:#173f73!important;
    text-decoration:underline!important;
  }
  html body.wave-receipt-print-body .wave-receipt-paid-stamp {
    background:transparent!important;
    color:#15803d!important;
    border-color:#15803d!important;
  }
  html body.wave-receipt-print-body .wave-receipt-powered,
  html body.wave-receipt-print-body .wave-receipt-powered span {
    background:#fff!important;
    color:#526176!important;
  }

  /* Direct Ctrl/Cmd+P prints the live Invoice rather than the isolated #99
     iframe. Give that path the same semantic light surfaces while leaving the
     paginator, dimensions and footer positioning untouched. */
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice,
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-doc-v2290-sheet,
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer,
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-flat-footer,
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-print-footer {
    background:#fff!important;
    background-image:none!important;
    color:#172033!important;
    border-color:#d9e1e8!important;
    box-shadow:none!important;
    color-scheme:light!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice :is(.wave-public-flat-label,.wave-public-flat-meta-box span,.wave-public-item-description,.wave-public-note-text,.wave-public-powered-by-text) {
    color:#526176!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice :is(.wave-public-flat-items-head,.wave-public-flat-item-row,.wave-public-flat-totals,.wave-public-payment-summary,.wave-public-flat-notes-below) {
    background:#fff!important;
    background-image:none!important;
    color:#172033!important;
    border-color:#d9e1e8!important;
  }
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-invoice-cancelled-stamp {
    background:transparent!important;
    color:#c62828!important;
    border-color:#c62828!important;
  }

  /* The authenticated view nests the Invoice below portal containers. Legacy
     print rules hide non-Invoice direct body children, which otherwise hides
     that entire ancestor chain and leaves only the dark body page visible. */
  html body.ca-invoice-live-print > *:not(.ca-invoice-live-print-host) {
    display:none!important;
  }
  html body.ca-invoice-live-print > .ca-invoice-live-print-host,
  html body.ca-invoice-live-print .ca-invoice-live-print-host {
    display:block!important;
    visibility:visible!important;
    background:#fff!important;
    background-color:#fff!important;
    background-image:none!important;
    color:#172033!important;
    border:0!important;
    box-shadow:none!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
  /* Match the specificity of the legacy body-child exclusion (including its
     two :not() selectors) so the authenticated portal host is not suppressed. */
  html body.wave-invoice-print-body.ca-invoice-live-print > .ca-invoice-live-print-host {
    display:block!important;
    visibility:visible!important;
  }
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice,
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-doc-v2290-sheet {
    display:block!important;
    position:static!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    page-break-inside:auto!important;
    break-inside:auto!important;
  }
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-flat-lower-grid,
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-payment-summary,
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-payment-summary * {
    position:static!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    background:#fff!important;
    color:#172033!important;
  }
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer,
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-print-footer {
    display:flex!important;
    position:static!important;
    visibility:visible!important;
    height:auto!important;
    margin-top:10mm!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
}

/* Issue #107: Invoice-only Amount Due roles have one stable, accessible
   palette across screen light/dark, isolated Print and generated PDF. */
html body .ca-doc-v2290-invoice .ca-invoice-amount-due,
html body.ca-dark-page .ca-doc-v2290-invoice .ca-invoice-amount-due,
html body[data-theme="dark"] .ca-doc-v2290-invoice .ca-invoice-amount-due,
html body .wave-portal-shell[data-theme="dark"] .ca-doc-v2290-invoice .ca-invoice-amount-due,
html body .ca-light-document.ca-doc-v2290-invoice .ca-invoice-amount-due,
html body .wave-pdf-export-clone.ca-doc-v2290-invoice .ca-invoice-amount-due {
  background:#eef6fc!important;
  background-color:#eef6fc!important;
  background-image:none!important;
  border-color:#cbd5e1!important;
  color:#172033!important;
}
html body .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
html body.ca-dark-page .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
html body[data-theme="dark"] .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
html body .wave-portal-shell[data-theme="dark"] .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
html body .ca-light-document.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
html body .wave-pdf-export-clone.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label {
  background:transparent!important;
  color:#46566c!important;
}
html body .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
html body.ca-dark-page .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
html body[data-theme="dark"] .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
html body .wave-portal-shell[data-theme="dark"] .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
html body .ca-light-document.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
html body .wave-pdf-export-clone.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value {
  background:transparent!important;
  color:#172033!important;
  font-weight:750!important;
}
@media print {
  html body .ca-doc-v2290-invoice .ca-invoice-amount-due {
    background:#eef6fc!important;
    color:#172033!important;
  }
  html body .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label { color:#46566c!important; }
  html body .ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value { color:#172033!important; }
}

.ca-doc-v2290-sheet { position:relative; }
.wave-invoice-cancelled-overlay {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:2;
  pointer-events:none;
}
.wave-invoice-cancelled-stamp {
  position:absolute;
  top:50%;
  left:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 17px;
  border:4px solid #c62828;
  border-radius:7px;
  color:#c62828!important;
  background:transparent!important;
  font-size:31px;
  line-height:1;
  font-weight:900;
  letter-spacing:3px;
  text-transform:uppercase;
  transform:translate(-50%, -50%) rotate(-12deg);
  opacity:.68;
  pointer-events:none;
}
.wave-invoice-cancelled-stamp * { color:#c62828!important; background:transparent!important; }
@media(max-width:640px){.wave-invoice-cancelled-stamp{font-size:24px;border-width:3px;padding:5px 12px;}}
@media print{.wave-invoice-cancelled-overlay{height:100%!important;}}
html body .wave-pdf-export-clone>.wave-invoice-cancelled-overlay{height:100%!important;}
html body .wave-pdf-export-clone>.wave-pdf-document-flow{
  display:flex!important;
  flex:1 0 auto!important;
  flex-direction:column!important;
  min-height:0!important;
  width:100%!important;
}
html body .wave-pdf-export-clone>.wave-pdf-document-flow>.wave-public-flat-lower-grid,
html body .wave-pdf-export-clone>.wave-pdf-document-flow>.wave-public-flat-notes-below{margin-top:auto!important;}


/* Mobile list consistency pass: shared compact card language across modules. */
@media(max-width:760px){
  /* Common list rhythm: same control density without changing desktop layouts. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ){
    padding:10px!important;
    border-radius:14px!important;
  }

  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  )>.wave-section-head{
    margin-bottom:8px!important;
  }

  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  )>.wave-section-head h2{
    font-size:15px!important;
  }

  /* Compact bulk actions: select-all on top, action + Apply on one row.
     "0 selected" is hidden until there is an actual selection. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ) .wave-bulk-toolbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:7px!important;
    align-items:center!important;
    margin:8px 0 10px!important;
    padding:8px!important;
    border-radius:11px!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ) .wave-bulk-select-label{
    grid-column:1/-1!important;
    margin:0!important;
    font-size:11px!important;
    line-height:1.2!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ) .wave-bulk-action-select{
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    height:40px!important;
    margin:0!important;
    font-size:13px!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ) .wave-bulk-apply{
    width:auto!important;
    min-width:88px!important;
    min-height:40px!important;
    height:40px!important;
    margin:0!important;
    padding:0 14px!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ) .wave-bulk-count{
    display:none!important;
    grid-column:1/-1!important;
    margin:0!important;
    font-size:11px!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-enhanced-list
  ):has(.wave-bulk-row-check:checked) .wave-bulk-count{
    display:inline-flex!important;
  }

  /* Filters use the same mobile control height and vertical spacing. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"]
  ) .wave-list-tools-grid,
  .ca-vendors-page .ca-vendor-filters,
  .ca-bills-page .ca-bills-auto-filters,
  .ca-bill-payments-page .ca-bill-payments-auto-filters{
    gap:8px!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"]
  ) :is(input,select),
  .ca-vendors-page .ca-vendor-filters :is(input,select),
  .ca-bills-page .ca-bills-auto-filters :is(input,select),
  .ca-bill-payments-page .ca-bill-payments-auto-filters :is(input,select),
  .ca-rec-list-page .ca-rec-customer-filter select{
    min-height:42px!important;
    height:42px!important;
    font-size:13px!important;
  }

  /* Shared compact record-card shell for table-based lists. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table-wrap{
    overflow:visible!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) :is(.wave-table,.wave-table tbody){
    display:block!important;
    width:100%!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table thead{
    display:none!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
    width:100%!important;
    box-sizing:border-box!important;
    margin:0 0 8px!important;
    padding:10px 12px!important;
    border:1px solid #dbe5f0!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  .ca-vendors-page .ca-vendors-table tbody tr[style*="display: none"]{
    display:none!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td{
    display:grid!important;
    grid-template-columns:minmax(88px,31%) minmax(0,1fr)!important;
    gap:8px!important;
    align-items:start!important;
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    padding:3px 0!important;
    border:0!important;
    background:transparent!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    text-align:left!important;
    font-size:13px!important;
    line-height:1.3!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td::before{
    content:attr(data-label);
    grid-column:1!important;
    font-size:10.5px!important;
    font-weight:800!important;
    letter-spacing:.035em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
    line-height:1.35!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td>*{
    grid-column:2!important;
    min-width:0!important;
  }

  /* Labels for legacy rows that pre-date data-label attributes. */
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td:nth-child(2)::before,
  .wave-enhanced-list[data-table-kind="vendors"] .wave-table tbody td:nth-child(2)::before{content:"Name";}
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td:nth-child(3)::before,
  .wave-enhanced-list[data-table-kind="vendors"] .wave-table tbody td:nth-child(3)::before{content:"Email";}
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td:nth-child(4)::before,
  .wave-enhanced-list[data-table-kind="vendors"] .wave-table tbody td:nth-child(4)::before{content:"Phone";}

  .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(2)::before{content:"Name";}
  .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(3)::before{content:"Description";}
  .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(4)::before{content:"Price";}

  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(2)::before{content:"Invoice #";}
  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(3)::before{content:"Customer";}
  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(4)::before{content:"Date";}
  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(5)::before{content:"Method";}
  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(6)::before{content:"Account";}
  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(7)::before{content:"Amount";}

  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2)::before{content:"Status";}
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(3)::before{content:"Date";}
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(4)::before{content:"Number";}
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(5)::before{content:"Vendor";}
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(6)::before{content:"Project";}
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(7)::before{content:"Total";}

  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(2)::before{content:"Payment #";}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3)::before{content:"Payment date";}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(4)::before{content:"Vendor";}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5)::before{content:"Paid";}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)::before{content:"Status";}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(7)::before{content:"Actions";}

  /* Checkbox and action rows do not consume a fake label column. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td.wave-bulk-col{
    display:block!important;
    padding:0 0 5px!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td.wave-bulk-col::before,
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell)::before{
    content:none!important;
    display:none!important;
  }
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(7)::before{
    content:"Actions"!important;
    display:block!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell){
    display:flex!important;
    grid-template-columns:none!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    margin-top:5px!important;
    padding:8px 0 0!important;
    border-top:1px solid #e4ebf3!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell)>*{
    grid-column:auto!important;
  }

  /* Consistent emphasis hierarchy. */
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td:nth-child(2),
  .wave-enhanced-list[data-table-kind="vendors"] .wave-table tbody td:nth-child(2),
  .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(2){
    font-weight:700!important;
    color:#172033!important;
  }
  .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(7),
  .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(4),
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(7),
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5){
    font-weight:750!important;
    color:#172033!important;
  }

  /* Recurring invoices use the same compact label/value rhythm. */
  html body .ca-rec-list-page .wave-table-wrap{
    overflow:visible!important;
    margin:0!important;
    border:0!important;
  }
  html body .ca-rec-list-page .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
    margin:0 0 8px!important;
    padding:10px 12px!important;
    border:1px solid #dbe5f0!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  html body .ca-rec-list-page .wave-table tbody td{
    display:grid!important;
    grid-template-columns:minmax(88px,31%) minmax(0,1fr)!important;
    gap:8px!important;
    align-items:start!important;
    padding:3px 0!important;
    border:0!important;
    min-height:0!important;
    background:transparent!important;
  }
  html body .ca-rec-list-page .wave-table tbody td::before{
    content:attr(data-label)!important;
    font-size:10.5px!important;
    font-weight:800!important;
    letter-spacing:.035em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
    line-height:1.35!important;
  }
  html body .ca-rec-list-page .wave-table tbody td>*{
    grid-column:2!important;
    min-width:0!important;
  }
  html body .ca-rec-list-page .wave-table tbody td.wave-bulk-col{
    display:block!important;
    padding:0 0 5px!important;
  }
  html body .ca-rec-list-page .wave-table tbody td.wave-bulk-col::before{display:none!important;}
  html body .ca-rec-list-page .ca-rec-row-actions{
    width:100%!important;
    justify-content:flex-start!important;
    gap:6px!important;
    flex-wrap:nowrap!important;
    border-top:1px solid #e4ebf3!important;
    padding-top:8px!important;
    margin-top:4px!important;
  }
  html body .ca-rec-list-page .ca-rec-muted{
    margin-top:2px!important;
    font-size:11px!important;
    line-height:1.35!important;
  }
  html body .ca-rec-list-page .wave-table tbody td:nth-child(7){
    font-weight:750!important;
    color:#172033!important;
  }

  /* Projects keep their semantic fields but share the same shell/buttons. */
  html body .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]{
    margin:0 0 8px!important;
    padding:10px 12px!important;
    border:1px solid #dbe5f0!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  html body .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td{
    grid-template-columns:minmax(88px,31%) minmax(0,1fr)!important;
    gap:8px!important;
    padding:3px 0!important;
  }
  html body .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td::before{
    font-size:10.5px!important;
    letter-spacing:.035em!important;
  }
  html body .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions{
    justify-content:flex-start!important;
    gap:6px!important;
    border-top:1px solid #e4ebf3!important;
    margin-top:5px!important;
    padding-top:8px!important;
  }

  /* Tax-rate cards follow the same card shell and action bar. */
  .ca-taxes-page .ca-tax-rates-card{
    padding:10px!important;
    border-radius:14px!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table-wrap{
    overflow:visible!important;
    margin:0!important;
    border:0!important;
  }
  .ca-taxes-page .ca-tax-rates-card :is(.wave-table,.wave-table tbody){
    display:block!important;
    width:100%!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table thead{display:none!important;}
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody tr{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
    width:100%!important;
    margin:0 0 8px!important;
    padding:10px 12px!important;
    box-sizing:border-box!important;
    border:1px solid #dbe5f0!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td{
    display:grid!important;
    grid-template-columns:minmax(88px,31%) minmax(0,1fr)!important;
    gap:8px!important;
    align-items:start!important;
    width:100%!important;
    padding:3px 0!important;
    border:0!important;
    background:transparent!important;
    text-align:left!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td::before{
    grid-column:1!important;
    font-size:10.5px!important;
    font-weight:800!important;
    letter-spacing:.035em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(1)::before{content:"Name";}
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(2)::before{content:"Rate";}
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td>*{
    grid-column:2!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td.wave-actions-cell{
    display:flex!important;
    justify-content:flex-start!important;
    gap:6px!important;
    margin-top:5px!important;
    padding:8px 0 0!important;
    border-top:1px solid #e4ebf3!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td.wave-actions-cell::before{
    content:none!important;
    display:none!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(1),
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(2){
    color:#172033!important;
  }
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(1){font-weight:700!important;}
  .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(2){font-weight:750!important;}

  /* One action-button language everywhere these mobile cards are used. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .ca-projects-page,
    .ca-rec-list-page,
    .ca-taxes-page .ca-tax-rates-card
  ) :is(.wave-icon-action,.ca-flat-pay-icon,.ca-mini-btn){
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border:1px solid #dbe5f0!important;
    border-radius:11px!important;
    background:#fff!important;
    color:#60758c!important;
    box-shadow:none!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .ca-projects-page,
    .ca-rec-list-page,
    .ca-taxes-page .ca-tax-rates-card
  ) :is(.wave-icon-danger,.ca-mini-danger){
    color:#dc2626!important;
  }

  /* Dark mode mirrors the same surfaces instead of changing the hierarchy. */
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden),
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-rec-list-page .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden),
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"],
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-taxes-page .ca-tax-rates-card .wave-table tbody tr{
    background:#101b2b!important;
    border-color:#2b3d53!important;
    color:#e8f0fb!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-rec-list-page .wave-table tbody td,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-taxes-page .ca-tax-rates-card .wave-table tbody td{
    color:#e8f0fb!important;
    background:transparent!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td::before,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-rec-list-page .wave-table tbody td::before,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-taxes-page .ca-tax-rates-card .wave-table tbody td::before{
    color:#b8c7dc!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .ca-projects-page,
    .ca-rec-list-page,
    .ca-taxes-page .ca-tax-rates-card
  ) :is(.wave-icon-action,.ca-flat-pay-icon,.ca-mini-btn){
    background:#0b1324!important;
    border-color:#2b3d53!important;
    color:#c7d2e5!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell),
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-rec-list-page .ca-rec-row-actions,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-taxes-page .ca-tax-rates-card .wave-table tbody td.wave-actions-cell{
    border-top-color:#2b3d53!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td:nth-child(2),
    .wave-enhanced-list[data-table-kind="vendors"] .wave-table tbody td:nth-child(2),
    .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(2),
    .wave-enhanced-list[data-table-kind="payments"] .wave-table tbody td:nth-child(7),
    .wave-enhanced-list[data-table-kind="products"] .wave-table tbody td:nth-child(4),
    .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(7),
    .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5),
    .ca-rec-list-page .wave-table tbody td:nth-child(7),
    .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(1),
    .ca-taxes-page .ca-tax-rates-card .wave-table tbody td:nth-child(2)
  ){
    color:#e8f0fb!important;
  }
}


/* Mobile consistency pass 2: status, typography, action dividers, recurring controls. */
@media(max-width:760px){
  /* One typography hierarchy across compact mobile record cards. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-table
  ) tbody td{
    font-size:14px!important;
    line-height:1.35!important;
    font-weight:500!important;
    color:#334155!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-table
  ) tbody td::before{
    font-size:10.5px!important;
    line-height:1.25!important;
    font-weight:800!important;
    letter-spacing:.035em!important;
    text-transform:uppercase!important;
    color:#64748b!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"] tbody td:nth-child(2),
    .wave-enhanced-list[data-table-kind="vendors"] tbody td:nth-child(2),
    .wave-enhanced-list[data-table-kind="products"] tbody td:nth-child(2),
    .wave-enhanced-list[data-table-kind="expense-products"] tbody td:nth-child(2),
    .ca-projects-page .ca-projects-table tbody td[data-label="Project"],
    .ca-rec-list-page .wave-table tbody td[data-label="Customer"],
    .ca-rec-list-page .wave-table tbody td[data-label="Schedule"]
  ){
    font-weight:700!important;
    color:#1f2937!important;
  }

  /* Expense Products/Services join the same compact card family. */
  .wave-enhanced-list[data-table-kind="expense-products"]{
    padding:10px!important;
    border-radius:14px!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table-wrap{
    overflow:visible!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] :is(.wave-table,.wave-table tbody){
    display:block!important;
    width:100%!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table thead{display:none!important}
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    box-sizing:border-box!important;
    margin:0 0 8px!important;
    padding:10px 12px!important;
    border:1px solid #dbe5f0!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td{
    display:grid!important;
    grid-template-columns:minmax(88px,31%) minmax(0,1fr)!important;
    gap:8px!important;
    align-items:start!important;
    width:100%!important;
    padding:3px 0!important;
    border:0!important;
    background:transparent!important;
    text-align:left!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td>*{grid-column:2!important}
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td:nth-child(2)::before{content:"Name"}
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td:nth-child(3)::before{content:"SKU"}
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td:nth-child(4)::before{content:"Unit cost"}
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td.wave-bulk-col{
    display:block!important;
    padding:0 0 5px!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td.wave-bulk-col::before{display:none!important}
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td.wave-actions-cell{
    display:flex!important;
    width:100%!important;
    justify-content:flex-start!important;
    gap:6px!important;
    margin-top:5px!important;
    padding:8px 0 0!important;
    border-top:1px solid #e4ebf3!important;
  }
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody td.wave-actions-cell::before{display:none!important;content:none!important}

  /* All status badges share the same shape, size and typography. */
  :is(.wave-status-badge,.wave-status-pill,.wave-badge){
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:78px!important;
    min-height:28px!important;
    height:28px!important;
    box-sizing:border-box!important;
    padding:4px 11px!important;
    border-radius:999px!important;
    border:1px solid transparent!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:750!important;
    letter-spacing:.01em!important;
    white-space:nowrap!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-active,
  .ca-rec-list-page .wave-badge-sent{
    background:#dcfce7!important;color:#166534!important;border-color:#86efac!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-completed{
    background:#dbeafe!important;color:#1d4ed8!important;border-color:#93c5fd!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-on-hold,
  .ca-rec-list-page .wave-badge-overdue{
    background:#fef3c7!important;color:#92400e!important;border-color:#fcd34d!important;
  }
  .ca-rec-list-page .wave-badge-draft{
    background:#f1f5f9!important;color:#475569!important;border-color:#cbd5e1!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-paid{
    background:#dcfce7!important;color:#166534!important;border-color:#86efac!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-partial{
    background:#ede9fe!important;color:#6d28d9!important;border-color:#c4b5fd!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-unpaid{
    background:#fef3c7!important;color:#92400e!important;border-color:#fcd34d!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-overdue{
    background:#fee2e2!important;color:#b91c1c!important;border-color:#fca5a5!important;
  }
  :is(.wave-status-badge,.wave-status-pill).status-draft{
    background:#f1f5f9!important;color:#475569!important;border-color:#cbd5e1!important;
  }

  /* Status is always the first information row after the checkbox where a card has one. */
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td{order:3}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-check-cell{order:0}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td[data-label="Status"]{order:1}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td[data-label="Project"]{order:2}
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions{order:9}

  .wave-enhanced-list[data-table-kind="bill-payments"] tbody tr>td{order:3}
  .wave-enhanced-list[data-table-kind="bill-payments"] tbody tr>td.wave-bulk-col{order:0}
  .wave-enhanced-list[data-table-kind="bill-payments"] tbody tr>td:nth-child(6){order:1}
  .wave-enhanced-list[data-table-kind="bill-payments"] tbody tr>td:nth-child(2){order:2}
  .wave-enhanced-list[data-table-kind="bill-payments"] tbody tr>td.wave-actions-cell{order:9}

  .ca-rec-list-page .wave-table tbody tr>td{order:3}
  .ca-rec-list-page .wave-table tbody tr>td.wave-bulk-col{order:0}
  .ca-rec-list-page .wave-table tbody tr>td[data-label="Status"]{order:1}
  .ca-rec-list-page .wave-table tbody tr>td[data-label="Customer"]{order:2}
  .ca-rec-list-page .wave-table tbody tr>td[data-label="Actions"]{order:9}

  /* Recurring actions: all four controls stay visible in one row. */
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]{
    display:block!important;
    width:100%!important;
    grid-template-columns:none!important;
    margin-top:5px!important;
    padding:8px 0 0!important;
    border-top:1px solid #e4ebf3!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]::before{
    display:none!important;
    content:none!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]>.ca-rec-row-actions{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
  }
  .ca-rec-list-page .ca-rec-row-actions form{
    display:inline-flex!important;
    width:auto!important;
    min-width:0!important;
    flex:0 0 auto!important;
    margin:0!important;
  }
  .ca-rec-list-page .ca-rec-row-actions :is(a.ca-mini-btn,button.ca-mini-btn){
    display:inline-flex!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    flex:0 0 38px!important;
    padding:0!important;
    border-radius:11px!important;
  }

  /* Full-width divider above every action footer where the markup allows it. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) tbody td:is(.wave-actions-cell,.wave-payment-actions-cell),
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-actions{
    width:100%!important;
    box-sizing:border-box!important;
    margin-top:5px!important;
    padding:8px 0 0!important;
    border-top:1px solid #e4ebf3!important;
  }

  /* Project buttons use the same button dimensions as the other cards. */
  .ca-projects-page .ca-project-actions :is(.ca-project-icon-btn,.wave-icon-action),
  .wave-enhanced-list[data-table-kind="expense-products"] .wave-icon-action{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border-radius:11px!important;
  }

  /* Project bulk selection follows the same "only when selected" behavior. */
  .ca-projects-page .ca-project-bulk-count{display:none!important}
  .ca-projects-page .ca-project-bulk-form:has(.ca-project-row-check:checked) .ca-project-bulk-count{
    display:inline-flex!important;
  }

  /* Invoice status joins the common badge size and lives in the upper card row. */
  .wave-invoice-list tr.ca-mobile-invoice-row{
    grid-template-areas:
      "select number status"
      "select customer due"
      "select date due"!important;
  }
  .ca-invoice-status-cell{
    align-self:start!important;
    justify-self:end!important;
  }
  .ca-invoice-status-cell .wave-status-badge{
    min-width:78px!important;
    min-height:28px!important;
    height:28px!important;
    padding:4px 11px!important;
    font-size:11px!important;
  }

  /* Dark mode: preserve the hierarchy and divider rather than changing sizes. */
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-table
  ) tbody td{
    color:#e8f0fb!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-table
  ) tbody td::before{
    color:#b8c7dc!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .wave-enhanced-list[data-table-kind="expense-products"] .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){
    background:#101b2b!important;
    border-color:#2b3d53!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) tbody td:is(.wave-actions-cell,.wave-payment-actions-cell),
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-rec-list-page .wave-table tbody td[data-label="Actions"],
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"]) .ca-projects-page .ca-project-actions{
    border-top-color:#2b3d53!important;
  }
}


/* Final mobile card policy: CSS-only, no behavior changes. */
@media(max-width:760px){
  /* 1) Selection checkbox: always visually anchored at the top-left. */
  .wave-invoice-list tr.ca-mobile-invoice-row{
    align-items:start!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-select-cell{
    align-self:start!important;
    justify-self:start!important;
    padding-top:1px!important;
  }
  .ca-credit-notes-table tr.ca-mobile-credit-note-row{
    align-items:start!important;
  }
  .ca-credit-notes-table tr.ca-mobile-credit-note-row .ca-credit-note-select-cell{
    align-self:start!important;
    justify-self:start!important;
    padding-top:1px!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row{
    align-items:start!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-select-cell{
    align-self:start!important;
    justify-self:start!important;
    padding-top:1px!important;
  }

  /* 2) One small status-chip size everywhere, matching the compact document lists. */
  :is(
    .wave-status-badge,
    .wave-status-pill,
    .ca-rec-list-page .wave-badge
  ){
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:78px!important;
    max-width:120px!important;
    height:28px!important;
    min-height:28px!important;
    padding:3px 10px!important;
    border-radius:999px!important;
    box-sizing:border-box!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:750!important;
    white-space:nowrap!important;
    flex:0 0 auto!important;
  }

  /* Do not stretch status controls across structured cards. */
  .ca-rec-list-page .wave-table tbody td[data-label="Status"],
  .ca-projects-page .ca-projects-table tbody td[data-label="Status"],
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2),
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6){
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    width:100%!important;
    min-height:28px!important;
    grid-template-columns:none!important;
    gap:0!important;
    padding:1px 0 5px!important;
    box-sizing:border-box!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Status"]::before,
  .ca-projects-page .ca-projects-table tbody td[data-label="Status"]::before,
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2)::before,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)::before{
    content:none!important;
    display:none!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Status"]>*,
  .ca-projects-page .ca-projects-table tbody td[data-label="Status"]>*,
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2)>*,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)>*{
    grid-column:auto!important;
    justify-self:end!important;
    width:auto!important;
    max-width:120px!important;
  }

  /* Keep document-list status chips compact at the same size. */
  .ca-invoice-status-cell .wave-status-badge,
  .ca-credit-note-status-cell .wave-status-badge,
  .ca-estimate-status-cell .wave-status-badge{
    width:auto!important;
    min-width:78px!important;
    max-width:120px!important;
    height:28px!important;
    min-height:28px!important;
    padding:3px 10px!important;
    font-size:11px!important;
  }

  /* 3) Shared action-footer policy: divider + left-aligned buttons. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .ca-taxes-page .ca-tax-rates-card
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell),
  .ca-projects-page .ca-projects-table tbody td.ca-project-actions,
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    box-sizing:border-box!important;
    gap:6px!important;
    margin-top:6px!important;
    padding:9px 0 0!important;
    border-top:1px solid #dfe7ef!important;
    text-align:left!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .ca-taxes-page .ca-tax-rates-card
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell)::before,
  .ca-projects-page .ca-projects-table tbody td.ca-project-actions::before,
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]::before{
    content:none!important;
    display:none!important;
  }
  :is(.wave-customer-actions,.ca-project-actions,.ca-rec-row-actions){
    justify-content:flex-start!important;
    align-items:center!important;
    text-align:left!important;
  }

  /* Customer cards explicitly get the same footer divider. */
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td.wave-actions-cell{
    border-top:1px solid #dfe7ef!important;
    margin-top:6px!important;
    padding-top:9px!important;
  }

  /* 4) Recurring cards: preserve all four controls, but reduce visual bulk. */
  .ca-rec-list-page .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){
    padding:9px 11px!important;
    margin-bottom:8px!important;
    border-radius:12px!important;
  }
  .ca-rec-list-page .wave-table tbody td{
    padding:2px 0!important;
    font-size:13.5px!important;
    line-height:1.3!important;
  }
  .ca-rec-list-page .wave-table tbody td::before{
    font-size:10px!important;
    line-height:1.2!important;
  }
  .ca-rec-list-page .ca-rec-schedule{
    font-size:13.5px!important;
    line-height:1.25!important;
  }
  .ca-rec-list-page .ca-rec-muted{
    margin-top:1px!important;
    font-size:10.5px!important;
    line-height:1.3!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]{
    display:block!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"]>.ca-rec-row-actions{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    justify-content:flex-start!important;
    gap:6px!important;
    width:100%!important;
  }
  .ca-rec-list-page .ca-rec-row-actions form{
    display:inline-flex!important;
    width:auto!important;
    flex:0 0 auto!important;
    margin:0!important;
  }
  .ca-rec-list-page .ca-rec-row-actions :is(a.ca-mini-btn,button.ca-mini-btn){
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    flex:0 0 38px!important;
  }

  /* 5) Shared typography tokens for structured cards. */
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-table,
    .ca-taxes-page .ca-tax-rates-card .wave-table
  ) tbody td{
    font-size:14px!important;
    line-height:1.32!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"],
    .ca-projects-page .wave-table,
    .ca-taxes-page .ca-tax-rates-card .wave-table
  ) tbody td::before{
    font-size:10.5px!important;
    line-height:1.2!important;
    font-weight:800!important;
    letter-spacing:.035em!important;
  }

  /* 6) Bulk count: hide zero-state everywhere; show only after a row is selected. */
  :is(
    .wave-enhanced-list[data-table-kind="invoices"],
    .wave-enhanced-list[data-table-kind="estimates"],
    .wave-enhanced-list[data-table-kind="credit-notes"],
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"]
  ) .wave-bulk-count{
    display:none!important;
  }
  :is(
    .wave-enhanced-list[data-table-kind="invoices"],
    .wave-enhanced-list[data-table-kind="estimates"],
    .wave-enhanced-list[data-table-kind="credit-notes"],
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"],
    .wave-enhanced-list[data-table-kind="recurring-invoices"]
  ):has(input[type="checkbox"]:checked) .wave-bulk-count{
    display:inline-flex!important;
  }
  .ca-projects-page .ca-project-bulk-count{display:none!important}
  .ca-projects-page .ca-project-bulk-form:has(.ca-project-row-check:checked) .ca-project-bulk-count{
    display:inline-flex!important;
  }

  /* 7) Customer Statement: remove the orphan legacy separator before the first mobile card. */
  .wvst-table,
  .wvst-table tbody,
  .wvst-table thead{
    border-top:0!important;
    box-shadow:none!important;
  }
  .wvst-table::before,
  .wvst-table tbody::before,
  .wvst-table thead::before{
    content:none!important;
    display:none!important;
    border:0!important;
  }
  .wvst-table tbody{
    padding-top:0!important;
    margin-top:0!important;
  }
  .wvst-table tbody tr:first-child{
    margin-top:0!important;
  }

  /* Dark mode mirrors dividers without altering dimensions or behavior. */
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"]) :is(
    .wave-enhanced-list[data-table-kind="customers"],
    .wave-enhanced-list[data-table-kind="payments"],
    .wave-enhanced-list[data-table-kind="products"],
    .wave-enhanced-list[data-table-kind="expense-products"],
    .wave-enhanced-list[data-table-kind="vendors"],
    .wave-enhanced-list[data-table-kind="bills"],
    .wave-enhanced-list[data-table-kind="bill-payments"]
  ) .wave-table tbody td:is(.wave-actions-cell,.wave-payment-actions-cell),
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"]) .ca-projects-page .ca-project-actions,
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"]) .ca-rec-list-page .wave-table tbody td[data-label="Actions"]{
    border-top-color:#2b3d53!important;
  }
}


/* Canonical mobile cards: Credit Note reference + structured header alignment. */
@media(max-width:760px){
  /* Shared badge token for the six cards in this pass.
     Width intentionally matches the Credit Note reference badge. */
  .wave-invoice-list .ca-invoice-status-cell .wave-status-badge,
  .wave-enhanced-list[data-table-kind="estimates"] .ca-estimate-status-cell .wave-status-badge,
  .ca-rec-list-page .wave-table tbody td[data-label="Status"] .wave-badge,
  .ca-projects-page .ca-projects-table tbody td[data-label="Status"] :is(.wave-status-badge,.wave-status-pill),
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2) :is(.wave-status-badge,.wave-status-pill),
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6) :is(.wave-status-badge,.wave-status-pill){
    width:96px!important;
    min-width:96px!important;
    max-width:96px!important;
    height:34px!important;
    min-height:34px!important;
    padding:3px 10px!important;
    border-radius:999px!important;
    box-sizing:border-box!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:750!important;
    text-align:center!important;
    white-space:nowrap!important;
  }

  /* Invoices adopt the Credit Note visual hierarchy:
     number + amount on row 1, customer + status on row 2, due text on row 3. */
  .wave-invoice-list tr.ca-mobile-invoice-row{
    grid-template-columns:22px minmax(0,1fr) auto!important;
    grid-template-rows:auto auto auto!important;
    grid-template-areas:
      "select number due"
      "select customer status"
      "select date ."!important;
    align-items:start!important;
    min-height:0!important;
    padding:12px 10px!important;
    row-gap:4px!important;
    column-gap:8px!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-select-cell{
    grid-area:select!important;
    align-self:start!important;
    justify-self:start!important;
    padding-top:1px!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-number-cell{
    grid-area:number!important;
    align-self:start!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-due-cell{
    grid-area:due!important;
    align-self:start!important;
    justify-self:end!important;
    text-align:right!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-customer-cell{
    grid-area:customer!important;
    align-self:center!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-status-cell{
    grid-area:status!important;
    align-self:center!important;
    justify-self:end!important;
  }
  .wave-invoice-list tr.ca-mobile-invoice-row .ca-invoice-date-cell{
    grid-area:date!important;
    align-self:start!important;
  }

  /* Estimates use the same document-card hierarchy as Credit Notes. */
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row{
    grid-template-columns:22px minmax(0,1fr) auto!important;
    grid-template-rows:auto auto auto!important;
    grid-template-areas:
      "select number total"
      "select customer status"
      "select valid ."!important;
    align-items:start!important;
    min-height:0!important;
    padding:12px 10px!important;
    row-gap:4px!important;
    column-gap:8px!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-select-cell{
    grid-area:select!important;
    align-self:start!important;
    justify-self:start!important;
    padding-top:1px!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-number-cell{
    grid-area:number!important;
    align-self:start!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-total-cell{
    grid-area:total!important;
    align-self:start!important;
    justify-self:end!important;
    text-align:right!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-customer-cell{
    grid-area:customer!important;
    align-self:center!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-status-cell{
    grid-area:status!important;
    align-self:center!important;
    justify-self:end!important;
  }
  .wave-enhanced-list[data-table-kind="estimates"] tr.ca-mobile-estimate-row .ca-estimate-valid-cell{
    grid-area:valid!important;
    align-self:start!important;
  }

  /* Structured cards: checkbox top-left, fixed badge top-right.
     Absolute positioning is visual-only and leaves every control/form intact. */
  .ca-rec-list-page .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden),
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"],
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden),
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){
    position:relative!important;
    padding-top:12px!important;
  }

  /* Recurring header. */
  .ca-rec-list-page .wave-table tbody td.wave-bulk-col{
    display:block!important;
    width:auto!important;
    padding:0 112px 7px 0!important;
    align-self:start!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Status"]{
    position:absolute!important;
    top:10px!important;
    right:11px!important;
    z-index:1!important;
    width:96px!important;
    min-height:34px!important;
    padding:0!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Status"]::before{
    content:none!important;
    display:none!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Status"]>*{
    width:96px!important;
    min-width:96px!important;
    max-width:96px!important;
  }
  .ca-rec-list-page .wave-table tbody td[data-label="Customer"]{
    margin-top:2px!important;
  }

  /* Projects: one clean header and one shared label/value column system. */
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>.ca-project-check-cell{
    display:block!important;
    width:auto!important;
    padding:0 112px 7px 0!important;
    align-self:start!important;
    justify-self:start!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td[data-label="Status"]{
    position:absolute!important;
    top:10px!important;
    right:12px!important;
    z-index:1!important;
    width:96px!important;
    min-height:34px!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td[data-label="Status"]::before{
    content:none!important;
    display:none!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td[data-label="Status"]>*{
    width:96px!important;
    min-width:96px!important;
    max-width:96px!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td:not(.ca-project-check-cell):not(.ca-project-actions):not([data-label="Status"]){
    display:grid!important;
    grid-template-columns:minmax(112px,30%) minmax(0,1fr)!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    padding:3px 0!important;
    text-align:left!important;
    justify-items:start!important;
    align-items:start!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td:not(.ca-project-check-cell):not(.ca-project-actions):not([data-label="Status"])::before{
    grid-column:1!important;
    justify-self:start!important;
    text-align:left!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td:not(.ca-project-check-cell):not(.ca-project-actions):not([data-label="Status"])>*{
    grid-column:2!important;
    justify-self:start!important;
    text-align:left!important;
    max-width:100%!important;
  }
  .ca-projects-page .ca-projects-table tbody tr[data-project-row="1"]>td[data-label="Customer"]{
    text-align:left!important;
    justify-content:start!important;
  }

  /* Bills header. */
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td.wave-bulk-col{
    display:block!important;
    width:auto!important;
    padding:0 112px 7px 0!important;
    align-self:start!important;
  }
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2){
    position:absolute!important;
    top:10px!important;
    right:12px!important;
    z-index:1!important;
    width:96px!important;
    min-height:34px!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2)::before{
    content:none!important;
    display:none!important;
  }
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td:nth-child(2)>*{
    width:96px!important;
    min-width:96px!important;
    max-width:96px!important;
  }

  /* Bill Payments header. */
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td.wave-bulk-col{
    display:block!important;
    width:auto!important;
    padding:0 112px 7px 0!important;
    align-self:start!important;
  }
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6){
    position:absolute!important;
    top:10px!important;
    right:12px!important;
    z-index:1!important;
    width:96px!important;
    min-height:34px!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)::before{
    content:none!important;
    display:none!important;
  }
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)>*{
    width:96px!important;
    min-width:96px!important;
    max-width:96px!important;
  }

  /* Status is the first data column; retain the established mobile card hierarchy. */
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(2){
    position:absolute!important;top:10px!important;right:12px!important;z-index:1!important;
    width:96px!important;min-height:34px!important;margin:0!important;padding:0!important;
    display:flex!important;align-items:center!important;justify-content:flex-end!important;
  }
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(2)::before{content:none!important;display:none!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(2)>*{width:96px!important;min-width:96px!important;max-width:96px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3){font-size:15px;font-weight:900;padding-right:112px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3)::before{content:none!important;display:none!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(4)::before{content:"Payment date"!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5)::before{content:"Vendor"!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6){position:static!important;width:100%!important;min-height:0!important;padding:7px 0!important;display:block!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)::before{content:"Paid"!important;display:block!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(7)::before{content:"Actions"!important;display:block!important;}

  /* Preserve the already-agreed left action footer on these structured cards. */
  .ca-rec-list-page .wave-table tbody td[data-label="Actions"],
  .ca-projects-page .ca-projects-table tbody td.ca-project-actions,
  .wave-enhanced-list[data-table-kind="bills"] .wave-table tbody td.wave-actions-cell,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td.wave-actions-cell{
    justify-content:flex-start!important;
    text-align:left!important;
  }

  /* Dark mode: positions/sizes remain identical; only existing theme colors apply. */
}


/* Customers mobile footer: divider + left-aligned actions. */
@media(max-width:760px){
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td.wave-actions-cell{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    margin-top:6px!important;
    padding:9px 0 0!important;
    border-top:1px solid #dfe7ef!important;
    text-align:left!important;
  }
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td.wave-actions-cell::before{
    content:none!important;
    display:none!important;
  }
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td.wave-actions-cell .wave-customer-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    gap:6px!important;
    flex-wrap:nowrap!important;
    text-align:left!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"])
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody td.wave-actions-cell{
    border-top-color:#2b3d53!important;
  }
}



/* Customers mobile footer correction: target actual fifth action cell. */
@media(max-width:760px){
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody tr > td:nth-child(5){
    display:flex!important;
    grid-template-columns:none!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    margin-top:6px!important;
    padding:9px 0 0!important;
    border-top:1px solid #dfe7ef!important;
    text-align:left!important;
  }
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody tr > td:nth-child(5)::before{
    content:none!important;
    display:none!important;
  }
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody tr > td:nth-child(5) > *{
    grid-column:auto!important;
    justify-self:start!important;
    margin-left:0!important;
  }
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody tr > td:nth-child(5) .wave-customer-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    gap:6px!important;
    flex-wrap:nowrap!important;
    text-align:left!important;
  }
  :is(body.ca-dark-page,body.ca-dark,body.ca-theme-dark,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"])
  .wave-enhanced-list[data-table-kind="customers"] .wave-table tbody tr > td:nth-child(5){
    border-top-color:#2b3d53!important;
  }
}

/* Runtime Phase 2: consistent Credit Note row/card borders for every lifecycle state. */
.ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row > td {
  border-top:0 !important;
  border-bottom:1px solid #edf1f5 !important;
}
.ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row > td:first-child { border-left:0 !important; }
.ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row > td:last-child { border-right:0 !important; }
@media (max-width:900px) {
  .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row {
    border:1px solid #edf1f5 !important;
    box-shadow:none !important;
  }
  .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row > td { border:0 !important; }
}
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row,
body[data-theme="dark"] .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row,
body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row > td,
body[data-theme="dark"] .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row > td {
  border-color:#2b3d53 !important;
}

/* Customer UX/settings batch: larger uploaded Business logo only. */
html body .wave-public-invoice-flat .wave-public-logo,
html body .wave-pdf-export-clone .wave-public-logo {
  width: 260px !important;
  max-width: 260px !important;
  height: 104px !important;
  max-height: 104px !important;
  object-fit: contain !important;
  object-position: left top !important;
}
@media (max-width: 760px) {
  html body .wave-public-invoice-flat .wave-public-logo {
    width: min(260px, 100%) !important;
    max-width: 100% !important;
    height: 100px !important;
    max-height: 100px !important;
  }
}
@media print {
  body.wave-invoice-print-body .wave-public-invoice-flat .wave-public-logo,
  html body .wave-public-invoice-flat.estimate-print .wave-public-logo,
  html body .wave-public-invoice-flat.ca-doc-v2290-credit-note .wave-public-logo {
    width: 65mm !important;
    max-width: 65mm !important;
    height: 26mm !important;
    max-height: 26mm !important;
    object-fit: contain !important;
  }
}
.ca-app-copy-dialog .ca-app-confirm-card input,
.ca-app-prompt .ca-app-confirm-card input { width:100%; min-width:0; margin-top:8px; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#0f172a; }
body.ca-dark-page .ca-app-copy-dialog .ca-app-confirm-card input,
body.ca-dark-page .ca-app-prompt .ca-app-confirm-card input,
body[data-theme="dark"] .ca-app-copy-dialog .ca-app-confirm-card input,
body[data-theme="dark"] .ca-app-prompt .ca-app-confirm-card input { background:#0f1b2d; border-color:#334155; color:#f8fafc; }


/* beta.37 UX: restore subtle vertical edges for Draft Credit Note rows only. */
@media (min-width:901px) {
  .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row.status-draft > td:first-child {
    border-left:1px solid #edf1f5 !important;
  }
  .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row.status-draft > td:last-child {
    border-right:1px solid #edf1f5 !important;
  }
  body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row.status-draft > td:first-child,
  body.ca-dark-page .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row.status-draft > td:last-child,
  body[data-theme="dark"] .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row.status-draft > td:first-child,
  body[data-theme="dark"] .ca-credit-notes-page .ca-credit-notes-table tbody tr.ca-mobile-credit-note-row.status-draft > td:last-child {
    border-color:#2b3d53 !important;
  }
}


/* beta.38 UX: final high-specificity Business logo sizing override.
   This intentionally outranks the legacy ca-doc-v2290 170x70 cap. */
html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo,
html body .wave-pdf-export-clone.ca-doc-v2290-sheet .wave-public-logo {
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:300px !important;
  max-height:110px !important;
  object-fit:contain !important;
  object-position:left top !important;
  margin:0 !important;
}
@media (max-width:760px) {
  html body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo {
    max-width:min(300px, 100%) !important;
    max-height:106px !important;
  }
}
@media print {
  body.wave-invoice-print-body .wave-public-invoice-flat.ca-doc-v2290 .wave-public-logo,
  html body .wave-public-invoice-flat.ca-doc-v2290.estimate-print .wave-public-logo,
  html body .wave-public-invoice-flat.ca-doc-v2290-credit-note .wave-public-logo {
    width:auto !important;
    height:auto !important;
    max-width:75mm !important;
    max-height:30mm !important;
    object-fit:contain !important;
  }
}

/* Bill View only: outrank the legacy 1040px public-document toolbar cap. */
@media screen and (min-width:761px) {
  html body .wave-public-invoice-flat.wave-bill-view-page .wave-public-toolbar.no-print.ca-doc-toolbar-bill {
    width:100% !important;
    max-width:1120px !important;
    margin:0 auto 16px !important;
    padding:14px 16px !important;
    box-sizing:border-box !important;
  }
}

/* Issue 71 UX follow-up — align document editor summaries and bottom actions. */
.wave-invoice-form .wave-actions.ca-doc-form-actions .wave-btn,
.ca-credit-note-form .wave-actions.ca-doc-form-actions .wave-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:160px!important;
  min-height:44px!important;
  height:44px!important;
  padding:0 20px!important;
  border-radius:10px!important;
}
.wave-invoice-form .ca-document-editor-summary{
  margin-left:auto!important;
  margin-right:0!important;
  box-sizing:border-box!important;
}
.wave-invoice-form .ca-document-editor-notes{
  width:100%!important;
  min-width:0!important;
}
@media(max-width:480px){
  .wave-invoice-form .wave-actions.ca-doc-form-actions .wave-btn,
  .ca-credit-note-form .wave-actions.ca-doc-form-actions .wave-btn{
    min-width:0!important;
    max-width:100%!important;
    padding:0 16px!important;
  }
}

/* Issue 75: orthogonal archive visibility state. */
.ca-archived-indicator{display:inline-flex;margin-left:.4rem;padding:.12rem .45rem;border-radius:999px;background:#e2e8f0;color:#334155;font-size:.72rem;font-weight:700;vertical-align:middle}
.ca-inline-archive-action{display:inline-block;margin-left:.35rem}.ca-inline-archive-action:empty{display:none}
body.ca-dark-page .ca-archived-indicator,body[data-theme="dark"] .ca-archived-indicator{background:#334155;color:#e2e8f0}
@media(max-width:700px){.ca-inline-archive-action{margin:.35rem 0 0;display:block}.ca-inline-archive-action button{min-height:44px}}

/* Issue 75 Runtime Test 1: keep status markers and lifecycle actions visually compact. */
.wave-invoice-list .ca-invoice-status-badges{
  display:inline-flex;
  align-items:center;
  flex-wrap:nowrap;
  white-space:nowrap;
  max-width:100%;
}
.wave-invoice-list .ca-invoice-status-badges .ca-archived-indicator{
  flex:0 0 auto;
}
.wave-actions-menu > .ca-invoice-primary-lifecycle-action{
  display:inline-flex;
  margin:0;
}
.wave-actions-menu > .ca-invoice-primary-lifecycle-action > button{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:52px;
  height:30px;
  padding:6px 12px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#fff;
  color:#334155;
  font:inherit;
  font-size:12px;
  font-weight:600;
  line-height:normal;
  text-decoration:none;
  cursor:pointer;
  transition:background .12s;
}
.wave-actions-menu > .ca-invoice-primary-lifecycle-action > button:hover{
  background:#f8fafc;
  border-color:#cbd5e1;
}
.wave-actions-menu > .ca-invoice-primary-lifecycle-action > button:focus-visible,
.wave-actions-menu > .wave-link-btn:focus-visible{
  outline:2px solid var(--ds-primary);
  outline-offset:2px;
}
.wave-actions-dropdown form.ca-invoice-dropdown-lifecycle-action{
  display:block;
  margin:0;
}
.wave-actions-dropdown form.ca-invoice-dropdown-lifecycle-action > button{
  appearance:none;
  -webkit-appearance:none;
  background:var(--ds-surface);
  border:0;
  border-bottom:1px solid #f1f5f9;
  border-radius:0;
  box-shadow:none;
}
.wave-actions-dropdown form.ca-invoice-dropdown-lifecycle-action > button:hover,
.wave-actions-dropdown form.ca-invoice-dropdown-lifecycle-action > button:focus-visible{
  background:#f8fafc;
}

/* Issue 75 final runtime lifecycle/UI parity. */
.wave-status-badge,
.ca-archived-indicator,
.ca-credit-notes-page .ca-credit-note-status-cell .wave-status-badge,
.ca-credit-notes-page .ca-credit-notes-table .ca-credit-note-status-cell .wave-status-badge {
  border-radius:3px !important;
}
.ca-document-status-badges {
  display:inline-flex;
  align-items:center;
  flex-wrap:nowrap;
  white-space:nowrap;
}
.ca-document-status-badges .ca-archived-indicator { flex:0 0 auto; }
.ca-estimate-status-cell { white-space:nowrap; }
.ca-primary-lifecycle-action { display:inline-flex; margin:0; }
.ca-primary-lifecycle-action > button {
  appearance:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:6px 12px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#fff;
  color:#0ea5e9;
  font:inherit;
  font-weight:700;
  cursor:pointer;
}
.wave-actions-dropdown .ca-document-lifecycle-action { display:flex;align-items:center;gap:7px;width:100%;background:transparent!important;border:0!important;box-shadow:none!important; }
.ca-document-lifecycle-action .ca-doc-action-svg { width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8; }

/* Cancelled Credit Notes retain the normal row surface; status colour belongs to the badge only. */
.ca-credit-notes-table tr.status-cancelled,
.ca-credit-notes-table tr.status-cancelled > td { background:inherit !important; }

/* Invoice filters are always visible and one field per row on narrow screens. */
@media(max-width:760px){
  .ca-invoice-filter-form { display:block !important; }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices { display:grid !important;grid-template-columns:1fr !important;gap:8px !important; }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices > label,
  .ca-invoice-filter-form.is-expanded .wave-list-tools-grid-invoices > label { display:block !important;grid-column:auto !important; }
  .ca-mobile-invoice-filter-toggle { display:none !important; }
}

/* Issue 75 final runtime polish: consistent list badges and unobtrusive date affordances. */
.wave-table .wave-status-badge,
.wave-table .ca-archived-indicator {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  width:84px!important;
  min-width:84px!important;
  height:26px!important;
  min-height:26px!important;
  margin:0!important;
  padding:5px 10px!important;
  border-width:1px!important;
  border-style:solid!important;
  border-radius:3px!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:14px!important;
  text-align:center!important;
}
.wave-payment-manage-card .wave-status-badge {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  width:84px!important;
  min-width:84px!important;
  height:26px!important;
  min-height:26px!important;
  padding:5px 10px!important;
  border-width:1px!important;
  border-style:solid!important;
  border-radius:3px!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:14px!important;
}
.wave-table .ca-document-status-badges,
.wave-table .ca-invoice-status-badges { gap:6px; }
.wave-actions-menu > .ca-primary-lifecycle-action > button { color:#334155!important; }
.wave-actions-dropdown .ca-document-lifecycle-action .ca-doc-action-svg { display:none!important; }

/* Calendar buttons remain accessible/clickable within the input without separate chrome. */
.wave-date-picker-wrap .wave-date-picker-btn,
.ca-universal-date-picker .ca-date-picker-btn,
.ca-date-picker-wrap .ca-date-picker-btn,
.ca-project-date-wrap .ca-date-picker-btn,
.wave-list-filters.ca-bills-auto-filters .wave-date-picker-btn,
.ca-credit-note-filter-form.ca-auto-filter-row .ca-credit-note-flat-calendar {
  border:0!important;
  outline:0;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.wave-date-picker-wrap .wave-date-picker-btn:hover,
.wave-date-picker-wrap .wave-date-picker-btn:focus-visible,
.ca-universal-date-picker .ca-date-picker-btn:hover,
.ca-universal-date-picker .ca-date-picker-btn:focus-visible,
.ca-date-picker-wrap .ca-date-picker-btn:hover,
.ca-date-picker-wrap .ca-date-picker-btn:focus-visible {
  background:transparent!important;
  box-shadow:none!important;
  color:#0ea5e9!important;
}
.wave-date-picker-wrap .wave-date-picker-btn:focus-visible,
.ca-universal-date-picker .ca-date-picker-btn:focus-visible,
.ca-date-picker-wrap .ca-date-picker-btn:focus-visible { outline:2px solid currentColor; outline-offset:-4px; }

/* Bill line totals mirror the canonical saved subtotal-plus-tax calculation. */
.ca-bill-totals-summary{width:min(360px,100%);margin:18px 0 0 auto;padding:14px 16px;border:1px solid #dbe5ef;border-radius:12px;background:#f8fafc}
.ca-bill-totals-summary>div{display:flex;justify-content:space-between;gap:20px;padding:5px 0;color:#475569}
.ca-bill-totals-summary .ca-bill-grand-total{margin-top:4px;padding-top:10px;border-top:1px solid #cbd5e1;color:#0f172a;font-size:16px;font-weight:850}
:is(body.ca-dark-page,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"]) .ca-bill-totals-summary{background:#111827;border-color:#334155}
:is(body.ca-dark-page,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"]) .ca-bill-totals-summary>div{color:#cbd5e1}
:is(body.ca-dark-page,body[data-theme="dark"],.wave-portal-shell[data-theme="dark"]) .ca-bill-totals-summary .ca-bill-grand-total{color:#f8fafc;border-color:#475569}

/* Accounting quantities keep fractional manual entry while native/keyboard stepping moves by whole units. */
input.ca-line-item-quantity{appearance:auto}

/* Bill View uses the shared document markers without changing print/PDF colours. */
.ca-doc-v2290-bill .ca-doc-v2290-status{display:inline-flex;margin-top:8px}

/* Issue 75 runtime polish: one authoritative list-status and create-CTA treatment. */
.wave-table .ca-credit-note-status-cell .wave-status-badge,
.ca-credit-notes-page .ca-credit-notes-table tr .ca-credit-note-status-cell .wave-status-badge {
  box-sizing:border-box!important;
  width:84px!important;
  min-width:84px!important;
  height:26px!important;
  min-height:26px!important;
  padding:5px 10px!important;
  border-width:1px!important;
  border-style:solid!important;
  border-radius:3px!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:14px!important;
}
.wave-table .ca-document-status-badges {
  display:inline-flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:6px!important;
  white-space:nowrap!important;
}
.wave-list-head .ca-top-create-btn {
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:190px!important;
  min-width:190px!important;
  max-width:190px!important;
  height:42px!important;
  min-height:42px!important;
  padding:0 18px!important;
  border-radius:10px!important;
  font-size:14px!important;
  font-weight:850!important;
  line-height:1.2!important;
  text-align:center!important;
  white-space:nowrap!important;
}

/* Final runtime document polish: authoritative accounting badges and Bill settlement layout. */
.wave-table .ca-accounting-status-badge,
.wave-payment-manage-card .ca-accounting-status-badge {
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:84px!important;
  min-width:84px!important;
  height:26px!important;
  min-height:26px!important;
  margin:0!important;
  padding:5px 10px!important;
  border-width:1px!important;
  border-style:solid!important;
  border-radius:3px!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:14px!important;
  text-align:center!important;
}
.wave-table .ca-document-status-badges {
  display:inline-flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:6px!important;
  white-space:nowrap!important;
}
.wave-bill-view-page .wave-public-invoice-top {
  align-items:start!important;
}
.wave-bill-view-page .ca-bill-document-heading,
.wave-bill-view-page .wave-public-party-right {
  padding-top:0!important;
}
.wave-bill-view-page .ca-bill-document-heading .wave-public-doc-title {
  margin-top:0!important;
  line-height:1!important;
}
.wave-bill-view-page .wave-public-party-right .wave-public-party-name {
  display:block!important;
  line-height:1.15!important;
}

html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-totals-layout {
  display:flex!important;
  justify-content:flex-end!important;
  align-items:flex-start!important;
  margin-top:18px!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-totals-column {
  width:min(100%,360px)!important;
  min-width:0!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-totals-layout .wave-public-totals-wrap {
  margin-top:0!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .wave-public-flat-lower-grid.ca-bill-document-footer.has-payment-summary {
  position:static!important;
  display:block!important;
  width:100%!important;
  max-width:none!important;
  margin:64px 0 0!important;
  padding:0!important;
}

/* Issue #113 — screen Invoice View must grow with Notes / Terms.
   The A4 template historically anchored Notes and the document footer to the
   bottom of the sheet. Keep those anchors for print/PDF, but use one natural
   flex flow on screen so long Notes and the optional Payment Summary always
   precede the footer. */
@media screen {
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-invoice-flow-sheet {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 980px !important;
    overflow: visible !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 24px 0 0 !important;
    padding: 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary {
    width: 370px !important;
    max-width: 100% !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid > .wave-public-flat-notes-below {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-document-footer {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: auto 0 0 !important;
    padding: 24px 0 0 !important;
    transform: none !important;
    overflow: visible !important;
  }
}
/* End Issue #113 screen-only Invoice View override. */

/* Issue #113 follow-up: the Invoice footer owns a protected final band.
   Screen View may grow beyond one sheet, but ordinary document content never
   shares this band. Native Ctrl/Cmd+P uses the same DOM order as View; keep a
   print-safe fallback here while the application Print paginator remains
   independently scoped in its isolated document. */
@media screen {
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-invoice-flow-sheet {
    /* The generic document sheet reserves 14mm for paged output. In View that
       became empty space below the already-flowing footer. Keep only the
       intended visual inset; the lower grid's auto margin owns all spare
       height above Notes/Payment/footer. */
    padding-bottom: 16px !important;
    min-height: 1122px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary {
    width: 100% !important;
    max-width: 100% !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary > .wave-public-payment-summary {
    width: 370px !important;
    max-width: 100% !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-document-footer {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    min-height: 86px !important;
    margin: auto 0 0 !important;
    padding: 20px 0 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer .wave-public-print-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 12px 0 0 !important;
    padding: 12px 0 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer .wave-public-powered-by-text {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer .wave-public-powered-by-logo {
    width: 132px !important;
    max-width: 132px !important;
    max-height: 34px !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

@media screen and (max-width: 760px) {
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-invoice-flow-sheet {
    min-height: calc((100vw - 32px) * 1.4142) !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer .wave-public-powered-by-text {
    font-size: 13px !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-document-footer .wave-public-powered-by-logo {
    width: 120px !important;
    max-width: 120px !important;
    max-height: 31px !important;
  }
}

@media print {
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-sheet-flat.ca-invoice-flow-sheet {
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    min-height: 270mm !important;
    height: auto !important;
    overflow: visible !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid,
  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 6mm 0 0 !important;
    padding: 0 !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid .wave-public-flat-notes-below {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary > .wave-public-payment-summary {
    width: 80mm !important;
    max-width: 100% !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-flat-item-row:last-child {
    break-after: avoid-page !important;
    page-break-after: avoid !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .wave-public-flat-bottom {
    break-before: avoid-page !important;
    page-break-before: avoid !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-document-footer {
    position: static !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    width: 100% !important;
    min-height: 20mm !important;
    margin: 0 !important;
    padding: 5mm 0 0 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice.ca-invoice-print-pages-v2 .wave-public-document-footer .wave-public-print-footer {
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice.ca-invoice-print-pages-v2 .wave-public-document-footer .wave-public-powered-by-text {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  html body.ca-invoice-live-print .wave-public-invoice-flat.ca-doc-v2290-invoice.ca-invoice-print-pages-v2 .wave-public-document-footer .wave-public-powered-by-logo {
    width: 132px !important;
    max-width: 132px !important;
    max-height: 34px !important;
    height: auto !important;
    object-fit: contain !important;
  }
}
/* End Issue #113 protected Invoice footer follow-up. */

/* Issue #113 v11.7: application Print keeps the established one-pixel item
   separators and pagination geometry, but restores their original subtle
   neutral colour. This is deliberately limited to the supported isolated
   Invoice Print document; View, PDF clones and other document types retain
   their own cascades. */
@media print {
  html body.ca-invoice-print-isolated-v23413
    .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-invoice
    .wave-public-flat-item-row:not(:last-child) {
    border-bottom-color: #f1f5f9 !important;
  }
}
/* End Issue #113 v11.7 application Print separator correction. */

/* Issue #113 v11: finish the supported View and Download PDF presentation.
   On screen, the lower content and footer form one bottom-aligned tail: free
   sheet space is consumed before Notes, while long content continues to grow
   normally. The PDF clone keeps Notes full width and constrains only Payment. */
@media screen {
  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-flat-lower-grid {
    margin: auto 0 0 !important;
    padding: 32px 0 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-flow-sheet > .wave-public-document-footer {
    align-self: stretch !important;
    min-height: 0 !important;
    margin: 20px 0 0 !important;
    padding: 0 !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due,
  html body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due,
  html body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due,
  html body .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due {
    background: #eef6fc !important;
    background-color: #eef6fc !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #172033 !important;
    box-shadow: none !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
  html body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
  html body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label,
  html body .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-label {
    background: transparent !important;
    color: #46566c !important;
  }

  html body .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
  html body.ca-dark-page .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
  html body[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value,
  html body .wave-portal-shell[data-theme="dark"] .wave-public-invoice-flat.ca-doc-v2290-invoice .ca-invoice-amount-due .ca-invoice-amount-due-value {
    background: transparent !important;
    color: #172033 !important;
    font-weight: 750 !important;
  }
}

html body .wave-pdf-export-clone.ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary {
  width: 100% !important;
  max-width: 100% !important;
}

html body .wave-pdf-export-clone.ca-invoice-flow-sheet > .wave-public-flat-lower-grid.has-payment-summary > .wave-public-payment-summary {
  box-sizing: border-box !important;
  width: 370px !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}
/* End Issue #113 v11 supported View/PDF polish. */
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-document-footer .ca-bill-notes {
  position:static!important;
  inset:auto!important;
  display:block!important;
  float:none!important;
  clear:both!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-document-footer .ca-bill-notes .wave-public-flat-label {
  margin-bottom:12px!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-document-footer .ca-bill-notes .wave-public-note-text {
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  line-height:1.65!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-document-footer .ca-bill-payment-summary {
  box-sizing:border-box!important;
  width:100%!important;
  max-width:420px!important;
  margin:16px 0 0!important;
}
html body :is(.wave-bill-view-page,.ca-bill-document-sheet) .ca-bill-document-footer:not(.has-notes) .ca-bill-payment-summary {
  margin-top:0!important;
}


/* Laptop widths reflow Invoice filters and keep the complete Actions column inside a scroll-safe table viewport. */
@media (min-width:901px) and (max-width:1500px) {
  .ca-invoice-filter-form .wave-list-tools-grid-invoices.ca-invoice-project-filter-grid {
    grid-template-columns:minmax(180px,1.4fr) repeat(2,minmax(140px,1fr))!important;
    gap:10px!important;
  }
  .ca-invoice-filter-form .wave-list-tools-grid-invoices.ca-invoice-project-filter-grid > label,
  .ca-invoice-filter-form .wave-list-tools-grid-invoices.ca-invoice-project-filter-grid input,
  .ca-invoice-filter-form .wave-list-tools-grid-invoices.ca-invoice-project-filter-grid select,
  .ca-invoice-filter-form .wave-list-tools-grid-invoices.ca-invoice-project-filter-grid .wave-date-picker-wrap {
    min-width:0!important;
    max-width:100%!important;
  }
}
@media(max-width:480px){
  .wave-list-head .ca-top-create-btn {
    width:100%!important;
    min-width:0!important;
    max-width:190px!important;
  }
}

/* Final live-runtime consolidation: dedicated accounting badges, spacious Bill footer, and fitted Invoice tables. */
.ca-accounting-status-badge {
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:84px!important;
  min-width:84px!important;
  height:26px!important;
  min-height:26px!important;
  margin:0!important;
  padding:5px 10px!important;
  border:1px solid currentColor!important;
  border-radius:3px!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:14px!important;
  text-align:center!important;
  white-space:nowrap!important;
}
.ca-accounting-status-badge.status-draft{background:var(--c-draft-bg)!important;color:var(--c-draft-txt)!important;border-color:var(--c-draft-bdr)!important}
.ca-accounting-status-badge.status-unsent{background:#e5e7eb!important;color:#4b5563!important;border-color:#cbd5e1!important}
.ca-accounting-status-badge.status-sent{background:var(--c-sent-bg)!important;color:var(--c-sent-txt)!important;border-color:var(--c-sent-bdr)!important}
.ca-accounting-status-badge.status-paid{background:var(--c-paid-bg)!important;color:var(--c-paid-txt)!important;border-color:var(--c-paid-bdr)!important}
.ca-accounting-status-badge.status-unpaid{background:var(--c-unpaid-bg)!important;color:var(--c-unpaid-txt)!important;border-color:var(--c-unpaid-bdr)!important}
.ca-accounting-status-badge.status-overdue{background:var(--c-overdue-bg)!important;color:var(--c-overdue-txt)!important;border-color:var(--c-overdue-bdr)!important}
.ca-accounting-status-badge.status-partial{background:var(--c-partial-bg)!important;color:var(--c-partial-txt)!important;border-color:var(--c-partial-bdr)!important}
.ca-accounting-status-badge.status-issued{background:#dbeafe!important;color:#1d4ed8!important;border-color:#93c5fd!important}
.ca-accounting-status-badge.status-applied{background:#dcfce7!important;color:#15803d!important;border-color:#86efac!important}
.ca-accounting-status-badge.status-refunded{background:#fef3c7!important;color:#92400e!important;border-color:#fcd34d!important}
.ca-accounting-status-badge.status-credited{background:#ecfdf5!important;color:#047857!important;border-color:#a7f3d0!important}
.ca-accounting-status-badge.status-cancelled{background:#fff1f2!important;color:#9f1239!important;border-color:#fecdd3!important}
.ca-accounting-status-badge.ca-archived-indicator{background:#e2e8f0!important;color:#334155!important;border-color:#cbd5e1!important}
.ca-document-status-badges{display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;flex-wrap:nowrap!important;white-space:nowrap!important}

.wave-bill-view-page .ca-bill-payment-summary{
  padding:10px 12px!important;
}


.wave-enhanced-list[data-table-kind="invoices"] > .wave-table-wrap{
  width:100%!important;
  max-width:100%!important;
  overflow-x:visible!important;
  padding-right:0!important;
}
.wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list{width:100%!important;min-width:0!important}
@media (min-width:901px) and (max-width:1500px){
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list{table-layout:fixed!important;font-size:13px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th,
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list td{box-sizing:border-box!important;padding-left:7px!important;padding-right:7px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th a{gap:2px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(1){width:34px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(2){width:98px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(3){width:82px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(4){width:14%!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(5){width:13%!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(6){width:86px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(7){width:88px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(8){width:96px!important;padding-right:8px!important;white-space:normal!important}
  .wave-enhanced-list[data-table-kind="invoices"] .wave-invoice-list th:nth-child(9){width:118px!important;padding-left:8px!important;white-space:nowrap!important}
  .wave-enhanced-list[data-table-kind="invoices"] .ca-invoice-amount-due-heading{display:inline-flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:0!important;line-height:1.05!important;text-transform:uppercase!important;white-space:normal!important}
  .wave-enhanced-list[data-table-kind="invoices"] :is(.ca-invoice-status-cell,.ca-invoice-date-cell,.ca-invoice-total-cell,.ca-invoice-due-cell,.ca-invoice-actions-cell){white-space:nowrap!important}
  .wave-enhanced-list[data-table-kind="invoices"] :is(.ca-invoice-number-cell,.ca-invoice-customer-cell,.ca-invoice-project-cell){white-space:normal!important;overflow-wrap:anywhere!important}
  .wave-enhanced-list[data-table-kind="invoices"] .ca-invoice-cell-clamp{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:2.5em;line-height:1.25}
  .wave-enhanced-list[data-table-kind="invoices"] .ca-invoice-due-cell{width:96px!important;padding-right:8px!important}
  .wave-enhanced-list[data-table-kind="invoices"] .ca-invoice-actions-cell{width:118px!important;min-width:118px!important;padding-left:8px!important;padding-right:8px!important;overflow:visible!important}
}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .ca-accounting-status-badge.status-issued{background:rgba(59,130,246,.22)!important;color:#bfdbfe!important;border-color:rgba(147,197,253,.6)!important}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .ca-accounting-status-badge.status-applied{background:rgba(34,197,94,.2)!important;color:#bbf7d0!important;border-color:rgba(134,239,172,.6)!important}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .ca-accounting-status-badge.status-refunded{background:rgba(245,158,11,.2)!important;color:#fde68a!important;border-color:rgba(252,211,77,.6)!important}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .ca-accounting-status-badge.status-cancelled{background:rgba(190,24,93,.16)!important;color:#fecdd3!important;border-color:rgba(251,113,133,.55)!important}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .ca-accounting-status-badge.ca-archived-indicator{background:#334155!important;color:#e2e8f0!important;border-color:#475569!important}
/* Issue #78 Phase 3: authenticated purchase Credit Note lifecycle UI; native document parity. */
.ca-ecn-page{max-width:1180px;margin:0 auto;min-width:0}.ca-ecn-notice{padding:12px 16px;border-radius:10px;margin:0 0 16px;font-weight:700}.ca-ecn-success{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}.ca-ecn-error{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}.ca-ecn-filter-form{margin:0 0 16px}.ca-ecn-filter-grid{grid-template-columns:minmax(220px,1.5fr) repeat(4,minmax(145px,1fr))}.ca-ecn-badge{display:inline-flex;padding:5px 10px;border-radius:999px;background:#e2e8f0;color:#334155;font-size:12px;font-weight:800;white-space:nowrap}.ca-ecn-status-issued{background:#dbeafe;color:#1d4ed8}.ca-ecn-status-partially_settled{background:#fef3c7;color:#92400e}.ca-ecn-status-applied,.ca-ecn-status-refunded,.ca-ecn-status-settled{background:#dcfce7;color:#166534}.ca-ecn-status-cancelled{background:#fee2e2;color:#991b1b}.ca-ecn-inline-form,.ca-doc-toolbar form,.ca-doc-more-menu form{display:inline-flex;margin:0}.ca-ecn-items-wrap{min-width:0}.ca-ecn-items label{display:block;margin:0}.ca-ecn-items label>span{display:none}.ca-ecn-items input,.ca-ecn-items textarea{width:100%;box-sizing:border-box}.ca-ecn-items textarea{min-height:44px;margin-top:6px}.ca-ecn-protected-line input[readonly],.ca-ecn-protected-line textarea[readonly]{background:#f8fafc;color:#475569}.ca-ecn-document{position:relative}.ca-ecn-flat-items{grid-template-columns:minmax(0,1fr) 18mm 27mm 28mm!important;gap:5mm!important}.ca-ecn-pdf-frame{position:fixed;width:1px;height:1px;left:-10000px;top:-10000px;border:0;visibility:hidden}.ca-ecn-remaining{margin-top:6px;padding-top:10px!important;border-top:1px solid #cbd5e1}.ca-ecn-cancelled{position:absolute;left:50%;top:44%;transform:translate(-50%,-50%) rotate(-12deg);border:5px solid #dc2626;color:#dc2626;padding:12px 24px;font-size:42px;font-weight:950;opacity:.25;z-index:2;pointer-events:none}.ca-ecn-archived{padding:10px;background:#f1f5f9;border-radius:8px}.ca-ecn-dialog{max-width:540px;border:0;border-radius:18px;padding:26px;box-shadow:0 24px 80px rgba(15,23,42,.3)}.ca-ecn-dialog::backdrop{background:rgba(15,23,42,.55)}.ca-ecn-dialog label{display:flex;flex-direction:column;gap:7px;font-weight:700}.ca-ecn-dialog textarea{min-height:90px}
.ca-ecn-bulk-form{margin:0}.ca-ecn-bulk-form .wave-bulk-actions{display:flex;align-items:end;gap:10px;margin:0 0 12px;flex-wrap:wrap}.ca-ecn-bulk-form .wave-bulk-actions label{display:grid;gap:4px}.ca-ecn-bulk-form .wave-bulk-actions span{font-size:12px;color:#64748b}.ca-ecn-table .wave-bulk-col{width:38px;text-align:center}.ca-ecn-table .wave-bulk-col:before{display:none}
.wave-portal-shell[data-theme="dark"] .ca-ecn-protected-line input[readonly],.wave-portal-shell[data-theme="dark"] .ca-ecn-protected-line textarea[readonly]{background:#172337;color:#dbe7f5}.wave-portal-shell[data-theme="dark"] .ca-ecn-archived{background:#172337;color:#dbe7f5}
@media(max-width:980px){.ca-ecn-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.ca-ecn-filter-grid{grid-template-columns:1fr}.ca-ecn-table thead{display:none}.ca-ecn-table,.ca-ecn-table tbody,.ca-ecn-table tr,.ca-ecn-table td{display:block;width:100%;box-sizing:border-box}.ca-ecn-table tr{border:1px solid #dbe5f0;border-radius:12px;padding:12px;margin-bottom:12px}.ca-ecn-table td{display:grid;grid-template-columns:42% 1fr;gap:8px;border:0;padding:6px}.ca-ecn-table td:before{content:attr(data-label);font-weight:800;color:#64748b}.ca-ecn-table .wave-actions-menu{justify-self:start}.ca-ecn-flat-items{grid-template-columns:minmax(0,1fr) 44px 66px 72px!important;gap:8px!important;font-size:10px!important}.ca-ecn-flat-items .ta-r{text-align:right!important}.ca-ecn-cancelled{font-size:30px}}
@media print{html,body{background:#fff!important;color:#111!important}.ca-ecn-page{max-width:none!important}.ca-ecn-cancelled{color:#dc2626!important;border-color:#dc2626!important}.ca-doc-toolbar,.ca-ecn-dialog{display:none!important}}

/* Issue #78 Phase 3 UX parity round 2: reuse the Sales Credit Note document contract. */
.ca-ecn-table tbody tr,.ca-ecn-table tbody tr>td{background:transparent!important;background-color:transparent!important}
.ca-ecn-editor-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 16px}
.ca-ecn-editor-summary .wave-card{display:flex;flex-direction:column;gap:6px;margin:0;padding:16px 18px}
.ca-ecn-editor-summary span{color:var(--ds-text-3,#64748b);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.ca-ecn-editor-summary strong{font-size:18px;color:var(--ds-text,#172033)}
.ca-doc-v2290-expense-credit-note,.ca-doc-v2290-expense-credit-note .ca-ecn-document{background:transparent!important}
@media screen{
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note{background:#0f1b2d!important;color:#eaf2ff!important;border:0!important;box-shadow:none!important}
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{background:#132238!important;color:#eaf2ff!important;border-color:#2a3c55!important;box-shadow:0 18px 45px rgba(0,0,0,.35)!important}
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note :is(.wave-public-flat-head,.wave-public-flat-meta-row,.wave-public-flat-billto,.wave-public-flat-meta-box,.wave-public-flat-items,.wave-public-flat-item-row,.wave-public-flat-bottom,.wave-public-flat-notes-below,.wave-public-payment-summary,.wave-public-document-footer,.wave-public-print-footer){background:transparent!important;color:#eaf2ff!important;border-color:#2a3c55!important}
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note :is(strong,a,.wave-public-note-text,.wave-public-logo-text,.wave-public-flat-kicker){color:#f8fbff!important}
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-credit-note :is(span,.wave-public-flat-label,.wave-public-item-description,.wave-public-flat-business-lines){color:#c7d5e8!important}
}
@media(max-width:760px){
  .ca-ecn-editor-summary{grid-template-columns:1fr}
  .ca-ecn-table td.ta-r{text-align:right;align-items:center}
  .ca-ecn-table td.ta-r:before{text-align:left}
  .ca-credit-note-view-page .ca-doc-toolbar{display:flex!important;flex-wrap:wrap!important;gap:8px!important;min-height:0!important}
  .ca-credit-note-view-page .ca-doc-toolbar-group{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
  .ca-ecn-document-summary{grid-template-columns:1fr!important}
  .ca-ecn-document-summary .wave-public-flat-totals{width:100%!important;max-width:none!important}
}
@media print{
  @page{size:A4 portrait;margin:0}
  html body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-expense-credit-note{width:190mm!important;max-width:190mm!important;min-width:190mm!important;margin:0 auto!important;padding:0!important;border:0!important;box-shadow:none!important;background:#fff!important}
  html body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-expense-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{display:block!important;width:190mm!important;max-width:190mm!important;min-width:190mm!important;min-height:0!important;height:auto!important;margin:0 auto!important;padding:10mm 12mm 8mm!important;border:0!important;box-shadow:none!important;border-radius:0!important;page-break-inside:avoid!important;break-inside:avoid!important;background:#fff!important;color:#172033!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-head{margin-bottom:7mm!important;padding-bottom:5mm!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-meta-row{margin-bottom:7mm!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-item-row{padding-top:2.5mm!important;padding-bottom:2.5mm!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-notes-below{margin-top:6mm!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-document-footer{margin-top:7mm!important}
}

/* Issue #78 Phase 3 runtime polish: native controls, contrast and safe document output. */
.ca-ecn-bulk-form .wave-bulk-actions select{height:38px;min-width:190px;padding:0 34px 0 10px;border:1px solid var(--ds-border-2,#cbd5e1);border-radius:10px;background:var(--ds-surface,#fff);color:var(--ds-text,#0f172a);font:inherit}
.ca-ecn-bulk-form .wave-bulk-actions .wave-btn{height:38px}
.ca-ecn-filter-form .wave-date-picker-wrap,.ca-ecn-filter-form .wave-date-ddmmyyyy,.ca-ecn-filter-form .wave-native-date-picker{height:38px!important;min-height:38px!important;box-sizing:border-box}
.ca-doc-editor-back{width:40px;height:40px;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}
.ca-doc-editor-back .ca-doc-action-label{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important}
.ca-ecn-cancelled{position:relative!important;left:auto!important;top:auto!important;display:block;width:max-content;max-width:80%;margin:22px auto 12px!important;transform:rotate(-12deg)!important;box-sizing:border-box;text-align:center;border-width:3px!important;padding:8px 18px!important;font-size:32px!important;line-height:1!important}
.wave-portal-shell[data-theme="dark"] .ca-ecn-bulk-form .wave-bulk-actions select{background:#111827;color:#e5e7eb;border-color:#475569}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .wave-bill-view-page .wave-public-flat-project-line{background:rgba(37,99,235,.24)!important;color:#dbeafe!important;border:1px solid rgba(147,197,253,.5)!important}
:is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .wave-bill-view-page .wave-public-flat-project-line :is(span,strong,a){color:#dbeafe!important}
@media print{.ca-ecn-cancelled{position:relative!important;left:auto!important;top:auto!important;margin:8mm auto 4mm!important;transform:rotate(-12deg)!important}.ca-ecn-document{break-inside:avoid-page!important;page-break-inside:avoid!important}.ca-ecn-document-summary,.wave-public-flat-notes-below,.wave-public-document-footer{break-inside:avoid!important;page-break-inside:avoid!important}}

/* Issue #78 runtime acceptance: Bills-style bulk tools and Sales Credit Note mobile cards. */
.ca-ecn-bulk-form .wave-bulk-actions{align-items:center!important;padding:10px 0;margin-bottom:10px!important}
.ca-ecn-bulk-form .wave-bulk-select-label{display:inline-flex!important;grid-template-columns:none!important;align-items:center;gap:7px;font-size:13px;font-weight:700;color:var(--ds-text,#334155)}
.ca-ecn-bulk-form .wave-bulk-select-label span{font-size:13px;color:inherit}
.ca-ecn-bulk-form .wave-bulk-action-label{display:block!important}
.ca-ecn-bulk-form .wave-bulk-actions select,.ca-ecn-bulk-form .wave-bulk-actions .wave-btn{height:40px!important;min-height:40px!important;border-radius:10px!important;font-size:14px!important;line-height:1!important}
.ca-ecn-bulk-form .wave-bulk-actions select{padding:0 36px 0 12px!important;border:1px solid var(--ds-border-2,#cbd5e1)!important}
.ca-ecn-filter-form .wave-list-tools-grid>label>select,.ca-ecn-filter-form .wave-list-tools-grid>label>input,.ca-ecn-filter-form .wave-date-picker-wrap{height:40px!important;min-height:40px!important;border-radius:10px!important;box-sizing:border-box!important}
.ca-ecn-filter-form .wave-date-ddmmyyyy,.ca-ecn-filter-form .wave-native-date-picker{height:40px!important;min-height:40px!important;padding-top:0!important;padding-bottom:0!important;border-radius:10px!important}
.ca-doc-toolbar-credit-note .ca-doc-action-approve{justify-content:center;text-align:center}
.ca-doc-toolbar-credit-note .ca-doc-action-approve{display:inline-flex!important;align-items:center!important;justify-content:center!important}
@media(max-width:760px){
  .ca-ecn-table tbody{display:grid!important;gap:18px}
  .ca-ecn-table tr.ca-mobile-credit-note-row{position:relative;display:grid!important;grid-template-columns:28px minmax(0,1fr) auto;gap:5px 10px;padding:13px 13px 12px!important;margin:0!important;background:var(--ds-surface,#fff)!important}
  .ca-ecn-table tr.ca-mobile-credit-note-row td{display:block!important;width:auto!important;padding:0!important;min-width:0}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:before{display:none!important}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(1){grid-column:1;grid-row:1;align-self:start;padding-top:3px!important}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(4){grid-column:2;grid-row:1;font-size:15px}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(7){grid-column:3;grid-row:1;text-align:right!important;font-size:15px}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(5){grid-column:2;grid-row:2;color:var(--ds-text-muted,#64748b);font-size:13px}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(6){grid-column:2;grid-row:3;font-size:13px}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(2){grid-column:3;grid-row:2;text-align:right}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(3){grid-column:3;grid-row:3;text-align:right;font-size:12px;color:var(--ds-text-muted,#64748b)}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(8),.ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(9),.ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(10){grid-row:4;font-size:12px;text-align:right!important;color:var(--ds-text-muted,#64748b)}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(8){grid-column:1 / 2}.ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(9){grid-column:2}.ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(10){grid-column:3}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(11){display:none!important}
  .ca-ecn-table tr.ca-mobile-credit-note-row{cursor:pointer}
  .ca-ecn-table tr.ca-mobile-credit-note-row:focus-visible{outline:2px solid var(--ds-primary,#2563eb);outline-offset:2px}
}
@media(max-width:760px){
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(8),
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(9),
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(10){display:none!important}
  .ca-ecn-table tr.ca-mobile-credit-note-row td:nth-child(11){display:none!important}
}

/* Issue #78 final A4 geometry: keep totals inside the printable width and anchor the footer. */
@media print{
  html body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-expense-credit-note{width:186mm!important;max-width:186mm!important;min-width:186mm!important}
  html body .wave-public-invoice-flat.ca-doc-v2290.ca-doc-v2290-expense-credit-note .wave-public-sheet-flat.ca-doc-v2290-sheet{display:flex!important;flex-direction:column!important;width:186mm!important;max-width:186mm!important;min-width:186mm!important;min-height:277mm!important;padding:9mm 11mm 8mm 10mm!important;box-sizing:border-box!important;overflow:visible!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-bottom{width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding-right:2mm!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-totals{max-width:74mm!important;width:74mm!important;box-sizing:border-box!important;margin-left:auto!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-flat-notes-below{margin-top:5mm!important}
  html body .ca-doc-v2290-expense-credit-note .wave-public-document-footer{margin-top:auto!important;padding-top:7mm!important}
}


/* Assistant Issue #78 UI-only acceptance polish — no accounting/lifecycle changes. */
.ca-doc-v2290-expense-credit-note .ca-ecn-recipient-address{margin-top:4px;color:var(--ds-text-muted,#64748b);font-size:13px;line-height:1.45}
.ca-doc-v2290-expense-credit-note .wave-public-flat-titlebox{justify-content:flex-start}
.ca-doc-toolbar-credit-note form.ca-app-confirm-form:has(.ca-doc-action-approve){display:inline-flex!important;align-items:center!important}
.ca-doc-toolbar-credit-note .ca-doc-action-approve .ca-doc-action-label{display:block!important;text-align:center!important;margin:0!important}
@media(min-width:761px){
  .ca-ecn-page .wave-table-wrap{max-width:100%!important}
  .ca-ecn-table{width:100%!important;min-width:0!important;table-layout:auto!important}
  .ca-ecn-table th,.ca-ecn-table td{padding-left:9px!important;padding-right:9px!important}
  .ca-ecn-table td[data-label="Vendor"]{white-space:normal!important;min-width:120px}
  .ca-ecn-table td[data-label="Source Bill"]{white-space:normal!important;min-width:120px}
  .ca-ecn-table td[data-label="Remaining"],.ca-ecn-table td[data-label="Total"]{white-space:nowrap!important}
}
@media(max-width:760px){
  .ca-ecn-cancelled{font-size:26px!important;padding:7px 14px!important;border-width:3px!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table-wrap{overflow:visible!important;border:0!important;background:transparent!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table,
  .wave-bill-view-page .wave-public-invoice-card .wave-table tbody,
  .wave-bill-view-page .wave-public-invoice-card .wave-table tr,
  .wave-bill-view-page .wave-public-invoice-card .wave-table td{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table thead{display:none!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table tr{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px 14px!important;padding:13px 0!important;border:0!important;border-bottom:1px solid #e5edf6!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table tr:last-child{border-bottom:0!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td{border:0!important;padding:0!important;text-align:right!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:first-child{grid-column:1/-1!important;text-align:left!important;font-weight:800!important;padding-bottom:3px!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(n+2){display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(n+2)::before{font-size:10.5px!important;font-weight:800!important;text-transform:uppercase!important;letter-spacing:.035em!important;color:#64748b!important;text-align:left!important}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(2)::before{content:"Qty"}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(3)::before{content:"Price"}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(4)::before{content:"Tax"}
  .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(5)::before{content:"Amount"}
  :is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .wave-bill-view-page .wave-public-invoice-card .wave-table tr{border-bottom-color:#334155!important}
  :is(body.ca-dark,body.ca-theme-dark,body.ca-dark-page,body.ca-core-dark,body[data-theme="dark"],html[data-theme="dark"],html[data-ca-theme="dark"]) .wave-bill-view-page .wave-public-invoice-card .wave-table td:nth-child(n+2)::before{color:#94a3b8!important}
}
@media print{
  .ca-doc-v2290-expense-credit-note .ca-ecn-cancelled{font-size:30px!important;padding:7px 16px!important;border-width:3px!important}
}


/* Issue #78 final UI polish from browser acceptance. */
.ca-doc-v2290-expense-credit-note .ca-ecn-party-details{
  margin-top:5px;
  color:var(--ds-text-muted,#64748b);
  font-size:12px;
  line-height:1.45;
  font-weight:500;
}
.ca-doc-v2290-expense-credit-note .ca-ecn-party-details>div+div{margin-top:1px}
.ca-doc-v2290-expense-credit-note .ca-ecn-flat-items{margin-top:22px!important}

/* Keep Expense Credit Note sorting glyphs visually attached to their headings. */
.ca-ecn-table.wave-sortable-table th[data-sort]{
  padding-right:9px!important;
}
.ca-ecn-table.wave-sortable-table th[data-sort]::after{
  position:static!important;
  display:inline-block!important;
  margin-left:6px!important;
  transform:none!important;
  vertical-align:middle!important;
  line-height:1!important;
}

/* Laptop Bills list: stable row rhythm and vertically centered actions. */
@media(min-width:761px){
  .ca-bills-list .wave-table tbody td{vertical-align:middle!important}
  .ca-bills-list .wave-table tbody td:nth-child(5){white-space:nowrap!important}
  .ca-bills-list .wave-table tbody td.wave-actions-cell{vertical-align:middle!important}
  .ca-bills-list .wave-table tbody td.wave-actions-cell .wave-customer-actions{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    flex-wrap:nowrap!important;
    min-height:40px;
  }

  /* Bill document numeric block lines up with the totals column on the right. */
  .wave-bill-view-page .ca-bill-document-sheet .wave-table{
    width:100%!important;
    table-layout:fixed!important;
  }
  .wave-bill-view-page .ca-bill-document-sheet .wave-table th:nth-child(1),
  .wave-bill-view-page .ca-bill-document-sheet .wave-table td:nth-child(1){width:18%!important}
  .wave-bill-view-page .ca-bill-document-sheet .wave-table th:nth-child(2),
  .wave-bill-view-page .ca-bill-document-sheet .wave-table td:nth-child(2){width:30%!important}
  .wave-bill-view-page .ca-bill-document-sheet .wave-table th:nth-child(3),
  .wave-bill-view-page .ca-bill-document-sheet .wave-table td:nth-child(3){width:8%!important;text-align:right!important}
  .wave-bill-view-page .ca-bill-document-sheet .wave-table th:nth-child(4),
  .wave-bill-view-page .ca-bill-document-sheet .wave-table td:nth-child(4){width:14%!important;text-align:right!important}
  .wave-bill-view-page .ca-bill-document-sheet .wave-table th:nth-child(5),
  .wave-bill-view-page .ca-bill-document-sheet .wave-table td:nth-child(5){width:12%!important;text-align:right!important}
  .wave-bill-view-page .ca-bill-document-sheet .wave-table th:nth-child(6),
  .wave-bill-view-page .ca-bill-document-sheet .wave-table td:nth-child(6){width:18%!important;text-align:right!important;padding-right:0!important}
}

/* Stronger visual separation between mobile Expense Credit Note cards. */
@media(max-width:760px){
  .ca-ecn-table tbody{gap:24px!important}
  .ca-ecn-table tr.ca-mobile-credit-note-row{margin:0!important}
}


/* Issue #78 browser acceptance follow-up: laptop list fit + mobile card separation. */
@media(min-width:761px) and (max-width:1440px){
  .ca-ecn-page .wave-table-wrap{
    width:100%!important;
    max-width:100%!important;
    overflow-x:visible!important;
    overflow-y:visible!important;
  }
  .ca-ecn-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
  }
  .ca-ecn-table th,.ca-ecn-table td{
    padding-left:5px!important;
    padding-right:5px!important;
    font-size:11.5px!important;
    box-sizing:border-box!important;
  }
  .ca-ecn-table th:nth-child(1),.ca-ecn-table td:nth-child(1){width:32px!important}
  .ca-ecn-table th:nth-child(2),.ca-ecn-table td:nth-child(2){width:88px!important}
  .ca-ecn-table th:nth-child(3),.ca-ecn-table td:nth-child(3){width:78px!important}
  .ca-ecn-table th:nth-child(4),.ca-ecn-table td:nth-child(4){width:86px!important}
  .ca-ecn-table th:nth-child(5),.ca-ecn-table td:nth-child(5){width:auto!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .ca-ecn-table th:nth-child(6),.ca-ecn-table td:nth-child(6){width:auto!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .ca-ecn-table th:nth-child(7),.ca-ecn-table td:nth-child(7){width:78px!important;white-space:nowrap!important}
  .ca-ecn-table th:nth-child(8),.ca-ecn-table td:nth-child(8){width:86px!important;white-space:nowrap!important}
  .ca-ecn-table th:nth-child(9),.ca-ecn-table td:nth-child(9){width:90px!important;min-width:90px!important}
  .ca-ecn-table .ca-accounting-status-badge{font-size:10.5px!important;padding:4px 7px!important}
  .ca-ecn-table .ca-ecn-row-actions{overflow:visible!important;white-space:nowrap!important}
  .ca-ecn-table .ca-ecn-row-actions .wave-actions-menu{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:2px!important;
    flex-wrap:nowrap!important;
    min-width:0!important;
    overflow:visible!important;
  }
  .ca-ecn-table .ca-ecn-row-actions .wave-link-btn{padding-left:5px!important;padding-right:5px!important}
  .ca-ecn-table .ca-ecn-row-actions .wave-actions-trigger{
    flex:0 0 auto!important;
    margin:0!important;
  }
}
@media(max-width:760px){
  .ca-ecn-table tbody{
    display:block!important;
    row-gap:0!important;
  }
  .ca-ecn-table tr.ca-mobile-credit-note-row{
    margin:0!important;
  }
  .ca-ecn-table tr.ca-mobile-credit-note-row + tr.ca-mobile-credit-note-row{
    margin-top:10px!important;
  }
}


/* Issue #78 vendor-reference laptop header polish. */
@media(min-width:761px) and (max-width:1440px){
  .ca-ecn-table thead th{
    padding-top:10px!important;
    padding-bottom:10px!important;
    line-height:1.25!important;
    vertical-align:middle!important;
  }
  .ca-ecn-table.wave-sortable-table th[data-sort]{
    white-space:nowrap!important;
    padding-left:7px!important;
    padding-right:7px!important;
  }
  .ca-ecn-table.wave-sortable-table th[data-sort]::after{
    margin-left:3px!important;
    font-size:9px!important;
    opacity:.72!important;
  }
  .ca-ecn-table th:nth-child(3),.ca-ecn-table td:nth-child(3){
    width:92px!important;
  }
  .ca-ecn-table th:nth-child(4),.ca-ecn-table td:nth-child(4){
    width:132px!important;
    min-width:132px!important;
  }
  .ca-ecn-table th:nth-child(7),.ca-ecn-table td:nth-child(7){
    width:82px!important;
  }
  .ca-ecn-table th:nth-child(8),.ca-ecn-table td:nth-child(8){
    width:92px!important;
  }
}

/* Issue #78 final acceptance follow-up: vendor stack, laptop edge inset, compact cancel stamp. */
.ca-doc-v2290-expense-credit-note .wave-public-flat-brand{
  display:block!important;
}
.ca-doc-v2290-expense-credit-note .wave-public-logo-text{
  display:block!important;
}
.ca-doc-v2290-expense-credit-note .ca-ecn-party-details{
  display:block!important;
  margin-top:5px!important;
}
@media(min-width:761px) and (max-width:1440px){
  .ca-ecn-page .wave-table-wrap{
    box-sizing:border-box!important;
    padding-right:10px!important;
  }
  .ca-ecn-table{
    width:calc(100% - 2px)!important;
    max-width:calc(100% - 2px)!important;
  }
  .ca-ecn-table th:nth-child(9),.ca-ecn-table td:nth-child(9){
    width:94px!important;
    min-width:94px!important;
    padding-right:2px!important;
  }
}
.ca-doc-v2290-expense-credit-note .ca-ecn-cancelled{
  font-size:26px!important;
  padding:4px 10px!important;
  border-width:2px!important;
}

/* Authenticated Vendor-credit settlement controls stay outside the immutable document sheet. */
.ca-ecn-settlement-panel{width:100%;max-width:none;margin:18px 0 24px;padding-top:16px;padding-bottom:16px;box-sizing:border-box}
.ca-ecn-settlement-panel .wave-section-head{margin-bottom:0}
.ca-ecn-settlement-panel .wave-section-head h2{margin-bottom:2px}
.ca-ecn-settlement-panel .wave-section-head p{margin:0;line-height:1.35}
.ca-ecn-settlement-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:11px}
.ca-ecn-settlement-summary>div{display:flex;flex-direction:column;gap:3px;padding:10px 12px;border:1px solid var(--ds-border,#dbe2ea);border-radius:10px;background:var(--ds-surface-subtle,#f8fafc)}
.ca-ecn-settlement-summary span,.ca-ecn-refund-entry span{color:var(--ds-text-muted,#64748b);font-size:12px}
.ca-ecn-settlement-remaining strong{color:var(--ds-primary,#2563eb)}
.ca-ecn-refund-history{margin-top:18px}
.ca-ecn-refund-history h3{margin:0 0 8px;font-size:18px;line-height:1.35;font-weight:700;color:var(--ds-text,#172033)}
.ca-ecn-refund-entry{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:14px;padding:10px 0;border-top:1px solid var(--ds-border,#dbe2ea)}
.ca-ecn-refund-entry>div{display:flex;flex-direction:column;gap:2px}
.ca-ecn-refund-dialog{overflow:hidden}
.ca-ecn-refund-dialog .ca-ecn-refund-form{display:grid;gap:12px;width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.ca-ecn-refund-dialog .ca-app-confirm-card{box-sizing:border-box;width:100%;max-width:100%}
.ca-ecn-refund-form label{display:grid;gap:6px;font-size:13px;font-weight:700;color:var(--ds-text,#334155)}
.ca-ecn-refund-form label small{font-size:12px;font-weight:500;color:var(--ds-text-muted,#64748b)}
.ca-ecn-refund-form input,.ca-ecn-refund-form textarea{width:100%;min-width:0;box-sizing:border-box;padding:10px 12px;border:1px solid var(--ds-border,#cbd5e1);border-radius:10px;background:var(--ds-surface,#fff);color:var(--ds-text,#172033);font:inherit;line-height:1.35;outline:none}
.ca-ecn-refund-form input{min-height:42px}
.ca-ecn-refund-form textarea{min-height:82px;resize:vertical}
.ca-ecn-refund-form input:focus,.ca-ecn-refund-form textarea:focus{border-color:var(--ds-primary,#2563eb);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.ca-ecn-refund-form input[type=number]{appearance:textfield;-moz-appearance:textfield}
.ca-ecn-refund-form input[type=number]::-webkit-inner-spin-button,.ca-ecn-refund-form input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-refund-history h3{color:var(--ca-dark-text,#f1f5f9)}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-refund-form label{color:var(--ca-dark-text,#f1f5f9)}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-refund-form input,
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-refund-form textarea{background:var(--ca-dark-surface,#0f1b2d);border-color:var(--ca-dark-border,#334155);color:var(--ca-dark-text,#f8fafc)}
@media screen{
  :is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-settlement-summary>div{background:var(--ca-dark-surface,#111c2f);border-color:var(--ca-dark-border,#3b4b63);color:var(--ca-dark-text,#f1f5f9)}
  :is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-settlement-summary span{color:var(--ca-dark-muted,#b8c7dc)}
  :is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-settlement-summary strong{color:var(--ca-dark-text,#f1f5f9)}
  :is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-doc-v2290-expense-credit-note .ca-ecn-party-details{color:var(--ca-dark-muted,#b8c7dc)!important}
}
@media(max-width:760px){.ca-ecn-settlement-panel{width:auto;margin:14px 10px 80px;padding-top:14px;padding-bottom:14px}.ca-ecn-settlement-summary{grid-template-columns:1fr 1fr}.ca-ecn-refund-entry{grid-template-columns:1fr auto}.ca-ecn-refund-entry form{grid-column:1/-1}.ca-ecn-refund-entry button{width:100%}.ca-ecn-refund-dialog{width:min(440px,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow:auto}.ca-ecn-refund-dialog .ca-app-confirm-card{padding:18px}}
@media print{
  .ca-doc-v2290-expense-credit-note .ca-ecn-cancelled{
    font-size:24px!important;
    padding:4px 10px!important;
    border-width:2px!important;
  }
}


/* Notebook Bills list fit: remove horizontal scroll and center row actions. */
@media(min-width:761px) and (max-width:1600px){
  .ca-bills-list .wave-table-wrap{
    width:100%!important;
    max-width:100%!important;
    overflow-x:visible!important;
    overflow-y:visible!important;
    box-sizing:border-box!important;
    padding-right:8px!important;
  }
  .ca-bills-list .wave-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
  }
  .ca-bills-list .wave-table th,
  .ca-bills-list .wave-table td{
    padding-left:5px!important;
    padding-right:5px!important;
    font-size:11.5px!important;
    box-sizing:border-box!important;
    vertical-align:middle!important;
  }
  .ca-bills-list .wave-table th:nth-child(1),
  .ca-bills-list .wave-table td:nth-child(1){width:32px!important}
  .ca-bills-list .wave-table th:nth-child(2),
  .ca-bills-list .wave-table td:nth-child(2){width:90px!important}
  .ca-bills-list .wave-table th:nth-child(3),
  .ca-bills-list .wave-table td:nth-child(3){width:82px!important;white-space:nowrap!important}
  .ca-bills-list .wave-table th:nth-child(4),
  .ca-bills-list .wave-table td:nth-child(4){width:170px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .ca-bills-list .wave-table th:nth-child(5),
  .ca-bills-list .wave-table td:nth-child(5){width:auto!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .ca-bills-list .wave-table th:nth-child(6),
  .ca-bills-list .wave-table td:nth-child(6){width:110px!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .ca-bills-list .wave-table th:nth-child(7),
  .ca-bills-list .wave-table td:nth-child(7){width:88px!important;white-space:nowrap!important;text-align:right!important}
  .ca-bills-list .wave-table th:nth-child(8),
  .ca-bills-list .wave-table td:nth-child(8){width:112px!important;min-width:112px!important;text-align:center!important}
  .ca-bills-list .wave-table th:nth-child(8){padding-left:0!important;padding-right:0!important}
  .ca-bills-list .wave-table td.wave-actions-cell{
    min-width:0!important;
    overflow:visible!important;
    white-space:nowrap!important;
    vertical-align:middle!important;
    padding-left:2px!important;
    padding-right:2px!important;
  }
  .ca-bills-list .wave-table td.wave-actions-cell .ca-bill-actions-menu{justify-content:center!important}
  .ca-bills-list .wave-table tbody td.ca-bill-vendor-cell,
  .ca-bills-list .wave-table tbody td.ca-bill-project-cell{
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    overflow:hidden!important;
    vertical-align:top!important;
  }
}


/* Issue #78 runtime acceptance UI polish: Vendor Refund modal + history. */
.ca-ecn-refund-form select{
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  min-height:42px!important;
  box-sizing:border-box!important;
  padding:0 12px!important;
  border:1px solid var(--ds-border,#cbd5e1)!important;
  border-radius:10px!important;
  background:var(--ds-surface,#fff)!important;
  color:var(--ds-text,#172033)!important;
  font-family:var(--ds-font)!important;
  font-size:13px!important;
  line-height:1.35!important;
  outline:none!important;
  appearance:auto!important;
}
.ca-ecn-refund-form select:focus{
  border-color:var(--ds-primary,#2563eb)!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;
}
.ca-ecn-refund-entry>div>strong{
  font-size:14px!important;
  line-height:1.3!important;
  font-weight:700!important;
}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-ecn-refund-form select{
  background:var(--ca-dark-surface,#0f1b2d)!important;
  border-color:var(--ca-dark-border,#334155)!important;
  color:var(--ca-dark-text,#f8fafc)!important;
}


/* Credit Note source type-to-search selector. */
.ca-credit-source-search{position:relative;width:100%;min-width:0}
.ca-credit-source-search-input{width:100%!important;min-width:0!important;height:42px!important;box-sizing:border-box!important;padding:0 12px!important;border:1px solid var(--ds-border-2,#cbd5e1)!important;border-radius:var(--ds-r-md,10px)!important;background:var(--ds-surface,#fff)!important;color:var(--ds-text,#172033)!important;font-family:var(--ds-font)!important;font-size:13px!important;line-height:1.35!important;outline:none!important}
.ca-credit-source-search-input:focus{border-color:var(--ds-primary,#2563eb)!important;box-shadow:0 0 0 3px rgba(37,99,235,.12)!important}
.ca-credit-source-search .ca-credit-source-search-input{padding-right:42px!important}
.ca-credit-source-search-toggle{position:absolute;right:5px;top:21px;transform:translateY(-50%);z-index:5;display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:7px;background:transparent;color:#64748b;cursor:pointer}
.ca-credit-source-search-toggle:hover{background:#eaf6ff;color:#0f172a}
.ca-credit-source-search-toggle:focus-visible{outline:2px solid #38bdf8;outline-offset:1px}
.ca-credit-source-search-toggle::before{content:"";display:block;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-2px) rotate(45deg)}
.ca-credit-source-native{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;opacity:0!important}
.ca-credit-source-search-results{display:none;position:fixed;z-index:2147483000;overflow-y:auto;padding:6px;box-sizing:border-box;background:#fff;color:#0f172a;border:1px solid #cbd5e1;border-radius:10px;box-shadow:0 12px 30px rgba(15,23,42,.18)}
.ca-credit-source-search.is-open .ca-credit-source-search-results{display:block}
.ca-credit-source-search-option{display:block;width:100%;margin:0;padding:9px 10px;border:0;border-radius:7px;background:transparent;color:inherit;text-align:left;font:inherit;line-height:1.35;cursor:pointer;white-space:normal;overflow-wrap:anywhere}
.ca-credit-source-search-option:hover,.ca-credit-source-search-option.is-active{background:#eaf6ff;color:#0f172a}
.ca-credit-source-search-empty,.ca-credit-source-search-more{padding:9px 10px;color:#64748b;font-size:12px;line-height:1.4}
.ca-credit-source-search-more{border-top:1px solid #e2e8f0;font-size:11px}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-input{background:var(--ca-dark-surface,#0f1b2d)!important;border-color:var(--ca-dark-border,#334155)!important;color:var(--ca-dark-text,#f8fafc)!important}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-toggle{color:#cbd5e1}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-toggle:hover{background:#1d3150;color:#f8fafc}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-results{background:#111c2d;color:#dce9f8;border-color:#334155;box-shadow:0 14px 34px rgba(0,0,0,.38)}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-option:hover,
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-option.is-active{background:#1d3150;color:#f8fafc}
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-empty,
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,html.ca-dark,html.ca-theme-dark) .ca-credit-source-search-more{color:#93a4ba}

/* PR #80 staging follow-up: authenticated ECN contrast and Create-menu containment. */
@media screen{
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page:not(.ca-credit-note-print-host) .ca-doc-v2290-expense-credit-note:not(.credit-note-print) .ca-ecn-party-details,
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-credit-note-view-page:not(.ca-credit-note-print-host) .ca-doc-v2290-expense-credit-note:not(.credit-note-print) .ca-ecn-party-details > div{
    color:var(--ca-dark-muted,#c7d5e8)!important;
  }
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-ecn-table td[data-label="Source Bill"] > a{
    color:var(--ca-dark-link,#7dd3fc)!important;
    text-decoration:underline;
    text-underline-offset:2px;
  }
  :is(body.ca-dark-page,body[data-theme="dark"],html.ca-theme-dark body,html[data-ca-theme="dark"] body) .ca-ecn-table td[data-label="Source Bill"] > a:is(:hover,:focus-visible){
    color:var(--ca-dark-text,#f1f5f9)!important;
  }
}
.wave-dashboard-create-menu .wave-create-dropdown.wave-create-dropdown-all{
  max-height:min(560px,var(--ca-create-menu-available-height,50dvh))!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  background:var(--ds-surface,#fff)!important;
  scrollbar-gutter:stable;
}
.wave-dashboard-create-menu.is-create-menu-above .wave-create-dropdown.wave-create-dropdown-all{
  top:auto!important;
  bottom:calc(100% + 8px)!important;
}
:is(.wave-portal-shell[data-theme="dark"],body[data-theme="dark"],body.ca-dark-page) .wave-dashboard-create-menu .wave-create-dropdown.wave-create-dropdown-all{
  background:var(--ca-dark-surface-raised,#1e293b)!important;
}
/* Dashboard-only dark menu states: reset the header CTA route rules before applying interaction states. */
:is(.wave-portal-shell[data-theme="dark"],body[data-theme="dark"],body.ca-dark-page,html.ca-theme-dark body,html[data-ca-theme="dark"] body) .wave-dashboard-create-menu .wave-create-dropdown-all > a,
:is(.wave-portal-shell[data-theme="dark"],body[data-theme="dark"],body.ca-dark-page,html.ca-theme-dark body,html[data-ca-theme="dark"] body) .wave-dashboard-create-menu .wave-create-dropdown-all > a:is(:link,:visited,:active,:focus){
  background:var(--ca-dark-surface-raised,#1e293b)!important;
  color:var(--ca-dark-text,#f1f5f9)!important;
  border:0!important;
  outline:none;
  box-shadow:none!important;
}
:is(.wave-portal-shell[data-theme="dark"],body[data-theme="dark"],body.ca-dark-page,html.ca-theme-dark body,html[data-ca-theme="dark"] body) .wave-dashboard-create-menu .wave-create-dropdown-all > a:hover{
  background:rgba(59,130,246,.15)!important;
  color:#93c5fd!important;
}
:is(.wave-portal-shell[data-theme="dark"],body[data-theme="dark"],body.ca-dark-page,html.ca-theme-dark body,html[data-ca-theme="dark"] body) .wave-dashboard-create-menu .wave-create-dropdown-all > a:focus-visible{
  background:rgba(59,130,246,.15)!important;
  color:#93c5fd!important;
  outline:2px solid var(--ca-dark-link,#7dd3fc)!important;
  outline-offset:-2px;
}

/* Bill Payments laptop fit: compact seven-column layout with a single-row action bar. */
@media (min-width:761px){
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table-wrap{overflow-x:visible!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table{width:100%!important;min-width:0!important;table-layout:fixed!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td){min-width:0!important;padding:8px 6px!important;box-sizing:border-box!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(1){width:4%!important;padding-left:4px!important;padding-right:4px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(2){width:11%!important;white-space:nowrap!important;text-align:left!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(3){width:23%!important;padding-left:12px!important;white-space:normal!important;overflow-wrap:anywhere!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(4){width:14%!important;white-space:nowrap!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(5){width:20%!important;text-align:center!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(6){width:11%!important;white-space:nowrap!important;text-align:right!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(7){width:17%!important;text-align:left!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table td.ca-bill-payment-vendor>span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table td.wave-actions-cell{min-width:0!important;padding-left:2px!important;padding-right:2px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table td.wave-actions-cell .wave-customer-actions{display:flex!important;gap:3px!important;justify-content:flex-start!important;flex-wrap:nowrap!important;white-space:nowrap!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-expense-payment-parent details{margin-top:3px;font-size:11px;line-height:1.25;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-expense-payment-parent details div{margin-top:2px;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-payment-readonly{display:inline-block;font-size:11px;line-height:1.2;color:var(--ca-muted,#64748b);white-space:normal;}
}

/* Bill Payments mobile cards: summary and amount share a row; details remain flush-left. */
@media (max-width:760px){
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody tr:not(.wave-filter-hidden):not(.ca-page-hidden){display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"select status" "payment paid" "date date" "vendor vendor" "actions actions"!important;column-gap:12px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td.wave-bulk-col{grid-area:select!important;padding:0 0 7px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(2){grid-area:status!important;position:static!important;width:auto!important;min-height:0!important;justify-self:end!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3){grid-area:payment!important;width:auto!important;min-width:0!important;padding:7px 0!important;margin:0!important;text-align:left!important;justify-self:stretch!important;align-self:start!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3)>*,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3) :is(strong,details,summary,div){grid-column:auto!important;margin-left:0!important;text-align:left!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(3) details{margin-top:3px!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(4){grid-area:date!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5){grid-area:vendor!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6){grid-area:paid!important;width:auto!important;padding:7px 0!important;display:block!important;justify-self:end!important;align-self:start!important;text-align:right!important;white-space:nowrap!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(6)::before{content:none!important;display:none!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(4),
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5){display:grid!important;grid-template-columns:minmax(120px,42%) minmax(0,1fr)!important;align-items:center!important;gap:12px!important;text-align:left!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(4)::before,
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5)::before{margin:0!important;text-align:left!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(5)>span{min-width:0!important;text-align:left!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(7){grid-area:actions!important;display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(7)::before{content:none!important;display:none!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .wave-table tbody td:nth-child(7) .wave-customer-actions{margin:0 auto!important;justify-content:center!important;}
}

/* Wide desktops put Actions at the far edge and return the released width to data columns. */
@media (min-width:1400px){
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(3){width:25%!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(5){width:21%!important;}
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-bill-payments-table :is(th,td):nth-child(7){width:14%!important;padding-left:8px!important;}
}

/* Sales Payments laptop parity: six visible columns and one-row actions. */
@media (min-width:761px){
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-wrap{overflow-x:visible!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table{width:100%!important;min-width:0!important;table-layout:fixed!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td){min-width:0!important;padding:8px 6px!important;box-sizing:border-box!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td):nth-child(1){width:4%!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td):nth-child(2){width:24%!important;overflow-wrap:anywhere!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td):nth-child(3){width:21%!important;overflow:hidden;text-overflow:ellipsis;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td):nth-child(4){width:12%!important;white-space:nowrap!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td):nth-child(5){width:11%!important;white-space:nowrap!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table :is(th,td):nth-child(6){width:28%!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table .wave-customer-actions,
  .wave-enhanced-list[data-table-kind="bill-payments"] .ca-expense-payment-parent .wave-customer-actions{display:flex!important;flex-wrap:nowrap!important;white-space:nowrap!important;gap:3px!important;}
}
@media (max-width:760px){
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table tbody td:nth-child(2)::before{content:"Invoice #";}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table tbody td:nth-child(3)::before{content:"Customer";}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table tbody td:nth-child(4)::before{content:"Date";}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table tbody td:nth-child(5)::before{content:"Amount";}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table tbody td:nth-child(6)::before{content:"Actions"!important;display:block!important;}
  .wave-enhanced-list[data-table-kind="payments"] .ca-sales-payments-table tbody td:nth-child(n+7){display:none!important;}
}


/* Issue #90 final correction: dark Multiple Payments surfaces. */
body.ca-dark-page .ca-pay-bills-page .ca-pay-bills-tools-clean,
html.ca-dark .ca-pay-bills-page .ca-pay-bills-tools-clean,
.wave-portal-shell[data-theme="dark"] .ca-pay-bills-page .ca-pay-bills-tools-clean{
  background:#101b2b!important;
  background-color:#101b2b!important;
  border-color:#26384f!important;
  color:#e5eefc!important;
  box-shadow:none!important;
}
body.ca-dark-page .ca-pay-bills-page .ca-pay-bills-tools-clean .wave-payment-pill,
html.ca-dark .ca-pay-bills-page .ca-pay-bills-tools-clean .wave-payment-pill,
.wave-portal-shell[data-theme="dark"] .ca-pay-bills-page .ca-pay-bills-tools-clean .wave-payment-pill{
  background:#132235!important;
  background-color:#132235!important;
  color:#e5eefc!important;
  border-color:#26384f!important;
}

body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tbody tr,
html.ca-dark .wave-receive-payment-page .wave-receive-payment-table tbody tr,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tbody tr{
  background:#0f172a!important;
  background-color:#0f172a!important;
}
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tbody td,
html.ca-dark .wave-receive-payment-page .wave-receive-payment-table tbody td,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tbody td{
  background:transparent!important;
  background-color:transparent!important;
  box-shadow:none!important;
}
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table tbody td[data-label="Allocate amount"],
html.ca-dark .wave-receive-payment-page .wave-receive-payment-table tbody td[data-label="Allocate amount"],
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table tbody td[data-label="Allocate amount"],
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table .wave-money-input-wrap,
html.ca-dark .wave-receive-payment-page .wave-receive-payment-table .wave-money-input-wrap,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table .wave-money-input-wrap{
  background:transparent!important;
  background-color:transparent!important;
  box-shadow:none!important;
}
body.ca-dark-page .wave-receive-payment-page .wave-receive-payment-table .wave-alloc-amount,
html.ca-dark .wave-receive-payment-page .wave-receive-payment-table .wave-alloc-amount,
.wave-portal-shell[data-theme="dark"] .wave-receive-payment-page .wave-receive-payment-table .wave-alloc-amount{
  background:#0b1220!important;
  background-color:#0b1220!important;
  border-color:#334155!important;
  box-shadow:none!important;
}


/* Issue #90 final correction: accessible Bill links in dark Multiple Bill Payments. */
html.ca-dark .ca-pay-bills-page .ca-pay-bills-table a,
body.ca-dark-page .ca-pay-bills-page .ca-pay-bills-table a,
.wave-portal-shell[data-theme="dark"] .ca-pay-bills-page .ca-pay-bills-table a{
  color:#38bdf8!important;
  text-decoration:underline!important;
  text-decoration-color:rgba(56,189,248,.55)!important;
  text-underline-offset:2px;
  font-weight:700;
}
html.ca-dark .ca-pay-bills-page .ca-pay-bills-table a:hover,
body.ca-dark-page .ca-pay-bills-page .ca-pay-bills-table a:hover,
.wave-portal-shell[data-theme="dark"] .ca-pay-bills-page .ca-pay-bills-table a:hover{
  color:#7dd3fc!important;
  text-decoration-color:#7dd3fc!important;
}

/* Phase A2 #110: only the Invoice Discount amount suppresses browser chrome.
 * Keep type=number for decimal validation and mobile numeric keyboards. */
.wave-invoice-form:not(#estimate-form) input.ca-invoice-discount-value{-moz-appearance:textfield;appearance:textfield;padding-right:10px!important}
.wave-invoice-form:not(#estimate-form) input.ca-invoice-discount-value::-webkit-inner-spin-button,
.wave-invoice-form:not(#estimate-form) input.ca-invoice-discount-value::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

/* Phase A2 #106: receipt View and print surfaces are deliberately separate. */
@media screen{
:is(.wave-portal-shell[data-theme="dark"],body.ca-dark-page,body.ca-dark,body.ca-theme-dark,html.ca-dark,html.ca-theme-dark) .ca-sales-payment-receipt .wave-receipt-footer-note{background:#f3f6fb!important;color:#334155!important}
}
@media print{
html body.wave-receipt-print-body .ca-sales-payment-receipt .wave-receipt-footer-note{background:#f3f6fb!important;color:#334155!important}
html body.wave-receipt-print-body :is(.wave-topbar,.ca-ui-topbar,.wave-sidebar,.ca-ui-sidebar,.wave-bottom-nav,.ca-mobile-bottom-nav,#wpadminbar){display:none!important;visibility:hidden!important;height:0!important;margin:0!important;padding:0!important}
html body.wave-receipt-print-body :is(.wave-portal-shell,.wave-wave-shell,.ca-invoicing-shell):before,
html body.wave-receipt-print-body :is(.wave-portal-shell,.wave-wave-shell,.ca-invoicing-shell):after{content:none!important;display:none!important;background:transparent!important}
html body.wave-receipt-print-body :is(.wave-portal-shell,.wave-wave-shell,.ca-invoicing-shell){background:#fff!important;background-image:none!important}
html body.wave-receipt-print-body .ca-supplier-payment-receipt{position:static!important;inset:auto!important;width:auto!important;max-width:100%!important;min-height:0!important;margin:0!important;box-sizing:border-box!important;background:#fff!important;background-image:none!important}
html body.wave-receipt-print-body .ca-supplier-payment-receipt .wave-receipt-sheet{width:auto!important;max-width:100%!important;margin:10mm auto 0!important;box-sizing:border-box!important;background:#fff!important;background-image:none!important;overflow:visible!important}
}

/* Issue #113 v4: fail closed when native print assets or pagination are not ready. */
.ca-invoice-print-failure-notice{display:none;}
@media print{
  html body.ca-invoice-live-print.ca-invoice-live-print-failed > *:not(.ca-invoice-print-failure-notice){display:none!important;visibility:hidden!important;}
  html body.ca-invoice-live-print.ca-invoice-live-print-failed > .ca-invoice-print-failure-notice.ca-invoice-live-print-host{
    display:block!important;
    visibility:visible!important;
    position:static!important;
    box-sizing:border-box!important;
    min-height:40mm!important;
    width:170mm!important;
    margin:32mm auto!important;
    padding:12mm!important;
    border:2px solid #b91c1c!important;
    background:#fff!important;
    color:#7f1d1d!important;
    font:700 16px/1.5 Arial,sans-serif!important;
    text-align:center!important;
  }
}
