/* ==========================================================================
   Inventory ERP — Premium layer (loads last)
   Direction: calm glass surfaces over a soft aurora backdrop, one indigo
   accent, layered depth, tabular numerals for money. Works in light + dark.
   ========================================================================== */

:root {
  --pm-accent: #4f46e5;
  --pm-accent-2: #7c3aed;
  --pm-accent-soft: rgba(79, 70, 229, .10);
  --pm-accent-ring: rgba(79, 70, 229, .28);
  --pm-ink: #0f172a;
  --pm-ink-2: #334155;
  --pm-muted: #64748b;
  --pm-line: rgba(15, 23, 42, .08);
  --pm-glass: rgba(255, 255, 255, .72);
  --pm-glass-strong: rgba(255, 255, 255, .88);
  --pm-shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
  --pm-shadow-2: 0 2px 4px rgba(15, 23, 42, .03), 0 10px 28px -8px rgba(15, 23, 42, .12);
  --pm-shadow-3: 0 4px 8px rgba(15, 23, 42, .04), 0 24px 48px -16px rgba(30, 41, 59, .22);
  --pm-r-sm: 10px;
  --pm-r-md: 14px;
  --pm-r-lg: 20px;
  --pm-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Backdrop: soft aurora ---------- */
html body {
  font-feature-settings: "ss01", "tnum" 0;
  color: var(--pm-ink-2);
  background-color: #f5f7fb;
  background-image:
    radial-gradient(1100px 620px at 88% -10%, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(900px 560px at -5% 105%, rgba(79, 70, 229, .09), transparent 60%),
    radial-gradient(700px 420px at 50% 50%, rgba(56, 189, 248, .05), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--pm-ink); letter-spacing: -.01em; }

/* Numbers: stable width so columns of money line up */
.stat-card strong, .app-table td, .compact-main small, .doc-summary, .ledger-positive, .ledger-negative {
  font-variant-numeric: tabular-nums;
}

/* ---------- Sidebar: frosted glass ---------- */
.sidebar {
  background: var(--pm-glass) !important;
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-left: 1px solid var(--pm-line) !important;
  box-shadow: 1px 0 0 rgba(255, 255, 255, .6) inset, 12px 0 40px -18px rgba(15, 23, 42, .12) !important;
  padding: 16px 10px !important;
}
.brand { border-bottom-color: var(--pm-line) !important; padding: 6px 8px 18px !important; }
.brand-mark {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, .55), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}
.brand b { font-weight: 800; color: var(--pm-ink) !important; }
.sidebar-group-toggle {
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
  border-radius: 8px;
  transition: color .2s var(--pm-ease), background .2s var(--pm-ease);
}
.sidebar-group-toggle:hover { color: var(--pm-ink-2) !important; background: rgba(15, 23, 42, .03); }
.sidebar .nav-link {
  border-radius: var(--pm-r-sm) !important;
  padding: 9px 10px !important;
  transition: background .2s var(--pm-ease), color .2s var(--pm-ease), transform .2s var(--pm-ease);
}
.sidebar .nav-link:hover { transform: translateX(-2px); }
.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, .12), rgba(124, 58, 237, .06)) !important;
  color: var(--pm-accent) !important;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .12) !important;
}
.sidebar .nav-link.active::before { background: linear-gradient(180deg, #6366f1, #7c3aed) !important; }
.sidebar .nav-link .ico { color: #94a3b8; }
.sidebar .nav-link.active .ico { color: var(--pm-accent) !important; opacity: 1; }
.sidebar-bottom { border-top-color: var(--pm-line) !important; }
.avatar {
  background: linear-gradient(135deg, #6366f1, #7c3aed) !important;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .5);
}

/* ---------- Topbar: frosted ---------- */
.topbar {
  background: rgba(255, 255, 255, .78) !important;
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--pm-line) !important;
  height: 64px !important;
  position: sticky;
  top: 0;
  z-index: 50;
}
.breadcrumb-lite { color: var(--pm-muted); }
.breadcrumb-lite strong { color: var(--pm-ink); font-weight: 700; }
.date-chip {
  background: rgba(15, 23, 42, .03) !important;
  border: 1px solid var(--pm-line) !important;
  border-radius: 999px !important;
  color: var(--pm-muted) !important;
}
.live-dot {
  background: #10b981 !important;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .45);
  animation: pm-pulse 2.4s var(--pm-ease) infinite;
}
@keyframes pm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Page heading ---------- */
.page-heading h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.page-heading p { color: var(--pm-muted); }

/* ---------- Cards: layered, glass-tinted ---------- */
.panel, .form-card, .stat-card, .cashbox-card, .exchange-rate-card, .login-card {
  background: var(--pm-glass-strong) !important;
  border: 1px solid rgba(255, 255, 255, .8) !important;
  box-shadow: var(--pm-shadow-2), inset 0 0 0 1px var(--pm-line) !important;
  border-radius: var(--pm-r-lg) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: box-shadow .25s var(--pm-ease), transform .25s var(--pm-ease);
}
.stat-card:hover {
  box-shadow: var(--pm-shadow-3), inset 0 0 0 1px var(--pm-line) !important;
  transform: translateY(-2px);
}
.stat-card { padding: 20px !important; }
.stat-card strong {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--pm-ink) !important;
  letter-spacing: -.01em;
}
.stat-card small { color: var(--pm-muted) !important; }
.stat-card.is-key { position: relative; overflow: hidden; }
.stat-card.is-key::after {
  content: "";
  position: absolute;
  inset-inline-end: -30px; top: -30px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, .14), transparent 70%);
  pointer-events: none;
}
.stat-icon {
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.panel { padding: 22px !important; }
.panel-heading { border-bottom-color: var(--pm-line) !important; }
.panel-heading h2 { font-weight: 800; }
.panel-heading a { color: var(--pm-accent) !important; font-weight: 600; }
.panel-heading a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 11px !important;
  font-weight: 600 !important;
  padding: 9px 16px !important;
  transition: transform .15s var(--pm-ease), box-shadow .2s var(--pm-ease), background .2s var(--pm-ease), color .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .55), inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}
.btn-primary:hover { box-shadow: 0 10px 22px -6px rgba(79, 70, 229, .6), inset 0 1px 0 rgba(255, 255, 255, .2) !important; transform: translateY(-1px); }
.btn-outline-primary, .btn-light {
  background: rgba(255, 255, 255, .9) !important;
  border: 1px solid #dfe3ef !important;
  color: var(--pm-ink-2) !important;
  box-shadow: var(--pm-shadow-1);
}
.btn-outline-primary { color: var(--pm-accent) !important; border-color: rgba(79, 70, 229, .25) !important; }
.btn-outline-primary:hover, .btn-light:hover {
  background: var(--pm-accent-soft) !important;
  border-color: rgba(79, 70, 229, .35) !important;
  color: var(--pm-accent) !important;
}
.btn:focus-visible, .sidebar .nav-link:focus-visible, .icon-button:focus-visible, .theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--pm-accent-ring) !important;
}

/* ---------- Inputs ---------- */
.form-control, .form-select {
  border-radius: var(--pm-r-sm) !important;
  border-color: #dde2ee !important;
  background-color: rgba(255, 255, 255, .95) !important;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form-control:hover, .form-select:hover { border-color: #c3cbdc !important; }
.form-control:focus, .form-select:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 4px var(--pm-accent-ring) !important;
  background-color: #fff !important;
}
.form-label, .form-card .form-grid .form-field .form-label { color: var(--pm-ink-2) !important; font-weight: 600; }

/* ---------- Tables ---------- */
.app-table thead th {
  background: rgba(248, 250, 252, .9) !important;
  color: var(--pm-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--pm-line) !important;
  letter-spacing: .01em;
}
.app-table tbody td {
  border-color: rgba(15, 23, 42, .05) !important;
  color: var(--pm-ink-2);
  transition: background .15s;
}
.app-table tbody tr:hover td { background: rgba(79, 70, 229, .035); }
.table-link { color: var(--pm-accent) !important; font-weight: 700; }

/* ---------- Status chips ---------- */
.badge-status {
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}
.badge-status.success { background: #ecfdf5 !important; color: #047857 !important; }
.badge-status.warning { background: #fffbeb !important; color: #b45309 !important; }
.badge-status.danger  { background: #fef2f2 !important; color: #b91c1c !important; }

/* ---------- Alerts / empty states ---------- */
.alert { border-radius: var(--pm-r-md) !important; border: 1px solid transparent !important; box-shadow: var(--pm-shadow-1); }
.empty-state { color: var(--pm-muted) !important; }

/* ---------- Login: premium split backdrop ---------- */
.login-body {
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(124, 58, 237, .18), transparent 60%),
    radial-gradient(800px 560px at 95% 95%, rgba(79, 70, 229, .16), transparent 60%),
    #eef1fa !important;
}
.login-card {
  width: min(440px, calc(100% - 32px));
  padding: 40px 36px !important;
  border-radius: 24px !important;
  box-shadow: var(--pm-shadow-3) !important;
}
.login-card h1 { font-size: 22px; font-weight: 800; }

/* ---------- Motion: respect user preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Dark theme
   ========================================================================== */
html[data-theme="dark"] body,
html[data-bs-theme="dark"] body {
  color: #cbd5e1;
  background-color: #0b1120;
  background-image:
    radial-gradient(1100px 620px at 88% -10%, rgba(124, 58, 237, .16), transparent 60%),
    radial-gradient(900px 560px at -5% 105%, rgba(79, 70, 229, .14), transparent 60%);
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] .page-heading h1, html[data-theme="dark"] .stat-card strong,
html[data-theme="dark"] .breadcrumb-lite strong { color: #f1f5f9 !important; }
html[data-theme="dark"] .sidebar {
  background: rgba(15, 23, 42, .72) !important;
  border-left-color: rgba(148, 163, 184, .12) !important;
  box-shadow: 12px 0 40px -18px rgba(0, 0, 0, .5) !important;
}
html[data-theme="dark"] .sidebar .nav-link { color: #94a3b8 !important; }
html[data-theme="dark"] .sidebar .nav-link:hover { background: rgba(148, 163, 184, .08) !important; color: #e2e8f0 !important; }
html[data-theme="dark"] .sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(124, 58, 237, .08)) !important;
  color: #c7d2fe !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .2) !important;
}
html[data-theme="dark"] .sidebar .nav-link.active .ico { color: #a5b4fc !important; }
html[data-theme="dark"] .brand b, html[data-theme="dark"] .user-name { color: #f1f5f9 !important; }
html[data-theme="dark"] .topbar { background: rgba(15, 23, 42, .75) !important; border-bottom-color: rgba(148, 163, 184, .12) !important; }
html[data-theme="dark"] .date-chip { background: rgba(148, 163, 184, .08) !important; border-color: rgba(148, 163, 184, .14) !important; color: #94a3b8 !important; }
html[data-theme="dark"] .panel,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .login-card {
  background: rgba(15, 23, 42, .7) !important;
  border-color: rgba(148, 163, 184, .10) !important;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(148, 163, 184, .06) !important;
}
html[data-theme="dark"] .app-table thead th { background: rgba(30, 41, 59, .6) !important; color: #94a3b8 !important; border-bottom-color: rgba(148, 163, 184, .12) !important; }
html[data-theme="dark"] .app-table tbody td { color: #cbd5e1; border-color: rgba(148, 163, 184, .08) !important; }
html[data-theme="dark"] .app-table tbody tr:hover td { background: rgba(129, 140, 248, .06); }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: rgba(15, 23, 42, .8) !important;
  border-color: rgba(148, 163, 184, .18) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus { background-color: rgba(15, 23, 42, .95) !important; }
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-light {
  background: rgba(30, 41, 59, .7) !important;
  border-color: rgba(148, 163, 184, .18) !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .login-body { background-color: #0b1120 !important; }

/* ==========================================================================
   Bolder pass: more visible hierarchy, accent bars, gradient headings
   ========================================================================== */
.page-heading h1 {
  font-size: 28px !important;
  background: linear-gradient(100deg, #0f172a 0%, #4338ca 60%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .page-heading h1 {
  background: linear-gradient(100deg, #f1f5f9 0%, #a5b4fc 60%, #c4b5fd 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: "";
  position: absolute;
  inset-inline: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  opacity: .9;
}
.stat-card:has(.stat-icon.green)::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card:has(.stat-icon.orange)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card:has(.stat-icon.red)::before    { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card:has(.stat-icon.cyan)::before   { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.stat-icon { height: 40px !important; width: 40px !important; }
.stat-icon.blue   { background: linear-gradient(135deg, #e0e7ff, #c7d2fe) !important; color: #4338ca !important; }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important; color: #6d28d9 !important; }
.stat-icon.green  { background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important; color: #047857 !important; }
.stat-icon.cyan   { background: linear-gradient(135deg, #cffafe, #a5f3fc) !important; color: #0e7490 !important; }
.stat-icon.orange { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; color: #b45309 !important; }
.stat-icon.red    { background: linear-gradient(135deg, #fee2e2, #fecaca) !important; color: #b91c1c !important; }
.stat-card .stat-top span:first-child { font-weight: 600; color: var(--pm-ink-2) !important; }
.stat-card strong { font-size: 26px !important; margin-top: 10px !important; }

.sidebar .nav-link .ico { width: 19px; height: 19px; }
.sidebar .nav-link.active { font-weight: 700; }
.sidebar { background: rgba(255, 255, 255, .82) !important; }
html[data-theme="dark"] .sidebar { background: rgba(15, 23, 42, .85) !important; }

.panel-heading h2 { font-size: 16px !important; }
.app-tab.is-active { box-shadow: 0 3px 0 var(--pm-accent) inset !important; }
.chart-bar.sales { background: linear-gradient(180deg, #6366f1, #4338ca) !important; }
.chart-bar.purchases { background: linear-gradient(180deg, #a78bfa, #7c3aed) !important; }
.chart-bar.expenses { background: linear-gradient(180deg, #34d399, #059669) !important; }

/* ---------- Row action menus (floating, never clipped) ---------- */
.product-actions-popover {
  min-width: 170px;
  padding: 6px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-r-md);
  box-shadow: var(--pm-shadow-3);
  display: grid;
  gap: 2px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.product-actions-popover button {
  display: block;
  width: 100%;
  text-align: start;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--pm-r-sm);
  background: transparent;
  color: var(--pm-ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
  transition: background .15s;
}
.product-actions-popover button:hover { background: var(--pm-accent-soft); color: var(--pm-accent); }
html[data-theme="dark"] .product-actions-popover { background: rgba(15, 23, 42, .97); border-color: rgba(148, 163, 184, .15); }
html[data-theme="dark"] .product-actions-popover button { color: #cbd5e1; }
html[data-theme="dark"] .product-actions-popover button:hover { background: rgba(129, 140, 248, .12); color: #c7d2fe; }

/* ==========================================================================
   Movement grid (گردش کالا) — dense ledger style
   ========================================================================== */
.mv-grid-wrap { overflow: auto; max-height: 68vh; border: 1px solid var(--pm-line); border-radius: var(--pm-r-md); background: #fff; }
.mv-grid { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; color: var(--pm-ink-2); }
.mv-grid th, .mv-grid td { padding: 9px 12px; border-bottom: 1px solid #eef1f6; border-inline-start: 1px solid #eef1f6; white-space: nowrap; text-align: start; }
.mv-grid th:first-child, .mv-grid td:first-child { border-inline-start: 0; }
.mv-grid thead th { position: sticky; top: 0; z-index: 2; background: #f6f8fc; color: var(--pm-muted); font-weight: 600; font-size: 12px; }
.mv-grid tbody tr:hover td { background: #f8faff; }
.mv-col-idx { width: 48px; text-align: center !important; color: var(--pm-muted); }
.mv-col-product { min-width: 260px; white-space: normal !important; }
.mv-num { text-align: end !important; font-variant-numeric: tabular-nums; }
.mv-strong { font-weight: 700; color: var(--pm-ink); }
.mv-nowrap { white-space: nowrap; }
.mv-chip { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; max-width: 340px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.mv-chip.is-in { color: #0f766e; background: #ecfdf8; border-color: #b7eee0; }
.mv-chip.is-out { color: #be185d; background: #fdf2f8; border-color: #f5c2dd; }
.mv-chip.is-neutral { color: #475569; background: #f1f5f9; border-color: #dfe6ef; }
.mv-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 8px 4px; font-size: 12px; color: var(--pm-muted); }
.mv-totals { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mv-badge { padding: 3px 9px; border-radius: 6px; font-weight: 600; font-size: 11.5px; }
.mv-badge.is-in { background: #ecfdf8; color: #0f766e; }
.mv-badge.is-out { background: #fdf2f8; color: #be185d; }
.mv-badge.is-neutral { background: #f1f5f9; color: #475569; }
.mv-pager { display: flex; align-items: center; gap: 6px; }
.mv-count { margin-inline-end: 8px; }
.mv-page { min-width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--pm-line); border-radius: 8px; color: var(--pm-ink-2); text-decoration: none; background: #fff; }
.mv-page:hover { border-color: #c7d2fe; color: var(--pm-accent); }
.mv-page.is-disabled { opacity: .4; pointer-events: none; }
.mv-page.is-current { border: 0; background: transparent; padding: 0 6px; font-weight: 600; color: var(--pm-ink-2); }

/* ==========================================================================
   Flat forms & buttons (no shadows) and calm, jank-free interaction
   ========================================================================== */
.btn, .btn-primary, .btn-outline-primary, .btn-light,
.form-control, .form-select, .form-control:focus, .form-select:focus,
.form-control:hover, .form-select:hover,
.form-card, .login-card, .panel, .stat-card,
.btn-primary:hover, .btn:active, .stat-card:hover,
.alert, .badge-status, .avatar, .brand-mark, .live-dot {
  box-shadow: none !important;
}
.btn-primary { background: var(--pm-accent) !important; background-image: none !important; }
.btn-primary:hover { background: #4338ca !important; }
.btn-outline-primary, .btn-light { background: #fff !important; }
.form-card, .panel, .stat-card, .login-card { border-color: var(--pm-line) !important; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px var(--pm-accent-ring) !important; }
.btn:focus-visible, .sidebar .nav-link:focus-visible, .icon-button:focus-visible { box-shadow: 0 0 0 3px var(--pm-accent-ring) !important; }

/* Remove hover/press movement that makes the layout feel heavy */
.btn, .btn:hover, .btn:active, .btn-primary:hover, .sidebar .nav-link:hover,
.stat-card:hover, .stat-card { transform: none !important; }
.btn, .form-control, .form-select, .nav-link, .icon-button {
  transition: background-color .12s linear, border-color .12s linear, color .12s linear !important;
}
.panel, .form-card, .stat-card, .login-card, .sidebar, .topbar, .product-actions-popover {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.sidebar { background: #fff !important; }
html[data-theme="dark"] .sidebar { background: #0f172a !important; }
html body { background-attachment: scroll !important; }
html { scrollbar-gutter: stable; overflow-anchor: none; -webkit-tap-highlight-color: transparent; }
.app-table tbody tr:hover td { transition: none; }

/* ---------- Row menu: danger action and disabled note ---------- */
.product-menu-danger {
  display: block; width: 100%; text-align: start;
  padding: 9px 12px; border: 0; border-radius: var(--pm-r-sm);
  background: transparent; color: #b91c1c; font-size: 13px; font-weight: 600; cursor: pointer;
}
.product-menu-danger:hover { background: #fef2f2; }
.product-menu-disabled { display: block; padding: 9px 12px; font-size: 12px; color: var(--pm-muted); }
html[data-theme="dark"] .product-menu-danger:hover { background: rgba(248, 113, 113, .12); }

/* ---------- Tabs: no colored frame; inactive tabs are glass ---------- */
.app-tab-bar {
  background: linear-gradient(180deg, rgba(241, 245, 252, .9), rgba(241, 245, 252, .6)) !important;
  border-bottom: 0 !important;
}
.app-tab {
  border: 0 !important;
  border-radius: 10px 10px 0 0 !important;
  background: rgba(255, 255, 255, .45) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none !important;
  color: var(--pm-ink-2) !important;
  transition: background-color .12s linear, color .12s linear !important;
}
.app-tab:hover { background: rgba(255, 255, 255, .7) !important; }
.app-tab.is-active {
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--pm-ink) !important;
  font-weight: 700;
}
.app-tab-tools button { border: 0 !important; background: rgba(255, 255, 255, .5) !important; }
html[data-theme="dark"] .app-tab-bar { background: rgba(15, 23, 42, .5) !important; }
html[data-theme="dark"] .app-tab { background: rgba(148, 163, 184, .08) !important; color: #94a3b8 !important; }
html[data-theme="dark"] .app-tab:hover { background: rgba(148, 163, 184, .16) !important; }
html[data-theme="dark"] .app-tab.is-active { background: #0f172a !important; color: #f1f5f9 !important; }

/* ---------- Page headers: title only, small ---------- */
.page-heading p { display: none !important; }
.page-heading { margin-bottom: 16px !important; }
.page-heading h1 {
  font-size: 17px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

/* ---------- Larger top-tab tool icons (print / Excel / refresh) ---------- */
.app-tab-tools button {
  width: 42px !important;
  height: 40px !important;
  border-radius: 11px !important;
}
.app-tab-tools button svg,
.app-tab-tools button .ico { width: 22px !important; height: 22px !important; }
.heading-actions .btn svg,
.heading-actions .btn .ico { width: 20px !important; height: 20px !important; vertical-align: -4px; margin-inline-end: 6px; }

/* ---------- Sidebar groups: closed on first paint unless they contain the current page ---------- */
.sidebar-group:not([data-sidebar-group="operations"]):not(:has(.nav-link.active)) > .sidebar-group-items {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

/* ---------- Accent palette picker (top bar) ---------- */
.accent-picker { position: relative; display: inline-flex; }
.accent-picker > summary { list-style: none; }
.accent-picker > summary::-webkit-details-marker { display: none; }
.accent-toggle { cursor: pointer; }
.accent-popover {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: 12px;
  box-shadow: 0 8px 24px -8px rgba(15, 23, 42, .18);
  margin: 0;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--sw);
  cursor: pointer;
  padding: 0;
  transition: box-shadow .15s linear;
}
.swatch:hover { box-shadow: 0 0 0 3px rgba(15, 23, 42, .08); }
.swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sw); }
html[data-theme="dark"] .accent-popover { background: #0f172a; border-color: rgba(148, 163, 184, .18); }
html[data-theme="dark"] .swatch.is-active { box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px var(--sw); }

/* ---------- Settings overview cards ---------- */
.settings-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-r-lg);
  color: var(--pm-ink);
  text-decoration: none;
  transition: border-color .15s linear, color .15s linear;
}
.settings-card b { font-size: 15px; font-weight: 700; }
.settings-card small { color: var(--pm-muted); font-size: 12px; line-height: 1.7; }
.settings-card:hover { border-color: #c7d2fe; color: var(--pm-accent); }
html[data-theme="dark"] .settings-card { background: rgba(15, 23, 42, .7); border-color: rgba(148, 163, 184, .12); color: #f1f5f9; }
.settings-page { max-width: 900px; }
.settings-page > * + * { margin-top: 16px; }

/* ==========================================================================
   Outlined fields: the label sits on the top border, like the reference design.
   Applies to form-field wrappers that contain a control.
   ========================================================================== */
.form-field:has(> .form-control),
.form-field:has(> .form-select) {
  position: relative;
  padding-top: 8px;
  margin-top: 4px;
}
.form-field:has(> .form-control) > .form-label,
.form-field:has(> .form-select) > .form-label {
  position: absolute;
  top: 0;
  inset-inline-start: 12px;
  transform: none !important;
  margin: 0 !important;
  padding: 0 6px;
  background: var(--pm-card-bg, #fff);
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pm-muted) !important;
  z-index: 1;
  pointer-events: none;
  transition: color .15s linear;
}
.form-field:has(> .form-control) > .form-control,
.form-field:has(> .form-select) > .form-select {
  min-height: 48px !important;
  padding: 12px 14px !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 12px !important;
  background-color: var(--pm-card-bg, #fff) !important;
  font-size: 14px !important;
  color: var(--pm-ink) !important;
  transition: border-color .15s linear !important;
}
.form-field:has(> .form-control):hover > .form-control,
.form-field:has(> .form-select):hover > .form-select { border-color: #94a3b8 !important; }
.form-field:has(> .form-control:focus) > .form-label,
.form-field:has(> .form-select:focus) > .form-label { color: var(--pm-accent) !important; }
.form-field:has(> .form-control:focus) > .form-control,
.form-field:has(> .form-select:focus) > .form-select {
  border-color: var(--pm-accent) !important;
  box-shadow: 0 0 0 3px var(--pm-accent-ring) !important;
}
.form-field:has(> .form-control[readonly]) > .form-control,
.form-field:has(> .form-control:disabled) > .form-control {
  background-color: #f8fafc !important;
  color: var(--pm-muted) !important;
}
/* Cards that hold fields define their own background for the label cut-out */
.form-card, .panel, .login-card { --pm-card-bg: #fff; }
html[data-theme="dark"] .form-card, html[data-theme="dark"] .panel, html[data-theme="dark"] .login-card { --pm-card-bg: #111c33; }
html[data-theme="dark"] .form-field:has(> .form-control) > .form-control,
html[data-theme="dark"] .form-field:has(> .form-select) > .form-select { border-color: rgba(148, 163, 184, .35) !important; }
html[data-theme="dark"] .form-field:has(> .form-control:focus) > .form-control,
html[data-theme="dark"] .form-field:has(> .form-select:focus) > .form-select { border-color: #818cf8 !important; }

/* ==========================================================================
   Invoice form refinements
   1) Every field in the invoice header / payment grid shares one box style
      (same height, border and radius), so customer and warehouse line up.
   2) Field titles sit centred on the top border line of the box.
   3) Wider product column and a search dropdown that shows full titles.
   ========================================================================== */
.form-grid { row-gap: 22px; column-gap: 14px; padding-top: 10px; align-items: start; }

.form-grid > .form-field:has(.form-control, .form-select) {
  position: relative !important;
  padding: 0 !important;
  margin: 0 !important;
}
.form-grid > .form-field:has(.form-control, .form-select) > .form-label {
  position: absolute !important;
  top: 0 !important;
  inset-inline-start: 14px !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 6px !important;
  display: block;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.3 !important;
  background: var(--pm-card-bg, #fff) !important;
  color: var(--pm-muted, #64748b) !important;
  z-index: 2;
  pointer-events: none;
}
.form-grid > .form-field:has(.form-control, .form-select):focus-within > .form-label { color: var(--pm-accent, #4f46e5) !important; }

.form-grid > .form-field:has(.form-control, .form-select) .form-control,
.form-grid > .form-field:has(.form-control, .form-select) .form-select,
.form-grid .form-field input#id_contact-search {
  display: block;
  width: 100%;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background-color: var(--pm-card-bg, #fff) !important;
  font-size: 13px !important;
  line-height: 44px;
  box-sizing: border-box;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color .15s linear, box-shadow .15s linear;
}
.form-grid > .form-field:has(.form-control, .form-select) textarea.form-control {
  height: auto !important;
  min-height: 76px !important;
  padding: 12px 14px !important;
  line-height: 1.6;
}
.form-grid > .form-field:has(.form-control, .form-select) .form-control:hover,
.form-grid > .form-field:has(.form-control, .form-select) .form-select:hover { border-color: #94a3b8 !important; }
/* Calm focus: one accent border and a soft ring (no double border, no tint) */
.form-grid > .form-field:has(.form-control, .form-select) .form-control:focus,
.form-grid > .form-field:has(.form-control, .form-select) .form-select:focus,
.form-grid .form-field input#id_contact-search:focus {
  border-color: var(--pm-accent, #4f46e5) !important;
  background-color: var(--pm-card-bg, #fff) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14) !important;
  outline: none !important;
}
/* Browser autofill / suggestion tint */
.form-grid > .form-field:has(.form-control, .form-select) input:-webkit-autofill,
.form-grid > .form-field:has(.form-control, .form-select) input:-webkit-autofill:hover,
.form-grid > .form-field:has(.form-control, .form-select) input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--pm-card-bg, #fff) inset !important;
  -webkit-text-fill-color: var(--ink, #1f2937) !important;
  caret-color: var(--ink, #1f2937);
}
.form-grid .form-field .product-search { width: 100%; }
html[data-theme="dark"] .form-grid > .form-field:has(.form-control, .form-select) .form-control,
html[data-theme="dark"] .form-grid > .form-field:has(.form-control, .form-select) .form-select,
html[data-theme="dark"] .form-grid .form-field input#id_contact-search {
  border-color: rgba(148, 163, 184, .35) !important;
  color: var(--ink, #e5e7eb) !important;
}
html[data-theme="dark"] .form-grid > .form-field:has(.form-control, .form-select) input:-webkit-autofill { -webkit-text-fill-color: #e5e7eb !important; }

/* ---------- Wider product column ---------- */
.document-editor .editable-grid-table { min-width: 1500px; }
.editable-grid-table td[data-field="product"] { width: 46%; min-width: 560px !important; }
.editable-grid-table td[data-field="source_line"] { width: 22%; min-width: 220px !important; }
.editable-grid-table td[data-field="quantity"] { width: 8%; min-width: 85px !important; }
.editable-grid-table td[data-field="unit"] { width: 8%; min-width: 85px !important; }
.editable-grid-table td[data-field="unit_price"] { width: 14%; min-width: 130px !important; }
.editable-grid-table td[data-field="discount"] { width: 11%; min-width: 110px !important; }
.editable-grid-table td.line-amount { width: 13%; min-width: 130px !important; }
.editable-grid-table td[data-field="product"] .product-search-input { min-width: 0; width: 100%; }

/* ---------- Search dropdown: full titles stay visible ---------- */
.product-search-option {
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: start;
  padding: 9px 12px;
}
.product-search-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.product-search-code, .product-search-price { white-space: nowrap; line-height: 1.6; }

/* ---------- Copy buttons ---------- */
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-inline-start: 4px;
  padding: 0;
  vertical-align: middle;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  opacity: .55;
  transition: opacity .12s, background .12s, color .12s;
}
.copy-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
tr:hover .copy-btn, .copy-btn:focus-visible, h1:hover .copy-btn, .doc-header div:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(79, 70, 229, .1); color: var(--pm-accent, #4f46e5); opacity: 1; }
.copy-btn.is-done { color: #16a34a; opacity: 1; }
.copy-btn.is-failed { color: #dc2626; opacity: 1; }
html[data-theme="dark"] .copy-btn { color: #94a3b8; }
html[data-theme="dark"] .copy-btn:hover { background: rgba(129, 140, 248, .18); color: #c7d2fe; }

/* ---------- Product list: compact three-dot actions column ---------- */
th[data-column="actions"], td[data-column="actions"] {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding-inline: 4px !important;
  text-align: center;
  white-space: nowrap;
}
th[data-column="actions"] { font-size: 10px; }
td[data-column="actions"] .table-actions { justify-content: center; gap: 0; }
td[data-column="actions"] .product-menu-toggle {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #64748b;
}
td[data-column="actions"] .product-menu-toggle svg { width: 15px; height: 15px; fill: currentColor; }
td[data-column="actions"] .product-menu-toggle:hover { background: rgba(79, 70, 229, .1); color: var(--pm-accent, #4f46e5); }
html[data-theme="dark"] td[data-column="actions"] .product-menu-toggle { color: #94a3b8; }

/* =====================================================================
   Sidebar: narrower, search field, standalone dashboard link, chevrons
   ===================================================================== */
:root { --sidebar-w: 228px; }
.sidebar { width: var(--sidebar-w); }
@media (min-width: 901px) { .main-area { margin-right: var(--sidebar-w); } }
.sidebar .nav-link { gap: 10px; font-size: 12.5px; }
.sidebar .brand { gap: 10px; padding-inline: 6px !important; }
.sidebar .brand-mark { width: 38px; height: 38px; flex: 0 0 38px; }

/* Group chevron: points down while the group is open, sideways while it is closed */
.sidebar-group-toggle svg { transition: transform .2s ease; }
.sidebar-group-toggle[aria-expanded="true"] svg { transform: rotate(0deg) !important; }
.sidebar-group-toggle[aria-expanded="false"] svg { transform: rotate(90deg); }

/* Dashboard stands alone at the top, with no group title */
.sidebar-single { margin: 0 0 8px; }
.sidebar-single .nav-link { margin-inline: 4px; }

/* Menu search */
.sidebar-search { position: relative; display: flex; align-items: center; margin: 0 4px 12px; }
.sidebar-search-input {
  width: 100%; height: 38px; padding: 0 38px 0 34px;
  border: 1px solid var(--pm-line); border-radius: 12px;
  background: rgba(15, 23, 42, .035); color: var(--pm-ink);
  font: inherit; font-size: 12.5px; outline: 0;
  transition: background .2s var(--pm-ease), border-color .2s var(--pm-ease), box-shadow .2s var(--pm-ease);
}
.sidebar-search-input::placeholder { color: #94a3b8; }
.sidebar-search-input::-webkit-search-cancel-button,
.sidebar-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.sidebar-search-input:hover { background: rgba(15, 23, 42, .055); }
.sidebar-search-input:focus {
  background: #fff; border-color: var(--pm-accent);
  box-shadow: 0 0 0 3px var(--pm-accent-ring, rgba(79, 70, 229, .16));
}
.sidebar-search-icon, .sidebar-search-clear {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #94a3b8; line-height: 0;
}
.sidebar-search-icon { inset-inline-start: 11px; width: 18px; height: 18px; pointer-events: none; transition: color .2s var(--pm-ease); }
.sidebar-search:focus-within .sidebar-search-icon { color: var(--pm-accent); }
.sidebar-search-clear { inset-inline-end: 7px; width: 22px; height: 22px; border-radius: 7px; cursor: pointer; }
.sidebar-search-clear:hover { background: rgba(15, 23, 42, .07); color: var(--pm-ink); }
.sidebar-search-icon svg, .sidebar-search-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-search-clear svg { width: 14px; height: 14px; }
.sidebar-search-clear[hidden] { display: none; }
.sidebar .nav-link.is-filtered, .sidebar-group.is-filtered { display: none !important; }
.sidebar-search-empty { margin: 6px 4px 12px; padding: 14px 10px; border-radius: 10px; background: rgba(15, 23, 42, .035); color: #94a3b8; font-size: 12px; text-align: center; }
.sidebar-search-empty[hidden] { display: none; }
html[data-theme="dark"] .sidebar-search-input { background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .16); color: #e2e8f0; }
html[data-theme="dark"] .sidebar-search-input:hover { background: rgba(148, 163, 184, .15); }
html[data-theme="dark"] .sidebar-search-input:focus { background: rgba(15, 23, 42, .6); border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129, 140, 248, .22); }
html[data-theme="dark"] .sidebar-search-clear:hover { background: rgba(148, 163, 184, .18); color: #e2e8f0; }
html[data-theme="dark"] .sidebar-search-empty { background: rgba(148, 163, 184, .1); }

/* Icon-only (collapsed) sidebar: the field becomes a magnifier button */
@media (min-width: 901px) {
  html.sidebar-collapsed .sidebar-search { justify-content: center; margin-inline: 0; }
  html.sidebar-collapsed .sidebar-search-input,
  html.sidebar-collapsed .sidebar-search-clear,
  html.sidebar-collapsed .sidebar-search-empty { display: none; }
  html.sidebar-collapsed .sidebar-search-icon {
    position: static; transform: none; width: 44px; height: 38px; pointer-events: auto; cursor: pointer;
    border-radius: 12px; background: rgba(15, 23, 42, .035);
  }
  html.sidebar-collapsed .sidebar-search-icon:hover { background: rgba(15, 23, 42, .07); color: var(--pm-accent); }
}

/* =====================================================================
   Page tools (print / barcode / Excel / refresh) beside the action buttons
   ===================================================================== */
.heading-actions { align-items: center; flex-wrap: wrap; }
.page-heading-tools-only { justify-content: flex-end; }
.is-tool-duplicate { display: none !important; }
.page-tools {
  display: inline-flex; align-items: center; gap: 6px;
  margin-inline-start: 4px; padding-inline-start: 10px;
  border-inline-start: 1px solid var(--pm-line, #e2e8f0);
}
.heading-actions > .page-tools:first-child { margin: 0; padding: 0; border: 0; }
.page-tool {
  box-sizing: border-box; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; margin: 0;
  display: inline-grid; place-items: center; line-height: 0;
  border: 1px solid var(--pm-line, #e2e8f0); border-radius: 11px;
  background: #fff; color: #475569; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.page-tool[hidden] { display: none; }
.page-tool svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-tool:hover:not(:disabled) { background: var(--primary-soft, #eaf0ff); border-color: transparent; color: var(--primary, #2f5bea); }
.page-tool:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pm-accent-ring, rgba(79, 70, 229, .2)); }
.page-tool:disabled { opacity: .4; cursor: not-allowed; }
.page-tool.is-loading svg { animation: spin .7s linear infinite; }
html[data-theme="dark"] .page-tool { background: var(--surface-2, #18223a); border-color: var(--border, #243047); color: var(--muted, #94a3b8); }
html[data-theme="dark"] .page-tool:hover:not(:disabled) { background: var(--primary-soft); color: #c7d2fe; }

/* =====================================================================
   Title + tools live inside the white card; tabs sit flush on that card
   ===================================================================== */
.page-heading.in-card {
  margin: 0 0 16px !important; padding: 0 0 14px;
  border-bottom: 1px solid var(--pm-line, #e2e8f0);
}
html.has-card-head .content-wrap { padding-top: 0; }
html.has-card-head .content-wrap > .messages { padding-top: 14px; margin-bottom: 0; }
html.has-card-head .card-attached { border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; }
.app-tab-bar { padding-inline: 30px; }
@media (max-width: 700px) { .app-tab-bar { padding-inline: 13px; } }
.app-tab-host { background: transparent; }
html[data-theme="dark"] .app-tab.is-active { background: var(--surface, #131c2e) !important; }

/* Sale invoice: contact, warehouse, date, shipping and VAT share a single row */
@media (min-width: 901px) {
  .document-editor[data-kind="sale"] > .form-grid,
  .document-editor[data-kind="sale_return"] > .form-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .document-editor[data-kind="sale"] > .form-grid > .form-field,
  .document-editor[data-kind="sale_return"] > .form-grid > .form-field { grid-column: span 1; }
  .document-editor[data-kind="sale"] > .form-grid > .span-full,
  .document-editor[data-kind="sale_return"] > .form-grid > .span-full { grid-column: 1 / -1; }
}

/* Invoice lines: the product column gets most of the width */
.document-editor .editable-grid-table { min-width: 1080px; }
.editable-grid-table thead th:nth-child(1) { width: 44%; }
.editable-grid-table thead th:nth-child(2) { width: 8%; }
.editable-grid-table thead th:nth-child(3) { width: 7%; }
.editable-grid-table thead th:nth-child(4) { width: 14%; }
.editable-grid-table thead th:nth-child(5) { width: 11%; }
.editable-grid-table thead th:nth-child(6) { width: 12%; }
.editable-grid-table thead th:nth-child(7) { width: 4%; }
.editable-grid-table td[data-field="product"] { min-width: 0 !important; }

/* Tabs and the white card read as one surface */
.app-tab-bar { background: var(--bg) !important; border-bottom: 0 !important; }
html.has-card-head .card-attached,
html.has-card-head .content-wrap > .card-attached {
  border-radius: 0 0 var(--pm-r-lg, 18px) var(--pm-r-lg, 18px) !important;
  border-top: 0 !important;
}
.app-tab.is-active { position: relative; z-index: 1; margin-bottom: -1px; border-bottom: 0 !important; }
html[data-theme="dark"] .app-tab-bar { background: var(--bg) !important; }

.page-tools.is-solo { margin: 0; padding: 0; border: 0; }
