/* Nutri Farmart Invoice Maker — light, clear (matches admin panel) */
:root {
  --im-bg: #f1f5f9;
  --im-surface: #ffffff;
  --im-border: #e2e8f0;
  --im-border-soft: #f1f5f9;
  --im-text: #1e293b;
  --im-muted: #64748b;
  --im-light: #94a3b8;
  --im-brand-blue: #3b82f6;
  --im-brand-orange: #f97316;
  --im-brand-sub: #64748b;
  --im-chrome-bg: #ffffff;
  --im-surface-2: #f8fafc;
  --im-input-bg: #ffffff;
  --im-accent: #5BA4FC;
  --im-accent-dark: #5897EE;
  --im-accent-soft: #eef5fe;
  --im-accent-muted: #d4e8fd;
  --im-danger: #FC3D39;
  --im-ok: #15803d;
  --im-radius: 14px;
  --im-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --im-shadow-md: 0 4px 20px rgba(15, 23, 42, 0.06);
  --im-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'DM Sans', sans-serif;
  --im-sidebar-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  font-family: var(--im-font);
  background: var(--im-bg);
  color: var(--im-text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; }

.im-autofill-trap {
  position: fixed;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

body.im-invoice-app .im-site-strip,
body.im-apk-embed .im-site-strip { display: none !important; }

body.im-invoice-app #app {
  min-height: 100vh;
  min-height: 100dvh;
}
body.im-invoice-app.im-web-admin {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
html:has(body.im-invoice-app.im-web-admin) {
  height: 100%;
  overflow: hidden;
}
body.im-invoice-app .app-bar {
  top: 0;
}
body.im-apk-embed .app-bar,
body.im-apk-embed .im-mobile-header {
  padding-top: 10px;
  padding-bottom: 10px;
  position: relative !important;
  top: auto !important;
}

/* APK: Capacitor adjustMarginsForEdgeToEdge=force insets WebView — no env() padding */
html:has(body.im-apk-embed),
html:has(body.im-apk-embed) body.im-apk-embed {
  height: 100%;
  overflow: hidden;
}
body.im-apk-embed {
  padding: 0;
  margin: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  min-height: 100%;
  background: var(--im-bg);
  --im-nav-h: 56px;
  --im-chrome-bottom: 72px;
  --im-font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
body.im-apk-embed #app {
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  padding-bottom: 0 !important;
  background: var(--im-bg);
  box-sizing: border-box;
}
body.im-apk-embed .ni-scroll,
body.im-apk-embed .add-item-scroll,
body.im-apk-embed .editor-scroll,
body.im-apk-embed .preview-scroll,
body.im-apk-embed .send-scroll,
body.im-apk-embed .settings-sub-scroll {
  max-width: none;
}
body.im-apk-embed .wa-direct {
  max-width: none;
  padding: 0;
  width: 100%;
}
body.im-apk-embed .im-mobile-shell {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  width: 100%;
  background: var(--im-bg);
}
body.im-apk-embed .im-mobile-header {
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  background: var(--im-chrome-bg);
  min-height: 58px;
}
body.im-apk-embed .app-title-logo {
  width: 50px;
  height: 50px;
}
body.im-apk-embed .brand-line1 {
  font-size: 17px;
}
body.im-apk-embed .brand-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--im-muted);
  opacity: 1;
}
body.im-dark.im-apk-embed .brand-sub {
  color: #c5d4e8;
}
body.im-apk-embed .app-title-brand {
  gap: 10px;
}
body.im-apk-embed:not(.im-dark) .im-mobile-header,
body.im-apk-embed:not(.im-dark) .app-bar--brand {
  background: #ffffff !important;
  color: #1e293b;
  border-bottom-color: #e2e8f0;
}
/* APK: never use .bottom-nav (global position:fixed breaks WebView) */
body.im-apk-embed .bottom-nav {
  display: none !important;
}
body.im-apk-embed .im-apk-tabbar {
  display: flex;
  flex-shrink: 0;
  width: 100%;
  min-height: var(--im-nav-h);
  margin: 0;
  padding: 6px 4px 12px;
  box-sizing: border-box;
  background: #ffffff;
  border-top: 1px solid var(--im-border);
  box-shadow: var(--im-shadow-md);
  z-index: 200;
}
body.im-apk-embed:not(.im-dark) .im-apk-tabbar {
  background: #ffffff !important;
  border-top-color: #e2e8f0;
}
body.im-apk-embed .im-apk-tabbar button {
  flex: 1;
  background: none;
  border: none;
  padding: 6px 4px;
  color: var(--im-muted);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
body.im-apk-embed .im-apk-tabbar button i {
  font-size: 20px;
  color: var(--im-light);
}
body.im-apk-embed .im-apk-tabbar button.active {
  color: var(--im-accent-dark);
  font-weight: 700;
}
body.im-apk-embed .im-apk-tabbar button.active i {
  color: var(--im-accent);
}
body.im-apk-embed .im-mobile-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--im-bg);
  box-sizing: border-box;
  padding-bottom: 0;
}
body.im-apk-embed .im-mobile-scroll.im-scroll-needed {
  overflow-y: auto;
}
body.im-apk-embed .app-content {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px 16px calc(16px + var(--im-chrome-bottom));
  overflow-x: hidden;
  box-sizing: border-box;
  background: var(--im-bg);
}
body.im-apk-embed .app-bar--brand .icon-btn {
  background: var(--im-accent-soft);
  border-color: var(--im-accent-muted);
  color: var(--im-accent-dark);
}
body.im-apk-embed .app-bar--brand .icon-btn:hover {
  background: var(--im-accent-muted);
  color: var(--im-accent-dark);
  border-color: var(--im-accent);
}
body.im-apk-embed .app-title-brand {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}
body.im-apk-embed .app-bar--brand {
  background: var(--im-chrome-bg, var(--im-surface));
  color: var(--im-text);
  border-bottom: 1px solid var(--im-border);
  box-shadow: var(--im-shadow);
}
body.im-apk-embed .im-bottom-spacer {
  display: none;
}
body.im-apk-embed .im-bottom-spacer--inline {
  display: block;
  height: 24px;
  flex-shrink: 0;
}
body.im-apk-embed .panel-form.sync-panel,
body.im-apk-embed .danger-zone {
  margin-bottom: 12px;
}
body.im-apk-embed .fab {
  position: absolute !important;
  right: 16px !important;
  bottom: calc(var(--im-nav-h) + 12px) !important;
  z-index: 60;
}
body.im-apk-embed .add-item-ftr {
  padding-bottom: 12px;
}
body.im-apk-embed .toast {
  bottom: calc(var(--im-nav-h) + 20px);
  z-index: 400;
}
body.im-apk-embed .sheet--menu {
  max-height: none;
  height: auto;
}
body.im-apk-embed .sheet--menu .sheet-body {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0 0 8px;
}
body.im-apk-embed #genericSheet.overlay {
  align-items: flex-end;
  padding-bottom: 0;
}
body.im-apk-embed #genericSheet.overlay.center {
  align-items: center;
  padding-bottom: 16px;
}
body.im-apk-embed .summary-2,
body.im-apk-embed .sync-alert,
body.im-apk-embed .inv-card:first-child {
  scroll-margin-top: 12px;
}
body.im-apk-embed .summary-2,
body.im-apk-embed .card-section,
body.im-apk-embed .panel-form,
body.im-apk-embed .toolbar-row,
body.im-apk-embed .filter-chips {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.im-site-strip {
  background: var(--im-surface);
  border-bottom: 1px solid var(--im-border);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: var(--im-shadow);
}
.im-site-strip a.im-brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--im-text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.im-site-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.im-site-brand-text { line-height: 1.2; }
.im-site-brand-text .brand-nutri { color: var(--im-brand-blue); }
.im-site-brand-text .brand-farmart { color: var(--im-brand-orange); }
.im-site-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--im-muted);
}
.im-site-strip a.im-brand > span:not(.brand-nutri):not(.brand-farmart) { color: inherit; }
.im-site-strip .im-home {
  margin-left: auto;
  font-size: 13px;
  color: var(--im-muted);
  text-decoration: none;
  font-weight: 500;
}
.im-site-strip .im-home:hover { color: var(--im-accent); }

#app {
  min-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.app-bar {
  background: var(--im-chrome-bg, var(--im-surface));
  color: var(--im-text);
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 52px;
  z-index: 50;
  border-bottom: 1px solid var(--im-border);
  box-shadow: var(--im-shadow);
  flex-shrink: 0;
}
/* Full-screen invoice / add-item overlays sit above site strip — no 52px gap */
.editor-full .app-bar,
.add-item-full .app-bar,
.new-item-full .app-bar,
#catalogItemPanel .app-bar,
.preview-full .app-bar {
  top: 0;
}
.app-bar--select {
  background: var(--im-accent);
  color: #fff;
  border-bottom-color: var(--im-accent-dark);
}
.app-bar--select .app-title,
.app-bar--select .icon-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}
.app-bar--select .icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.app-bar--select .icon-btn--danger {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
}
.items-sel-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}
.editor-full .app-bar h1,
.preview-full .app-bar h1 {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.app-bar h1.app-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--im-text);
  line-height: 1.3;
}

/* Themed icon buttons — web topbar, app-bar, overlays (override legacy inline greys) */
.im-invoice-app .icon-btn,
.im-apk-embed .icon-btn,
.overlay .icon-btn,
button.icon-btn {
  background: var(--im-accent-soft) !important;
  border: 1px solid var(--im-accent-muted) !important;
  color: var(--im-accent-dark) !important;
}
body.im-dark.im-invoice-app .icon-btn,
body.im-dark.im-apk-embed .icon-btn,
body.im-dark .overlay .icon-btn {
  color: var(--im-accent) !important;
}
.icon-btn {
  background: var(--im-accent-soft);
  border: 1px solid var(--im-accent-muted);
  color: var(--im-accent-dark);
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 2;
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.icon-btn i {
  pointer-events: none;
  line-height: 1;
}
.icon-btn:hover {
  background: var(--im-accent-muted);
  color: var(--im-accent-dark);
  border-color: var(--im-accent);
  transform: translateY(-1px);
}
.icon-btn:active {
  transform: translateY(0);
}
body.im-dark .icon-btn {
  background: var(--im-accent-soft);
  border-color: var(--im-accent-muted);
  color: var(--im-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
body.im-dark .icon-btn:hover {
  background: var(--im-accent-muted);
  color: var(--im-accent);
  border-color: var(--im-accent);
}

.app-bar .icon-btn i,
.fab i {
  pointer-events: none;
}
.app-bar-actions { display: flex; gap: 6px; margin-left: auto; }
#btnSyncCloud[hidden] { display: none !important; visibility: hidden !important; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.app-content {
  flex: 1;
  padding: 14px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.summary-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.summary-card {
  background: var(--im-surface);
  border-radius: var(--im-radius);
  padding: 14px;
  border: 1px solid var(--im-border);
  box-shadow: var(--im-shadow);
}
.summary-card .lbl {
  font-size: 11px;
  color: var(--im-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.summary-card .val {
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
  color: var(--im-text);
}
.summary-card .val.danger { color: var(--im-danger); }
.summary-hint {
  font-size: 12px;
  color: var(--im-muted);
  text-align: center;
  margin: -4px 0 12px;
  line-height: 1.5;
}
.import-promo-card {
  background: var(--im-accent-soft);
  border: 1px solid var(--im-accent-muted);
  border-radius: var(--im-radius);
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
}
.import-promo-card i {
  font-size: 28px;
  color: var(--im-accent);
  margin-bottom: 8px;
  display: block;
}
.import-promo-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--im-text);
  margin-bottom: 8px;
}
.import-promo-card .btn { margin-top: 4px; }

.sync-panel .sync-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sync-hint {
  font-size: 12px;
  color: var(--im-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.sync-status {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--im-bg);
  border-radius: 8px;
  border: 1px solid var(--im-border);
}
.sync-status.sync-ok { color: var(--im-ok); border-color: #bbf7d0; background: #f0fdf4; }
.sync-status.sync-err { color: var(--im-danger); border-color: #fecaca; background: #fef2f2; }
.sync-meta { font-size: 11px; color: var(--im-muted); }

.app-bar--brand {
  background: var(--im-chrome-bg, var(--im-surface));
  color: var(--im-text);
  border-bottom: 1px solid var(--im-border);
  box-shadow: var(--im-shadow);
}
.app-bar--brand .app-title-tab {
  color: var(--im-text);
  font-weight: 700;
}
.app-bar--brand .icon-btn {
  background: var(--im-accent-soft);
  border-color: var(--im-accent-muted);
  color: var(--im-accent-dark);
}
.app-bar--brand .icon-btn:hover {
  background: var(--im-accent-muted);
  color: var(--im-accent-dark);
  border-color: var(--im-accent);
}
.app-title-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  background: transparent;
  border-radius: 0;
  padding: 4px 0;
  box-shadow: none;
}
.app-title-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: none;
}
.brand-wordmark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}
.brand-line1 {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--im-brand-sub);
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.brand-nutri { color: var(--im-accent-dark) !important; }
.brand-farmart { color: var(--im-brand-orange) !important; }
.app-bar--brand h1.app-title:has(.app-title-brand) {
  text-align: left;
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--im-chrome-bg, var(--im-surface));
  border-top: 1px solid var(--im-border);
  display: flex;
  padding: 6px 0 env(safe-area-inset-bottom);
  z-index: 40;
  box-shadow: var(--im-shadow-md);
}
.bottom-nav button {
  flex: 1;
  background: none;
  border: none;
  padding: 6px 4px;
  color: var(--im-muted);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.bottom-nav button i { font-size: 20px; color: var(--im-light); }
.bottom-nav button.active {
  color: var(--im-accent-dark);
  font-weight: 700;
}
.bottom-nav button.active i { color: var(--im-accent); }
.sync-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--im-radius);
  padding: 12px;
  margin-bottom: 12px;
  font-size: 12px;
}
.sync-alert > i {
  color: #f57c00;
  font-size: 18px;
  margin-top: 2px;
}
.sync-alert p {
  margin: 4px 0 0;
  line-height: 1.45;
  color: var(--im-text);
}
.sync-alert .btn {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.filter-chips button {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--im-border);
  background: var(--im-surface);
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  color: var(--im-muted);
  cursor: pointer;
}
.filter-chips button.active {
  background: var(--im-accent);
  color: #fff;
  border-color: var(--im-accent);
}

.inv-card {
  background: var(--im-surface);
  border-radius: var(--im-radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--im-border);
  box-shadow: var(--im-shadow);
  cursor: pointer;
}
.inv-card .num { font-weight: 700; font-size: 15px; color: var(--im-text); }
.inv-card .client { font-size: 13px; color: var(--im-muted); margin-top: 2px; }
.inv-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.inv-card .bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.inv-card .amt { font-weight: 700; font-size: 16px; color: var(--im-accent-dark); }
.inv-card .meta { font-size: 12px; color: var(--im-muted); text-align: right; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.status-unpaid, .status-sent { background: #ffedd5; color: #c2410c; }
.status-paid { background: #dcfce7; color: #15803d; }
.status-partial { background: #dbeafe; color: #1d4ed8; }
.status-overdue { background: #fee2e2; color: #b91c1c; }
.status-draft { background: #f1f5f9; color: #64748b; }

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--im-accent);
  color: #fff;
  border: none;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
  cursor: pointer;
  z-index: 45;
}

.card-section {
  background: var(--im-surface);
  border-radius: var(--im-radius);
  margin-bottom: 12px;
  border: 1px solid var(--im-border);
  overflow: hidden;
  box-shadow: var(--im-shadow);
}
.card-section .sec-hdr {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--im-muted);
  text-transform: uppercase;
  background: var(--im-surface-2);
}
.row-link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-top: 1px solid var(--im-border);
  gap: 12px;
  color: inherit;
}
.row-link:first-of-type { border-top: none; }
.row-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.row-icon.blue { background: var(--im-accent-soft); color: var(--im-accent); }
.row-icon.orange { background: #ffedd5; color: #c2410c; }
.row-body { flex: 1; min-width: 0; }
.row-body strong { display: block; font-size: 15px; }
.row-body small { color: var(--im-muted); font-size: 12px; }

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--im-border);
  cursor: pointer;
}
.item-row:first-child { border-top: none; }
.item-row:hover { background: var(--im-accent-soft); }
.item-row-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.item-row-name {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
  min-width: 0;
}
.item-row .price { font-weight: 700; color: var(--im-accent-dark); white-space: nowrap; }
.item-row-chev { color: var(--im-light); font-size: 12px; flex-shrink: 0; }
.item-row--select { cursor: pointer; }
.item-catalog-cb {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--im-accent);
}
.item-search-bar {
  margin-bottom: 12px;
}
.item-search-bar input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--im-border);
  border-radius: 10px;
  background: var(--im-input-bg);
  color: var(--im-text);
}
.items-delete-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.items-delete-bar .item-clear-sel {
  border: none;
  background: transparent;
  color: var(--im-danger);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}
.items-delete-bar .item-clear-sel:hover { text-decoration: underline; }
.item-row--select .item-catalog-cb { order: 2; margin-left: 8px; }
.icon-btn--danger {
  color: var(--im-danger) !important;
  border-color: #fecaca !important;
  background: #fef2f2 !important;
}
.icon-btn--danger:hover:not(:disabled) {
  background: #fee2e2 !important;
}
.icon-btn--danger:disabled { opacity: 0.4; cursor: default; }

.panel-form { padding: 16px; }
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--im-muted);
  margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--im-border);
  border-radius: 8px;
  background: var(--im-input-bg);
  color: var(--im-text);
}
.form-group textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary { background: var(--im-accent); color: #fff; }
.btn-primary:hover { background: var(--im-accent-dark); }
.btn-outline { background: var(--im-surface); border: 1px solid var(--im-border); color: var(--im-text); }
.btn-danger { background: var(--im-danger); color: #fff; }
.btn-block { width: 100%; }

.danger-zone { border-color: #fecaca; background: #fef2f2; }
.danger-title { font-size: 15px; font-weight: 700; color: var(--im-danger); margin-bottom: 8px; }
.danger-desc { font-size: 13px; color: var(--im-muted); line-height: 1.5; margin-bottom: 14px; }

.toolbar-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.search-field { flex: 1; }
.search-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--im-border);
  border-radius: 10px;
  background: var(--im-input-bg);
  color: var(--im-text);
}
.search-field input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-results-button,
.search-field input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}
.btn-clear-search {
  width: 40px;
  height: 40px;
  border: 1px solid var(--im-border);
  border-radius: 10px;
  background: var(--im-input-bg);
  color: var(--im-accent);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
  box-sizing: border-box;
}
.filtered-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--im-surface);
  border: 1px dashed var(--im-accent);
  border-radius: var(--im-radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--im-text);
  box-shadow: var(--im-shadow);
  animation: fadeIn 0.2s ease-out;
}
.filtered-summary-bar .lbl {
  font-weight: 600;
  color: var(--im-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.filtered-summary-bar .val {
  font-weight: 700;
  color: var(--im-accent-dark);
  font-size: 14px;
}
.filtered-summary-bar .count-badge {
  background: var(--im-accent-soft);
  color: var(--im-accent-dark);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.empty { padding: 40px 20px; text-align: center; color: var(--im-muted); }
.empty i { font-size: 40px; opacity: 0.35; margin-bottom: 12px; display: block; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 260;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.overlay.open { display: flex; }
#importOverlay.open { display: flex; }
.overlay.center { align-items: center; padding: 16px; }

.sheet {
  background: var(--im-surface);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.overlay.center .sheet { border-radius: var(--im-radius); max-height: 85vh; }
.sheet-hdr {
  padding: 16px;
  border-bottom: 1px solid var(--im-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sheet-hdr h2 { flex: 1; font-size: 17px; font-weight: 700; }
.sheet-hdr .icon-btn {
  background: var(--im-accent-soft);
  border: 1px solid var(--im-accent-muted);
  color: var(--im-accent-dark);
}
body.im-dark .sheet-hdr .icon-btn {
  color: var(--im-accent);
}
.sheet-hdr .icon-btn:hover {
  background: var(--im-accent-muted);
  border-color: var(--im-accent);
  color: var(--im-accent-dark);
}
body.im-dark .sheet-hdr .icon-btn:hover {
  color: var(--im-accent);
}
.sheet-body { flex: 1; overflow-y: auto; padding: 16px; }
body.im-apk-embed .overlay.center.open,
#genericSheet.im-sheet--login.overlay.center.open {
  align-items: flex-end;
  padding-bottom: calc(12px + var(--im-sheet-kb-inset, 0px));
}
body.im-apk-embed .overlay.center .sheet,
#genericSheet.im-sheet--login.overlay.center .sheet {
  max-height: min(85vh, calc(100dvh - var(--im-sheet-kb-inset, 0px) - 24px));
}
body.im-apk-embed .overlay.center .sheet-body,
#genericSheet.im-sheet--login .sheet-body {
  -webkit-overflow-scrolling: touch;
}
#genericSheet.im-sheet--login.overlay.center.open {
  align-items: flex-end;
  padding: 0 12px calc(12px + var(--im-sheet-kb-inset, 0px));
}
#genericSheet.im-sheet--login .sheet.im-sheet--login {
  display: flex;
  flex-direction: column;
  max-height: min(85dvh, calc(100dvh - var(--im-sheet-kb-inset, 0px) - 16px));
}
#genericSheet.im-sheet--login .sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 8px;
  padding-bottom: calc(8px + var(--im-sheet-kb-inset, 0px));
}
.im-sheet-login-actions {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--im-border);
  background: var(--im-surface);
  position: sticky;
  bottom: 0;
  z-index: 2;
}

/* Native APK — full-screen login (keyboard-safe) */
.login-full {
  position: fixed;
  inset: 0;
  z-index: 265;
  background: var(--im-bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 100dvh;
}
.login-full.open { display: flex; }
body.im-apk-embed .login-full.open {
  justify-content: flex-start;
  padding-top: env(safe-area-inset-top, 0px);
}
.login-full-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--im-surface);
  border-bottom: 1px solid var(--im-border);
  flex-shrink: 0;
}
.login-full-hdr h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.login-full-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.login-full-form {
  flex: 0 0 auto;
  padding: 16px 16px 8px;
  width: 100%;
}
.login-full-spacer {
  flex: 1 1 auto;
  min-height: 0;
}
.login-full-actions {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px) + var(--im-login-kb-inset, 0px));
  border-top: 1px solid var(--im-border);
  background: var(--im-surface);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}
.login-full-actions .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
body.im-apk-embed #genericSheet.im-sheet--login.overlay.center.open {
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(12px + var(--im-sheet-kb-inset, 0px));
}
#genericSheet.im-sheet--login.overlay.center.open.im-sheet--kb-active {
  align-items: flex-start;
  justify-content: flex-start;
}

.editor-full, .preview-full {
  position: fixed;
  inset: 0;
  background: var(--im-bg);
  z-index: 215;
  display: none;
  flex-direction: column;
}
body.im-apk-embed .editor-full,
body.im-apk-embed .preview-full,
body.im-apk-embed .invoice-detail-full,
body.im-apk-embed .add-item-full,
body.im-apk-embed .new-item-full {
  padding-bottom: var(--im-safe-bottom);
}
.editor-full.open, .preview-full.open { display: flex; }
.preview-full { z-index: 220; }
.editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.editor-ftr {
  padding: 12px 16px;
  background: var(--im-surface);
  border-top: 1px solid var(--im-border);
  display: flex;
  gap: 10px;
}
.editor-ftr .btn { flex: 1; }

.hero-inv {
  background: var(--im-surface);
  border-radius: var(--im-radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--im-border);
}
.hero-inv .big-num-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--im-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.hero-inv .big-num-input {
  display: block;
  width: 100%;
  font-size: 28px;
  font-weight: 800;
  color: var(--im-accent-dark);
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 4px 8px;
  margin: 0 0 8px -8px;
  box-sizing: border-box;
}
.hero-inv .big-num-input:focus {
  outline: none;
  border-color: var(--im-accent);
  background: var(--im-input-bg);
}
.hero-inv .dates { font-size: 13px; color: var(--im-muted); margin-top: 6px; line-height: 1.6; }

.line-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0;
}
.line-table-scroll .line-table {
  margin: 0;
  min-width: 520px;
}
.line-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.line-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--im-muted);
  text-align: left;
  padding: 8px 4px;
  border-bottom: 2px solid var(--im-border);
}
.line-table td { padding: 6px 4px; border-bottom: 1px solid var(--im-border); vertical-align: middle; }
.line-table td:nth-child(4),
.line-table th:nth-child(4) { text-align: center; }
.line-table td:nth-child(4) input.li-qty { text-align: center; }
.line-table .li-del-cell {
  width: 48px;
  min-width: 48px;
  padding: 4px;
  text-align: center;
}
.line-table .li-remove {
  min-width: 40px;
  min-height: 40px;
  font-size: 22px;
  line-height: 1;
  color: var(--im-danger) !important;
  border-color: #fecaca;
  background: #fef2f2;
}
.line-table .li-remove:hover {
  background: #fee2e2;
  border-color: var(--im-danger);
}
.line-table input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--im-border);
  border-radius: 6px;
}

.add-line-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--im-surface-2);
  border: 1px solid var(--im-border);
  border-radius: 10px;
  color: var(--im-accent);
  font-weight: 600;
  cursor: pointer;
  margin: 8px 0;
}
.add-line-btn--primary {
  background: var(--im-accent-soft);
  border: 2px solid var(--im-accent);
  font-size: 15px;
}
.im-build-hint {
  font-size: 11px;
  color: var(--im-muted);
  text-align: center;
  margin: 0 0 4px;
}
.im-hint-bar {
  font-size: 12px;
  line-height: 1.5;
  color: var(--im-muted);
  background: var(--im-accent-soft);
  border: 1px solid var(--im-accent-muted);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.im-hint-bar strong { color: var(--im-accent-dark); }
.items-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 4px;
  border-top: 1px solid var(--im-border);
  margin-top: 4px;
}
.items-subtotal-row .lbl { font-weight: 700; color: var(--im-text); }
.items-subtotal-row .val { font-weight: 800; color: var(--im-text); font-size: 16px; }

.add-item-full {
  position: fixed;
  inset: 0;
  background: var(--im-bg);
  z-index: 215;
  display: none;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
}
.add-item-full.open { display: flex; }
.add-item-full > .app-bar {
  flex-shrink: 0;
  background: var(--im-surface);
  color: var(--im-text);
  border-bottom: 1px solid var(--im-border);
  top: 0;
}
.add-item-full > .app-bar .app-title {
  color: var(--im-text);
}
.add-item-full > .app-bar .icon-btn {
  color: var(--im-accent-dark);
  border-color: var(--im-accent-muted);
  background: var(--im-accent-soft);
}
.add-item-full > .app-bar .icon-btn:hover {
  background: var(--im-accent-muted);
  color: var(--im-accent-dark);
  border-color: var(--im-accent);
}
.add-item-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 16px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.pick-search-wrap { margin-bottom: 10px; }
.pick-search-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--im-muted);
  line-height: 1.4;
}
.pick-search-wrap input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--im-border);
  border-radius: 10px;
  background: var(--im-input-bg);
  color: var(--im-text);
}
.new-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  box-shadow: var(--im-shadow);
  cursor: pointer;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--im-text);
}
.new-item-card:hover { border-color: var(--im-accent-muted); background: var(--im-accent-soft); }
.new-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--im-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.item-list-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--im-muted);
  margin: 4px 2px 8px;
}
.item-picker-list {
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  overflow: hidden;
  box-shadow: var(--im-shadow);
}
.item-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.im-items-toolbar {
  padding: 0 4px 4px;
}
.item-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--im-border);
  border-radius: 8px;
  background: var(--im-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--im-text);
  cursor: pointer;
}
.item-sort-btn:hover { border-color: var(--im-accent); color: var(--im-accent); }
.item-sort-btn .fa-chevron-down { font-size: 10px; opacity: 0.5; }
.item-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--im-muted);
  cursor: pointer;
  user-select: none;
}
.item-select-all input { width: 18px; height: 18px; accent-color: var(--im-accent); }
.item-clear-sel {
  border: none;
  background: transparent;
  color: var(--im-danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}
.item-clear-sel:hover { text-decoration: underline; }
.add-item-ftr {
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--im-surface);
  border-top: 2px solid var(--im-accent-muted);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  box-shadow: 0 -4px 16px rgba(25, 118, 210, 0.12);
  z-index: 5;
}
.add-item-ftr .btn-primary {
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
  background: var(--im-accent);
  border-color: var(--im-accent-dark);
}
.add-item-ftr .btn-primary:disabled {
  opacity: 0.45;
  background: #90a4ae;
  border-color: #78909c;
}
.add-item-ftr-hint {
  font-size: 12px;
  color: var(--im-muted);
  text-align: center;
  margin: 0 0 8px;
}
.add-item-ftr--active {
  border-top-color: var(--im-accent);
  background: var(--im-surface);
}
.add-item-ftr--active .add-item-ftr-hint { display: none; }
.item-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--im-border);
  background: var(--im-surface);
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  color: var(--im-text);
}
.item-pick-row--check {
  cursor: pointer;
  gap: 12px;
}
.item-pick-row--check .item-pick-cb {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--im-accent);
  cursor: pointer;
}
.item-pick-row:last-child { border-bottom: none; }
.item-pick-row:hover { background: var(--im-accent-soft); }
.item-pick-row .name { font-weight: 600; color: var(--im-text); flex: 1; padding-right: 8px; }
.item-pick-row .price { font-weight: 600; color: var(--im-text); white-space: nowrap; }

.sheet-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--im-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 8px 0 4px;
}
.req { color: var(--im-danger); }
.line-amount-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin: 8px 0;
  border-top: 1px dashed var(--im-border);
  font-size: 15px;
}
.line-amount-preview strong { color: var(--im-danger); font-size: 18px; }
.save-catalog-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--im-muted);
  margin-bottom: 14px;
  cursor: pointer;
}

/* New Item — app-style full screen */
.new-item-full {
  position: fixed;
  inset: 0;
  background: var(--im-bg);
  z-index: 215;
  display: none;
  flex-direction: column;
}
.new-item-full.open { display: flex; }
.ni-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 28px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.ci-delete-wrap {
  margin-top: 20px;
  padding-bottom: 8px;
}
.ci-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  background: var(--im-surface);
  box-shadow: var(--im-shadow);
  font-size: 16px;
  font-weight: 600;
  color: var(--im-danger);
  cursor: pointer;
}
.ci-delete-btn:hover { background: #fff5f5; }
.ci-delete-btn:active { opacity: 0.88; }
.ni-sec-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--im-muted);
  margin: 12px 4px 8px;
}
.ni-card {
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  box-shadow: var(--im-shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.ni-card--pad { padding: 12px 14px; }
.ni-block-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--im-text);
  padding: 14px 14px 0;
}
.ni-input-block {
  width: 100%;
  border: none;
  padding: 10px 14px 14px;
  font-size: 15px;
  background: transparent;
  color: var(--im-text);
  outline: none;
}
.ni-input-block::placeholder { color: var(--im-light); }
.ni-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--im-border);
  min-height: 52px;
}
.ni-row:last-child { border-bottom: none; }
.ni-row--pick {
  width: 100%;
  border: none;
  background: var(--im-surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.ni-row--pick:hover { background: var(--im-accent-soft); }
.ni-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--im-text);
  flex-shrink: 0;
}
.ni-val {
  font-size: 14px;
  color: var(--im-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ni-val i { font-size: 11px; opacity: 0.6; }
.ni-input-right {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--im-text);
  text-align: right;
  width: 120px;
  outline: none;
}
.ni-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ni-suffix {
  font-size: 14px;
  color: var(--im-muted);
  min-width: 1.2em;
}
.ni-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff7ed;
  border-top: 1px dashed var(--im-border);
  margin-top: 0;
}
.ni-amount-row .ni-label { font-weight: 700; }
.ni-amount-row strong {
  font-size: 18px;
  font-weight: 800;
  color: #ea580c;
}
.ni-textarea {
  width: 100%;
  border: none;
  resize: vertical;
  min-height: 88px;
  font-size: 15px;
  color: var(--im-text);
  outline: none;
  font-family: inherit;
}
.ni-textarea::placeholder { color: var(--im-light); }
.ni-save-btn {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--im-accent);
  padding: 8px 4px;
  cursor: pointer;
  min-width: 48px;
}
.ni-save-btn:disabled {
  color: var(--im-light);
  cursor: default;
}
.ni-pick-opt.active {
  background: var(--im-accent-soft);
  border-left: 3px solid var(--im-accent);
}

.totals-bar {
  background: var(--im-accent);
  color: #fff;
  border-radius: var(--im-radius);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.totals-bar .val { font-size: 20px; font-weight: 800; }

/* Invoice on-screen preview (PDF/print use inv-a4 export separately) */
.inv-detail-preview .invoice-paper.inv-ref:not(.inv-a4),
.preview-scroll .invoice-paper.inv-ref:not(.inv-a4) {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

.invoice-paper-viewer {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: #1a2332;
  display: none;
  flex-direction: column;
}
.invoice-paper-viewer.open { display: flex; }
body.im-paper-viewer-open { overflow: hidden; }
.ipv-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--im-surface);
  border-bottom: 1px solid var(--im-border);
  flex-shrink: 0;
}
.ipv-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--im-text);
}
.ipv-zoom-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--im-muted);
}
.ipv-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #cfd8dc 0%, #eceff1 100%);
}
.ipv-pan {
  transform-origin: top center;
  transition: transform 0.05s ease-out;
}
.ipv-pan .invoice-paper {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}
.invoice-paper-viewer .ipv-editor-ftr {
  flex-shrink: 0;
}
.settings-sync-actions--sheet {
  margin: 0 -4px 4px;
}
.settings-sync-actions--sheet .settings-sync-row {
  margin-bottom: 8px;
  border-radius: var(--im-radius, 10px);
}
.settings-sync-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-sync-row {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 2px;
}
.settings-sync-row .settings-row-meta {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.settings-sync-row {
  position: relative;
  padding-right: 44px;
}
.settings-sync-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-right: 8px;
}
.settings-sync-row-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--im-text);
}
.settings-sync-row-sub {
  font-size: 11px;
  color: var(--im-muted);
  font-weight: 500;
}
.settings-sync-hint,
.settings-sync-intro {
  font-size: 12px;
  color: var(--im-muted);
  padding: 0 16px 8px;
  line-height: 1.5;
}
.settings-sync-intro {
  padding-bottom: 12px;
}
.settings-row.settings-row--busy {
  opacity: 0.72;
}
.settings-row.settings-row--busy .settings-icon.fa-spin {
  animation: fa-spin 1s infinite linear;
}
.settings-sync-status .sync-status {
  margin: 0;
  font-size: 12px;
  min-height: 2.75em;
}
.im-sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  pointer-events: all;
}
.im-sync-overlay.open {
  display: flex;
}
.im-sync-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 28px;
  border-radius: 14px;
  background: var(--im-surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  max-width: min(320px, 90vw);
  text-align: center;
}
.im-sync-overlay-card i {
  font-size: 28px;
  color: var(--im-accent, #0d9488);
}
.im-sync-overlay-card p {
  margin: 0;
  font-size: 14px;
  color: var(--im-text);
  line-height: 1.45;
}
body.im-dark .im-sync-overlay {
  background: rgba(0, 0, 0, 0.62);
}
.settings-row:disabled {
  opacity: 0.65;
  pointer-events: none;
}
.inv-detail-preview {
  cursor: pointer;
}
.inv-detail-preview .inv-detail-zoom-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--im-muted);
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 5;
  pointer-events: none;
}

.invoice-detail-full {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: var(--im-bg);
  display: none;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.invoice-detail-full.open { display: flex; }
.invoice-detail-full > .app-bar { top: 0; flex-shrink: 0; }
.inv-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 12px 14px 16px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.inv-detail-scroll.im-scroll-needed {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.inv-detail-scroll--full {
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: none;
  background: var(--im-bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.inv-detail-scroll--full.im-scroll-needed {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.inv-detail-preview-wrap {
  flex-shrink: 0;
  padding: 8px 14px 12px;
  display: flex;
  justify-content: center;
  background: var(--im-bg);
}
.inv-detail-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
  padding: 12px 8px;
  background: var(--im-bg);
  border-radius: 0;
  overflow: hidden;
  height: min(48vh, 420px);
  min-height: 260px;
  width: 100%;
  max-width: 520px;
  position: relative;
}
.inv-detail-zoom-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--im-shadow);
  z-index: 10;
  cursor: pointer;
  color: var(--im-text);
}
.inv-detail-paper-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.inv-detail-body {
  flex-shrink: 0;
  background: var(--im-surface);
  padding: 16px 20px calc(20px + var(--im-safe-bottom, 0px));
  border-top: 1px solid var(--im-border);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.inv-detail-summary-new { margin: 0 0 12px; padding: 0; }
.inv-detail-amt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.inv-detail-total {
  font-size: 26px;
  font-weight: 700;
  color: var(--im-text);
}
.inv-detail-meta-row,
.inv-detail-client-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.inv-detail-client-row { margin-bottom: 12px; align-items: baseline; }
.inv-detail-number {
  font-size: 16px;
  font-weight: 600;
  color: var(--im-accent-dark);
}
.inv-detail-due-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--im-accent-dark);
}
.inv-detail-client-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--im-text);
}
.inv-detail-due-date {
  font-size: 14px;
  color: var(--im-muted);
}
.inv-detail-status {
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
}
.inv-detail-status i {
  font-size: 10px;
  margin-left: 4px;
}
.inv-send-row--detail {
  margin-bottom: 14px;
}
.inv-send-row--detail .inv-send-btn {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
}
.inv-detail-actions--bar {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-top: 0;
  padding-top: 4px;
}
body.im-web-admin .invoice-detail-full--web.open,
body.im-web-admin .invoice-detail-full.open {
  display: flex;
  flex-direction: column;
}
body.im-web-admin .invoice-detail-full--web .inv-detail-scroll--full {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
body.im-web-admin .invoice-detail-full--web .inv-detail-scroll--full.im-scroll-needed {
  overflow-y: auto;
}
body.im-web-admin .invoice-detail-full--web .inv-detail-preview-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 20px 4px;
  overflow: hidden;
}
body.im-web-admin .inv-detail-preview {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  max-width: min(720px, 100%);
  width: 100%;
  margin: 0 auto;
}
body.im-web-admin .inv-detail-preview .inv-detail-zoom-hint {
  display: none;
}
body.im-web-admin .invoice-detail-full--web .inv-detail-body {
  flex-shrink: 0;
  max-width: min(720px, 100%);
  margin: 0 auto;
  width: 100%;
  padding: 8px 20px 12px;
}
body.im-web-admin .inv-detail-body {
  max-width: min(720px, 100%);
}
body.im-web-admin .inv-detail-actions--bar {
  margin-top: 0;
  padding-top: 0;
}
.preview-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #eceff1;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.inv-detail-summary { padding: 16px; margin-bottom: 12px; }
.inv-detail-amt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.inv-detail-amt .lbl { font-size: 13px; color: var(--im-muted); }
.inv-detail-amt .val { font-size: 22px; font-weight: 800; color: var(--im-accent-dark); }
.inv-detail-status { margin-bottom: 8px; }
.inv-detail-balance { font-size: 13px; color: var(--im-danger); margin-bottom: 6px; }
.inv-detail-client { font-size: 15px; margin-bottom: 4px; }
.inv-detail-due { font-size: 13px; color: var(--im-muted); }
.inv-send-btn { margin-bottom: 14px; min-height: 48px; font-size: 16px; }
.inv-detail-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.inv-detail-actions--bar .inv-act-btn-new {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.inv-act-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid var(--im-border);
  border-radius: 12px;
  background: var(--im-surface);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--im-text);
}
.inv-act-btn i { font-size: 18px; color: var(--im-accent); }
.inv-act-btn:hover { background: var(--im-accent-soft); border-color: var(--im-accent-muted); }
.inv-more-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--im-border);
  background: var(--im-surface);
  color: var(--im-text);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.line-drag-hint {
  font-size: 11px;
  color: var(--im-muted);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.line-table--reorder .li-grip-th { width: 28px; min-width: 28px; padding: 0; }
.line-table--reorder .li-grip-th,
.line-table--reorder .li-grip-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--im-surface);
}
.line-table--reorder thead .li-grip-th,
.line-table--reorder thead .li-num-th {
  background: var(--im-surface);
}
.line-table--reorder .li-num-th,
.line-table--reorder .li-num-cell {
  position: sticky;
  left: 28px;
  z-index: 2;
  background: var(--im-surface);
  min-width: 32px;
}
.line-table--reorder .li-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.line-table--reorder .li-grip .fa-grip-vertical {
  font-size: 14px;
}
.line-table--reorder .li-num-th { width: 32px; padding: 0 4px; text-align: center; }
.line-table .li-amt-th,
.line-table .li-amt-cell {
  width: 76px;
  min-width: 76px;
  text-align: right;
  white-space: nowrap;
  padding-right: 6px;
}
.li-amount {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--im-text);
}
.li-num-cell { width: 32px; padding: 4px 2px; vertical-align: middle; text-align: center; }
.li-num {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--im-text);
  min-width: 1.5em;
  line-height: 1.2;
}
.li-grip-cell { width: 28px; padding: 4px 2px; vertical-align: middle; }
.li-grip {
  border: none;
  background: var(--im-surface-2);
  color: var(--im-muted);
  border-radius: 6px;
  width: 28px;
  height: 32px;
  cursor: grab;
  touch-action: none;
}
.li-grip:active { cursor: grabbing; }
tr.line-row-lift {
  background: #f0fdfa;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
  position: relative;
  z-index: 2;
}

.settings-menu { padding: 8px 0; }
.settings-section-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--im-muted);
  padding: 12px 16px 6px;
  margin: 0;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-top: 1px solid var(--im-border);
  background: var(--im-surface);
  color: var(--im-text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  gap: 12px;
}
.settings-row-meta {
  font-size: 12px;
  color: var(--im-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.settings-row-meta > i,
.settings-row-meta i.settings-icon {
  color: var(--im-accent-dark);
  font-size: 14px;
}
body.im-dark .settings-row-meta > i,
body.im-dark .settings-row-meta i.settings-icon {
  color: var(--im-accent);
}
.settings-row-meta i.settings-icon--danger {
  color: var(--im-danger) !important;
}
.settings-hint {
  font-size: 12px;
  color: var(--im-muted);
  padding: 12px 16px 8px;
  line-height: 1.5;
  margin: 0;
}
.settings-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-top: 1px solid var(--im-border);
  background: var(--im-surface);
  color: var(--im-text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.settings-pick-row.active {
  background: var(--im-accent-soft);
  color: var(--im-accent-dark);
  font-weight: 600;
  border-left: 3px solid var(--im-accent);
}
.settings-row--toggle {
  cursor: default;
}
.settings-row--toggle .im-switch {
  --im-sw-w: 40px;
  --im-sw-h: 24px;
  --im-sw-knob: 20px;
  --im-sw-pad: 2px;
  position: relative;
  display: inline-flex;
  align-items: center;
  width: var(--im-sw-w);
  height: var(--im-sw-h);
  flex-shrink: 0;
}
.settings-row--toggle input[type="checkbox"],
.im-switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  accent-color: transparent;
  background: transparent;
  border: none;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}
.im-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--im-border);
  border-radius: var(--im-sw-h, 24px);
  transition: background 0.2s ease;
  pointer-events: none;
  z-index: 1;
}
.im-switch-slider::before {
  content: '';
  position: absolute;
  width: var(--im-sw-knob, 20px);
  height: var(--im-sw-knob, 20px);
  left: var(--im-sw-pad, 2px);
  top: var(--im-sw-pad, 2px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}
.im-switch input:checked + .im-switch-slider {
  background: var(--im-accent);
}
.im-switch input:checked + .im-switch-slider::before {
  transform: translateX(calc(var(--im-sw-w, 40px) - var(--im-sw-knob, 20px) - var(--im-sw-pad, 2px) * 2));
}
body.im-dark .im-switch-slider {
  background: #3a4658;
}
body.im-dark .im-switch input:checked + .im-switch-slider {
  background: var(--im-accent);
}
.app-bar-text-btn {
  border: none;
  background: transparent;
  color: var(--im-accent);
  font-size: 16px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}
.app-bar-spacer { width: 44px; flex-shrink: 0; }
.settings-full, .send-full {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  flex-direction: column;
  background: var(--im-bg, #f1f5f9);
}
.settings-full.open, .send-full.open { display: flex; }
.settings-sub-scroll, .send-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--im-chrome-bottom, 68px) + 12px);
}
.biz-list-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.biz-card {
  position: relative;
  border: 2px solid var(--im-border);
  border-radius: 12px;
  background: var(--im-surface);
  padding: 24px 16px 20px;
  text-align: center;
  cursor: pointer;
}
.biz-card--active {
  border-color: var(--im-brand-blue);
  background: var(--im-accent-soft);
}
.biz-card--add { border-style: dashed; }
.biz-card-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
}
.biz-card-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.biz-card-logo-img { width: 100%; height: 100%; object-fit: cover; }
.biz-card-initial { font-size: 28px; font-weight: 700; }
.biz-card-name { font-size: 16px; font-weight: 600; color: var(--im-text); }
.biz-vip-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}
.biz-edit-logo-wrap { text-align: center; padding: 20px; }
.biz-logo-upload {
  position: relative;
  display: inline-block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.biz-logo-preview-host { display: inline-block; }
.biz-logo-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.biz-logo-placeholder {
  width: 120px;
  height: 120px;
  border: 2px dashed var(--im-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--im-muted);
  gap: 8px;
}
.biz-logo-preview { width: 120px; height: 120px; object-fit: contain; border-radius: 12px; }
.biz-field-list { padding: 0; }
.biz-field-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--im-border);
  margin: 0;
}
.biz-field-row:first-child { border-top: none; }
.biz-field-lbl {
  flex: 0 0 110px;
  font-size: 14px;
  color: var(--im-muted);
  padding-top: 10px;
}
.biz-field-lbl em { color: var(--im-danger); font-style: normal; }
.biz-field-row input,
.biz-field-row textarea {
  flex: 1;
  border: none;
  font-size: 15px;
  text-align: right;
  padding: 8px 0;
  background: transparent;
}
.biz-field-row--ta { align-items: flex-start; }
.biz-field-row--ta textarea { text-align: right; min-height: 56px; resize: vertical; }
.format-pick-list { margin: 0 -4px; }
.picker-ftr {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding: 16px 8px 4px;
  border-top: 1px solid var(--im-border);
  margin-top: 12px;
}
.picker-ftr-btn {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--im-accent);
  cursor: pointer;
  padding: 8px 12px;
}
.picker-ftr-btn--primary { color: var(--im-accent-dark); }
.send-preview-wrap {
  padding: 12px;
  background: #e2e8f0;
}
.send-preview-wrap .invoice-paper { margin: 0 auto; }
.send-ftr {
  display: flex;
  gap: 12px;
  padding: 12px 16px calc(12px + var(--im-safe-bottom, 0px));
  background: var(--im-chrome-bg, var(--im-surface));
  border-top: 1px solid var(--im-border);
}
.send-ftr-btn {
  flex: 1;
  min-height: 48px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.send-full { z-index: 235; }
.sortable-list { display: flex; flex-direction: column; }
.sortable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--im-border);
}
.sortable-row:first-child { border-top: none; }
.sortable-row .pm-text {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--im-border);
  border-radius: 8px;
}
.sort-grip {
  border: none;
  background: var(--im-surface-2);
  color: var(--im-muted);
  border-radius: 6px;
  width: 32px;
  height: 36px;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}
.sortable-lift {
  background: #f0fdfa;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.15);
}
.item-row .sort-grip { margin-right: 4px; }
.item-row { display: flex; align-items: center; gap: 8px; }
.item-row .item-row-main { flex: 1; min-width: 0; }

.report-card {
  background: var(--im-surface);
  border-radius: var(--im-radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--im-border);
}
.client-bar .bar {
  height: 6px;
  background: var(--im-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.client-bar .fill { height: 100%; background: var(--im-accent); }

.mark-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: none;
  background: none;
  border-bottom: 1px solid var(--im-border);
  font-size: 15px;
  cursor: pointer;
}
.mark-opt.active { background: var(--im-accent-soft); color: var(--im-accent-dark); font-weight: 600; }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #27272a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: 0.25s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.im-load-err {
  padding: 24px;
  text-align: center;
  color: var(--im-danger);
  max-width: 400px;
  margin: 2rem auto;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .fab { right: calc(50% - 320px + 20px); }
  body.im-apk-embed .fab { right: 16px !important; }
}

/* Web — same shell as Nutri Farmart Admin Panel (screenshot 1) */
body.im-web-admin {
  --im-bg: #f1f5f9;
}
body.im-web-admin.im-dark {
  --im-bg: #0b1118;
}
body.im-web-admin.im-dark .im-sidebar-brand {
  background: var(--im-surface) !important;
}
body.im-web-admin #app {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}
body.im-web-admin .im-admin-layout {
  display: flex;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
body.im-web-admin .im-admin-sidebar {
  width: var(--im-sidebar-w);
  min-height: 100vh;
  background: var(--im-surface);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  border-right: 1px solid var(--im-border);
  box-shadow: var(--im-shadow-md);
  transition: width 0.3s;
}
body.im-web-admin .im-sidebar-brand {
  padding: 1.25rem 1.1rem;
  border-bottom: 1px solid var(--im-border);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  display: flex;
  align-items: center;
  gap: 12px;
}
body.im-web-admin .im-sidebar-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
body.im-web-admin .im-sidebar-brand h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--im-text);
  line-height: 1.2;
}
body.im-web-admin .im-sidebar-brand .brand-accent { color: var(--im-accent); }
body.im-web-admin .im-sidebar-brand .brand-farmart { color: var(--im-text); font-weight: 700; }
body.im-web-admin .im-sidebar-brand small {
  color: var(--im-light);
  font-size: 0.75rem;
  font-weight: 500;
}
body.im-web-admin .im-sidebar-nav {
  padding: 0.65rem 0.75rem 1.25rem;
}
body.im-web-admin .im-sidebar-section {
  color: var(--im-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 0.85rem 0.35rem;
}
body.im-web-admin .im-sidebar-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.58rem 0.85rem;
  color: var(--im-muted);
  text-decoration: none;
  border-radius: 10px;
  margin: 2px 0;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
body.im-web-admin .im-sidebar-link i {
  width: 20px;
  margin-right: 10px;
  font-size: 0.95rem;
  color: var(--im-light);
  text-align: center;
}
body.im-web-admin .im-sidebar-link:hover {
  background: var(--im-border-soft);
  color: var(--im-text);
}
body.im-web-admin .im-sidebar-link:hover i { color: var(--im-accent); }
body.im-web-admin .im-sidebar-link.active {
  background: var(--im-accent-soft);
  color: var(--im-accent-dark);
  border-color: var(--im-accent-muted);
  font-weight: 600;
  box-shadow: var(--im-shadow);
}
body.im-web-admin .im-sidebar-link.active i { color: var(--im-accent); }
body.im-web-admin .im-admin-main {
  margin-left: var(--im-sidebar-w);
  flex: 1;
  min-height: 0;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--im-bg);
  min-width: 0;
  overflow: hidden;
}
body.im-web-admin .im-admin-topbar {
  background: var(--im-surface);
  padding: 0.8rem 1.5rem;
  box-shadow: var(--im-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--im-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
body.im-web-admin .im-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.im-web-admin .im-topbar-title {
  margin: 0;
  font-weight: 600;
  color: var(--im-text);
  font-size: 1rem;
}
body.im-web-admin .im-topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
body.im-web-admin .im-admin-topbar .icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  font-size: 17px;
}
body.im-web-admin .im-sidebar-toggle {
  display: none;
  background: var(--im-accent-soft);
  border: 1px solid var(--im-accent-muted);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--im-accent-dark);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
body.im-web-admin .im-sidebar-toggle:hover {
  background: var(--im-accent-muted);
  border-color: var(--im-accent);
  color: var(--im-accent-dark);
}
body.im-dark.im-web-admin .im-sidebar-toggle {
  color: var(--im-accent);
}
body.im-web-admin .im-admin-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.25rem 1.5rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.im-web-admin .im-admin-content.im-scroll-needed {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.im-web-admin .im-admin-content .app-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}
body.im-web-admin .fab {
  display: flex;
  align-items: center;
  justify-content: center;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 55;
}
body.im-web-admin.im-logged-in .im-topbar-new-inv {
  background: var(--im-accent);
  border-color: var(--im-accent);
  color: #fff;
}
body.im-web-admin.im-logged-in .im-topbar-new-inv:hover {
  filter: brightness(1.05);
}
body.im-web-admin .bottom-nav,
body.im-web-admin .app-bar.app-bar--brand {
  display: none !important;
}
/* WhatsApp Direct Chat — matches site theme */
.wa-direct { padding: 0 0 24px; width: 100%; }
.wa-card {
  background: var(--im-surface);
  color: var(--im-text);
  border-radius: var(--im-radius);
  padding: 18px 16px 20px;
  border: 1px solid var(--im-border);
  box-shadow: var(--im-shadow);
}
.wa-card-title { font-size: 14px; margin: 0 0 14px; color: var(--im-muted); font-weight: 600; }
.wa-country-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--im-border);
  border-radius: 10px;
  background: var(--im-bg);
  color: var(--im-text);
  font-size: 15px;
  cursor: pointer;
}
.wa-country-btn--inline {
  width: auto;
  margin: 0 8px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  flex-shrink: 0;
}
.wa-field-label { display: block; font-size: 13px; color: var(--im-accent); font-weight: 600; margin: 0 0 6px; }
.wa-phone-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.wa-input {
  flex: 1;
  border: none;
  border-bottom: 2px solid var(--im-accent);
  background: transparent;
  color: var(--im-text);
  font-size: 18px;
  padding: 8px 0;
  outline: none;
}
.wa-input--msg { border-bottom-color: var(--im-border); font-size: 16px; margin-bottom: 20px; }
.wa-clear {
  border: none;
  background: transparent;
  color: var(--im-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
.wa-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.wa-btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.wa-btn--outline { background: transparent; color: var(--im-accent); border: 2px solid var(--im-accent); }
.wa-btn--primary { background: var(--im-accent); color: #fff; border: 2px solid var(--im-accent); }
.wa-link-preview {
  margin-top: 14px;
  font-size: 11px;
  word-break: break-all;
  color: var(--im-accent);
  opacity: 0.85;
}
/* Theme picker */
.theme-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 14px;
}
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--im-border);
  background: var(--im-surface);
  color: var(--im-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.theme-chip.active {
  border-color: var(--chip-color, var(--im-accent));
  background: var(--im-accent-soft);
  color: var(--im-accent-dark);
}
.theme-chip-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--chip-color, var(--im-accent));
  flex-shrink: 0;
}
.theme-chip-label { white-space: nowrap; }
/* Dark mode — deep navy like Currency Converter (Fig 5) */
body.im-dark.im-apk-embed,
body.im-dark.im-apk-embed #app,
body.im-dark.im-apk-embed .im-mobile-scroll,
body.im-dark.im-apk-embed .app-content {
  background: var(--im-bg);
}
body.im-dark .card-section,
body.im-dark .summary-card,
body.im-dark .inv-card,
body.im-dark .import-promo-card,
body.im-dark .new-item-card,
body.im-dark .wa-card,
body.im-dark .ni-card,
body.im-dark .settings-menu,
body.im-dark .report-card,
body.im-dark .client-pick-row,
body.im-dark .item-pick-row {
  background: var(--im-surface);
  color: var(--im-text);
  border-color: var(--im-border);
}
body.im-dark .settings-row,
body.im-dark .settings-row--toggle,
body.im-dark .settings-pick-row {
  background: var(--im-surface);
  color: var(--im-text);
}
body.im-dark .settings-section-lbl {
  background: transparent;
  color: var(--im-muted);
}
body.im-dark .theme-chip-row {
  background: transparent;
  padding-bottom: 16px;
}
body.im-dark .theme-chip {
  background: var(--im-surface-2, var(--im-surface));
  color: var(--im-text);
  border-color: var(--im-border);
}
body.im-dark .filter-chips button {
  background: var(--im-surface);
  color: var(--im-muted);
  border-color: var(--im-border);
}
body.im-dark .filter-chips button.active {
  background: var(--im-accent);
  color: #fff;
  border-color: var(--im-accent);
}
body.im-dark input,
body.im-dark select,
body.im-dark textarea,
body.im-dark .search-field input,
body.im-dark .toolbar-row input {
  background: var(--im-input-bg, var(--im-surface-2));
  color: var(--im-text);
  border-color: var(--im-border);
}
body.im-dark ::placeholder,
body.im-dark input::placeholder,
body.im-dark textarea::placeholder {
  color: var(--im-light) !important;
  opacity: 1;
}
body.im-dark .search-field input[readonly] {
  background: var(--im-input-bg, var(--im-surface-2));
  color: var(--im-text);
}
body.im-dark .sheet { background: var(--im-surface); color: var(--im-text); }
body.im-dark .overlay { background: rgba(0,0,0,0.65); }
body.im-dark .bottom-nav,
body.im-dark.im-apk-embed .im-apk-tabbar {
  background: var(--im-chrome-bg);
  border-color: var(--im-border);
}
body.im-dark .app-bar,
body.im-dark .app-bar--brand,
body.im-dark.im-apk-embed .im-mobile-header {
  background: var(--im-chrome-bg);
  color: var(--im-text);
}
body.im-dark .inv-card .amt { color: var(--im-accent); }
body.im-dark .summary-card .val.danger { color: var(--im-danger); }
body.im-dark .ni-row--pick { background: var(--im-surface); }
body.im-dark .btn-outline {
  background: var(--im-surface-2);
  color: var(--im-text);
  border-color: var(--im-border);
}
body.im-dark .im-hint-bar {
  background: var(--im-accent-soft);
  color: var(--im-text);
}
body.im-dark .card-section .sec-hdr {
  background: var(--im-surface-2);
  color: var(--im-muted);
}
body.im-dark .settings-pick-row.active {
  background: var(--im-accent-soft);
  color: var(--im-accent);
}
body.im-dark .item-pick-row,
body.im-dark .inv-more-opt,
body.im-dark .mark-opt {
  background: var(--im-surface);
  color: var(--im-text);
}
body.im-dark .item-pick-row:hover,
body.im-dark .mark-opt.active {
  background: var(--im-accent-soft);
}
body.im-dark .add-line-btn {
  background: var(--im-surface-2);
  color: var(--im-accent);
}
body.im-dark .editor-ftr,
body.im-dark .add-item-ftr {
  background: var(--im-chrome-bg);
  border-color: var(--im-border);
}
body.im-dark .add-item-ftr--active {
  background: var(--im-surface);
}
body.im-dark .send-ftr {
  background: var(--im-chrome-bg);
}
body.im-dark .send-preview-wrap {
  background: var(--im-bg);
}
body.im-dark .inv-detail-preview,
body.im-dark .inv-detail-preview-wrap,
body.im-dark .invoice-detail-full .inv-detail-scroll--full {
  background: var(--im-bg);
}
body.im-dark .ipv-stage {
  background: var(--im-bg);
}
body.im-dark .biz-card {
  background: var(--im-surface);
  color: var(--im-text);
}
body.im-dark .biz-card--active {
  background: var(--im-accent-soft);
  border-color: var(--im-accent);
}
body.im-dark .biz-card-name {
  color: var(--im-text);
}
body.im-dark .sync-status {
  background: var(--im-surface-2);
  border-color: var(--im-border);
  color: var(--im-text);
}
body.im-dark .sync-status.sync-ok {
  background: rgba(83, 215, 105, 0.12);
  border-color: rgba(83, 215, 105, 0.35);
  color: #53D769;
}
body.im-dark .sync-status.sync-err {
  background: rgba(252, 61, 57, 0.12);
  border-color: rgba(252, 61, 57, 0.35);
  color: var(--im-danger);
}
body.im-dark .danger-zone {
  background: rgba(252, 61, 57, 0.1);
  border-color: rgba(252, 61, 57, 0.35);
}
body.im-dark .icon-btn--danger {
  color: #fca5a5 !important;
  border-color: rgba(252, 61, 57, 0.45) !important;
  background: rgba(252, 61, 57, 0.14) !important;
}
body.im-dark .icon-btn--danger:hover:not(:disabled) {
  background: rgba(252, 61, 57, 0.24) !important;
  border-color: var(--im-danger) !important;
}
  background: rgba(252, 61, 57, 0.12) !important;
  border-color: rgba(252, 61, 57, 0.35) !important;
}
body.im-dark .line-table .li-remove {
  background: rgba(252, 61, 57, 0.12);
  border-color: rgba(252, 61, 57, 0.35);
}
body.im-dark .line-table input {
  background: var(--im-input-bg);
  color: var(--im-text);
  border-color: var(--im-border);
}
body.im-dark .doc-kind-chip {
  background: var(--im-surface);
  color: var(--im-muted);
  border-color: var(--im-border);
}
body.im-dark .doc-kind-chip.active {
  background: var(--im-accent-soft);
  color: var(--im-accent);
  border-color: var(--im-accent);
}
body.im-dark .dial-search {
  background: var(--im-input-bg);
  color: var(--im-text);
}
body.im-dark .dial-country-row {
  color: var(--im-text);
}
body.im-dark .li-grip,
body.im-dark .sort-grip {
  background: var(--im-surface-2);
}
body.im-dark tr.line-row-lift,
body.im-dark .sortable-lift {
  background: var(--im-accent-soft);
}
body.im-dark .status-draft {
  background: var(--im-surface-2);
  color: var(--im-muted);
}
body.im-dark .btn-clear-search {
  background: var(--im-input-bg);
  color: var(--im-accent);
  border-color: var(--im-border);
}
body.im-dark .item-search-bar input,
body.im-dark .pick-search-wrap input,
body.im-dark .form-group input,
body.im-dark .form-group select,
body.im-dark .form-group textarea {
  background: var(--im-input-bg);
  color: var(--im-text);
}
body.im-dark.im-apk-embed .im-apk-tabbar button {
  color: #a8b8cc;
}
body.im-dark.im-apk-embed .im-apk-tabbar button i {
  color: #9eb0c4;
}
body.im-dark.im-apk-embed .im-apk-tabbar button.active {
  color: var(--im-accent);
}
body.im-dark.im-apk-embed .im-apk-tabbar button.active i {
  color: var(--im-accent);
}
body.im-dark .brand-nutri { color: var(--im-accent) !important; }
body.im-dark .brand-farmart { color: var(--im-brand-orange) !important; }
body.im-dark .brand-sub { color: var(--im-brand-sub); opacity: 1; }
.dial-search {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 2px solid var(--im-accent);
  margin-bottom: 8px;
  font-size: 15px;
}
.dial-country-list { max-height: 50vh; overflow-y: auto; }
.dial-country-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 36px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 4px;
  border: none;
  border-bottom: 1px solid var(--im-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.dial-country-row.active { background: var(--im-accent-soft); }
.dial-country-code { font-weight: 600; color: var(--im-muted); }
.dial-pin { display: flex; align-items: center; justify-content: center; }
.doc-kind-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px 0;
  flex-wrap: wrap;
}
.doc-kind-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--im-border);
  background: var(--im-surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--im-muted);
}
.doc-kind-chip.active {
  border-color: var(--im-accent);
  background: var(--im-accent-soft);
  color: var(--im-accent);
}
.client-picker-list { padding: 0 !important; }
.client-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--im-border);
  cursor: pointer;
}
.client-pick-row--static { cursor: default; }
.client-pick-row--selected { background: var(--im-accent-soft); }
.client-pick-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--im-border);
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0;
  background: var(--im-card);
  cursor: pointer;
}
.client-pick-radio:checked {
  border-color: var(--im-accent);
  background: radial-gradient(circle, var(--im-accent) 42%, transparent 46%);
}
.client-pick-body { flex: 1; min-width: 0; }
.client-pick-body strong { display: block; font-size: 15px; }
.client-pick-body small { display: block; color: var(--im-muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-pick-edit { flex-shrink: 0; color: var(--im-accent); }
.ni-row--phone { flex-wrap: wrap; }
.ni-row--phone .ni-input-right { flex: 1; min-width: 120px; }
.ni-char-count { display: block; text-align: right; font-size: 11px; color: var(--im-muted); margin-top: 6px; }
.send-ftr--multi { display: flex; flex-wrap: wrap; gap: 8px; }
.send-ftr--multi .send-ftr-btn { flex: 1 1 45%; min-width: 120px; }
.btn-wa { background: #25d366; color: #fff; border: none; }
.btn-wa:hover { filter: brightness(1.05); }
.inv-send-row { display: flex; gap: 8px; margin-bottom: 12px; }
.inv-send-row .inv-send-btn { flex: 1; }
.inv-send-row .inv-send-btn:not(.btn-primary) { flex: 0 0 52px; padding: 0; }

@media (max-width: 768px) {
  body.im-web-admin .im-admin-sidebar {
    width: 0;
    overflow: hidden;
  }
  body.im-web-admin .im-admin-sidebar.open {
    width: var(--im-sidebar-w);
    overflow: visible;
  }
  body.im-web-admin .im-admin-main {
    margin-left: 0;
  }
  body.im-web-admin .im-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Reports Dashboard Styles */
.report-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.filter-dropdown {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--im-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  outline: none;
  min-height: 40px;
}
.filter-dropdown:hover {
  background: var(--im-border-soft);
}
.filter-dropdown i {
  color: var(--im-muted);
}
.summary-card--split {
  display: flex;
  align-items: center;
  padding: 16px 0 !important;
  margin-bottom: 12px;
}
.summary-card-half {
  flex: 1;
  text-align: center;
  padding: 0 12px;
}
.summary-card-divider {
  width: 1px;
  height: 38px;
  background: var(--im-border);
}
.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.report-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--im-text);
  margin: 0;
}
.report-card-subtitle {
  font-size: 11px;
  color: var(--im-muted);
  font-weight: 500;
  margin-top: 2px;
}
.report-card-more {
  font-size: 12px;
  color: var(--im-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.report-donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 10px;
}
.report-rows-list {
  display: flex;
  flex-direction: column;
}
.report-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--im-border-soft);
}
.report-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.report-row-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 4px 6px;
  border-radius: 6px;
  min-width: 44px;
  text-align: center;
  margin-top: 2px;
}
.report-row-info {
  flex: 1;
  min-width: 0;
}
.report-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.report-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--im-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.report-row-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--im-text);
  flex-shrink: 0;
}
.report-row-sub {
  font-size: 11px;
  color: var(--im-muted);
  margin-top: 2px;
}
.report-row-bar-wrap {
  height: 4px;
  background: var(--im-border-soft);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.report-row-bar-fill {
  height: 100%;
  border-radius: 2px;
}

/* Reports Detail Table Styles */
.report-table-card {
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}
.report-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-detail-table th {
  background: var(--im-accent-soft);
  color: var(--im-text);
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--im-border);
}
.report-detail-table td {
  padding: 10px 12px;
  color: var(--im-text);
  border-bottom: 1px solid var(--im-border-soft);
}
.report-detail-table tr:last-child td {
  border-bottom: none;
}
.report-detail-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.01);
}
body.im-dark .report-detail-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

/* Reports Detail Bottom Action Bar Styles */
.report-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: var(--im-surface);
  border-top: 1px solid var(--im-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0 16px;
}
@media (min-width: 769px) {
  .report-bottom-bar {
    left: var(--im-sidebar-w);
  }
}
.report-action-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  flex: 1;
}
body.im-dark .report-action-btn {
  color: #93c5fd;
}
.report-action-btn i {
  font-size: 20px;
}

/* Invoice Detail Header button styles to avoid system circle backgrounds */
.inv-header-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  min-width: 48px;
  min-height: 48px;
}
.inv-header-btn i {
  pointer-events: none;
}
.invoice-detail-full > header {
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  pointer-events: auto;
}
.invoice-detail-full .inv-detail-scroll--full {
  position: relative;
  z-index: 1;
}
.invoice-detail-full .inv-detail-preview-wrap,
.invoice-detail-full .inv-detail-preview {
  pointer-events: auto;
}
.inv-header-btn {
  pointer-events: auto;
}
.inv-header-btn:hover,
.inv-header-btn:active,
.inv-header-btn:focus {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}


