/* ============================================================
   GENERATED FILE — do not edit by hand.
   Sources: assets/styles/modules/*.css
   Build:   npm run build
   Hash:    7f2c15f3
   ============================================================ */

/* ── 01-base.css ── */
/* ============================================================
   BrickPro — Fly Ash Brick Management System
   style.css — Premium Black & White Theme
   ============================================================ */

/* ── Fonts & Reset ── */
/* Latinka has ONLY a regular cut — do NOT map 700/900 to the same file
   (that blocks browser synthetic bold and looks identical to regular). */
@font-face {
  font-family: 'Latinka';
  src: url('../fonts/latinka-regular.woff2') format('woff2'),
       url('../fonts/latinka-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-family: var(--font);
  font-weight: var(--font-weight-base);
  font-synthesis: weight;
}

/* Whole-app text/UI size (user preference) */
html[data-font-scale="sm"] {
  --font-size-base: 13px;
  zoom: 0.9;
}
html[data-font-scale="md"] {
  --font-size-base: 15px;
  zoom: 1;
}
html[data-font-scale="lg"] {
  --font-size-base: 16px;
  zoom: 1.12;
}
html[data-font-scale="xl"] {
  --font-size-base: 18px;
  zoom: 1.25;
}

/* Firefox / engines without zoom — scale root rem + body base */
@supports not (zoom: 1) {
  html[data-font-scale="sm"] { font-size: 90%; }
  html[data-font-scale="md"] { font-size: 100%; }
  html[data-font-scale="lg"] { font-size: 112%; }
  html[data-font-scale="xl"] { font-size: 125%; }
}

@media print {
  html[data-font-scale] {
    zoom: 1 !important;
    font-size: 100% !important;
  }
}

/* ── CSS Variables — Light / white theme (only mode) ── */
:root,
[data-theme="light"] {
  --bg:           #eef1f6;
  --bg2:          #ffffff;
  --bg3:          #f7f8fb;
  --surface:      #ffffff;
  --surface2:     #f3f5f9;
  --border:       #e4e8f0;
  --border2:      #cfd6e4;
  --text:         #12151c;
  --text2:        #4b5160;
  --text3:        #8b92a5;
  --accent:       #12151c;
  --accent2:      #2a3140;
  --primary:      #12151c;
  --primary-soft: rgba(18, 21, 28, 0.08);
  --success:      #22c55e;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --sidebar-w:    236px;
  --shell-gap:    8px;
  --topbar-h:     56px;
  --panel-radius: 16px;
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    22px;
  --shadow:       0 10px 40px rgba(18, 30, 60, .08);
  --shadow-sm:    0 2px 12px rgba(18, 30, 60, .06);
  --trans:        .22s cubic-bezier(.4,0,.2,1);
  --font:         'Latinka', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 15px;
  --font-weight-base: 700;
  color-scheme: light;
}

/* Dark theme disabled — kept only so leftover data-theme="dark" still looks light */
[data-theme="dark"] {
  --bg:           #eef1f6;
  --bg2:          #ffffff;
  --bg3:          #f7f8fb;
  --surface:      #ffffff;
  --surface2:     #f3f5f9;
  --border:       #e4e8f0;
  --border2:      #cfd6e4;
  --text:         #12151c;
  --text2:        #4b5160;
  --text3:        #8b92a5;
  --accent:       #12151c;
  --accent2:      #2a3140;
  --primary:      #12151c;
  --primary-soft: rgba(18, 21, 28, 0.08);
  --shadow:       0 10px 40px rgba(18, 30, 60, .08);
  --shadow-sm:    0 2px 12px rgba(18, 30, 60, .06);
  color-scheme: light;
}

/* ── Base ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-base) !important;
  letter-spacing: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background var(--trans), color var(--trans);
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* Force Latinka platform-wide — medium-bold (no stroke / no faux shadow) */
body, body *:not(svg):not(path):not(circle):not(line):not(polyline):not(polygon):not(rect) {
  font-family: var(--font) !important;
  font-weight: 700 !important;
  font-synthesis: weight !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea, optgroup, label, a, p, span, td, th, li, h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: inherit;
}

/* Beat Bootstrap reboot — Latinka bold (balanced) */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font) !important;
  font-weight: 800 !important;
}
.page-header h1,
.dash-title,
.nav-item,
.nav-section-label,
.card-pro-title,
.btn-pro,
.btn-outline,
.form-label,
.kpi-label,
.kpi-value,
.page-sub,
.tbl th,
.tbl td,
.form-ctrl {
  font-family: var(--font) !important;
  font-weight: 700 !important;
}
.page-header h1,
.dash-title,
.kpi-value,
.nav-item.active,
.card-pro-title {
  font-weight: 800 !important;
}
b, strong { font-weight: 800 !important; }

/* iOS-style passcode lock */
.passcode-lock {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255,255,255,.08), transparent 55%),
    linear-gradient(180deg, #10131a 0%, #0b0e14 100%);
}
.passcode-card {
  width: min(360px, 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px;
  background: #12151d;
  box-shadow: 0 24px 56px rgba(0,0,0,.45);
  padding: 22px 18px 18px;
  text-align: center;
}
.passcode-logo-wrap {
  width: 58px;
  height: 58px;
  margin: 2px auto 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.passcode-logo { width: 40px; height: 40px; object-fit: contain; }
.passcode-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.passcode-sub { margin: 6px 0 14px; color: #a6afc1; font-size: 13px; }
.passcode-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.passcode-dots span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  transition: background .2s ease, border-color .2s ease;
}
.passcode-dots span.filled {
  background: #fff;
  border-color: #fff;
}
.passcode-error {
  color: #f87171;
  font-size: 12px;
  font-weight: 800;
  min-height: 16px;
  margin: 0 0 8px;
}
.passcode-input {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font);
  text-align: center;
  letter-spacing: 8px;
  outline: none;
}
.passcode-input::placeholder {
  letter-spacing: .2px;
  color: rgba(255,255,255,.55);
  font-size: 13px;
}
.passcode-input:focus {
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 0 0 3px rgba(255,255,255,.09);
}
.passcode-card.shake { animation: passcodeShake .28s linear 1; }
@keyframes passcodeShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

#appShell {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* Shared panel look (solid — no glass blur) */
.shell-glass {
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .shell-glass {
  background: #ffffff;
  border-color: var(--border);
}

/* ── 02-layout.css ── */
/* ================================================================
   SIDEBAR — equal gap on all sides
================================================================ */
.sidebar {
  position: fixed;
  top: var(--shell-gap);
  left: var(--shell-gap);
  bottom: var(--shell-gap);
  width: var(--sidebar-w);
  height: calc(100vh - (var(--shell-gap) * 2));
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--trans), box-shadow var(--trans);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 24px 48px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: auto;
  flex-shrink: 0;
}
[data-theme="light"] .sidebar-brand {
  border-bottom-color: rgba(18, 30, 60, 0.08);
}

.brand-icon {
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: none;
  padding: 3px;
}
.brand-icon-only {
  width: 100%;
  height: auto;
  max-height: 128px;
  background: transparent;
  border-radius: 12px;
  padding: 2px 4px;
}
[data-theme="light"] .brand-icon {
  background: rgba(18, 30, 60, 0.06);
}
[data-theme="light"] .brand-icon-only {
  background: transparent;
}
.brand-icon svg.lucide,
.brand-icon .icon { width: 20px; height: 20px; stroke-width: 1.85; color: #fff; }
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}
.brand-icon-only .brand-logo {
  width: 100%;
  height: auto;
  max-height: 118px;
  object-fit: contain;
}
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: -.3px; color: var(--text); }
.brand-sub  { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; }

.sidebar-nav {
  padding: 8px 8px 16px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--trans), color var(--trans), box-shadow var(--trans), border-color var(--trans);
  color: var(--text2);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  margin-bottom: 1px;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
  background: transparent;
}
.nav-item svg.lucide,
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .88; }
.nav-item:hover  {
  background: rgba(255, 255, 255, 0.07);
  color: #f1f3f7;
  border-color: rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #12151c;
  border-color: rgba(0, 0, 0, 0.08);
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.28);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.16);
  font-weight: 800;
}
.nav-item.active svg.lucide,
.nav-item.active .icon { color: #f5f5f7; opacity: 1; }
[data-theme="light"] .nav-item.active {
  background: rgba(255, 255, 255, 0.92);
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .nav-item.active svg.lucide,
[data-theme="light"] .nav-item.active .icon { color: #1d1d1f; opacity: 1; }

.sidebar-lang {
  padding: 10px 2px 16px;
  margin-top: 8px;
}
.sidebar-lang-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
  padding-left: 2px;
}
.sidebar-font-scale {
  padding-top: 0;
  margin-top: 0;
}
.sidebar-font-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}
.sidebar-font-switch .font-scale-option {
  padding: 6px 2px;
  font-size: 11px;
  border-radius: 8px;
}
.lang-switch {
  display: flex;
  gap: 6px;
}
.lang-option {
  flex: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.2;
}
.lang-option:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}
.lang-option.active {
  background: #fff;
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.lang-switch-lg .lang-option {
  padding: 12px 10px;
  font-size: 14px;
}
.auth-lang-switch,
.onboard-lang-switch {
  margin: 0 0 14px;
  max-width: 260px;
}
.onboard-lang-switch {
  margin: 0 auto 16px;
}

/* ================================================================
   TOPBAR removed — main content is the floating panel
================================================================ */
.topbar { display: none !important; }

/* Desktop: hidden. Mobile: shown in 05-responsive-print.css */
.mobile-nav-fab {
  display: none;
  position: fixed;
  top: calc(var(--shell-gap) + 10px);
  left: calc(var(--shell-gap) + 10px);
  z-index: 210;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 8px 24px rgba(18, 30, 60, 0.12);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-fab svg.lucide,
.mobile-nav-fab i.icon,
.mobile-nav-fab .icon {
  width: 22px;
  height: 22px;
}
.mobile-nav-fab:active {
  transform: scale(0.96);
}
/* Hide menu button while drawer is open (overlay closes it) */
body:has(#sidebar.open) .mobile-nav-fab {
  opacity: 0;
  pointer-events: none;
}

/* Platform admin contact — bottom-right (dashboard on mobile; always on desktop) */
.platform-contact {
  position: fixed;
  bottom: calc(var(--shell-gap, 12px) + 14px);
  right: calc(var(--shell-gap, 12px) + 14px);
  z-index: 220;
}
.platform-contact[hidden] { display: none !important; }

/* Page primary action FAB (Add Production / Invoice / …) — compact like app-bar btn */
.page-action-fab {
  position: fixed;
  bottom: calc(var(--shell-gap, 12px) + 14px);
  right: calc(var(--shell-gap, 12px) + 14px);
  z-index: 220;
}
.page-action-fab[hidden] { display: none !important; }
.page-action-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: none;
  border-radius: 12px;
  background: #e85d04;
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 93, 4, 0.28);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.page-action-fab-btn .icon {
  width: 18px;
  height: 18px;
  color: #fff;
}
.page-action-fab-btn:active {
  transform: scale(0.97);
  opacity: 0.95;
}
.platform-contact-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 28%, var(--border));
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 8px 24px rgba(18, 30, 60, 0.12);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
  animation: platform-contact-glow 2.8s ease-in-out infinite;
}
.platform-contact-fab-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--primary, #2563eb) 45%, transparent);
  opacity: 0;
  animation: platform-contact-ping 2.8s ease-out infinite;
}
.platform-contact-fab .icon,
.platform-contact-fab-label {
  position: relative;
  z-index: 1;
}
.platform-contact-fab .icon {
  width: 18px;
  height: 18px;
  color: var(--primary, #2563eb);
}
.platform-contact-fab:hover {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, var(--border));
  box-shadow: var(--shadow-sm), 0 10px 28px rgba(18, 30, 60, 0.16);
}
.platform-contact-fab[aria-expanded="true"] {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #2563eb) 18%, transparent), 0 8px 24px rgba(18, 30, 60, 0.12);
  animation: none;
}
.platform-contact-fab[aria-expanded="true"] .platform-contact-fab-ring {
  animation: none;
  opacity: 0;
}
@keyframes platform-contact-glow {
  0%, 100% {
    box-shadow: var(--shadow-sm), 0 8px 24px rgba(18, 30, 60, 0.12), 0 0 0 0 color-mix(in srgb, var(--primary, #2563eb) 0%, transparent);
  }
  50% {
    box-shadow: var(--shadow-sm), 0 8px 24px rgba(18, 30, 60, 0.14), 0 0 0 6px color-mix(in srgb, var(--primary, #2563eb) 12%, transparent);
  }
}
@keyframes platform-contact-ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%, 100% {
    transform: scale(1.22);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .platform-contact-fab,
  .platform-contact-fab-ring {
    animation: none;
  }
}
.platform-contact-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(18, 30, 60, 0.16);
}
.platform-contact-menu[hidden] { display: none !important; }
.platform-contact-menu-title {
  padding: 6px 10px 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3, #94a3b8);
}
.platform-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.platform-contact-item .icon {
  width: 16px;
  height: 16px;
  color: var(--text2, #64748b);
  flex-shrink: 0;
}
.platform-contact-item:hover {
  background: var(--bg2, #f1f5f9);
}
.platform-contact-item--call .icon { color: #2563eb; }
.platform-contact-item--wa .icon { color: #25d366; }

@media (max-width: 767px) {
  .platform-contact-fab-label { display: none; }
  .platform-contact-fab {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
  }
}

/* ================================================================
   MAIN CONTENT — fixed floating panel (only inner content scrolls)
================================================================ */
.main-content {
  position: fixed;
  top: var(--shell-gap);
  left: calc(var(--shell-gap) + var(--sidebar-w) + var(--shell-gap));
  right: var(--shell-gap);
  bottom: var(--shell-gap);
  margin: 0;
  padding: 22px 16px 16px 22px;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: left var(--trans), right var(--trans), top var(--trans), bottom var(--trans);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  z-index: 100;
}
.main-content::-webkit-scrollbar { display: none; }
[data-theme="light"] .main-content {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   PAGES
================================================================ */
.page { display: none; }
.page.active { display: block; animation: fadeIn .3s ease; }

@keyframes fadeIn {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: translateY(0); }
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.page-header h1 {
  font-size: 32px; font-weight: 800;
  letter-spacing: -.6px; color: var(--text);
  line-height: 1.15;
}
.page-sub {
  color: var(--text2);
  font-size: 17px;
  font-weight: 800;
  margin-top: 4px;
  line-height: 1.35;
}

/* ── 03-components.css ── */
/* ================================================================
   KPI CARDS
================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  transition: box-shadow var(--trans), border-color var(--trans), transform var(--trans);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border2);
}
.kpi-card::before {
  content: '';
  position: absolute; top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg, var(--kpi-color, var(--primary)), transparent 85%);
  opacity: .9;
}

.kpi-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kpi-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon svg.lucide,
.kpi-icon .icon { width: 17px; height: 17px; color: var(--kpi-color, var(--text2)); }
.kpi-info-dot {
  width: 20px; height: 20px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 10px;
  font-weight: 800;
  font-style: italic;
  display: grid;
  place-items: center;
  opacity: .7;
}
.kpi-label { font-size: 13px; color: var(--text3); font-weight: 800; letter-spacing: .2px; }
.kpi-value { font-size: 20px; font-weight: 800; color: var(--text); margin: 5px 0 0; letter-spacing: -.3px; line-height: 1.25; }
.kpi-value .prod-split-line { display: block; line-height: 1.3; font-size: 1em; font-weight: 800; }
.kpi-value .prod-split-line + .prod-split-line { margin-top: 4px; font-size: .92em; font-weight: 800; }

/* Unit-wise breakdown inside a KPI card — capped so cards stay same height */
.kpi-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kpi-bd-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1.2;
  white-space: nowrap;
}
.kpi-bd-row:first-child .kpi-bd-val { font-size: 20px; }
.kpi-bd-val {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.kpi-bd-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: .2px;
}
.kpi-bd-row.inv-stock-low .kpi-bd-val { color: #ef4444; }
.kpi-bd-row.inv-stock-ok .kpi-bd-val { color: #16a34a; }
.kpi-bd-more {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  cursor: help;
}
.kpi-value-locked { font-size: 14px !important; font-weight: 800 !important; color: var(--text3) !important; }
.kpi-sub   { font-size: 11px; color: var(--text3); }

/* ================================================================
   CARDS
================================================================ */
.card-pro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  transition: box-shadow var(--trans), border-color var(--trans);
  box-shadow: var(--shadow-sm);
}
.card-pro:hover { box-shadow: var(--shadow); border-color: var(--border2); }

.card-pro-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 10px; flex-wrap: wrap;
}

/* Tighter stack between page cards */
.page .card-pro.mt-3 { margin-top: 12px !important; }
.page .card-pro.mt-4 { margin-top: 14px !important; }
.card-pro-title { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.2px; }

/* ================================================================
   CHARTS
================================================================ */
.chart-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}
.chart-wrap-lg { height: 280px; }
.chart-wrap-donut { height: 260px; }
.chart-legend {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text2);
  margin-top: 4px;
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 99px;
  margin-right: 4px;
}

/* ================================================================
   TABLE
================================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl thead { background: var(--surface2); }
.tbl th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  color: var(--text2);
  font-size: 12.5px;
  letter-spacing: .3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--surface2); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ================================================================
   FORMS
================================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.form-ctrl {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-ctrl:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(200,202,208,.15);
}
.form-ctrl::placeholder { color: var(--text3); }
select.form-ctrl option { background: var(--surface); color: var(--text); }
textarea.form-ctrl { resize: vertical; min-height: 70px; }

.search-select { position: relative; z-index: 6; }
.search-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.search-select-input { padding-right: 36px; }
.search-select::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--text3);
  border-bottom: 2px solid var(--text3);
  transform: rotate(45deg);
  pointer-events: none;
}
.search-select.is-open::after { transform: rotate(225deg); margin-top: -2px; }
.search-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(280px, 50vh);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(18, 21, 28, 0.14);
  z-index: 40;
  padding: 4px;
}
.search-select-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.search-select-opt:hover,
.search-select-opt.is-active { background: var(--surface2); }
.search-select-opt.is-selected { background: var(--bg3); }
.search-select-opt-name {
  display: block;
  font-weight: 800;
  font-size: 13.5px;
}
.search-select-opt-meta {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}
.search-select-empty {
  padding: 12px 10px;
  color: var(--text3);
  font-size: 13px;
}

/* ================================================================
   BUTTONS
================================================================ */
.btn-pro {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity var(--trans), transform var(--trans);
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}
.btn-pro:hover { opacity: .88; }
.btn-pro:active { transform: scale(.97); }
.btn-pro svg.lucide,
.btn-pro .icon { width: 17px; height: 17px; }
.btn-pro.danger { background: var(--danger); color: #fff; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans);
  font-family: inherit;
  white-space: nowrap;
}
.btn-outline:hover { background: var(--surface2); border-color: var(--text2); }
.btn-outline.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline svg.lucide,
.btn-outline .icon { width: 16px; height: 16px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  font-family: inherit;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.btn-icon svg.lucide,
.btn-icon .icon { width: 17px; height: 17px; }
.btn-icon svg.lucide,
.btn-icon i.icon,
.btn-icon .icon {
  pointer-events: none;
}
.btn-icon.danger { color: var(--danger); border-color: transparent; }
.btn-icon.danger:hover { background: rgba(239,68,68,.12); }

/* ================================================================
   FILTER BAR
================================================================ */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-bar label { font-size: 14px; color: var(--text2); font-weight: 800; white-space: nowrap; }
.filter-bar .form-ctrl { width: auto; min-width: 140px; }

/* Page filters — dashboard-style icon + popup (mobile + desktop) */
.page-header-tools {
  margin-left: auto;
}
.page-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 14px;
  min-height: 40px;
}
.page-filter-toolbar .dashboard-period-pill,
.page-filter-toolbar .page-filter-search {
  margin-right: auto;
}
.page-filter-search {
  flex: 1 1 auto;
  min-width: 0 !important;
  width: auto !important;
  max-width: 320px;
}
@media (max-width: 900px) {
  .page-filter-search {
    max-width: none;
  }
  .page-filter-toolbar {
    margin-bottom: 10px;
  }
}
.page-filter-actions,
.page-filter-toolbar .dash-filter-wrap,
.page-header-tools .dash-filter-wrap {
  position: relative;
  flex-shrink: 0;
}
.page-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

/* Invoice tools — desktop: full search field; mobile app bar: icons → expand search */
.inv-appbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}
.inv-appbar-tools .inv-search-toggle,
.inv-appbar-tools .inv-search-close {
  display: none;
}
.inv-appbar-tools .inv-appbar-search-field {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 320px;
  margin-right: auto;
}

@media (max-width: 767px) {
  #page-invoice #invFilterToolbar {
    margin: 0;
    min-height: 0;
  }
  #page-invoice .inv-period-desktop {
    display: none !important;
  }
  /* When tools are in the page (before mount) or restored — hide toolbar chrome */
  #page-invoice #invFilterToolbar:not(:has(#invHeaderTools)) {
    display: none !important;
  }
  #page-invoice #invFilterToolbar:has(#invHeaderTools) {
    /* tools still in toolbar (desktop resize edge) — keep layout */
  }
}
  padding: 0;
  flex-shrink: 0;
}
.page-filter-period-start {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-filter-panel[hidden] { display: none !important; }
.page-filter-panel:not([hidden]) {
  display: block !important;
  position: fixed !important;
  z-index: 9000;
  min-width: 220px !important;
  max-width: min(300px, calc(100vw - 16px)) !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}
.page-filter-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.page-filter-fields .form-ctrl,
.page-filter-year-month .form-ctrl {
  width: 100% !important;
  min-width: 0 !important;
}
.page-filter-year-month {
  display: flex;
  gap: 8px;
  width: 100%;
}
.page-filter-year-month .dash-year {
  width: 78px !important;
  flex-shrink: 0;
}
.page-filter-year-month .dash-month {
  flex: 1;
  min-width: 0 !important;
}
.page-filter-panel .dash-filter-popup-title {
  display: block;
}
.page-filter-panel .dash-filter-apply {
  display: inline-flex;
  width: 100%;
  justify-content: center;
}
.dash-filter-btn { position: relative; }
.dash-filter-btn.has-filter {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.dash-filter-btn.has-filter::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

/* ================================================================
   MODALS
================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 400;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; pointer-events: auto; animation: fadeIn .2s ease; }

/* Confirm must sit above any already-open modal (e.g. Manage Materials) */
#confirmDialog.modal-overlay {
  z-index: 560;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
.modal-box.modal-lg { max-width: 680px; }

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.modal-body  { padding: 20px 22px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* ================================================================
   CALC PREVIEW
================================================================ */
.calc-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.calc-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text2);
  padding: 4px 0;
}
.calc-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px; padding-top: 10px;
  font-weight: 800; color: var(--text);
}
.kpi-card-locked:hover { border-color: var(--primary); opacity: .95; }
.calc-val { font-family: var(--font), sans-serif; font-weight: 800; color: var(--text); }

/* ================================================================
   BADGES / STATUS
================================================================ */
.badge-pro {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-success { background: rgba(34,197,94,.12); color: #22c55e; }
.badge-danger  { background: rgba(239,68,68,.12);  color: #ef4444; }
.badge-warning { background: rgba(245,158,11,.12); color: #f59e0b; }
.badge-info    { background: rgba(59,130,246,.12); color: #3b82f6; }
.badge-neutral { background: var(--surface2); color: var(--text2); }
.btn-danger-outline {
  border-color: color-mix(in srgb, #ef4444 45%, var(--border));
  color: #dc2626;
}

/* ================================================================
   ACTION BUTTONS (table row)
================================================================ */
.action-btns { display: flex; gap: 4px; }
.action-btns .btn-icon { width: 30px; height: 30px; }
.action-btns .btn-icon svg.lucide,
.action-btns .btn-icon .icon { width: 15px; height: 15px; }

/* ================================================================
   TOAST NOTIFICATIONS
================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  max-width: 340px;
  pointer-events: all;
  animation: slideInRight .3s ease;
}
.toast-item.remove { animation: slideOutRight .3s ease forwards; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-info    .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(60px); opacity: 0; }
}

/* ================================================================
   RECENT TRANSACTIONS / TOP CUSTOMERS
================================================================ */
.txn-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
  border-bottom: none;
  transition: background var(--trans);
}
.txn-item:hover { background: var(--surface2); }
.txn-item:last-child { border-bottom: none; }
.txn-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.txn-icon-in { background: rgba(34, 197, 94, .12); color: #22c55e; }
.txn-icon-out { background: rgba(239, 68, 68, .12); color: #ef4444; }
.txn-icon svg.lucide,
.txn-icon .icon { width: 17px; height: 17px; }
.txn-info { flex: 1; min-width: 0; }
.txn-name { font-size: 13.5px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-date { font-size: 11.5px; color: var(--text3); }
.txn-amount { font-size: 14px; font-weight: 800; font-family: var(--font), sans-serif; white-space: nowrap; }
.txn-credit { color: var(--success); }
.txn-debit  { color: var(--danger); }
.txn-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.txn-amounts .txn-amount { font-size: 13.5px; line-height: 1.2; }
.txn-pending {
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
  white-space: nowrap;
}
.txn-pending.has-pending { color: var(--warning, #f59e0b); }
.txn-rank {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.txn-progress {
  height: 5px;
  background: var(--surface2);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}
.txn-progress span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #9ca3af, #4b5563);
}

.tbl tbody tr.row-overdue { background: rgba(239,68,68,.12) !important; }
.tbl tbody tr.row-overdue:hover { background: rgba(239,68,68,.18) !important; }
.tbl tbody tr.row-pending { background: rgba(245,158,11,.1) !important; }
.tbl tbody tr.row-pending:hover { background: rgba(245,158,11,.16) !important; }
.outstanding-tag { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.outstanding-tag.overdue { background: rgba(239,68,68,.15); color: #ef4444; }
.outstanding-tag.within { background: rgba(245,158,11,.15); color: #f59e0b; }
.outstanding-tag.paid { background: rgba(34,197,94,.12); color: #22c55e; }
.outstanding-tag.settled { background: rgba(245,158,11,.15); color: #d97706; }
.inv-stock-ok { color: #22c55e; }
.inv-stock-low { color: #ef4444; }

/* Invoice list polish */
#page-invoice .table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
#page-invoice .tbl { font-size: 13.5px; }
#page-invoice .tbl th {
  padding: 11px 12px;
  font-size: 11px;
  letter-spacing: .42px;
}
#page-invoice .tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
#page-invoice .inv-list-row td { vertical-align: middle; }
.inv-list-date {
  font-size: 12.5px;
  color: var(--text2);
  font-weight: 800;
}
.inv-list-date-mobile { display: none; }
.inv-due-chip-mobile { display: none; }
.inv-amt-mobile { display: none; }
.inv-list-date-inline { display: none; }
.inv-list-invno {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .2px;
}
.inv-list-customer {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.3;
}
.inv-list-sub {
  font-size: 11.5px;
  color: var(--text3);
  margin-top: 2px;
}
.inv-list-products {
  font-size: 12.5px;
  color: var(--text2);
  font-weight: 700;
  line-height: 1.35;
  max-width: 220px;
}
.inv-list-amt {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}
.inv-list-amt-pending { color: #f59e0b; }

/* Invoice list — simple flat cards on mobile (no nested boxes) */
@media (max-width: 900px) {
  #page-invoice .card-pro {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  #page-invoice .card-pro > .card-pro-header {
    display: none;
  }
  #page-invoice .card-pro > .table-wrap {
    padding: 0 !important;
    overflow: visible;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
  }
  #page-invoice #invKpi.kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  #page-invoice #invKpi .kpi-card {
    padding: 10px 11px;
    min-width: 0;
    overflow: hidden;
  }
  #page-invoice #invKpi .kpi-label {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #page-invoice #invKpi .kpi-value {
    font-size: 14px;
    margin-top: 3px;
  }
  #page-invoice #invKpi .kpi-card:nth-child(n+5) {
    display: none;
  }
  #page-invoice .tbl.is-mobile-cards tbody {
    gap: 8px;
  }
  #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "inv status"
      "cust cust"
      "prod prod"
      "money money"
      "actions actions";
    gap: 4px 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid #22c55e;
    background: #ffffff !important;
    align-items: center;
  }
  #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row.row-overdue {
    border-color: #ef4444;
    background: #ffffff !important;
  }
  #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row.row-pending {
    border-color: #f59e0b;
    background: #ffffff !important;
  }
  #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row:hover {
    background: #ffffff !important;
  }
  #page-invoice .tbl.is-mobile-cards td {
    font-size: 13px;
    line-height: 1.3;
    padding: 0;
    border: none;
    background: transparent !important;
  }
  #page-invoice .tbl.is-mobile-cards td::before {
    display: none !important;
  }
  #page-invoice .tbl.is-mobile-cards .inv-cell-invno { grid-area: inv; }
  #page-invoice .tbl.is-mobile-cards .inv-cell-status { grid-area: status; justify-self: end; }
  #page-invoice .tbl.is-mobile-cards .inv-cell-customer { grid-area: cust; }
  #page-invoice .tbl.is-mobile-cards .inv-cell-product { grid-area: prod; }
  #page-invoice .tbl.is-mobile-cards .inv-cell-total { grid-area: money; }
  #page-invoice .tbl.is-mobile-cards .inv-cell-actions { grid-area: actions; }
  #page-invoice .tbl.is-mobile-cards .inv-cell-desktop {
    display: none !important;
  }
  #page-invoice .tbl.is-mobile-cards .inv-amt-desktop {
    display: none !important;
  }
  #page-invoice .tbl.is-mobile-cards .inv-amt-mobile {
    display: flex;
  }
  #page-invoice .tbl.is-mobile-cards .inv-list-date-inline {
    display: inline;
  }
  #page-invoice .tbl.is-mobile-cards .inv-list-invno {
    font-size: 13px;
    letter-spacing: 0;
  }
  #page-invoice .tbl.is-mobile-cards .inv-list-customer {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  #page-invoice .tbl.is-mobile-cards .inv-list-phone {
    display: none;
  }
  #page-invoice .tbl.is-mobile-cards .inv-list-products {
    max-width: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #page-invoice .tbl.is-mobile-cards .inv-money-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
  }
  #page-invoice .tbl.is-mobile-cards .inv-money-total {
    color: var(--text);
    font-weight: 800;
    font-size: 14px;
  }
  #page-invoice .tbl.is-mobile-cards .inv-money-sep {
    color: var(--text3);
    font-weight: 600;
  }
  #page-invoice .tbl.is-mobile-cards .inv-money-baki {
    color: #d97706;
    font-weight: 800;
  }
  #page-invoice .tbl.is-mobile-cards .outstanding-tag {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 999px;
  }
  #page-invoice .tbl.is-mobile-cards .inv-cell-actions {
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
  }
  #page-invoice .tbl.is-mobile-cards .action-btns {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  #page-invoice .tbl.is-mobile-cards .action-btns::-webkit-scrollbar {
    display: none;
  }
  #page-invoice .tbl.is-mobile-cards .action-btns .btn-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
  }
}

.inv-credit-chip,
.inv-mode-chip,
.inv-due-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.inv-credit-chip {
  background: rgba(59,130,246,.14);
  color: #60a5fa;
}
.inv-mode-chip {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.inv-due-chip {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.inv-due-chip.is-overdue {
  background: rgba(239,68,68,.15);
  color: #ef4444;
  border-color: rgba(239,68,68,.24);
}
.inv-due-chip.is-open {
  background: rgba(245,158,11,.12);
  color: #f59e0b;
  border-color: rgba(245,158,11,.24);
}
.inv-due-chip.is-paid {
  background: rgba(34,197,94,.12);
  color: #22c55e;
  border-color: rgba(34,197,94,.24);
}
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.action-btns .btn-icon { width: 30px; height: 30px; }
.action-btns .btn-icon svg.lucide,
.action-btns .btn-icon .icon { width: 15px; height: 15px; }

/* Hidden on-screen host for PDF capture (must stay at left:0 — off-screen coords crop in html2canvas) */
.invoice-pdf-host {
  position: fixed;
  top: 0;
  left: 0;
  width: 794px;
  max-width: 794px;
  background: #fafafa;
  opacity: 0;
  visibility: hidden;
  overflow: visible !important;
  min-height: auto !important;
  pointer-events: none;
  z-index: -1;
}
.invoice-pdf-host.invoice-print-area {
  border: none !important;
  border-radius: 0 !important;
}
.invoice-pdf-host .inv-wrap {
  width: 794px !important;
  max-width: 794px !important;
  margin: 0 !important;
  box-sizing: border-box;
  overflow: visible;
  padding: 36px 40px !important;
}

/* ── 04-backup.css ── */
/* ================================================================
   BACKUP PAGE
================================================================ */
.backup-icon {
  width: 72px; height: 72px;
  background: var(--surface2);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.backup-icon svg.lucide,
.backup-icon .icon { width: 34px; height: 34px; color: var(--text2); }
.backup-icon.restore svg.lucide,
.backup-icon.restore .icon { color: var(--info); }

.danger-zone-card {
  border: 1px solid rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .04);
}

.backup-includes-list {
  margin: 0;
  padding: 0 0 0 20px;
  font-size: 13px;
  line-height: 1.8;
}
.backup-includes-list li { margin-bottom: 2px; }

.backup-download-card .settings-panel-desc { margin: 0 0 14px; }
.backup-scope-segment {
  max-width: none;
  margin-bottom: 12px;
}
.backup-period-bar {
  margin: 0 0 8px;
  padding: 0;
}
.backup-period-bar .form-ctrl { min-width: 0; }

.backup-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.backup-status-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.backup-status-label {
  display: block;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.backup-status-item strong {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.backup-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 10px;
  cursor: pointer;
}
.backup-toggle-row input { margin-top: 3px; accent-color: var(--text); }

.inv-settle-card {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--warning);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
}
.inv-settle-card.visible { display: block; }
.inv-settle-loss-box { margin-top: 8px; margin-bottom: 0; }

.party-hisab-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.party-hisab-empty-icon { width: 56px; height: 56px; opacity: 0.35; margin-bottom: 12px; }
.party-hisab-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.party-profile-card { padding: 16px 18px; }
.party-profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}
.party-profile-name { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.party-profile-meta { font-size: 13px; color: var(--text2); line-height: 1.5; }
.party-profile-lifetime {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 12px;
  color: var(--text3);
}
.party-profile-lifetime strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-top: 2px;
}
.tbl-compact th, .tbl-compact td { padding: 6px 8px; font-size: 12px; }

#confirmMsg { white-space: pre-line; line-height: 1.55; font-size: 13px; }
.text-warning { color: var(--warning) !important; }

/* Invoice Print Styles */
.invoice-print-area {
  font-family: var(--font), system-ui, sans-serif;
  background: #fafafa;
  color: #4b5563;
  min-height: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.invoice-preview-card .card-pro-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.invoice-preview-card .invoice-print-area { border: 1px solid #e5e7eb; }
@media (min-width: 992px) {
  .invoice-create-row { align-items: flex-start; }
  .invoice-preview-col { position: sticky; top: 12px; }
  .invoice-preview-card .invoice-print-area {
    transform: scale(0.78);
    transform-origin: top center;
    width: 128%;
    margin-left: -14%;
    margin-bottom: -18%;
  }
  .invoice-form-col .form-ctrl {
    min-height: 42px;
    font-size: 14px;
  }
  .invoice-form-col textarea.form-ctrl { min-height: 78px; }
  .invoice-form-col .search-select { z-index: 8; }
}
.invoice-modal-body { padding: 0; background: #f3f4f6; }
.invoice-modal-body .invoice-print-area { border-radius: 0; }
.inv-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 360px;
  color: var(--text2);
  padding: 40px;
}
.invoice-form-header-left {
  display: flex; align-items: center; gap: 14px;
}
.btn-icon-text {
  display: inline-flex; align-items: center; gap: 6px;
}
.modal-box-xl { max-width: 920px; width: 96%; }
.modal-box-lg { max-width: 640px; width: 94%; }

/* Full-screen production entry (lots of products / labour) */
.modal-overlay:has(.modal-box-fullscreen) {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.modal-box-fullscreen {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-box-fullscreen .modal-header,
.modal-box-fullscreen .modal-footer {
  flex-shrink: 0;
}
.modal-box-fullscreen .modal-body,
.modal-box-fullscreen .prod-modal-body {
  flex: 1;
  overflow-y: auto;
  max-height: none;
}

/* Raw material admin list */
.mat-setup-gate { margin-bottom: 16px; }
.mat-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mat-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 12px 14px;
}
.mat-admin-row.is-inactive {
  opacity: 0.72;
  background: var(--surface);
}
.mat-admin-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  flex: 1;
}
.mat-admin-row-main strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.mat-admin-row-main em {
  font-style: normal;
  font-size: 11px;
  color: var(--text3);
}
.mat-admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mat-admin-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.mat-admin-badge.is-on {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}
.mat-admin-badge.is-off {
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}
.mat-selected-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.mat-chip em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
}
.mp-lines-wrap {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.mp-lines-tbl th,
.mp-lines-tbl td {
  padding: 6px 8px;
  vertical-align: middle;
}
.mp-lines-tbl .form-ctrl {
  min-width: 0;
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
}
.mp-lines-tbl th:nth-child(1),
.mp-lines-tbl td:nth-child(1) { min-width: 132px; }
.mp-lines-tbl th:nth-child(2),
.mp-lines-tbl td:nth-child(2) { min-width: 140px; }
.mp-lines-tbl th:nth-child(3),
.mp-lines-tbl td:nth-child(3),
.mp-lines-tbl th:nth-child(4),
.mp-lines-tbl td:nth-child(4),
.mp-lines-tbl th:nth-child(5),
.mp-lines-tbl td:nth-child(5) { min-width: 88px; width: 100px; }
.mp-lines-tbl th:nth-child(6),
.mp-lines-tbl td:nth-child(6) { min-width: 120px; }
.mp-lines-tbl th:last-child,
.mp-lines-tbl td:last-child { width: 40px; text-align: center; }

.mat-history-section {
  margin-top: 12px;
}
.mat-history-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.2px;
  margin-bottom: 8px;
}

/* Raw materials — page-specific mobile tweaks (global KPI/list styles in 05-responsive) */
@media (max-width: 900px) {
  #page-materials > .settings-panel-desc {
    display: none;
  }
  #page-materials #matSelectedStripCard {
    padding: 8px 10px;
    margin-bottom: 8px !important;
  }
  #page-materials .mat-history-heading {
    font-size: 13.5px;
    margin-bottom: 6px;
  }
  #page-materials .mat-history-tbl.is-mobile-cards tbody tr {
    grid-template-columns: 1fr 1fr 1fr;
  }
  #page-materials .mat-history-tbl.is-mobile-cards td:nth-child(2) {
    grid-column: span 2;
  }
}

.inv-wrap {
  padding: 28px 32px;
  background: #fafafa;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}
.inv-accent-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d1d5db 0%, #9ca3af 50%, #d1d5db 100%);
}
.inv-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d1d5db;
  gap: 20px;
}
.inv-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.inv-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}
.inv-brand-text { min-width: 0; flex: 1; }
.inv-company-name {
  font-size: 22px; font-weight: 800; color: #374151;
  letter-spacing: -0.2px; line-height: 1.25;
}
.inv-company-sub { font-size: 12px; color: #6b7280; margin-top: 4px; }
.inv-meta-box {
  flex-shrink: 0;
  min-width: 200px;
  max-width: 300px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.inv-meta-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: #e5e7eb;
  border-bottom: 1px solid #d1d5db;
}
.inv-doc-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #374151;
}
.inv-meta-no {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  color: #374151;
}
.inv-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 7px 10px;
  font-size: 10px;
  color: #9ca3af;
}
.inv-meta-row strong {
  color: #374151;
  font-weight: 800;
  margin-left: 3px;
}
.inv-meta-head .inv-status { flex-shrink: 0; }
.inv-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.inv-status.paid { background: #e5e7eb; color: #374151; }
.inv-status.partial { background: #f3f4f6; color: #6b7280; }
.inv-status.settled { background: rgba(245,158,11,.15); color: #d97706; }
.inv-status.pending { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }
.inv-status.overdue { background: #f3f4f6; color: #52525b; border: 1px solid #d1d5db; }

.inv-parties {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
.inv-party-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}
.inv-party-from { background: #f9fafb; }
.inv-party-label {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: #9ca3af; margin-bottom: 6px;
}
.inv-party-name { font-size: 14px; font-weight: 800; color: #374151; margin-bottom: 3px; }
.inv-party-sub { font-size: 11.5px; color: #6b7280; line-height: 1.45; }

.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; background: #fff; }
.inv-table th {
  background: #e5e7eb; color: #374151;
  padding: 9px 10px; text-align: left;
  font-size: 10px; font-weight: 800; letter-spacing: 0.3px;
  border-bottom: 1px solid #d1d5db;
}
.inv-table th.text-right, .inv-table td.text-right { text-align: right; }
.inv-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
  vertical-align: top;
  color: #4b5563;
}
.inv-table tbody tr:nth-child(even) { background: #f9fafb; }
.inv-table .inv-item-desc { font-weight: 800; color: #374151; }
.inv-table .inv-item-sub { font-size: 10px; color: #9ca3af; margin-top: 2px; }

.inv-bottom {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.inv-amount-words {
  font-size: 11.5px;
  color: #6b7280;
  padding: 10px 12px;
  background: #fff;
  border-left: 3px solid #d1d5db;
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
  line-height: 1.55;
}
.inv-totals-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.inv-total-row {
  display: flex; justify-content: space-between;
  padding: 7px 12px;
  font-size: 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #6b7280;
}
.inv-total-row span:last-child { font-weight: 800; color: #374151; }
.inv-total-row.grand {
  background: #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
  border-bottom: none;
  padding: 10px 12px;
}
.inv-total-row.grand span:last-child { font-weight: 800; color: #1f2937; }
.inv-total-row.pending-row { background: #f9fafb; color: #6b7280; }
.inv-total-row.pending-row span:last-child { color: #52525b; font-weight: 800; }

.inv-bank {
  font-size: 11.5px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 10px;
  color: #6b7280;
}
.inv-bank-label {
  font-size: 9px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: #9ca3af; margin-bottom: 4px;
}
.inv-notes {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: #6b7280;
  line-height: 1.5;
}
.inv-notes-label {
  font-size: 9px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: #9ca3af; margin-bottom: 4px;
}
.inv-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: 18px;
  border-top: 1px dashed #d1d5db;
  gap: 20px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.inv-terms { font-size: 10.5px; color: #9ca3af; max-width: 55%; line-height: 1.55; }
.inv-sig { text-align: right; min-width: 180px; flex-shrink: 0; }
.inv-sig-line { width: 160px; border-top: 1px solid #6b7280; margin: 48px 0 8px auto; }
.inv-sig-label { font-size: 11px; color: #374151; font-weight: 800; }
.inv-sig-company { font-size: 10px; color: #6b7280; margin-top: 3px; }

/* ── 05-responsive-print.css ── */
/* ================================================================
   SIDEBAR OVERLAY (mobile)
================================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.5);
}

/* ================================================================
   TABLET + MOBILE — flatten nested panels + compact page chrome
   main-content is already the outer panel; inner card-pro boxes waste space
================================================================ */
@media (max-width: 1024px) {
  .main-content .page .card-pro,
  .main-content .page .reports-filter-card,
  .main-content .page .prod-product-calc-card,
  .main-content .settings-cards-grid > .card-pro,
  body.admin-panel .main-content .page .card-pro {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .main-content .page .card-pro:hover,
  body.admin-panel .main-content .page .card-pro:hover {
    box-shadow: none;
    border-color: transparent;
  }

  .main-content .page .card-pro + .card-pro,
  .main-content .page .card-pro.mt-3,
  .main-content .page .card-pro.mt-4,
  body.admin-panel .main-content .page .card-pro + .card-pro,
  body.admin-panel .main-content .page .card-pro.mt-3 {
    margin-top: 14px !important;
  }

  .main-content .page .card-pro-header,
  body.admin-panel .main-content .page .card-pro-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }

  .main-content .page .table-wrap {
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .main-content .page .admin-table-wrap,
  body.admin-panel .main-content .page .admin-table-wrap {
    border: none;
    border-radius: 0;
    background: transparent;
  }

  /* ── Global compact stats cards (all pages) ── */
  .page .kpi-grid,
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }
  .page .kpi-card,
  .kpi-card {
    padding: 8px 9px;
    border-radius: 10px;
  }
  .page .kpi-card::before,
  .kpi-card::before {
    height: 2px;
  }
  .page .kpi-card-top,
  .kpi-card-top {
    margin-bottom: 4px;
  }
  .page .kpi-icon,
  .kpi-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .page .kpi-icon svg.lucide,
  .page .kpi-icon .icon,
  .kpi-icon svg.lucide,
  .kpi-icon .icon {
    width: 13px;
    height: 13px;
  }
  .page .kpi-info-dot,
  .kpi-info-dot {
    display: none;
  }
  .page .kpi-label,
  .kpi-label {
    font-size: 10.5px;
    line-height: 1.2;
  }
  .page .kpi-value,
  .kpi-value {
    font-size: 15px;
    margin-top: 2px;
  }
  .page .kpi-bd-row:first-child .kpi-bd-val {
    font-size: 15px;
  }

  /* ── Compact page chrome ── */
  .page .page-header {
    margin-bottom: 8px;
    gap: 8px;
  }
  .page .page-header h1,
  .page .dash-title {
    font-size: 24px;
  }
  .page .page-sub,
  .page > .settings-panel-desc,
  .page .dash-sub {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .page .card-pro-title {
    font-size: 13.5px;
  }
  .page .page-header .btn-outline,
  .page .page-header .btn-pro {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* ── Horizontal chip / tab strips ── */
  .mat-selected-strip,
  .prod-inventory-tabs,
  .chip-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .mat-selected-strip::-webkit-scrollbar,
  .prod-inventory-tabs::-webkit-scrollbar,
  .chip-strip::-webkit-scrollbar {
    display: none;
  }
  .mat-chip,
  .prod-inventory-tab {
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px 8px;
    font-size: 11px;
  }
  .prod-inventory-tab {
    padding: 5px 10px;
    font-size: 12px;
  }
  .mat-chip em {
    font-size: 10px;
  }

  /* ── Dense inventory / stats mini-cards ── */
  .prod-inventory-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .prod-inventory-card {
    padding: 8px 9px;
    border-radius: 10px;
  }
  .prod-inventory-card-head {
    margin-bottom: 8px;
  }
  .prod-inventory-card-head strong {
    font-size: 12px;
  }
  .prod-inventory-stats {
    gap: 4px;
  }
  .prod-inventory-stats small {
    font-size: 9px;
  }
  .prod-inventory-stats b {
    font-size: 13px;
  }
  .prod-inventory-stats--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .prod-inventory-progress {
    margin-top: 8px;
    height: 3px;
  }

  /* ── Table → card list (all pages) ── */
  .page .table-wrap:not(.no-mobile-cards):not(.mp-lines-wrap) {
    overflow-x: visible;
  }
  .page .tbl.is-mobile-cards {
    min-width: 0;
  }
  .page .tbl.is-mobile-cards thead {
    display: none;
  }
  .page .tbl.is-mobile-cards tbody {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .page .tbl.is-mobile-cards tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
  }
  .page .tbl.is-mobile-cards tbody tr:hover {
    background: #ffffff;
  }
  .page .tbl.is-mobile-cards tbody tr:last-child td {
    border-bottom: none;
  }
  .page .tbl.is-mobile-cards td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    border: none;
    white-space: normal;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
  }
  .page .tbl.is-mobile-cards td::before {
    content: attr(data-label);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .2px;
    text-transform: uppercase;
    color: var(--text3);
    line-height: 1.1;
    margin-bottom: 1px;
  }
  .page .tbl.is-mobile-cards td[colspan] {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
    font-weight: 600;
    padding: 12px 6px;
  }
  .page .tbl.is-mobile-cards td[colspan]::before {
    display: none;
  }
  .page .tbl.is-mobile-cards td.mobile-card-actions,
  .page .tbl.is-mobile-cards td.mat-history-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    padding-top: 5px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
    gap: 8px;
  }
  .page .tbl.is-mobile-cards td.mobile-card-actions::before,
  .page .tbl.is-mobile-cards td.mat-history-actions::before {
    display: none;
  }
  .page .tbl.is-mobile-cards .action-btns {
    margin-left: 0;
    gap: 4px;
  }
  .page .tbl.is-mobile-cards .action-btns .btn-sm {
    padding: 3px 8px;
    font-size: 11px;
  }
  .page .tbl.is-mobile-cards .action-btns .btn-icon {
    width: 28px;
    height: 28px;
  }
}

/* ================================================================
   TABLET — narrow sidebar: icon + short label stacked (user portal)
================================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
  body.user-portal {
    --sidebar-w-tablet: 88px;
  }

  body.user-portal .sidebar {
    top: var(--shell-gap);
    left: var(--shell-gap);
    bottom: var(--shell-gap);
    width: var(--sidebar-w-tablet);
    height: calc(100vh - (var(--shell-gap) * 2));
    border-radius: var(--panel-radius);
    transform: none !important;
  }

  body.user-portal .sidebar-brand {
    padding: 8px 4px 6px;
  }

  body.user-portal .brand-icon-only {
    max-height: 32px;
    padding: 0 2px;
  }

  body.user-portal .brand-icon-only .brand-logo {
    max-height: 28px;
  }

  body.user-portal .sidebar-nav {
    padding: 4px 4px 10px;
  }

  body.user-portal .nav-section-label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-align: center;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .25px;
    text-transform: uppercase;
    color: var(--text3);
    padding: 8px 2px 3px;
    margin: 0 1px 1px;
    line-height: 1.2;
    border-top: 1px solid var(--border);
    opacity: .9;
  }

  body.user-portal .sidebar-nav > .nav-section-label:first-child {
    border-top: none;
    padding-top: 2px;
  }

  /* Language block follows Support — treat as its own mini section */
  body.user-portal .sidebar-lang::before {
    content: attr(aria-label);
    display: block;
    text-align: center;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .25px;
    text-transform: uppercase;
    color: var(--text3);
    padding: 8px 2px 4px;
    margin: 0 1px 2px;
    line-height: 1.2;
    border-top: 1px solid var(--border);
    opacity: .9;
  }

  body.user-portal .sidebar-lang-label {
    display: none;
  }

  body.user-portal .nav-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 3px;
    margin-bottom: 2px;
    text-align: center;
    border-radius: 10px;
    white-space: normal;
  }

  body.user-portal .nav-item > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.15;
    max-width: 100%;
    white-space: normal;
  }

  body.user-portal .nav-item svg.lucide,
  body.user-portal .nav-item .icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
  }

  body.user-portal .sidebar-lang {
    padding: 0 3px 10px;
    margin-top: 0;
  }

  body.user-portal .sidebar-lang-label {
    display: none;
  }

  body.user-portal .lang-switch {
    flex-direction: column;
    gap: 3px;
  }

  body.user-portal .lang-option {
    font-size: 9px;
    padding: 4px 2px;
    line-height: 1.1;
  }

  body.user-portal .main-content {
    top: var(--shell-gap);
    left: calc(var(--shell-gap) + var(--sidebar-w-tablet) + var(--shell-gap));
    right: var(--shell-gap);
    bottom: var(--shell-gap);
    padding: 14px 10px 10px 14px;
  }

  body.user-portal .mobile-nav-fab {
    display: none !important;
  }

  body.user-portal .sidebar-overlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* ================================================================
   PHONE — bottom nav shell (sidebar hidden via 12-native-mobile.css)
================================================================ */
@media (max-width: 767px) {
  .sidebar {
    display: none !important;
  }
  .sidebar-overlay { display: none !important; }

  .topbar {
    display: none !important;
  }

  .mobile-nav-fab {
    display: none !important;
  }

  .main-content {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 56px 10px 10px 14px;
    border-radius: 0;
  }

  .page .page-header h1,
  .page .dash-title {
    font-size: 22px;
  }
}

@media (max-width: 560px) {
  :root, [data-theme="dark"], [data-theme="light"] {
    --shell-gap: 6px;
  }
  .page-header h1 { font-size: 22px; }
  .page-sub { font-size: 13px; }
  .modal-box { border-radius: var(--radius); }
  .inv-parties { grid-template-columns: 1fr; }
  .inv-bottom { grid-template-columns: 1fr; }
  .inv-header { flex-direction: column; gap: 16px; }
  .inv-meta-box { width: 100%; max-width: 280px; }
}

/* iOS Safari zooms focused inputs when font-size < 16px — keep ≥16 on touch widths */
@media (max-width: 1024px) {
  input.form-ctrl,
  select.form-ctrl,
  textarea.form-ctrl,
  .form-ctrl,
  .passcode-input,
  .auth-otp-input,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]):not([type="image"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ================================================================
   PRINT STYLES
================================================================ */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  .sidebar, .topbar, .modal-overlay, .toast-container,
  .mobile-nav-fab, .platform-contact, .sidebar-overlay { display: none !important; }
  .page-header .btn-pro, .page-header .btn-outline,
  .filter-bar, .page-filter-toolbar, .action-btns, #invoicePreviewCard .card-pro-header { display: none !important; }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fafafa !important;
    color: #4b5563;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .page { display: none !important; }
  .page.active { display: block !important; padding: 0; }
  .invoice-form-col,
  .col-lg-5.invoice-form-col { display: none !important; }
  .invoice-preview-col,
  .col-lg-7.invoice-preview-col,
  .col-lg-5.invoice-preview-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    display: block !important;
  }
  .invoice-preview-card .invoice-print-area {
    transform: none !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .card-pro { border: none !important; box-shadow: none !important; padding: 0 !important; background: transparent !important; }
  .invoice-print-area { background: #fafafa !important; margin: 0 !important; padding: 0 !important; border: none !important; }
  .inv-wrap { padding: 12mm 14mm !important; margin: 0 !important; }

  /* Report print */
  .print-report-area { display: block; }
}

/* ================================================================
   MISC UTILITIES
================================================================ */
.text-muted  { color: var(--text3) !important; }
.text-success{ color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning{ color: var(--warning) !important; }
.mono        { font-family: var(--font), sans-serif; }
.w-100       { width: 100%; }
.flex-fill   { flex: 1 1 auto; }
.gap-2       { gap: 8px !important; }
.d-flex      { display: flex !important; }
.flex-wrap   { flex-wrap: wrap; }
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text3); font-size: 13px;
}
.empty-state svg.lucide,
.empty-state .icon {
  width: 48px; height: 48px; opacity: .3; display: block; margin: 0 auto 12px;
}

/* Local inline Lucide SVGs */
.icon, svg.lucide, svg.icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
  flex-shrink: 0;
  display: block;
}
.toast-icon svg.lucide,
.toast-icon.icon { width: 18px; height: 18px; }
.inv-placeholder-icon svg.lucide,
.inv-placeholder-icon.icon { width: 56px; height: 56px; opacity: .22; }

/* Inv item row delete button fix */
.inv-items-head .inv-items-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 2px;
}
.inv-item-row .btn-icon { width: 36px; height: 36px; margin-top: 0; }

/* ── 06-production.css ── */
/* ================================================================
   PRODUCTION — compact category sheet
================================================================ */
#productionModal .prod-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
#productionModal .prod-sticky-bar {
  position: relative;
  top: auto;
  z-index: 1;
  background: #fff;
  padding: 12px 22px 10px;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.prod-sticky-tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.prod-sticky-bar:has(.prod-cat-tabs[hidden]) .prod-sticky-tools {
  margin-bottom: 0;
}
.prod-date-widget {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 1 340px;
  width: auto;
  min-width: 220px;
  max-width: 360px;
}
.prod-date-stepper {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.prod-date-nav,
.prod-date-cal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.prod-date-nav:hover,
.prod-date-cal:hover {
  border-color: #007aff;
  color: #007aff;
  background: rgba(0, 122, 255, 0.08);
}
.prod-date-nav .icon,
.prod-date-cal .icon {
  width: 18px;
  height: 18px;
}
.prod-date-display {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.prod-date-display strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}
.prod-date-display span {
  font-size: 11px;
  font-weight: 700;
  color: #007aff;
}
.prod-date-cal {
  position: relative;
  overflow: hidden;
}
.prod-date-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.prod-entry-empty {
  margin: 0;
  padding: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
}

.prod-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.prod-cat-tabs[hidden],
.prod-calc-panel[hidden],
.prod-qty-panel[hidden],
.prod-pole-subpanel[hidden] {
  display: none !important;
}
.prod-calc-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prod-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.prod-cat-tab.is-active {
  border-color: #007aff;
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
}

.prod-cat-tab-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 7px;
}

.prod-cat-tab.is-active .prod-cat-tab-count {
  color: #007aff;
  background: rgba(0, 122, 255, 0.12);
}

.prod-cat-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prod-pole-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prod-pole-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.prod-pole-subtab.is-active {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.prod-entry-sheet {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.prod-entry-cols {
  display: grid;
  grid-template-columns: minmax(140px, 1.25fr) repeat(3, minmax(92px, 1fr)) minmax(96px, 0.85fr);
  gap: 8px 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text3);
}
.prod-product-calc-card {
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.prod-product-calc-card:last-child {
  border-bottom: none;
}
.prod-product-calc-card.has-qty {
  background: color-mix(in srgb, #22c55e 7%, var(--surface));
}
.prod-entry-main {
  display: grid;
  grid-template-columns: minmax(140px, 1.25fr) repeat(3, minmax(92px, 1fr)) minmax(96px, 0.85fr);
  gap: 8px 10px;
  align-items: start;
}
.prod-entry-product {
  min-width: 0;
  padding-top: 18px;
}
.prod-entry-product strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}
.prod-entry-product span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
}
.prod-entry-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-width: 0;
}
.prod-entry-field-lbl {
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
}
@media (min-width: 861px) {
  .prod-entry-field-lbl {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .prod-entry-product,
  .prod-entry-sum {
    padding-top: 0;
    align-self: center;
  }
}
.prod-entry-field .form-ctrl {
  height: 36px;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 800;
}
.prod-entry-rate {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
}
.prod-entry-rate em {
  font-style: normal;
  white-space: nowrap;
}
.prod-calc-rate-input {
  width: 58px;
  max-width: 100%;
  height: 26px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 700;
}
.prod-entry-sum {
  min-width: 0;
  padding-top: 18px;
  text-align: right;
}
.prod-entry-sum .prod-calc-total-out,
.prod-entry-sum strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #007aff;
  line-height: 1.2;
}
.prod-entry-sum-break {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
}
.prod-entry-sum-break em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
}
.prod-entry-labour {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.prod-entry-labour-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
}
.prod-entry-labour .prod-labour-divide-section {
  margin-top: 0;
}

.modal-footer.prod-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.prod-modal-footer-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.prod-qty-panels {
  min-height: 120px;
}

.prod-qty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.prod-qty-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 12px;
}

.prod-qty-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.prod-qty-card-meta {
  font-size: 11px;
  color: var(--text3);
  margin: 2px 0 8px;
}

.prod-qty-card .form-label {
  display: block;
  margin: 6px 0 4px;
  font-size: 11px;
}

.prod-qty-brash-input,
.prod-qty-input {
  width: 100%;
}

.prod-inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.prod-inventory-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.prod-inventory-tab.is-active {
  border-color: #007aff;
  background: rgba(0, 122, 255, .1);
  color: #007aff;
}

.prod-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.prod-inventory-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #ffffff;
}

.prod-inventory-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.prod-inventory-card-head strong {
  font-size: 14px;
  line-height: 1.3;
}

.prod-inventory-card-head > span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text3);
  font-size: 10px;
  font-weight: 800;
}

.prod-inventory-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.prod-inventory-stats--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.prod-inventory-stats > div {
  min-width: 0;
}

.prod-inventory-stats small,
.prod-inventory-stats b {
  display: block;
}

.prod-inventory-stats small {
  margin-bottom: 2px;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
}

.prod-inventory-stats b {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

.prod-inventory-progress {
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.opening-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}
.card-pro > .opening-hint {
  margin: 0 16px 14px;
}
.opening-hint[hidden] {
  display: none !important;
}
.opening-hint-btn {
  margin-left: auto;
}

.prod-inventory-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #22c55e;
}

.prod-inventory-sold-pct {
  display: block;
  margin-top: 4px;
  color: var(--text3);
  font-size: 10px;
  text-align: right;
}

.prod-calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  position: relative;
  padding: 14px 22px 20px;
}
#productionModal.prod-rates-open .prod-calc-layout {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
}
.prod-rates-open-btn {
  flex: 0 0 auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.prod-rates-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  align-self: start;
}
.prod-rates-panel[hidden] { display: none !important; }
.prod-rates-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.prod-labour-calc {
  margin: 0 0 16px;
  padding: 14px 16px;
}
.prod-bela-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.prod-labour-calc-rate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.prod-labour-calc-totals {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.prod-labour-calc-totals .calc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}
.prod-labour-calc-totals .calc-row-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-weight: 800;
}
.prod-labour-calc-actions {
  display: none;
}
.prod-divide-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.prod-other-products {
  margin: 8px 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--surface2);
}
.prod-other-products summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--text2);
}
@media (max-width: 900px) {
  #productionModal.prod-rates-open .prod-calc-layout {
    grid-template-columns: 1fr;
  }
  .prod-labour-family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.prod-grand-total-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.prod-grand-total-bar small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prod-grand-total-bar strong {
  font-size: 15px;
}
.prod-grand-total-main strong {
  color: #007aff;
  font-size: 18px;
}
.prod-product-calcs-root {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#productionModal #prodCalcPreview {
  display: none !important;
}

/* Majdoor divide — compact family cards */
.prod-labour-divide-section {
  margin-top: 0;
}
.prod-labour-divide-wrap {
  max-width: 100%;
}
.prod-labour-family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.prod-labour-family-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  padding: 8px;
  min-width: 0;
}
.prod-labour-family-card.is-selected {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 55%, var(--border));
  background: color-mix(in srgb, var(--primary, #2563eb) 5%, var(--surface));
}
.prod-labour-family-members {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prod-labour-family-members-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3);
}
.prod-calc-split-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
}

.prod-labour-workers {
  max-height: none;
  overflow: visible;
}

.prod-divide-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}
.prod-divide-row.is-selected {
  border: none;
  background: transparent;
}
.prod-divide-main .prod-labour-worker-name {
  font-size: 13px;
}
.prod-divide-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}
.prod-divide-vals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.prod-divide-sub {
  margin: 0;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.prod-divide-sub.is-selected {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 40%, var(--border));
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, var(--surface2));
}
.prod-divide-check {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary, #2563eb);
  flex-shrink: 0;
}
.prod-divide-row .prod-labour-worker-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.prod-divide-row .prod-divide-pct,
.prod-divide-row .prod-labour-amount-input {
  min-width: 0;
  text-align: center;
  box-sizing: border-box;
}
.prod-divide-row .prod-divide-pct {
  width: 38px;
  min-height: 26px;
  padding: 2px 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  opacity: 0.7;
}
.prod-divide-row .prod-labour-amount-input {
  width: 72px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
}
.prod-divide-row .prod-labour-amount-input[readonly],
.prod-divide-row .prod-divide-pct[readonly] {
  background: var(--surface2);
  opacity: 1;
}
.prod-divide-row .prod-divide-pct[readonly] {
  opacity: 0.65;
}
.prod-divide-sub .prod-divide-pct {
  width: 34px;
  min-height: 24px;
  font-size: 10px;
}
.prod-divide-sub .prod-labour-amount-input {
  width: 64px;
  min-height: 28px;
  font-size: 12px;
}

/* legacy */
.prod-labour-divide-table,
.prod-labour-divide-head,
.prod-labour-divide-body {
  display: none;
}
.prod-labour-divide-grid,
.prod-labour-groups-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prod-labour-group-col,
.prod-labour-group-subs {
  display: contents;
}

.prod-rates-panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
}
.prod-rate-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prod-rate-name {
  font-size: 13px;
}
.prod-rate-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.prod-rate-field > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
}

.brick-type-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brick-type-radio {
  flex: 1 1 calc(50% - 5px);
  min-width: 130px;
  margin: 0;
  cursor: pointer;
}

.brick-type-radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.brick-type-radio-box {
  display: block;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
}

.brick-type-radio-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

@media (max-width: 860px) {
  #productionModal.modal-overlay,
  #productionModal .modal-box,
  #productionModal .modal-box-fullscreen {
    border-radius: 0 !important;
  }
  .prod-entry-cols {
    display: none;
  }
  /* Flatten nested sheet — each product is its own card */
  .prod-entry-sheet {
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .prod-product-calc-card {
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
  }
  .prod-product-calc-card:last-child {
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  }
  .prod-product-calc-card.has-qty {
    background: color-mix(in srgb, #22c55e 6%, #ffffff);
    border-color: color-mix(in srgb, #22c55e 35%, var(--border));
  }
  .prod-entry-main {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }
  .prod-entry-product {
    grid-column: 1 / -1;
    padding-top: 0;
  }
  .prod-entry-sum {
    grid-column: 1 / -1;
    padding-top: 4px;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
  }
  .prod-entry-sum-break {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-top: 0;
  }
  .prod-entry-labour {
    margin-top: 10px;
    padding-top: 10px;
  }
  .prod-entry-labour-head {
    margin-bottom: 6px;
  }
  .prod-labour-family-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .prod-labour-family-card {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
  }
  .prod-labour-family-members {
    margin-top: 6px;
    padding-top: 6px;
  }
  .prod-modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .prod-modal-footer-actions {
    margin-left: 0;
    justify-content: stretch;
  }
  .prod-modal-footer-actions .btn-outline,
  .prod-modal-footer-actions .btn-pro {
    flex: 1;
  }
  .prod-grand-total-bar {
    gap: 8px 14px;
    width: 100%;
    justify-content: space-between;
  }
  .prod-sticky-tools {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 8px;
  }
  .prod-date-widget {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }
  #productionModal .prod-sticky-bar {
    padding: 8px 12px 8px;
  }
  #productionModal .modal-header {
    padding: 10px 12px;
  }
  #productionModal .modal-title {
    font-size: 1.05rem;
  }
  #productionModal .prod-calc-layout {
    padding: 0;
  }
  #productionModal .prod-rates-panel {
    margin: 10px 12px 16px;
    padding: 12px;
    border-radius: 12px;
    position: static;
  }
  .prod-product-calcs-root {
    gap: 0;
    padding: 10px 12px 16px;
  }
  .prod-calc-panel {
    gap: 8px;
  }
  .prod-cat-tabs {
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .prod-cat-tabs::-webkit-scrollbar {
    display: none;
  }
  .prod-cat-tab {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 12px;
  }
  .prod-rates-open-btn {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .prod-pole-subtabs {
    gap: 6px;
    margin-bottom: 2px;
  }
}

@media (max-width: 640px) {
  .prod-labour-family-grid {
    grid-template-columns: 1fr;
  }
  .prod-rates-open-btn { margin: 0; }
  .prod-entry-main {
    grid-template-columns: 1fr 1fr;
  }
  .prod-entry-product { grid-column: 1 / -1; }
  .prod-entry-sum { grid-column: 1 / -1; }
  .prod-entry-field .form-ctrl {
    height: 40px;
    font-size: 15px;
  }
  .prod-entry-rate {
    font-size: 10px;
  }
  .prod-calc-rate-input {
    width: 52px;
    height: 24px;
    font-size: 11px;
  }
  .prod-date-nav,
  .prod-date-cal {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }
  .prod-date-display {
    padding: 4px 8px;
  }
  .prod-date-display strong {
    font-size: 12px;
  }
  .prod-date-display span {
    font-size: 10px;
  }
  .prod-grand-total-bar strong {
    font-size: 14px;
  }
  .prod-grand-total-main strong {
    font-size: 16px;
  }
}

.prod-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  line-height: 1.35;
}
.prod-list-item + .prod-list-item { margin-top: 4px; }
.prod-list-item strong { font-size: 13px; }
.prod-list-item span { font-size: 12px; color: var(--text2); font-weight: 700; }
.prod-list-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}

.prod-calc-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.prod-calc-amt strong {
  font-size: 13px;
  font-weight: 800;
}
.prod-calc-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prod-calc-line {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text3);
  font-weight: 600;
}
.prod-calc-line strong {
  color: var(--text2);
  font-weight: 800;
}
.prod-calc-sub {
  margin-top: 1px;
  padding-left: 8px;
  font-size: 10px;
  color: var(--text3);
  font-weight: 600;
}
.prod-calc-sum {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
  color: var(--text2);
  font-weight: 700;
}
.prod-calc-sum strong {
  color: var(--text);
}
.prod-calc-name {
  color: var(--text2);
  font-weight: 700;
}
.prod-calc-kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text3);
}

#productionTable td,
#page-labour .tbl td {
  vertical-align: top;
}

.labour-share-calc {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.labour-share-calc-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  margin-bottom: 10px;
}
.labour-share-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.labour-share-calc-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.labour-share-calc-block > .text-muted {
  font-size: 11px;
  font-weight: 700;
}

/* ── 07-daybook.css ── */
/* ================================================================
   DAY & MONTH HISAB
================================================================ */
.daybook-month-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.daybook-month-input {
  flex: 1;
  min-width: 160px;
  max-width: 220px;
  font-weight: 800;
}

.daybook-month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.daybook-month-chip {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--trans);
}

.daybook-month-chip:hover {
  border-color: var(--border2);
  color: var(--text);
}

.daybook-month-chip.active {
  background: rgba(59, 130, 246, .12);
  border-color: #3b82f6;
  color: #3b82f6;
}

.daybook-month-summary {
  margin-bottom: 8px;
}

.daybook-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 4px 2px 8px;
}

.daybook-day-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans), box-shadow var(--trans);
}

.daybook-day-item:hover {
  border-color: var(--border2);
  background: var(--surface);
}

.daybook-day-item.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, .08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .2);
}

.daybook-day-item.inactive {
  opacity: .55;
}

.daybook-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.daybook-day-date {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.daybook-day-wd {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.daybook-day-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.daybook-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
}

.daybook-day-sum {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

.daybook-day-muted {
  font-size: 12px;
  color: var(--text3);
  font-style: italic;
}

.daybook-detail-card {
  min-height: 320px;
}

.daybook-empty-hint {
  color: var(--text3);
  font-size: 14px;
  padding: 24px 8px;
  text-align: center;
}

.daybook-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.daybook-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.daybook-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
}

.daybook-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}

.daybook-stat-row.total {
  font-weight: 800;
  border-bottom: none;
  padding-top: 10px;
  color: var(--text);
}

.daybook-mini-total {
  font-size: 12px;
  color: var(--text2);
  margin: 10px 0 0;
}

.tbl-compact th,
.tbl-compact td {
  padding: 8px 10px;
  font-size: 12px;
}

.prod-split-line {
  display: inline;
}

.prod-split-line + .prod-split-line::before {
  content: ' · ';
  color: var(--text3);
}

/* ── 08-settings-auth.css ── */
/* ================================================================
   SETTINGS — card-pro layout (matches Backup / rest of app)
================================================================ */
.page-settings {
  max-width: none;
  width: 100%;
}

.page-settings .page-header {
  align-items: flex-start;
}
.settings-lang-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}
.settings-pref-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.settings-lang-inline-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--text3);
  line-height: 1.2;
  white-space: nowrap;
}
.settings-lang-switch {
  width: 168px;
  max-width: 100%;
}
.settings-font-switch {
  width: 220px;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.settings-lang-switch .lang-option,
.settings-font-switch .font-scale-option {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}
.font-scale-option {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
}
.font-scale-option:hover {
  border-color: var(--border2);
  color: var(--text);
}
.font-scale-option.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
@media (max-width: 640px) {
  .settings-lang-inline {
    width: 100%;
    align-items: stretch;
    margin-left: 0;
  }
  .settings-pref-block {
    align-items: stretch;
  }
  .settings-lang-switch,
  .settings-font-switch {
    width: 100%;
  }
}

.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.settings-cards-grid > .card-pro {
  margin-top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
@media (max-width: 960px) {
  .settings-cards-grid {
    grid-template-columns: 1fr;
  }
}

.settings-logo-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.settings-logo-preview {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.settings-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.settings-logo-placeholder {
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-logo-placeholder .icon {
  width: 28px;
  height: 28px;
}
.settings-logo-meta { flex: 1; min-width: 0; }
.settings-logo-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.settings-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.settings-logo-upload-btn {
  cursor: pointer;
  margin: 0;
}

.settings-tabs-wrap {
  margin-bottom: 20px;
}

/* Shared segmented control (Settings + Labour) — no bar background */
.ios-segment-wrap {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: 0 0 18px;
  padding: 4px 0 8px;
  background: transparent;
}
.ios-segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  max-width: 420px;
}
.ios-segment-btn {
  appearance: none;
  margin: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.1px;
  line-height: 1.2;
  padding: 10px 8px;
  min-height: 36px;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ios-segment-btn:active { transform: scale(.985); }
.ios-segment-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.ios-segment-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Support — single page with 5 iOS tabs */
.support-tabs-wrap .support-ios-segment {
  max-width: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.support-tabs-wrap .support-ios-segment::-webkit-scrollbar { display: none; }
.support-tabs-wrap .support-ios-segment .ios-segment-btn {
  flex: 1 0 auto;
  min-width: 76px;
  white-space: nowrap;
  padding: 10px 12px;
}
.support-tab-panel { animation: supportTabIn .18s ease; }
@keyframes supportTabIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-panel {
  display: none;
  animation: settingsPanelIn .22s ease;
}
.settings-panel.active { display: block; }

@keyframes settingsPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-panel-desc {
  font-size: 13px;
  color: var(--text3);
  margin: -2px 0 12px;
  line-height: 1.45;
}
.settings-panel-desc-inline {
  margin: 4px 0 0;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.settings-logout-btn {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}
.settings-logout-btn:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-color: var(--danger);
}

.settings-products-header {
  align-items: flex-start;
}
.settings-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-pro.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-pro.btn-sm svg.lucide,
.btn-pro.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.settings-preview-text {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.45;
}

.settings-card { margin-bottom: 0; }
.settings-product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-product-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.settings-product-group-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text3);
}
.settings-product-group-head span {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
}
.settings-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.settings-product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.settings-product-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-sm);
}
.settings-product-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.settings-product-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text2);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
}
.settings-product-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -.2px;
}
.settings-product-meta { margin: 0; font-size: 12px; color: var(--text3); }
.settings-product-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.settings-product-stats span {
  display: block;
  font-size: 10px;
  color: var(--text3);
  margin-bottom: 2px;
}
.settings-product-stats strong {
  font-size: 12px;
  color: var(--text);
  font-weight: 800;
}
.settings-product-empty {
  text-align: center;
  color: var(--text3);
  padding: 32px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px dashed var(--border);
  font-size: 13px;
}

.field-hint {
  display: block;
  color: var(--text3);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.4;
}
.settings-apply-box {
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-apply-box .settings-preview-text {
  margin: 0;
  flex: 1 1 200px;
}
.settings-apply-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
}
.settings-split-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text2);
}
.settings-split-total {
  font-weight: 800;
  color: var(--text);
}
.settings-split-total.is-bad { color: var(--danger); }
.settings-split-total.is-ok { color: var(--success); }
.settings-save-bar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 8px;
}
.team-group-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 110px 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.team-group-row:last-child { margin-bottom: 0; }
.team-group-idx {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
}
.team-group-pay-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.team-group-pay-wrap .form-ctrl {
  min-width: 0;
  text-align: right;
}
.team-group-pay-wrap span {
  font-size: 12px;
  color: var(--text3);
  font-weight: 800;
}
@media (max-width: 560px) {
  .team-group-row {
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    grid-template-areas:
      "idx name del"
      "idx pay del";
  }
  .team-group-idx { grid-area: idx; }
  .team-group-row .stg-team-name { grid-area: name; }
  .team-group-pay-wrap { grid-area: pay; }
  .team-group-row .btn-icon { grid-area: del; }
  .settings-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-actions .btn-pro,
  .settings-actions .btn-outline {
    justify-content: center;
    width: 100%;
  }
  .settings-products-header {
    flex-direction: column;
  }
}

/* Hidden app sections */
.nav-item-hidden,
.page-hidden {
  display: none !important;
}

@media (max-width: 576px) {
  .ios-segment-btn {
    font-size: 12px;
    padding: 8px 4px;
  }
}

.split-team-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.split-team-row .form-label {
  font-size: 12px;
  margin-bottom: 4px;
}
.split-total-hint {
  display: block;
  margin-top: 6px;
}
.split-pct-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.split-member-row .split-amt-hint {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}
.team-groups-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface2);
}
.team-group-row .form-ctrl {
  min-width: 0;
}
.labour-team-count {
  font-size: 14px;
  font-weight: 800;
}
.labour-team-grid-label {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.labour-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.labour-family-card {
  min-width: 0;
  border: 2px solid color-mix(in srgb, var(--text, #12151c) 55%, var(--border));
  border-radius: 10px;
  padding: 8px;
  background: var(--surface);
}
.labour-summary-box .labour-family-select {
  flex-direction: column;
  align-items: stretch;
}
.labour-summary-box .labour-family-name {
  white-space: normal;
}
.labour-summary-box .labour-family-select > .labour-amt-stats {
  width: 100%;
  margin-top: 6px;
}
.labour-box-detail-totals {
  margin-bottom: 12px;
}
.labour-box-detail-totals .labour-amt-stats {
  margin-top: 0;
}
.labour-family-card.is-active {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 75%, var(--text, #12151c));
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, var(--surface));
  box-shadow: none;
}
.labour-family-person {
  display: flex;
  align-items: center;
  gap: 6px;
}
.labour-family-select {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.labour-family-name {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.labour-family-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  line-height: 1.3;
}
.labour-family-stats {
  display: none;
}
.labour-amt-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}
.labour-family-select > .labour-amt-stats {
  flex: 1 1 auto;
  margin-top: 0;
  width: auto;
  min-width: 0;
  gap: 4px;
}
.labour-tree-main-row > .labour-amt-stats,
.labour-tree-sub > .labour-amt-stats {
  flex: 1 1 100%;
  margin-top: 6px;
}
.labour-amt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--surface2);
}
.labour-tree-sub .labour-amt,
.labour-family-person.is-sub .labour-amt {
  background: var(--surface);
}
.labour-amt small {
  font-size: 10px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.labour-amt b {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.labour-amt-baki b {
  font-size: 13.5px;
}
.labour-amt-baki.is-due b,
.labour-amt-baki.text-danger b {
  color: var(--danger, #ef4444);
}
.labour-amt-baki.is-credit b,
.labour-amt-baki.text-success b {
  color: var(--success, #22c55e);
}
.labour-family-members {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--text, #12151c) 35%, var(--border));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.labour-family-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid color-mix(in srgb, var(--text, #12151c) 35%, var(--border));
}
.labour-tree-group > .labour-family-total {
  margin: 0;
  padding: 10px 16px 12px;
  background: var(--surface);
  border-top: 2px solid color-mix(in srgb, var(--text, #12151c) 35%, var(--border));
}
.labour-family-total-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.labour-family-total-head .labour-family-total-label {
  margin-bottom: 0;
}
.labour-family-total .labour-team-box-pay {
  margin-top: 0;
}
.labour-family-total-label {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text2);
}
.labour-family-total .labour-amt {
  background: color-mix(in srgb, var(--text, #12151c) 6%, var(--surface2));
}
.labour-tree-group > .labour-family-total .labour-amt {
  background: var(--surface2);
}
.labour-family-members-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3);
}
.labour-family-person.is-sub {
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--text, #12151c) 28%, var(--border));
  border-radius: 8px;
  background: var(--surface2);
}
.labour-family-person.is-sub.is-active {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, var(--border));
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--surface2));
}
.labour-family-person.is-active:not(.is-sub) .labour-family-name {
  color: var(--primary, #2563eb);
}
.labour-family-card .labour-team-box-pay {
  margin-top: 0;
  padding: 4px 10px;
  font-size: 12px;
}
.labour-team-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  min-height: 200px;
  max-width: 100%;
  flex: 1 1 280px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font: inherit;
  color: inherit;
}
.labour-team-box:hover {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 55%, var(--border));
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.labour-team-box-active {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 7%, var(--surface2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 30%, transparent);
}
.labour-team-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.labour-team-box-name {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.3;
}
.labour-team-box-meta {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text3);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}
.labour-team-box-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  align-content: center;
}
.labour-team-box-stats > div {
  min-width: 0;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--surface);
}
.labour-team-box-stats small {
  display: block;
  margin-bottom: 4px;
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
}
.labour-team-box-stats b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.labour-team-box-baki {
  font-size: 12px;
  font-weight: 800;
}
.labour-team-box-baki.is-due {
  color: var(--danger, #ef4444);
}
.labour-team-box-baki.is-credit {
  color: var(--success, #22c55e);
}
.labour-team-box-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.labour-team-box-foot .labour-team-box-baki {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
}
.labour-team-box-foot .labour-team-box-baki.is-due,
.labour-team-box-foot .labour-team-box-baki.is-credit {
  color: inherit;
}
.labour-team-box-foot .labour-team-box-baki.is-due { color: var(--danger, #ef4444); }
.labour-team-box-foot .labour-team-box-baki.is-credit { color: var(--success, #22c55e); }
.labour-team-box-pay {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  color: var(--primary, #2563eb);
  cursor: pointer;
  text-decoration: none;
}
.labour-team-box-pay:hover {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--surface));
}
.labour-pager {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.labour-pager-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.labour-pager-info,
.labour-pager-page {
  font-size: 12px;
  color: var(--text3);
  font-weight: 600;
}
.labour-pager-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.labour-team-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 0 16px 8px;
}
.labour-team-stat {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}
.labour-team-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}
@media (max-width: 900px) {
  .labour-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .labour-team-grid {
    grid-template-columns: 1fr;
  }
  .labour-team-box {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 180px;
  }
}

.labour-tree-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.labour-tree-group {
  border: 2px solid color-mix(in srgb, var(--text, #12151c) 55%, var(--border));
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
}
.labour-tree-main {
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid color-mix(in srgb, var(--text, #12151c) 28%, var(--border));
}
.labour-tree-main-row,
.labour-tree-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.labour-tree-main-name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  min-width: 120px;
}
.labour-tree-sub-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  min-width: 100px;
}
.labour-tree-meta {
  flex: 1 1 180px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
  font-weight: 700;
}
.labour-tree-actions {
  margin-left: auto;
}
.labour-tree-subs {
  list-style: none;
  margin: 0;
  padding: 6px 0 10px 8px;
}
.labour-tree-sub {
  padding: 10px 16px 10px 40px;
  border-bottom: 1px solid var(--border);
}
.labour-tree-sub:last-child {
  border-bottom: none;
}
.labour-tree-sub::before {
  content: '—';
  margin-right: 10px;
  color: var(--text3);
  font-weight: 800;
}
@media (max-width: 640px) {
  .labour-tree-main-row,
  .labour-tree-sub {
    flex-direction: column;
    align-items: stretch;
  }
  .labour-tree-actions {
    margin-left: 0;
    width: 100%;
  }
}

.labour-share-preview {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  max-width: 220px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  color: inherit;
  cursor: pointer;
}
.labour-share-preview:hover .labour-share-line {
  text-decoration: underline;
}
.labour-share-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.labour-share-line strong { font-weight: 800; }
.labour-share-more {
  color: var(--text3);
  font-weight: 800;
  font-size: 11px;
}
.labour-share-popup-meta {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.4;
}

/* Majdoor share popup — wider modal + family cards */
.labour-share-modal {
  max-width: 720px;
  width: 94%;
}
.labour-share-modal .modal-body {
  padding: 22px 24px 24px;
}
.labour-share-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.labour-share-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.2;
}
.labour-share-chip-total {
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border));
  color: var(--primary, #2563eb);
  font-weight: 800;
}
.labour-share-section-title {
  margin: 20px 0 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}
.labour-share-families-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding-right: 2px;
}
.labour-share-family-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.labour-share-family-card.is-family {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--primary, #2563eb) 30%, var(--border));
}
.labour-share-family-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.labour-share-family-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.labour-share-family-card-meta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
}
.labour-share-family-card-amt {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary, #2563eb);
  white-space: nowrap;
}
.labour-share-family-table-wrap {
  margin: 0;
}
.labour-share-family-table {
  margin: 0;
  font-size: 13px;
}
.labour-share-family-table thead th {
  font-size: 11px;
  padding: 8px 14px;
  background: transparent;
}
.labour-share-family-table tbody td,
.labour-share-family-table tfoot td {
  padding: 10px 14px;
}
.labour-share-family-table .ta-center { text-align: center; }
.labour-share-family-table .ta-right { text-align: right; }
.labour-share-family-foot td {
  border-top: 1px dashed var(--border);
  background: color-mix(in srgb, var(--primary, #2563eb) 5%, var(--surface));
  font-size: 12px;
}
.labour-share-role {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.labour-share-role.is-head {
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, var(--surface));
  color: var(--primary, #2563eb);
}
.labour-share-role.is-sub {
  background: var(--surface2);
  color: var(--text3);
  border: 1px solid var(--border);
}
.labour-share-modal .labour-share-calc {
  margin-bottom: 0;
}
.labour-share-modal .labour-share-calc-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.labour-detail-heading {
  margin: 16px 16px 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.team-split-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.team-split-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.team-split-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}
.team-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 13px;
}
.team-split-grid strong {
  display: block;
  margin-top: 2px;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.link-btn:hover { text-decoration: underline; }
tr.row-active { background: rgba(59, 130, 246, 0.08); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: #25d366;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.btn-whatsapp:hover { background: #1fb855; }
.btn-whatsapp.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon.btn-whatsapp-icon { color: #25d366; }
.btn-icon.btn-whatsapp-icon:hover { background: rgba(37, 211, 102, 0.12); }

.dashboard-filter-bar {
  align-items: center;
  margin-bottom: 16px;
}
#page-dashboard .dashboard-filter-bar,
.dash-toolbar.dashboard-filter-bar {
  margin-bottom: 0;
}
.filter-bar + .kpi-grid {
  margin-top: 4px;
}
.dashboard-period-pill {
  margin-left: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: center;
}
@media (max-width: 768px) {
  .dashboard-period-pill {
    width: auto;
    text-align: center;
  }
}

.gu-ime-nav-toggle {
  margin-top: 8px;
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 10px;
}
.gu-ime-nav-toggle.is-on {
  border-color: #16a34a;
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}
.gu-ime-bar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: auto;
  z-index: 11000;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}
.gu-ime-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 960px;
  margin: 0 auto;
}
.gu-ime-roman {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #15803d;
  background: rgba(22, 163, 74, .12);
  padding: 6px 8px;
  border-radius: 8px;
  max-width: 28%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gu-ime-cands {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.gu-ime-cand {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #f7f7f7;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.gu-ime-cand.is-sel {
  border-color: #16a34a;
  background: rgba(22, 163, 74, .14);
  color: #14532d;
}

.product-brash-block {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.product-brash-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  cursor: pointer;
}
.product-brash-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
.product-brash-rates {
  margin-top: 8px;
}
.product-brash-hint {
  font-size: 11px;
  margin: 8px 0 0;
}
.inv-qty-unit {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.inv-qty-unit input {
  flex: 1;
  min-width: 0;
}
.inv-qty-unit-sel {
  flex: 0 0 88px;
  padding-left: 8px;
  padding-right: 8px;
}
.prod-qty-brash-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.prod-qty-brash-wrap .form-label {
  margin: 0;
  font-size: 12px;
}
.prod-calc-brash-eq {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

/* ── 09-dashboard-reports.css ── */
/* ================================================================
   DASHBOARD — compact header + side-by-side widgets
================================================================ */
.dash-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dashIn .35s ease both;
}
@keyframes dashIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 0;
  margin-bottom: 2px;
}

.dash-hero-text {
  min-width: 0;
  flex: 1 1 220px;
}
.dash-sync-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
}
.dash-sync-bar[hidden] { display: none !important; }
.dash-sync-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e5e7eb;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: dashSyncSpin .7s linear infinite;
}
@keyframes dashSyncSpin { to { transform: rotate(360deg); } }

.dash-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.6px;
  color: var(--text);
  margin: 0;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.dash-greeting {
  margin: 0;
  font-size: 16px;
  color: var(--text2);
  font-weight: 800;
  letter-spacing: -.2px;
}

.dash-sub {
  margin-top: 4px !important;
  margin-bottom: 0;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--text2) !important;
  line-height: 1.35;
}

.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: none;
  flex: 0 1 auto;
}
.dash-toolbar-compact {
  flex-wrap: nowrap;
  padding: 6px 8px;
  gap: 6px;
}
[data-theme="light"] .dash-toolbar {
  background: var(--surface2);
}

.dash-filter-wrap {
  position: relative;
  flex-shrink: 0;
}

.dash-filter-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.dash-filter-popup {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9000;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.dash-filter-popup-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
  padding: 2px 6px 8px;
}

.dash-filter-presets {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-filter-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: none;
  border-radius: 10px;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background var(--trans), border-color var(--trans);
}

.dash-filter-opt .icon,
.dash-filter-opt svg.lucide {
  width: 16px;
  height: 16px;
  color: var(--text3);
  flex-shrink: 0;
}

.dash-filter-opt:hover {
  background: var(--surface2);
}

.dash-filter-opt.active {
  background: var(--primary-soft);
  border-color: rgba(59, 130, 246, .25);
  color: var(--primary);
}

.dash-filter-opt.active .icon,
.dash-filter-opt.active svg.lucide {
  color: var(--primary);
}

.dash-filter-custom {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-filter-custom-row {
  display: flex;
  gap: 8px;
}

.dash-filter-custom-row .dash-year { width: 78px !important; flex-shrink: 0; }
.dash-filter-custom-row .dash-month { flex: 1; min-width: 0; }

.dash-filter-apply {
  width: 100%;
  justify-content: center;
  font-size: 13px !important;
  padding: 8px 12px !important;
}

/* Reports */
.page-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.reports-filter-card { margin-bottom: 0; }
.reports-filter-bar {
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.reports-period-pill {
  font-size: 12px;
  font-weight: 800;
  color: #000;
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font);
}
.rep-filter-year { width: 90px !important; min-width: 90px; }
.rep-filter-month { width: 140px !important; min-width: 120px; }
.rep-filter-from,
.rep-filter-to { width: 150px !important; min-width: 140px; }
.reports-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  padding: 4px 0 12px;
}
.reports-catalog-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 18px;
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.reports-catalog-item:hover {
  border-color: #000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.reports-catalog-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reports-catalog-icon .br-ico { line-height: 0; }
.reports-catalog-body { flex: 1; min-width: 0; padding-top: 2px; }
.reports-catalog-title {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.reports-catalog-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.reports-catalog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.reports-catalog-actions .rep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 14px;
  height: auto;
  white-space: nowrap;
  font-family: var(--font);
}
.reports-catalog-actions .rep-btn .br-ico { flex-shrink: 0; }
.modal-box-xl.report-preview-modal { max-width: 920px; }
.report-preview-body {
  max-height: min(72vh, 760px);
  overflow: auto;
  background: #e8e8e8;
  padding: 32px 36px;
  border-radius: 10px;
}
.report-preview-body .bank-stmt {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.12);
  border: 1px solid #ccc;
  max-width: 794px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px !important;
  box-sizing: border-box;
}

/* Paper Formats — blank A4 stationery */
.paper-formats-toolbar {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.paper-formats-copies-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  margin: 0;
}
.paper-formats-copies {
  width: 72px;
  min-width: 72px;
  text-align: center;
}
.paper-formats-copies-modal {
  margin-right: auto;
}
.paper-formats-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 720px;
}
.paper-formats-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.paper-formats-list-wrap {
  position: sticky;
  top: 12px;
}
.paper-formats-list-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
}
.paper-formats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.paper-format-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.paper-format-pick:hover {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 40%, var(--border));
}
.paper-format-pick.is-active {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 65%, var(--border));
  background: color-mix(in srgb, var(--primary, #2563eb) 7%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 25%, transparent);
}
.paper-format-pick-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.paper-format-pick-icon .icon,
.paper-format-pick-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  color: inherit;
  stroke: currentColor;
}
.paper-format-pick.is-active .paper-format-pick-icon {
  color: var(--primary, #2563eb);
  border-color: color-mix(in srgb, var(--primary, #2563eb) 40%, var(--border));
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--surface));
}
.paper-format-pick-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.paper-format-pick-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}
.paper-format-pick-desc {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text3);
}
.paper-formats-live {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.paper-formats-live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.paper-formats-live-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 2px;
}
.paper-formats-live-bar strong {
  font-size: 14px;
  color: var(--text);
}
.paper-formats-live-size {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  white-space: nowrap;
}
.paper-formats-opts {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.paper-formats-opts-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.paper-formats-opts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.paper-formats-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
}
.paper-formats-opt input[type="number"] {
  width: 64px;
  min-width: 64px;
  text-align: center;
  padding: 6px 8px;
}
.paper-formats-opt-check {
  font-weight: 600;
  cursor: pointer;
}
.paper-formats-opt-check input {
  accent-color: var(--text);
}
.paper-formats-opts-hint {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}
.paper-formats-live-stage {
  background: #cfcfcf;
  padding: 28px 20px 36px;
  min-height: 420px;
  overflow: auto;
  max-height: min(85vh, 1100px);
}
.paper-formats-live-empty {
  text-align: center;
  padding: 48px 16px;
  font-size: 13px;
}
.paper-formats-live-paper {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto;
}
.paper-formats-live-paper .pf-pack {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}
.paper-formats-live-paper .pf-sheet {
  width: 210mm;
  height: 297mm;
  max-width: 210mm;
  min-height: 297mm;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  border: 1px solid #aaa;
  background: #fff;
}
.paper-format-preview-body {
  background: #cfcfcf;
  padding: 20px 12px;
  overflow: auto;
}
.paper-format-preview-body .pf-sheet {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  border: 1px solid #aaa;
  width: 210mm;
  height: 297mm;
  max-width: 210mm;
  margin: 0 auto;
  background: #fff;
}
.paper-format-preview-modal .modal-footer {
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 960px) {
  .paper-formats-layout {
    grid-template-columns: 1fr;
  }
  .paper-formats-list-wrap {
    position: static;
  }
  .paper-formats-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
  }
  .paper-formats-live-stage {
    max-height: none;
    padding: 16px 8px 24px;
  }
  .paper-formats-live-paper .pf-sheet {
    /* keep A4 ratio on small screens via scale if needed */
    transform-origin: top center;
  }
}

/* Report PDF capture host — left:0 required (off-screen coords crop in html2canvas) */
.report-pdf-host {
  position: fixed;
  top: 0;
  left: 0;
  width: 794px;
  max-width: 794px;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  overflow: visible !important;
  min-height: auto !important;
  pointer-events: none;
  z-index: -1;
  box-sizing: border-box;
  padding: 0;
}
.report-pdf-host .bank-stmt {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  overflow: visible !important;
}
@media print {
  .sidebar, .topbar, .reports-filter-card, .modal-header, .modal-footer { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .reports-preview-wrap { max-height: none; border: none; }
}

.dash-filter-ctrl {
  width: auto !important;
  min-width: 0;
  height: 34px;
  padding: 4px 10px !important;
  border-radius: 10px !important;
  background: var(--surface2) !important;
  font-size: 12.5px !important;
}
.dash-year { width: 78px !important; }
.dash-month { width: 120px !important; }

.dash-tool-btn {
  border-radius: 10px !important;
  height: 34px;
  padding: 4px 10px !important;
  font-size: 12px !important;
  align-self: center;
}

.dash-kpi-grid {
  margin-bottom: 0;
}

.dash-widgets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

.dash-grid-charts {
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
  align-items: stretch;
}

.dash-grid-charts-2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.dash-grid-data {
  grid-template-columns: 1fr 1fr;
}

.dash-overview-card .card-pro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-overview-sub {
  font-size: 12px;
}

.dash-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dash-ov-tile {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.dash-ov-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ov-color, var(--primary));
}

.dash-ov-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text3);
  letter-spacing: .2px;
}

.dash-ov-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -.3px;
  line-height: 1.2;
}

.dash-ov-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}

.chart-wrap-md { height: 200px; }

.dash-data-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-data-head,
.dash-data-row,
.dash-data-foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  font-size: 12.5px;
}

.dash-data-head-prod,
.dash-data-row-prod {
  grid-template-columns: 1.2fr 0.9fr 0.9fr 1fr;
}

.dash-data-head {
  font-weight: 800;
  color: var(--text3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.dash-data-row {
  border-radius: 8px;
  transition: background var(--trans);
}

.dash-data-row:hover {
  background: var(--surface2);
}

.dash-data-name {
  font-weight: 800;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-data-val {
  font-weight: 800;
  color: var(--text);
  text-align: right;
}

.dash-data-pct {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text3);
  justify-content: flex-end;
}

.dash-data-bar {
  display: inline-block;
  height: 5px;
  border-radius: 99px;
  background: var(--primary);
  max-width: 48px;
  min-width: 4px;
}

.dash-data-foot {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 800;
  color: var(--text);
}

.dash-data-foot span:last-child,
.dash-data-foot span:nth-child(2) {
  text-align: right;
}

.dash-grid-lists {
  grid-template-columns: 1fr 1fr;
}

.dash-card {
  min-width: 0;
}

#page-dashboard .chart-wrap-lg { height: 220px; }
#page-dashboard .chart-wrap-donut { height: 220px; }
#page-dashboard .chart-wrap-md { height: 200px; }

.dash-see-all {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 0;
}
.dash-see-all:hover { text-decoration: underline; }

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.empty-cell {
  color: var(--text3);
  font-size: 13px;
  padding: 20px 12px;
  text-align: center;
  margin: 0;
}

.kpi-card-locked {
  cursor: pointer;
}
.kpi-card-locked:hover {
  border-color: var(--primary);
}

/* Keep charts/lists side-by-side until tablet */
@media (max-width: 1100px) {
  .dash-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-grid-charts-2 {
    grid-template-columns: 1fr 1fr;
  }
  .dash-grid-charts-2 .dash-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .dash-grid-charts,
  .dash-grid-lists,
  .dash-grid-data {
    grid-template-columns: 1fr 1fr;
  }
  .dash-grid-charts-2 {
    grid-template-columns: 1fr;
  }
  .dash-grid-charts-2 .dash-card:last-child {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .dash-title { font-size: 26px; }
  .dash-greeting { display: block; width: 100%; font-size: 14px; }
  .dash-sub { font-size: 15px !important; }
  .dash-toolbar-compact { flex-shrink: 0; }
  .dash-overview-grid { grid-template-columns: 1fr 1fr; }
  .dash-ov-value { font-size: 16px; }
  .dash-grid-charts,
  .dash-grid-lists,
  .dash-grid-data,
  .dash-grid-charts-2 {
    grid-template-columns: 1fr;
  }
}

/* Auth / Cloud account */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.18), transparent 55%),
    var(--bg, #0b1220);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card, #111827);
  border: 1px solid var(--border, #1f2937);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}
.auth-brand h1 {
  font-size: 1.4rem;
  margin: 10px 0 4px;
}
.auth-brand p {
  color: var(--muted, #94a3b8);
  font-size: 13px;
  margin: 0;
}
.auth-brand .brand-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary, #3b82f6);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.auth-tab {
  border: 1px solid var(--border);
  background: var(--surface2, transparent);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font-weight: 800;
  cursor: pointer;
}
.auth-tab.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
}
.cloud-account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
}
.cloud-account-chip #cloudAccountLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Local auth gate — split layout (platform + continue) */
.auth-gate {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 48px);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 80%, rgba(251, 191, 36, 0.08), transparent 50%),
    linear-gradient(160deg, #0b1220 0%, #111827 50%, #0f172a 100%);
  color: #1e293b;
  box-sizing: border-box;
}
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.9fr);
  width: 100%;
  max-width: 1080px;
  min-height: min(640px, calc(100vh - 2 * clamp(20px, 4vw, 48px)));
  margin: auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}
.auth-split-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 5vw, 56px);
  color: #f8fafc;
  background:
    linear-gradient(145deg, rgba(8, 14, 28, 0.55), rgba(8, 14, 28, 0.82)),
    radial-gradient(ellipse 90% 70% at 20% 10%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(251, 191, 36, 0.12), transparent 50%),
    linear-gradient(160deg, #101827 0%, #0b1220 55%, #151b2d 100%);
  overflow: hidden;
}
.auth-split-left::after {
  content: '';
  position: absolute;
  inset: auto -20% -30% 40%;
  height: 70%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.12), transparent 65%);
  pointer-events: none;
}
.auth-left-top { position: relative; z-index: 1; max-width: 440px; }
.auth-left-logo-wrap {
  width: 88px;
  height: 88px;
  margin: 0 0 18px;
  padding: 10px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-left-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.auth-right-logo-wrap {
  width: 64px;
  height: 64px;
  margin: 0 0 14px;
  padding: 8px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: none;
  align-items: center;
  justify-content: center;
}
.auth-right-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.auth-left-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 800;
}
.auth-left-title {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 3.8vw, 2.55rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}
.auth-left-tagline {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 36ch;
}
.auth-platform-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.auth-platform-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}
.auth-platform-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}
.auth-platform-icon .icon { width: 18px; height: 18px; }
.auth-platform-list strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 2px;
}
.auth-platform-list span {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}
.auth-platform-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.auth-platform-stats > div {
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-platform-stats strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}
.auth-platform-stats span {
  font-size: 11px;
  color: #94a3b8;
}

.auth-split-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 44px);
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(226, 232, 240, 0.9), transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  overflow-y: auto;
}
.auth-right-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}
.auth-right-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.auth-right-sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #64748b;
}
.auth-google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.auth-google-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.auth-google-btn:disabled,
.auth-gate .btn-pro:disabled,
.auth-link-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.auth-google-btn.is-loading,
.auth-gate .btn-pro.is-loading {
  pointer-events: none;
}
.auth-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Auth loading — glass popup + button spinner */
.auth-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(241, 245, 249, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.auth-loading-overlay.is-visible,
.auth-loading-overlay:not([hidden]) {
  display: flex;
}
.auth-loading-overlay[hidden] {
  display: none !important;
}
.auth-loading-card {
  width: min(320px, 100%);
  padding: 28px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
}
.auth-loading-spinner,
.auth-btn-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: #0f172a;
  animation: authSpin 0.75s linear infinite;
}
.auth-btn-spinner {
  width: 16px;
  height: 16px;
  margin: 0;
  border-width: 2px;
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
}
.auth-loading-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.auth-loading-sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}
.auth-gate--busy .auth-right-card {
  pointer-events: none;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}
.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.auth-email-form {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}
.auth-email-form .auth-link-btn {
  margin-top: 10px;
}
.account-password-card .auth-field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #dc2626;
}
.auth-phone-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.auth-phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  font-size: 14px;
}
.auth-otp-input {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.auth-otp-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
}
#authRegisterStep .form-label {
  margin-top: 10px;
}
#authRegisterStep .form-ctrl {
  margin-bottom: 4px;
}
.auth-recaptcha {
  margin: 12px 0 4px;
  min-height: 78px;
  display: flex;
  justify-content: flex-start;
}
.auth-recaptcha--invisible {
  margin: 0;
  min-height: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}
.auth-step .btn-pro {
  margin-top: 12px;
}
.auth-link-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-howto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.auth-howto-btn .icon { width: 16px; height: 16px; }
.auth-howto-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.auth-fineprint {
  margin: 18px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #94a3b8;
  text-align: center;
}

.howto-gate {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: #f1f5f9;
  color: #0f172a;
  overflow: auto;
}
.howto-page {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  padding: 16px 16px 40px;
  box-sizing: border-box;
}
.howto-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  padding: 8px 0 12px;
}
.howto-top h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
}
.howto-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 4px;
}
.howto-back-btn .icon { width: 16px; height: 16px; }
.howto-lang-switch { flex-shrink: 0; }
.howto-lang-option {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.howto-lang-option.active {
  background: #0f172a;
  color: #fff;
}
.howto-intro {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}
.howto-steps { display: grid; gap: 12px; }
.howto-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.howto-step-num {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.howto-step h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.howto-step p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
  white-space: pre-wrap;
}
.howto-empty { color: #64748b; text-align: center; padding: 24px 8px; }
@media (max-width: 640px) {
  .howto-top { grid-template-columns: 1fr; justify-items: start; }
  .howto-top h1 { text-align: left; }
}
.auth-field-error {
  display: none;
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}
.auth-gate .form-label { color: #475569; font-weight: 800; }
.auth-gate .form-ctrl {
  background: #fff;
  border-color: #e2e8f0;
  color: #0f172a;
}
.auth-gate .btn-pro {
  background: #0f172a;
  color: #fff;
  border: none;
}
.auth-gate .form-ctrl.is-invalid {
  border-color: #ef4444;
}

@media (max-width: 900px) {
  /* Desktop card layout overridden by 12-native-mobile.css — keep minimal fallback */
  .auth-gate {
    align-items: stretch;
    padding: 0;
  }
}

/* Onboarding */
.onboard-gate {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px 40px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(148, 163, 184, 0.35), transparent 55%),
    linear-gradient(165deg, #eef2f7 0%, #f8fafc 50%, #e8eef5 100%);
  color: #1e293b;
}
.onboard-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(241, 245, 249, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.onboard-loading-overlay.is-visible,
.onboard-loading-overlay:not([hidden]) {
  display: flex;
}
.onboard-loading-overlay[hidden] {
  display: none !important;
}
.onboard-gate.onboard-gate--busy .onboard-actions button {
  pointer-events: none;
  opacity: 0.65;
}
.onboard-shell {
  width: 100%;
  max-width: 960px;
  padding: 28px 26px;
  margin: auto;
}
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.onboard-progress {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  justify-content: center;
}
.onboard-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #cbd5e1;
}
.onboard-progress-dot.active { background: #0f172a; width: 28px; }
.onboard-progress-dot.done { background: #64748b; }
.onboard-step {
  display: flex;
  flex-direction: column;
}
.onboard-step[style*="display: none"],
.onboard-step[hidden] {
  display: none !important;
}
.onboard-step h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}
.onboard-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}
.onboard-cat { margin-bottom: 18px; }
.onboard-cat h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  margin: 0 0 10px;
}
.onboard-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.onboard-product-card {
  text-align: left;
  border: 1px solid #e2e8f0;
  background: rgba(255,255,255,.85);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #334155;
}
.onboard-product-card strong { color: #0f172a; font-size: 14px; }
.onboard-product-card span { font-size: 11px; color: #64748b; line-height: 1.35; }
.onboard-product-card em { font-style: normal; font-size: 11px; color: #475569; font-weight: 800; }
.onboard-product-card.selected {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15);
  background: #fff;
}
.onboard-rate-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.8);
}
.onboard-rate-card h4 { margin: 0 0 10px; font-size: 15px; color: #0f172a; }
.ob-team-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px;
  margin-bottom: 8px;
}
.ob-labour-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.ob-labour-remove {
  width: 40px;
  min-width: 40px;
  padding: 8px 0;
  font-size: 18px;
  line-height: 1;
}
.onboard-opening-hint {
  font-size: 12px;
  margin: 0 0 10px;
}
.onboard-stock-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}
.onboard-stock-row:last-child {
  border-bottom: 0;
}
.onboard-stock-row strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}
.onboard-stock-row span {
  font-size: 12px;
}
@media (max-width: 560px) {
  .onboard-stock-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .ob-labour-row {
    grid-template-columns: 1fr auto;
  }
  .ob-labour-row .ob-labour-phone {
    grid-column: 1 / -1;
  }
}
.catalog-pick-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.catalog-pick-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.catalog-pick-row.is-added { opacity: .55; }
.catalog-pick-row small { display: block; color: var(--text3); font-size: 12px; }

.modal-box.modal-catalog-full {
  width: min(1120px, 96vw);
  max-width: 96vw;
  height: min(92vh, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
}
.modal-box.modal-catalog-full .modal-header {
  flex-shrink: 0;
  align-items: flex-start;
}
.catalog-modal-sub {
  font-size: 12.5px;
  margin-top: 4px;
  line-height: 1.4;
}
.catalog-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 8px;
}
.catalog-modal-footer { flex-shrink: 0; }
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.catalog-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.catalog-filter-tab {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.catalog-filter-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.catalog-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.catalog-pick-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
}
.catalog-section-head,
.catalog-pole-group-head,
.onboard-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.catalog-section-head h3,
.onboard-cat-head h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
}
.catalog-pole-group {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
}
.catalog-pole-group-head strong {
  font-size: 13px;
  color: var(--text);
}
.pole-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.pole-wire-tabs {
  display: none !important;
}
.pole-type-tab,
.pole-wire-tab {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.pole-type-tab.active,
.pole-wire-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.pole-tab-hint {
  margin: 0 0 12px;
  font-size: 12px;
}
.catalog-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.catalog-pick-grid-poles {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.catalog-pick-card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 12px 34px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--trans), box-shadow var(--trans);
  margin: 0;
}
.catalog-pick-card:hover { border-color: var(--border2); }
.catalog-pick-card:has(input:checked) {
  border-color: var(--text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 18%, transparent);
}
.catalog-pick-card.is-added { opacity: .5; cursor: default; }
.catalog-pick-card input {
  position: absolute;
  left: 12px;
  top: 14px;
}
.catalog-pick-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.catalog-pick-card strong {
  font-size: 13px;
  color: var(--text);
}
.catalog-pick-card small {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.35;
}
.catalog-pick-card em {
  font-style: normal;
  font-size: 11px;
  color: var(--text2);
  font-weight: 800;
}
.catalog-pick-price { color: var(--text) !important; }

/* Invoice product picker: category → product boxes */
.inv-line-items-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.inv-product-view-toggle.ios-segment {
  flex-shrink: 0;
}
.inv-product-view-toggle .ios-segment-btn {
  padding: 5px 10px;
  font-size: 12px;
  min-height: 30px;
}
.inv-product-picker { width: 100%; }
.inv-product-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text3);
}
.inv-product-picker-btn.has-value { color: var(--text); font-weight: 700; }
.inv-product-picker-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-product-picker-chevron {
  flex-shrink: 0;
  opacity: .55;
  font-size: 12px;
}
.inv-product-pick-modal .modal-body { padding-top: 8px; }
.inv-product-pick-sub { font-size: 13px; margin-top: 4px; }
.inv-product-pick-search-wrap { margin-bottom: 14px; }
.inv-product-pick-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.inv-product-cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--trans), box-shadow var(--trans);
  color: var(--text);
}
.inv-product-cat-card:hover {
  border-color: var(--border2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 12%, transparent);
}
.inv-product-cat-card strong {
  font-size: 14px;
  font-weight: 800;
}
.inv-product-cat-card span {
  font-size: 12px;
  color: var(--text3);
}
.inv-product-pick-back-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.inv-product-pick-back-row strong {
  font-size: 14px;
  font-weight: 800;
}
.inv-product-pick-pole-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.inv-product-pole-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.inv-product-pole-tab.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.inv-product-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-bottom: 4px;
}
.inv-product-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.inv-product-box:hover { border-color: var(--border2); }
.inv-product-box.is-selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 18%, transparent);
}
.inv-product-box strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.inv-product-box small {
  font-size: 11px;
  color: var(--text3);
}
.inv-product-box em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  margin-top: 2px;
}

.team-member-products { max-height: 140px; overflow: auto; }
/* majdoor boxes layout lives in 06-production.css (horizontal small cards) */
.labour-tabs-wrap { margin-bottom: 14px; }
.labour-panel { margin-top: 4px; }
.form-ctrl.is-invalid {
  border-color: #ef4444;
}
.auth-switch-line {
  text-align: center;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted, #94a3b8);
}
.auth-switch-line a {
  color: var(--primary, #3b82f6);
  text-decoration: none;
  font-weight: 800;
}
.auth-switch-line a:hover {
  text-decoration: underline;
}

/* Dashboard shimmer loading */
@keyframes dash-shimmer-slide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dash-shimmer-block {
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--surface2) 0%,
    color-mix(in srgb, var(--border) 55%, var(--surface2)) 50%,
    var(--surface2) 100%
  );
  background-size: 200% 100%;
  animation: dash-shimmer-slide 1.2s ease-in-out infinite;
}

#page-dashboard.is-loading .dash-shimmer-card,
#page-dashboard.is-loading .dash-shimmer-tile {
  pointer-events: none;
}

.dash-shimmer-card {
  min-height: 92px;
}

.dash-shimmer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dash-shimmer-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.dash-shimmer-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
}

.dash-shimmer-text {
  height: 10px;
  margin-top: 6px;
}

.dash-shimmer-text.xs { width: 38%; max-width: 72px; height: 8px; }
.dash-shimmer-text.sm { width: 52%; max-width: 100px; }
.dash-shimmer-text.md { width: 68%; max-width: 140px; height: 11px; }
.dash-shimmer-text.lg { width: 78%; max-width: 120px; height: 18px; margin-top: 8px; }

.dash-shimmer-tile {
  min-height: 78px;
}

.chart-wrap.has-shimmer canvas {
  opacity: 0;
}

.dash-chart-shimmer {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    var(--surface2) 0%,
    color-mix(in srgb, var(--border) 55%, var(--surface2)) 50%,
    var(--surface2) 100%
  );
  background-size: 200% 100%;
  animation: dash-shimmer-slide 1.2s ease-in-out infinite;
}

.chart-wrap {
  position: relative;
}

.dash-shimmer-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.dash-shimmer-table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 10px;
  align-items: center;
}

.dash-shimmer-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.dash-shimmer-list-item:last-child {
  border-bottom: none;
}

.dash-shimmer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.dash-shimmer-list-body {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .dash-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── 10-support.css ── */
/* ── Support pages ── */
.page-support .support-contact-card {
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.page-support .support-contact-card .support-contact-action {
  margin-top: auto;
  width: 100%;
}
.page-support .support-contact-card h3 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 800;
}
.page-support .support-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  margin-bottom: 4px;
}
.page-support .support-icon .icon {
  width: 22px;
  height: 22px;
}
.page-support .support-meta {
  font-size: 13px;
  color: var(--text3);
  margin: 0;
  line-height: 1.4;
}
.page-support .support-faq details {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.page-support .support-faq details:last-child {
  border-bottom: none;
}
.page-support .support-faq summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-support .support-faq summary::-webkit-details-marker { display: none; }
.page-support .support-faq summary::after {
  content: '+';
  font-weight: 700;
  color: var(--text3);
  font-size: 18px;
  line-height: 1;
}
.page-support .support-faq details[open] summary::after { content: '−'; }
.page-support .support-faq details p {
  margin: 10px 0 4px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}
.page-support .support-legal h3 {
  margin: 18px 0 6px;
  font-size: 15px;
  font-weight: 800;
}
.page-support .support-legal h3:first-of-type { margin-top: 8px; }
.page-support .support-legal p {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}
.page-support .support-updated {
  font-size: 12px !important;
  color: var(--text3) !important;
  margin-bottom: 8px !important;
}
.page-support .support-about-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-support .support-about-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface2, rgba(0,0,0,.04));
  padding: 6px;
}
.page-support .support-about-hero h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}
.page-support .support-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface2, rgba(0,0,0,.04));
}
.page-support .support-stat strong {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.page-support .support-stat span {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.page-support .support-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.7;
}
@media (max-width: 768px) {
  .page-support .support-about-hero {
    flex-direction: column;
    text-align: center;
  }
}

/* Account & Plans */
.page-account-plans .plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--accent, #f59e0b) 18%, transparent);
  color: var(--accent, #f59e0b);
  border: 1px solid color-mix(in srgb, var(--accent, #f59e0b) 35%, transparent);
}
.page-account-plans .account-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2, var(--bg)) 60%, transparent);
}
.page-account-plans .account-info-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
.page-account-plans .account-info-row strong {
  font-size: 15px;
  color: var(--text);
  word-break: break-word;
}
.page-account-plans .plan-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.page-account-plans .plan-card-featured {
  border-color: color-mix(in srgb, var(--accent, #f59e0b) 55%, var(--border));
}
.page-account-plans .plan-card.is-current {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #f59e0b) 45%, transparent);
}
.page-account-plans .plan-card.is-locked {
  opacity: 0.72;
}
.page-account-plans .plan-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.page-account-plans .plan-selected-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, #22c55e 18%, transparent);
  color: #16a34a;
  border: 1px solid color-mix(in srgb, #22c55e 35%, transparent);
}
.page-account-plans .plan-card button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}
.page-account-plans .plan-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: color-mix(in srgb, #3b82f6 16%, transparent);
  color: #3b82f6;
}
.page-account-plans .plan-chip-plus {
  background: color-mix(in srgb, var(--accent, #f59e0b) 18%, transparent);
  color: var(--accent, #f59e0b);
}
.page-account-plans .plan-price {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.page-account-plans .plan-price span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-left: 2px;
}
.page-account-plans .plan-card-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}
.page-account-plans .plan-features {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.7;
  flex: 1;
}
.page-account-plans .plan-card .btn-pro:disabled {
  opacity: 0.7;
  cursor: default;
}
.page-account-plans .account-coupon-bar {
  padding: 14px 16px;
}
.page-account-plans .account-coupon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.page-account-plans .account-coupon-row .form-ctrl {
  flex: 1 1 180px;
  min-width: 140px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.page-account-plans .account-coupon-row .btn-pro,
.page-account-plans .account-coupon-row .btn-outline {
  flex: 0 0 auto;
}
.page-account-plans .plan-price-old {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  text-decoration: line-through;
  margin-bottom: 2px;
}
.page-account-plans .plan-coupon-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: color-mix(in srgb, #22c55e 16%, transparent);
  color: #16a34a;
}
.page-account-plans .account-team-form .form-ctrl,
.page-account-plans .account-team-role-select {
  min-width: 0;
}
.page-account-plans .account-team-list,
.page-account-plans .account-devices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-account-plans .account-team-row,
.page-account-plans .account-device-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2, var(--bg)) 60%, transparent);
}
.page-account-plans .account-device-row.is-current {
  border-color: color-mix(in srgb, #22c55e 45%, var(--border));
}
.page-account-plans .account-team-main,
.page-account-plans .account-device-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  flex: 1 1 220px;
}
.page-account-plans .account-team-main strong,
.page-account-plans .account-device-main strong {
  font-size: 15px;
}
.page-account-plans .account-team-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.page-account-plans .account-role-chip,
.page-account-plans .account-pending-chip,
.page-account-plans .account-me-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.page-account-plans .account-role-chip {
  background: color-mix(in srgb, #3b82f6 16%, transparent);
  color: #2563eb;
}
.page-account-plans .account-pending-chip {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #d97706;
}
.page-account-plans .account-me-chip {
  background: color-mix(in srgb, #22c55e 16%, transparent);
  color: #16a34a;
}
.page-account-plans .btn-danger-outline {
  border-color: color-mix(in srgb, #ef4444 45%, var(--border));
  color: #dc2626;
}
@media (max-width: 700px) {
  .page-account-plans .ios-segment {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .page-account-plans .ios-segment-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* ── 11-subscription.css ── */
.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 13px;
  font-weight: 650;
}
.trial-banner[hidden] { display: none !important; }
.trial-banner-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  background: #ea580c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.trial-banner-btn:hover { background: #c2410c; }

.admin-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 650;
}
.admin-view-banner[hidden] { display: none !important; }
.admin-view-banner-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.admin-view-banner-btn:hover { background: #1e40af; }

.premium-paywall {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}
.premium-paywall[hidden] { display: none !important; }
.premium-paywall-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.premium-paywall-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  color: #ea580c;
}
.premium-paywall-icon .icon { width: 28px; height: 28px; }
.premium-paywall-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}
.premium-paywall-card p {
  margin: 0 0 18px;
  color: var(--text2, #475569);
  font-size: 14px;
  line-height: 1.55;
}

.paywall-logout-fab {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: 8px 14px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.paywall-logout-fab[hidden] { display: none !important; }
.paywall-logout-fab .icon { width: 15px; height: 15px; }
.paywall-logout-fab:hover { background: #1e293b; }

.nav-item.nav-item-locked {
  opacity: .45;
  pointer-events: none;
}
body.subscription-locked .main-content .page:not(#page-account-plans):not(#page-support) {
  pointer-events: none;
  filter: grayscale(.2);
}

/* ── 12-native-mobile.css ── */
/* Detected by early script OR narrow viewport */
html.native-app,
html.native-app body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── AUTH: full-screen native (phone / webview) ── */
@media (max-width: 900px) {
  .auth-gate {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: #ffffff !important;
    overflow: hidden;
  }

  .auth-split {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    max-width: none !important;
    min-height: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
  }

  /* Brand header — compact native top */
  .auth-split-left {
    flex: 0 0 auto;
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      20px
      18px !important;
    gap: 10px !important;
    border-radius: 0 0 28px 28px;
    background:
      radial-gradient(ellipse 80% 80% at 100% 0%, rgba(232, 93, 4, 0.22), transparent 55%),
      linear-gradient(165deg, #0f172a 0%, #1e293b 100%) !important;
  }
  .auth-split-left::after { display: none; }
  .auth-left-top { max-width: none; }
  .auth-left-logo-wrap {
    width: 56px !important;
    height: 56px !important;
    margin: 0 0 10px !important;
    padding: 6px !important;
    border-radius: 16px !important;
  }
  .auth-left-eyebrow {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .auth-left-title {
    font-size: 1.45rem !important;
    margin-bottom: 4px !important;
    letter-spacing: -0.03em;
  }
  .auth-left-tagline {
    font-size: 13px !important;
    line-height: 1.45;
    max-width: none;
    color: #94a3b8 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .auth-platform-list { display: none !important; }
  .auth-platform-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px !important;
    max-width: none;
    margin-top: 4px;
  }
  .auth-platform-stats > div {
    padding: 8px 6px !important;
    border-radius: 12px !important;
    text-align: center;
  }
  .auth-platform-stats strong { font-size: 12px !important; }
  .auth-platform-stats span { font-size: 10px !important; }

  /* Form sheet — fills rest, scrolls; CTAs feel sticky */
  .auth-split-right {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 !important;
    align-items: stretch !important;
    background: #fff !important;
    overflow: hidden;
    display: flex;
  }
  .auth-right-card {
    width: 100%;
    max-width: none !important;
    height: 100%;
    margin: 0;
    padding:
      16px 20px
      calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .auth-right-logo-wrap { display: none !important; }
  .auth-lang-switch {
    align-self: flex-end;
    margin-bottom: 8px;
  }
  .auth-right-card h2 {
    font-size: 1.5rem !important;
    margin-bottom: 4px !important;
  }
  .auth-right-sub {
    font-size: 14px !important;
    margin-bottom: 18px !important;
  }

  /* Native-sized controls */
  .auth-gate .form-label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  .auth-gate .form-ctrl,
  .auth-phone-prefix {
    min-height: 52px;
    border-radius: 14px !important;
    font-size: 16px !important; /* iOS zoom prevent */
    padding: 12px 14px;
  }
  .auth-phone-prefix {
    padding: 0 14px !important;
    font-size: 15px !important;
  }
  .auth-otp-input {
    min-height: 56px;
    font-size: 1.35rem !important;
    letter-spacing: 0.4em;
    border-radius: 16px !important;
  }
  .auth-google-btn {
    min-height: 54px;
    border-radius: 16px !important;
    font-size: 15px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  .auth-gate .btn-pro {
    min-height: 54px;
    border-radius: 16px !important;
    font-size: 15px !important;
    font-weight: 800;
  }
  .auth-howto-btn {
    min-height: 48px;
    border-radius: 14px !important;
    margin-top: auto;
    margin-bottom: 8px;
  }
  .auth-fineprint {
    font-size: 11px;
    line-height: 1.4;
    color: #94a3b8;
    text-align: center;
    margin: 0;
  }
  .auth-link-btn {
    min-height: 44px;
    font-size: 14px !important;
  }
  .auth-or { margin: 16px 0; }

  .auth-loading-overlay {
    background: rgba(255, 255, 255, 0.72) !important;
  }
  .auth-loading-card {
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
  }
}

/* Force same native auth when WebView sets .native-app even on wider screens */
html.native-app .auth-gate {
  padding: 0 !important;
  background: #fff !important;
}
html.native-app .auth-split {
  max-width: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 100%;
  height: 100%;
}

/* ── ONBOARDING: native full-screen wizard ── */
@media (max-width: 900px) {
  .onboard-gate {
    padding: 0 !important;
    align-items: stretch !important;
    background: #fff !important;
    overflow: hidden;
  }
  .onboard-shell {
    max-width: none !important;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .glass-card.onboard-shell,
  .onboard-shell.glass-card {
    background: #fff !important;
    backdrop-filter: none;
  }

  .onboard-lang-switch {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 16px;
    z-index: 2;
  }

  .onboard-progress {
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 6px;
    margin: 0;
    padding:
      calc(18px + env(safe-area-inset-top, 0px))
      20px
      0;
  }
  .onboard-progress-dot {
    flex: 1;
    height: 4px !important;
    width: auto !important;
    max-width: none;
    border-radius: 99px;
    background: #e2e8f0;
  }
  .onboard-progress-dot.active {
    background: #e85d04;
    width: auto !important;
  }
  .onboard-progress-dot.done {
    background: #0f172a;
  }

  .onboard-step {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 0;
    overflow: hidden;
  }
  .onboard-step[style*="display: none"],
  .onboard-step[hidden] {
    display: none !important;
  }
  .onboard-step h2 {
    font-size: 1.45rem !important;
    letter-spacing: -0.03em;
    margin-bottom: 4px !important;
  }
  .onboard-step > .text-muted {
    font-size: 14px;
    margin-bottom: 16px;
    color: #64748b;
  }
  .onboard-step > .row,
  .onboard-step > .onboard-step-body,
  .onboard-step > #onboardCatalog,
  .onboard-step > #onboardRates {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    margin: 0;
  }

  .onboard-gate .form-ctrl,
  .onboard-gate select.form-ctrl,
  .onboard-gate textarea.form-ctrl {
    min-height: 48px;
    border-radius: 14px !important;
    font-size: 16px !important;
  }
  .onboard-gate textarea.form-ctrl { min-height: 72px; }

  .onboard-actions {
    flex: 0 0 auto;
    margin: 0 !important;
    padding:
      12px 20px
      calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #f1f5f9;
    background: #fff;
    justify-content: stretch;
    gap: 10px;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.04);
  }
  .onboard-actions .btn-pro,
  .onboard-actions .btn-outline {
    flex: 1;
    min-height: 52px;
    border-radius: 16px !important;
    font-size: 15px !important;
    font-weight: 800;
  }
  .onboard-actions .btn-outline {
    flex: 0 0 auto;
    min-width: 96px;
  }

  .onboard-cat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .onboard-product-card {
    min-height: 88px;
    border-radius: 16px !important;
    padding: 14px !important;
    -webkit-tap-highlight-color: transparent;
  }
  .onboard-product-card.selected {
    border-color: #e85d04 !important;
    box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.2) !important;
  }
  .onboard-rate-card {
    border-radius: 16px !important;
  }
}

/* How-to as native sheet on phone */
@media (max-width: 900px) {
  .howto-gate {
    padding: 0 !important;
  }
  .howto-page {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .howto-top {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .howto-body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

/* ════════════════════════════════════════════════════════════
   NATIVE SHELL — bottom nav, no left menu, full-bleed pages
════════════════════════════════════════════════════════════ */
.bottom-nav,
.more-sheet {
  display: none;
}

/* Constant Flutter-style app bar — mobile / native only */
.app-bar {
  display: none;
}

@media (max-width: 767px) {
  body.user-portal .app-bar {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 350;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    margin: 0;
    padding:
      env(safe-area-inset-top, 0px)
      16px
      0;
    background: #0f172a;
    border: none;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
  }
  body.user-portal .app-bar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
  }
  body.user-portal .app-bar-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.user-portal .app-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 auto;
    max-width: 62%;
    min-width: 0;
  }
  body.user-portal .app-bar-actions:empty {
    display: none;
  }
  body.user-portal .app-bar-actions > .page-header-tools,
  body.user-portal .app-bar-actions > .d-flex,
  body.user-portal .app-bar-actions > .dash-toolbar,
  body.user-portal .app-bar-actions > .dash-toolbar-compact,
  body.user-portal .app-bar-actions > .party-hisab-actions,
  body.user-portal .app-bar-actions > .settings-toolbar-actions,
  body.user-portal .app-bar-actions > .settings-lang-inline,
  body.user-portal .app-bar-actions > #matHeaderActions {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: auto !important;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  body.user-portal .app-bar-actions > *::-webkit-scrollbar {
    display: none;
  }
  body.user-portal .app-bar-actions .btn-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
  }
  body.user-portal .app-bar-actions .btn-icon:active {
    background: rgba(255, 255, 255, 0.18);
  }
  body.user-portal .app-bar-actions .btn-pro,
  body.user-portal .app-bar-actions .btn-outline {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 750;
    border-radius: 10px;
    white-space: nowrap;
  }
  body.user-portal .app-bar-actions .btn-pro {
    background: #e85d04;
    border-color: #e85d04;
    color: #fff;
  }
  body.user-portal .app-bar-actions .btn-outline {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
  }
  body.user-portal .app-bar-actions .btn-pro .icon,
  body.user-portal .app-bar-actions .btn-outline .icon,
  body.user-portal .app-bar-actions .btn-icon .icon {
    width: 18px;
    height: 18px;
    color: inherit;
  }
  body.user-portal .app-bar-actions .dashboard-period-pill {
    max-width: 78px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 750;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
  }
  body.user-portal .app-bar-actions .dash-sync-bar {
    color: #cbd5e1;
    font-size: 11px;
  }
  body.user-portal .app-bar-actions .dash-filter-popup,
  body.user-portal .app-bar-actions .page-filter-popup {
    color: #0f172a;
  }
  body.user-portal .app-bar-actions .settings-lang-inline-label {
    display: none;
  }
  body.user-portal .app-bar-actions .lang-switch {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 2px;
  }
  body.user-portal .app-bar-actions .lang-option {
    color: #cbd5e1;
    font-size: 11px;
    padding: 5px 8px;
  }
  body.user-portal .app-bar-actions .lang-option.active {
    background: #fff;
    color: #0f172a;
  }

  /* Invoice app-bar: search / filter / clear icons */
  body.user-portal .app-bar-actions .inv-appbar-tools {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    width: auto !important;
    max-width: 100%;
    justify-content: flex-end;
  }
  body.user-portal .app-bar-actions .inv-search-toggle {
    display: inline-flex !important;
  }
  body.user-portal .app-bar-actions .inv-appbar-search-field {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    height: 36px;
    padding: 6px 10px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
  }
  body.user-portal .app-bar-actions .inv-appbar-search-field::placeholder {
    color: rgba(255, 255, 255, 0.55);
  }
  body.user-portal .app-bar-actions .inv-search-close {
    display: none;
  }
  body.user-portal .app-bar-actions .inv-appbar-tools.is-search-open {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: none;
  }
  body.user-portal .app-bar-actions .inv-appbar-tools.is-search-open .inv-search-toggle,
  body.user-portal .app-bar-actions .inv-appbar-tools.is-search-open .dash-filter-wrap,
  body.user-portal .app-bar-actions .inv-appbar-tools.is-search-open .page-filter-clear {
    display: none !important;
  }
  body.user-portal .app-bar-actions .inv-appbar-tools.is-search-open .inv-appbar-search-field {
    display: block;
  }
  body.user-portal .app-bar-actions .inv-appbar-tools.is-search-open .inv-search-close {
    display: inline-flex !important;
  }
  body.user-portal .app-bar.app-bar--search .app-bar-title {
    display: none;
  }
  body.user-portal .app-bar.app-bar--search .app-bar-actions {
    flex: 1 1 auto;
    max-width: none;
  }
  body.user-portal #page-invoice #invFilterToolbar {
    display: none !important;
  }

  /* Page titles live in app bar — hide duplicate in-page titles / empty headers */
  body.user-portal .page .page-header > h1,
  body.user-portal .page .page-header > div > h1,
  body.user-portal .page .page-sub,
  body.user-portal .page .dash-sub,
  body.user-portal .page .settings-panel-desc.page-filler,
  body.user-portal .dash-title > span:first-child:not(.dash-greeting) {
    display: none !important;
  }
  body.user-portal .page .page-header {
    margin: 0 0 8px;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
  }
  body.user-portal .page .page-header:not(:has(.page-header-tools, .d-flex, #matHeaderActions, .party-hisab-actions, .settings-toolbar-actions, .settings-lang-inline, button, .btn-pro, .btn-outline)) {
    display: none !important;
  }
  body.user-portal .page .page-header > div:has(> h1) {
    display: none;
  }
}

@media (max-width: 767px) {
  /* Kill drawer sidebar + hamburger */
  body.user-portal .sidebar,
  body.user-portal .sidebar-overlay,
  body.user-portal .mobile-nav-fab {
    display: none !important;
  }

  /* Full-bleed main (no floating card chrome) */
  body.user-portal .main-content {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding:
      calc(52px + env(safe-area-inset-top, 0px) + 10px)
      14px
      calc(72px + env(safe-area-inset-bottom, 0px))
      14px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f4f6f9 !important;
  }

  /* Bottom tab bar */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    min-height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 48px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: -0.01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
  }
  .bottom-nav-item .icon {
    width: 22px;
    height: 22px;
  }
  .bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.1;
  }
  .bottom-nav-item.active {
    color: #0f172a;
  }
  .bottom-nav-item.active .icon {
    color: #e85d04;
  }
  .bottom-nav-item--accent.active {
    color: #e85d04;
  }
  .bottom-nav-item:active {
    background: rgba(15, 23, 42, 0.04);
  }

  /* Contact FAB — dashboard only; page action FAB — other pages */
  body.user-portal .platform-contact,
  body.user-portal .page-action-fab {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
  }
  body.user-portal .page-action-fab-btn {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 750;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(232, 93, 4, 0.3);
  }
  body.user-portal .page-action-fab-btn .icon {
    width: 16px;
    height: 16px;
  }
  body.user-portal .page-action-fab-label {
    font-size: 12px;
  }
  body.user-portal .page-header-primary-action {
    display: none !important;
  }
  /* Period pill not needed in app bar on production (filter covers it) */
  body.user-portal #page-production .dashboard-period-pill,
  body.user-portal #appBarActions #prodPeriodLabel {
    display: none !important;
  }

  /* More sheet */
  .more-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 450;
  }
  .more-sheet[hidden] { display: none !important; }
  .more-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
  }
  .more-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(82vh, 640px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.18);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: moreSheetUp .28s ease;
  }
  @keyframes moreSheetUp {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: none; opacity: 1; }
  }
  .more-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: #e2e8f0;
    margin: 10px auto 4px;
  }
  .more-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 12px;
  }
  .more-sheet-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  .more-sheet-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .more-sheet-close .icon { width: 18px; height: 18px; }
  .more-sheet-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px 18px;
  }
  .more-sheet-section { margin-bottom: 16px; }
  .more-sheet-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 8px 4px;
  }
  .more-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .more-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .more-sheet-item .icon {
    width: 22px;
    height: 22px;
    color: #e85d04;
  }
  .more-sheet-item span {
    text-align: center;
    line-height: 1.2;
  }
  .more-sheet-item.active {
    border-color: rgba(232, 93, 4, 0.35);
    background: #fff7ed;
  }

  /* ── Native page chrome ── */
  body.user-portal .page .page-header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
  }
  body.user-portal .page .page-header-tools,
  body.user-portal .page .page-header .d-flex {
    width: 100%;
  }
  body.user-portal .page .card-pro {
    border-radius: 18px;
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  }

  /* Invoice management — flat card list on phone */
  body.user-portal #page-invoice .page-header {
    margin-bottom: 8px;
    gap: 8px;
    align-items: center;
  }
  body.user-portal #page-invoice .page-header h1 {
    font-size: 1.25rem !important;
  }
  body.user-portal #page-invoice .page-header .btn-pro {
    padding: 8px 12px;
    font-size: 12.5px;
  }
  body.user-portal #page-invoice .page-filter-toolbar {
    gap: 6px;
    margin-bottom: 8px;
  }
  body.user-portal #page-invoice .card-pro {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  body.user-portal #page-invoice .card-pro > .table-wrap {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }
  body.user-portal #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row {
    background: #ffffff !important;
    border: 1.5px solid #22c55e;
    box-shadow: none;
  }
  body.user-portal #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row.row-overdue {
    border-color: #ef4444;
    background: #ffffff !important;
  }
  body.user-portal #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row.row-pending {
    border-color: #f59e0b;
    background: #ffffff !important;
  }
  body.user-portal #page-invoice .tbl.is-mobile-cards tbody tr.inv-list-row:hover {
    background: #ffffff !important;
  }

  /* Item cards only — not section shells / labels / nested cells */
  body.user-portal .page .tbl.is-mobile-cards tbody tr {
    background: #ffffff !important;
  }
  body.user-portal .page .tbl.is-mobile-cards tbody tr:hover {
    background: #ffffff !important;
  }
  body.user-portal .page .tbl.is-mobile-cards td {
    background: transparent !important;
  }
  body.user-portal .prod-inventory-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1);
  }
  body.user-portal .labour-team-box {
    background: #ffffff !important;
  }
  body.user-portal .labour-team-box.labour-team-box-active {
    background: color-mix(in srgb, var(--primary, #2563eb) 7%, #ffffff) !important;
  }

  /* Labour — transparent section wrap; white only on person/work/payment cards */
  body.user-portal #page-labour .card-pro {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  body.user-portal #page-labour .card-pro > .card-pro-header {
    padding: 0 2px 8px;
    margin-bottom: 4px;
    background: transparent !important;
  }
  body.user-portal #page-labour .card-pro > .table-wrap {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  /* Production list — flat shell, tight stock widgets + entry cards */
  body.user-portal #page-production {
    gap: 0;
  }
  body.user-portal #page-production .card-pro {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 12px !important;
  }
  body.user-portal #page-production .card-pro:first-of-type {
    margin-top: 0 !important;
  }
  body.user-portal #page-production .card-pro > .card-pro-header {
    padding: 0 2px 6px;
    margin-bottom: 2px;
    background: transparent !important;
    border: none !important;
  }
  body.user-portal #page-production .card-pro > .table-wrap {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }
  body.user-portal #page-production .prod-inventory-tabs {
    margin: 0 0 8px;
    gap: 6px;
  }
  body.user-portal #page-production .prod-inventory-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body.user-portal #page-production .prod-inventory-card {
    padding: 10px;
    border-radius: 12px;
    box-shadow: none;
  }
  body.user-portal #page-production .prod-inventory-card-head {
    margin-bottom: 6px;
    gap: 6px;
  }
  body.user-portal #page-production .prod-inventory-card-head strong {
    font-size: 12px;
    line-height: 1.25;
  }
  body.user-portal #page-production .prod-inventory-stats {
    gap: 4px 6px;
  }
  body.user-portal #page-production .prod-inventory-stats--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.user-portal #page-production .prod-inventory-stats small {
    font-size: 9px;
    margin-bottom: 1px;
  }
  body.user-portal #page-production .prod-inventory-stats b {
    font-size: 13px;
  }
  body.user-portal #page-production .prod-inventory-progress {
    margin-top: 6px;
    height: 3px;
  }
  body.user-portal #page-production .prod-inventory-sold-pct {
    margin-top: 3px;
    font-size: 10px;
  }
  body.user-portal #page-production .opening-hint {
    margin: 0 0 8px;
    padding: 8px 10px;
    font-size: 12px;
  }
  body.user-portal #page-production .tbl.is-mobile-cards tbody {
    gap: 8px;
  }
  body.user-portal #page-production .tbl.is-mobile-cards tbody tr.prod-list-row {
    padding: 10px 12px;
    border-radius: 12px;
    gap: 4px 8px;
  }
  body.user-portal #page-production .tbl.is-mobile-cards .prod-calc-lines {
    display: none;
  }
  body.user-portal #page-production .tbl.is-mobile-cards .prod-calc-amt strong {
    font-size: 13px;
  }
  body.user-portal #page-production .tbl.is-mobile-cards .prod-list-item {
    gap: 4px 6px;
  }
  body.user-portal #page-production .tbl.is-mobile-cards .prod-list-item strong {
    font-size: 13px;
  }
  body.user-portal #page-production .tbl.is-mobile-cards td {
    font-size: 12px;
  }

  /* Dashboard native — compact header, no filler subtitle */
  body.user-portal #page-dashboard {
    margin: 0;
  }
  body.user-portal .dash-shell {
    gap: 10px;
  }
  body.user-portal .dash-hero {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    margin: 0;
  }
  body.user-portal .dash-hero-text {
    flex: 1 1 auto;
    min-width: 0;
  }
  body.user-portal .dash-title {
    display: block;
    font-size: inherit !important;
    line-height: 1.15;
    gap: 0;
  }
  /* Hide "Dashboard" label — greeting is enough on phone */
  body.user-portal .dash-title > span:first-child:not(.dash-greeting) {
    display: none !important;
  }
  body.user-portal .dash-greeting {
    display: block;
    font-size: 1.2rem !important;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1.2;
  }
  /* "Here's what's happening" — filler; hide on mobile */
  body.user-portal .dash-sub,
  body.user-portal #dashSubtitle {
    display: none !important;
  }
  body.user-portal .dash-toolbar,
  body.user-portal .dash-toolbar-compact {
    flex: 0 0 auto;
    padding: 4px 6px;
    gap: 4px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
  }
  body.user-portal .dashboard-period-pill {
    font-size: 11px;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.user-portal .dash-kpi-grid,
  body.user-portal #kpiGrid.kpi-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
  }
  body.user-portal .dash-kpi-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  body.user-portal .kpi-grid--collapsed > .kpi-card--extra {
    display: none !important;
  }
  body.user-portal .dash-kpi-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  body.user-portal .dash-kpi-view-all[hidden] {
    display: none !important;
  }
  body.user-portal .dash-kpi-grid .kpi-card,
  body.user-portal #kpiGrid .kpi-card {
    border-radius: 16px;
    padding: 12px 10px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
    min-width: 0;
    overflow: hidden;
  }
  body.user-portal .kpi-info {
    min-width: 0;
  }
  body.user-portal .kpi-label {
    font-size: 11px !important;
    line-height: 1.25 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  body.user-portal .kpi-value {
    font-size: 15px !important;
    line-height: 1.25 !important;
    margin-top: 4px !important;
    overflow: hidden;
    word-break: break-word;
  }
  body.user-portal .kpi-value .prod-split-line,
  body.user-portal .kpi-bd-row,
  body.user-portal .kpi-bd-val,
  body.user-portal .kpi-bd-unit {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  body.user-portal .kpi-bd-row:first-child .kpi-bd-val {
    font-size: 15px !important;
  }
  body.user-portal .kpi-value .prod-split-line {
    font-size: 13px !important;
  }
  body.user-portal .kpi-breakdown {
    max-width: 100%;
  }
  body.user-portal .dash-widgets,
  body.user-portal .dash-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  body.user-portal .dash-card {
    border-radius: 16px !important;
  }

  /* Quicker page enter on mobile */
  body.user-portal .page.active {
    animation: nativePageIn .22s ease;
  }
  @keyframes nativePageIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}

@media (max-width: 560px) {
  .more-sheet-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media print {
  .bottom-nav,
  .more-sheet {
    display: none !important;
  }
}
