/**
 * BNPL ERP — Admin Dashboard UI polish (spacing/sizing only).
 * Scope: Control Center home + shared list/toolbar patterns.
 * No permission, navigation, or business-logic changes.
 */

/* ── Dashboard section rhythm ── */
.dash-home.cc-home {
  --dash-gap: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
}

.dash-home.cc-home > .dash-section-title {
  margin: 0 !important;
  font-size: 16px;
  line-height: 1.25;
}

.dash-home.cc-home > .hint {
  margin: -2px 0 0 !important;
  line-height: 1.35;
}

.dash-home.cc-home > .cc-kpi-strip,
.dash-home.cc-home > .dash-actions-grid,
.dash-home.cc-home > .cc-table-wrap,
.dash-home.cc-home > .dash-allotted-panel,
.dash-home.cc-home > #liveDutyGpsMapSection,
.dash-home.cc-home > .dash-owner-power {
  margin: 0 !important;
}

.dash-home.cc-home > .dash-owner-power {
  margin-top: 8px !important;
  /* LOCK: always last on dashboard — even if stale cached index.html inserts block early */
  order: 99;
}

.dash-section-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
  color: #0F172A;
}

.dash-home.cc-home > .dash-section-title {
  color: #0F172A;
  font-size: 17px;
  font-weight: 800;
}

/* ── Header compact (~20% height reduction) ── */
.erp-shell-header .topbar {
  padding: 5px 10px;
  gap: 4px;
  row-gap: 4px;
}

.erp-shell-header .topbar .menu-btn,
.erp-shell-header .topbar-icon-btn,
.erp-shell-header .topbar #btnGlobalSearch.topbar-search-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  max-height: 36px;
  font-size: 18px !important;
  line-height: 1 !important;
  align-self: center;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.erp-shell-header .topbar #btnGlobalSearch.topbar-search-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.erp-shell-header .topbar .company-select {
  padding: 5px 7px;
  font-size: 12px;
}

.erp-shell-header .topbar .lang-select-btn {
  padding: 6px 8px !important;
  min-height: 36px;
}

.erp-shell-header .action-btn.topbar-inline {
  padding: 6px 8px;
  min-height: 36px;
}

.erp-shell-header .action-btn.topbar-inline .action-icon {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.erp-crumb-row {
  padding: 4px 10px 5px;
  gap: 6px;
}

.erp-crumb-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.erp-crumb-app-icon {
  display: none;
}

.erp-crumb-row #erpBreadcrumb {
  font-size: 15px;
}

.erp-crumb-row .erp-last-updated {
  font-size: 11px;
}

/* ── Executive summary / KPI cards — horizontal: icon | title | value ── */
.cc-kpi-strip {
  gap: 8px !important;
  margin: 0 !important;
}

@media (max-width: 640px) {
  .cc-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 360px) {
  .cc-kpi-strip {
    gap: 6px !important;
  }
}

.cc-kpi {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  min-height: 48px !important;
  height: 48px !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  border: 1px solid #E2E8F0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  text-align: left;
  font: inherit;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cc-kpi:hover {
  border-color: #A5B4FC;
  box-shadow: 0 2px 8px rgba(57, 73, 171, 0.12);
}

.cc-kpi-left {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden;
}

.cc-kpi-icon {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0 !important;
  color: #3949AB;
}

.cc-kpi-icon .dash-svg {
  display: block;
  width: 17px;
  height: 17px;
}

.cc-kpi-label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  color: #334155 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-kpi-value {
  flex: 0 0 auto !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  margin: 0 0 0 4px !important;
  color: #0F172A !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  align-self: center;
}

.cc-kpi.cc-kpi-empty .cc-kpi-value {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #94A3B8 !important;
}

.cc-kpi.kpi-sites { border-color: #C7D2FE; background: linear-gradient(90deg, #EEF2FF 0%, #fff 40%); }
.cc-kpi.kpi-sites .cc-kpi-icon { background: #E0E7FF; color: #3949AB; }
.cc-kpi.kpi-labor { border-color: #A7F3D0; background: linear-gradient(90deg, #ECFDF5 0%, #fff 40%); }
.cc-kpi.kpi-labor .cc-kpi-icon { background: #D1FAE5; color: #047857; }
.cc-kpi.kpi-material { border-color: #FED7AA; background: linear-gradient(90deg, #FFF7ED 0%, #fff 40%); }
.cc-kpi.kpi-material .cc-kpi-icon { background: #FFEDD5; color: #C2410C; }
.cc-kpi.kpi-purchase { border-color: #CBD5E1; background: linear-gradient(90deg, #F8FAFC 0%, #fff 40%); }
.cc-kpi.kpi-purchase .cc-kpi-icon { background: #E2E8F0; color: #475569; }
.cc-kpi.kpi-finance { border-color: #BBF7D0; background: linear-gradient(90deg, #F0FDF4 0%, #fff 40%); }
.cc-kpi.kpi-finance .cc-kpi-icon { background: #DCFCE7; color: #15803D; }
.cc-kpi.kpi-security { border-color: #FECACA; background: linear-gradient(90deg, #FEF2F2 0%, #fff 40%); }
.cc-kpi.kpi-security .cc-kpi-icon { background: #FEE2E2; color: #B91C1C; }

/* ── Owner / Super Admin Power — blue header + compact rows ── */
.dash-owner-power {
  margin-top: 4px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1D4ED8;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.15);
}

.dash-owner-power-head {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
  color: #fff !important;
  padding: 12px 14px;
}

.dash-owner-power-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff !important;
}

.dash-owner-power-head p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
}

.dash-owner-actions {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.dash-owner-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #E2E8F0;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #0F172A;
  transition: background .12s ease;
}

.dash-owner-row:last-child {
  border-bottom: 0;
}

.dash-owner-row:hover,
.dash-owner-row:focus-visible {
  background: #F8FAFC;
}

.dash-owner-row-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #EEF2FF;
  color: #3949AB;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-owner-row-icon .dash-svg {
  width: 18px;
  height: 18px;
}

.dash-owner-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dash-owner-row-body b {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #0F172A;
}

.dash-owner-row-body span {
  font-size: 11px;
  line-height: 1.25;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-owner-row-arrow {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 700;
  color: #94A3B8;
  line-height: 1;
}

html.bnpl-android-shell .dash-owner-actions {
  padding-bottom: 0;
}

html.bnpl-android-shell .dash-home.cc-home > .dash-owner-power {
  margin-bottom: 0;
}

/* Persona summary cards (Approvals / Material / To Do pattern) */
.dash-summary {
  gap: 8px;
}

.dash-sum-card {
  padding: 9px 10px;
  gap: 2px;
  min-height: 72px;
  justify-content: center;
  border-radius: 9px;
}

.dash-sum-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.dash-sum-card span {
  font-size: 12px;
  line-height: 1.25;
}

/* ── Quick actions (Punch | DPR | … pattern) ── */
.dash-actions-grid {
  gap: 6px;
  margin-top: 0;
}

.dash-qa {
  padding: 8px 9px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

.dash-qa b {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.dash-qa span {
  font-size: 11px;
  line-height: 1.25;
}

/* ── Filter / search / toolbar ── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 5px 0 8px;
  padding-bottom: 2px;
}

.filter-chip {
  padding: 5px 10px;
  font-size: 11px;
}

.subnav-actions,
.back-action {
  margin-bottom: 8px;
}

/* ── Project / site list cards (~22% shorter) ── */
.list-item {
  padding: 7px 10px;
}

.list-item b {
  font-size: 14px;
  line-height: 1.25;
  margin: 0;
}

.list-item span {
  font-size: 11px;
  line-height: 1.3;
  display: block;
  margin-top: 1px;
}

.list-item .badge {
  margin-top: 4px;
  padding: 2px 7px;
  font-size: 10px;
}

/* ── Module control table (dense rows) ── */
.cc-table th,
.cc-table td {
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.3;
}

.cc-table th {
  font-size: 12px;
  background: #F8FAFC !important;
  color: #0F172A !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

/* Content padding SSOT: erp-foundation.css #content / .content */

.dash-home.cc-home > *:last-child {
  margin-bottom: 0;
}

.dash-home.cc-home > .dash-actions-grid {
  padding-bottom: 0;
  overflow: visible;
}

/* ── Zero-module dashboard empty state ── */
.dash-home.dash-home--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
  padding: 24px 16px 32px;
}

.dash-empty-state {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 28px 22px;
  text-align: center;
  background: #fff;
  border: 2px solid #0f172a;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.dash-empty-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}

.dash-empty-hint {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.45;
}

/* Phone menu sits under fixed erp-shell-header (--erp-drawer-overlay-top); header z-index 90 */
@media (max-width: 1099px) {
  .side-drawer .backdrop,
  .side-drawer .panel {
    top: var(--erp-drawer-overlay-top, var(--erp-shell-sticky-offset, 96px));
  }
}

/* ── Side drawer nav — DRAWER-NAV-COMPACT (phone full-width menu) ── */
@media (max-width: 1099px) {
  .side-drawer .zone-head {
    min-height: 40px !important;
    padding: 6px 10px !important;
    line-height: 1.2 !important;
  }
  .side-drawer .nav-item {
    min-height: 36px !important;
    padding: 5px 10px 5px 16px !important;
    line-height: 1.25 !important;
    margin: 0 0 0 4px !important;
  }
  .side-drawer .zone-items,
  .side-drawer .nav-zone-block--open .zone-items {
    padding: 0 0 4px !important;
  }
  .side-drawer .nav-zone-block,
  .side-drawer .nav-zone-block--open {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

@media (min-width: 1100px) {
  .side-drawer .nav-item {
    min-height: 40px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .side-drawer .zone-head {
    min-height: 42px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

/* ── Pinned drawer offset matches compact header ── */
@media (min-width: 1100px) {
  #sideDrawer.erp-drawer-pinned .panel {
    top: 98px;
  }
}

/* ── Logout button — icon + label visible on all breakpoints ── */
.erp-shell-header .topbar #btnLogout {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 5px 8px !important;
  min-width: 0 !important;
  min-height: 36px;
  flex-shrink: 0;
  margin-left: auto;
}

.erp-shell-header .topbar #btnLogout .action-text {
  display: inline !important;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.1;
}

.erp-shell-header .topbar #btnLogout .action-icon {
  width: 20px !important;
  height: 20px !important;
  font-size: 12px !important;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .erp-shell-header .topbar .topbar-row-toolbar {
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow-x: visible !important;
    padding-right: max(4px, env(safe-area-inset-right, 0px));
  }
  .erp-shell-header .topbar .topbar-toolbar-nav {
    gap: 2px !important;
    flex: 0 0 auto !important;
  }
  .erp-shell-header .topbar #erpNavHome {
    margin-left: 0 !important;
  }
  .erp-shell-header .topbar #btnGlobalSearch.topbar-search-btn {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    margin-left: 0 !important;
  }
  .erp-shell-header .topbar .topbar-toolbar-account {
    gap: 3px !important;
    flex-shrink: 0 !important;
    margin-left: auto;
  }
  .erp-shell-header .topbar #btnLogout {
    margin-left: 0 !important;
  }
}

@media (max-width: 480px) {
  .erp-shell-header .topbar #btnLogout {
    padding: 4px 6px !important;
    gap: 3px;
  }

  .erp-shell-header .topbar #btnLogout .action-text {
    font-size: 10px;
  }

  .erp-shell-header .topbar #btnLogout .action-icon {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
  }
}

/* Desktop / wide — util row transparent wrapper (children stay in topbar flow) */
.erp-topbar-util-row {
  display: contents;
}

.erp-topbar-util-cluster {
  display: contents;
}

.erp-topbar-util-spacer {
  display: none;
}

/* Android shell — Row1 identity + Row2 action icons + Row3 breadcrumb */
.topbar .topbar-app-icon {
  display: none;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header {
  overflow-x: hidden !important;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 6px !important;
  row-gap: 4px !important;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) 4px max(8px, env(safe-area-inset-left, 0px)) !important;
  overflow-x: hidden !important;
  max-width: 100%;
  box-sizing: border-box;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .topbar-row-company,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .topbar-row-company {
  order: 0;
  width: 100%;
  min-width: 0;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .topbar-row-toolbar,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .topbar-row-toolbar {
  order: 1;
  width: 100%;
  min-width: 0;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar #user-line,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar #user-line {
  display: none !important;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .topbar-toolbar-nav .menu-btn#btnMenu,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .topbar-toolbar-nav .menu-btn#btnMenu {
  order: -1 !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  font-size: 18px !important;
  border-radius: 8px;
  padding: 0;
  flex-shrink: 0;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .topbar-toolbar-nav .topbar-icon-btn,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .topbar-toolbar-nav .topbar-icon-btn {
  order: 0;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .topbar-app-icon,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .topbar-app-icon {
  display: none !important;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .top-meta,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .top-meta {
  order: 3;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
  display: flex !important;
  align-items: center;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar #companySelect,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar #companySelect {
  display: none !important;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar #companyNamePlain,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar #companyNamePlain,
html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar #topbarCompanyTitle,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar #topbarCompanyTitle {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 1 1 auto !important;
  width: auto;
  min-width: 0;
  min-height: 18px;
  max-height: none;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #000000 !important;
  line-height: 1.3;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .topbar-toolbar-account #btnLogout,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .topbar-toolbar-account #btnLogout {
  order: 0;
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px !important;
  min-width: 0 !important;
  max-width: none;
  width: auto;
  min-height: 34px;
  max-height: 36px;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex-shrink: 0;
  border-radius: 8px;
  box-sizing: border-box;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar #btnLogout .action-icon,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar #btnLogout .action-icon {
  width: 18px !important;
  height: 18px !important;
  font-size: 12px !important;
  line-height: 1;
}

html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar #btnLogout .action-text,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar #btnLogout .action-text {
  display: inline !important;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

/* Row 2 — compact ERP icon cluster (left) + spacer + lang (right) */
html.bnpl-android-shell.bnpl-app-active .erp-shell-header .topbar .erp-topbar-util-row,
html.bnpl-ios-standalone.bnpl-app-active .erp-shell-header .topbar .erp-topbar-util-row {
  display: flex !important;
  order: 10;
  flex: 1 1 100%;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 3px 2px 2px;
  margin: 0;
  border-top: 1px solid #e5e7eb;
  box-sizing: border-box;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .erp-topbar-util-cluster,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .erp-topbar-util-cluster {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .erp-top-nav-group,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .erp-top-nav-group {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .erp-top-nav-group .topbar-icon-btn,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .erp-top-nav-group .topbar-icon-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  min-height: 34px;
  padding: 0 !important;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
  box-sizing: border-box;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .erp-topbar-util-search,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .erp-topbar-util-search {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  flex-shrink: 0;
  margin: 0 0 0 2px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .erp-topbar-util-spacer,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .erp-topbar-util-spacer {
  display: block;
  flex: 1 1 auto;
  min-width: 8px;
  min-height: 1px;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .header-lang-pills,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .header-lang-pills {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  margin: 0 0 0 4px;
  padding: 0;
  visibility: visible !important;
  pointer-events: auto !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
}

html.bnpl-android-shell.bnpl-app-active .erp-topbar-util-row .header-lang-pill,
html.bnpl-ios-standalone.bnpl-app-active .erp-topbar-util-row .header-lang-pill {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* Drawer quick actions — removed (topbar row-2 SSOT) */
html.bnpl-android-shell .side-drawer .drawer-android-util {
  display: none !important;
}

html.bnpl-android-shell .side-drawer .drawer-util-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 4px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
  color: #000000 !important;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

html.bnpl-android-shell .side-drawer .drawer-util-btn:active {
  background: #EEF2FF;
  border-color: #3949AB;
}

html.bnpl-android-shell .side-drawer .drawer-util-lang.is-active {
  background: #3949AB !important;
  border-color: #3949AB !important;
  color: #FFFFFF !important;
}

html.bnpl-android-shell .side-drawer .drawer-util-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

html.bnpl-android-shell .side-drawer .drawer-util-icon--back {
  width: 11px;
  height: 11px;
  border-left: 3px solid #1E293B;
  border-bottom: 3px solid #1E293B;
  transform: rotate(45deg);
  margin-left: 3px;
  border-radius: 1px;
}

html.bnpl-android-shell .side-drawer .drawer-util-icon--home::before {
  content: '⌂';
  font-size: 17px;
  line-height: 1;
}

html.bnpl-android-shell .side-drawer .drawer-util-icon--refresh::before {
  content: '↻';
  font-size: 17px;
  line-height: 1;
}

/* ── Responsive: quick actions + KPI grid ── */
@media (max-width: 420px) {
  .cc-kpi {
    padding: 7px 8px !important;
    gap: 6px !important;
    min-height: 48px !important;
    height: 48px !important;
  }

  .cc-kpi-value {
    font-size: 20px !important;
  }

  .cc-kpi-label {
    font-size: 11px !important;
  }

  .cc-kpi-icon {
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
  }

  .dash-owner-row {
    min-height: 48px;
    padding: 8px 10px;
  }

  .dash-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .dash-qa b {
    font-size: 12px;
  }
}

@media (min-width: 421px) and (max-width: 640px) {
  .dash-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
}

@media (min-width: 641px) and (max-width: 899px) {
  .dash-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .dash-actions-grid {
    gap: 7px;
  }

  .dash-summary {
    gap: 9px;
  }
}

@media (min-width: 1200px) {
  .cc-kpi-strip {
    gap: 9px;
  }
}

/* ── Mobile plain home (Android WebView + iOS PWA) — task launcher only ── */
html.bnpl-android-shell.bnpl-app-active .erp-crumb-row .erp-last-updated,
html.bnpl-ios-standalone.bnpl-app-active .erp-crumb-row .erp-last-updated {
  display: none !important;
}

html.bnpl-android-shell #updateBanner,
html.bnpl-android-shell #updateModal,
html.bnpl-android-shell #updateBlocker {
  display: none !important;
}

html.bnpl-android-shell .dash-home--mobile-plain,
html.bnpl-ios-standalone .dash-home--mobile-plain {
  gap: 12px;
  padding: 4px 0 20px;
}

html.bnpl-android-shell .dash-home--mobile-plain > .dash-section-title,
html.bnpl-ios-standalone .dash-home--mobile-plain > .dash-section-title {
  font-size: 15px;
  margin-bottom: 4px;
}

html.bnpl-android-shell .dash-actions-grid--mobile-plain,
html.bnpl-ios-standalone .dash-actions-grid--mobile-plain {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

html.bnpl-android-shell .dash-actions-grid--mobile-plain .dash-qa,
html.bnpl-ios-standalone .dash-actions-grid--mobile-plain .dash-qa {
  min-height: 76px;
  padding: 12px 11px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html.bnpl-android-shell .dash-actions-grid--mobile-plain .dash-qa b,
html.bnpl-ios-standalone .dash-actions-grid--mobile-plain .dash-qa b {
  font-size: 14px;
}

html.bnpl-android-shell .dash-owner-actions--mobile-plain .dash-owner-row,
html.bnpl-ios-standalone .dash-owner-actions--mobile-plain .dash-owner-row {
  min-height: 56px;
  margin-bottom: 8px;
}

html.bnpl-android-shell .dash-mobile-menu-hint,
html.bnpl-ios-standalone .dash-mobile-menu-hint {
  text-align: center;
  margin: 10px 4px 0;
  color: #64748B !important;
  font-size: 12px;
  font-weight: 600;
}
