/* ==========================================================================
   Braynix Books - Professional application UI
   Presentation-only layer for the signed-in product. No workflow, accounting,
   document, or data behavior is defined here.
   ========================================================================== */

body.bb-app-active {
  --pro-canvas: #f4f7fb;
  --pro-surface: #ffffff;
  --pro-surface-soft: #f7f9fc;
  --pro-surface-raised: #ffffff;
  --pro-line: #dbe4ef;
  --pro-line-strong: #c7d3e2;
  --pro-ink: #10213a;
  --pro-ink-soft: #344860;
  --pro-muted: #687990;
  --pro-muted-soft: #8d9caf;
  --pro-blue: #1f63d8;
  --pro-blue-strong: #174eae;
  --pro-blue-soft: #eaf2ff;
  --pro-green: #13805e;
  --pro-green-soft: #eaf8f3;
  --pro-amber: #ad6814;
  --pro-amber-soft: #fff7e7;
  --pro-red: #c44252;
  --pro-red-soft: #fff0f2;
  --pro-navy: #0d1a2e;
  --pro-shadow-xs: 0 1px 2px rgba(15, 35, 66, 0.04);
  --pro-shadow-sm: 0 2px 7px rgba(15, 35, 66, 0.05), 0 1px 2px rgba(15, 35, 66, 0.03);
  --pro-shadow-md: 0 12px 32px rgba(15, 35, 66, 0.075), 0 2px 8px rgba(15, 35, 66, 0.04);
  --pro-shadow-lg: 0 24px 65px rgba(8, 24, 50, 0.18), 0 5px 18px rgba(8, 24, 50, 0.08);
  --pro-radius-sm: 9px;
  --pro-radius: 13px;
  --pro-radius-lg: 17px;
  color: var(--pro-ink);
  background: var(--pro-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Custom modules ---------------------------------------------------------
   A focused workspace treatment for client-defined modules. These rules are
   deliberately scoped so standard accounting screens keep their own layout. */

body.bb-app-active .custom-module-page {
  gap: 18px;
  padding-bottom: 24px;
}

body.bb-app-active .custom-module-page > .panel,
body.bb-app-active .custom-module-card {
  border: 1px solid color-mix(in srgb, var(--pro-line) 92%, var(--pro-blue));
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: 0 1px 2px rgba(15, 35, 66, 0.035), 0 7px 22px rgba(15, 35, 66, 0.055);
}

body.bb-app-active .custom-module-page .module-toolbar {
  position: relative;
  min-height: 136px;
  overflow: hidden;
  padding: 25px 27px;
  border-color: color-mix(in srgb, var(--pro-blue) 27%, var(--pro-line));
  background:
    radial-gradient(circle at 94% -25%, color-mix(in srgb, var(--pro-blue) 13%, transparent), transparent 24rem),
    radial-gradient(circle at 3% 115%, color-mix(in srgb, #22c55e 8%, transparent), transparent 18rem),
    linear-gradient(126deg, var(--pro-surface) 0%, color-mix(in srgb, var(--pro-blue-soft) 56%, var(--pro-surface)) 100%);
  box-shadow: 0 1px 2px rgba(15, 35, 66, 0.045), 0 18px 42px rgba(30, 64, 120, 0.095);
}

body.bb-app-active .custom-module-page .module-toolbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--pro-blue), color-mix(in srgb, var(--pro-blue) 55%, #22c55e));
}

body.bb-app-active .custom-module-page .module-toolbar::after {
  content: "";
  position: absolute;
  top: -86px;
  right: 9%;
  width: 210px;
  height: 210px;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 11%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px color-mix(in srgb, var(--pro-blue) 3%, transparent),
    0 0 0 58px color-mix(in srgb, var(--pro-blue) 2%, transparent);
  pointer-events: none;
}

body.bb-app-active .cm-module-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: 1 1 480px;
  gap: 18px;
  min-width: 0;
}

body.bb-app-active .cm-module-icon {
  display: inline-grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 70%, var(--pro-blue-strong));
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--pro-blue) 82%, #57a4ff), var(--pro-blue-strong));
  box-shadow: 0 9px 20px color-mix(in srgb, var(--pro-blue) 24%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

body.bb-app-active .cm-module-icon svg {
  width: 23px;
  height: 23px;
}

body.bb-app-active .custom-module-page .module-toolbar .eyebrow {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 14%, var(--pro-line));
  border-radius: 999px;
  color: var(--pro-blue);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.095em;
  background: color-mix(in srgb, var(--pro-blue-soft) 58%, var(--pro-surface));
}

body.bb-app-active .custom-module-page .module-toolbar h3 {
  margin-top: 5px;
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

body.bb-app-active .custom-module-page .module-description {
  max-width: 680px;
  margin-top: 7px;
  color: var(--pro-muted);
  font-size: 13.25px;
  line-height: 1.55;
}

body.bb-app-active .cm-module-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

body.bb-app-active .cm-module-meta > span {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--pro-line) 82%, transparent);
  border-radius: 999px;
  color: var(--pro-muted);
  font-size: 10.5px;
  font-weight: 650;
  background: color-mix(in srgb, var(--pro-surface) 88%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 58%, transparent);
}

body.bb-app-active .cm-module-meta strong {
  color: var(--pro-ink);
  font-size: 11px;
}

body.bb-app-active .cm-module-meta .cm-module-health {
  color: color-mix(in srgb, var(--pro-green) 78%, var(--pro-ink));
  border-color: color-mix(in srgb, var(--pro-green) 22%, var(--pro-line));
  background: color-mix(in srgb, var(--pro-green) 8%, var(--pro-surface));
}

body.bb-app-active .cm-module-health i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pro-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-green) 13%, transparent);
}

body.bb-app-active .custom-module-page .module-actions {
  position: relative;
  z-index: 1;
  justify-content: flex-end;
  gap: 7px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--pro-line) 84%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--pro-surface) 82%, transparent);
  box-shadow: 0 7px 20px rgba(15, 35, 66, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(8px);
}

body.bb-app-active .custom-module-page .module-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 9px;
  font-weight: 700;
}

body.bb-app-active .custom-module-page .module-actions .ghost-button {
  border-color: color-mix(in srgb, var(--pro-line-strong) 84%, transparent);
  background: color-mix(in srgb, var(--pro-surface) 92%, transparent);
}

body.bb-app-active .custom-module-page .module-actions .ghost-button:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 30%, var(--pro-line));
  color: var(--pro-blue-strong);
  background: var(--pro-blue-soft);
}

body.bb-app-active .custom-module-page .cm-toolbar-button svg {
  color: var(--pro-muted);
}

body.bb-app-active .custom-module-page .cm-new-record-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 17px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--pro-blue) 25%, transparent);
}

body.bb-app-active .custom-module-page .cm-overview {
  overflow: hidden;
  padding: 0;
}

body.bb-app-active .cm-overview-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--pro-line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--pro-blue-soft) 44%, var(--pro-surface)), var(--pro-surface) 64%);
}

body.bb-app-active .cm-overview-heading h4,
body.bb-app-active .cm-recent-heading h4,
body.bb-app-active .cm-list-heading h4 {
  margin: 2px 0 0;
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

body.bb-app-active .cm-overview-heading p,
body.bb-app-active .cm-list-heading p {
  margin: 4px 0 0;
  color: var(--pro-muted);
  font-size: 11.5px;
}

body.bb-app-active .cm-overview-live {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--pro-green) 22%, var(--pro-line));
  border-radius: 999px;
  color: color-mix(in srgb, var(--pro-green) 76%, var(--pro-ink));
  font-size: 10.5px;
  font-weight: 750;
  background: color-mix(in srgb, var(--pro-green) 8%, var(--pro-surface));
}

body.bb-app-active .cm-overview-live > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pro-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-green) 13%, transparent);
}

body.bb-app-active .cm-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 0.72fr);
  align-items: stretch;
  gap: 16px;
  padding: 17px 20px 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pro-surface-soft) 56%, var(--pro-surface)), var(--pro-surface));
}

body.bb-app-active .custom-module-page .cm-overview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(145px, 1fr));
  align-content: start;
  gap: 11px;
  margin: 0;
}

body.bb-app-active .custom-module-page .cm-overview-card {
  --cm-card-accent: var(--pro-blue);
  position: relative;
  min-width: 0;
  min-height: 132px;
  overflow: hidden;
  padding: 17px 16px 14px;
  border: 1px solid var(--pro-line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--cm-card-accent) 10%, transparent), transparent 8rem),
    linear-gradient(145deg, color-mix(in srgb, var(--cm-card-accent) 5%, var(--pro-surface)) 0%, var(--pro-surface) 76%);
  box-shadow: 0 2px 8px rgba(15, 35, 66, 0.045);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

body.bb-app-active .custom-module-page .cm-overview-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cm-card-accent), color-mix(in srgb, var(--cm-card-accent) 18%, transparent));
}

body.bb-app-active .custom-module-page .cm-overview-card--added {
  --cm-card-accent: #129167;
}

body.bb-app-active .custom-module-page .cm-overview-card--modified {
  --cm-card-accent: #7656d9;
}

body.bb-app-active .custom-module-page .cm-overview-card--data {
  --cm-card-accent: #b56b12;
}

body.bb-app-active .custom-module-page .cm-overview-card--completion {
  --cm-card-accent: #1583a5;
}

body.bb-app-active .custom-module-page .cm-overview-card:hover {
  border-color: color-mix(in srgb, var(--cm-card-accent) 30%, var(--pro-line));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 35, 66, 0.085);
}

body.bb-app-active .custom-module-page .cm-overview-card span {
  color: var(--pro-muted);
  font-size: 11px;
  font-weight: 700;
}

body.bb-app-active .cm-overview-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.bb-app-active .cm-overview-card-icon {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 18%, var(--pro-line));
  border-radius: 8px;
  color: var(--cm-card-accent);
  background: color-mix(in srgb, var(--cm-card-accent) 10%, var(--pro-surface));
}

body.bb-app-active .cm-overview-card-icon svg {
  width: 16px;
  height: 16px;
}

body.bb-app-active .custom-module-page .cm-overview-card strong {
  display: block;
  margin-top: 14px;
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.025em;
}

body.bb-app-active .custom-module-page .cm-overview-sub {
  display: block;
  margin-top: 9px;
  color: var(--pro-muted);
  font-size: 10.5px;
}

body.bb-app-active .custom-module-page .cm-recent-section {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--pro-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--pro-surface), var(--pro-surface-soft));
  box-shadow: 0 2px 8px rgba(15, 35, 66, 0.045);
}

body.bb-app-active .cm-recent-heading {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--pro-line);
  background: var(--pro-surface);
}

body.bb-app-active .cm-recent-count {
  display: inline-grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  padding-inline: 7px;
  border-radius: 999px;
  color: var(--pro-blue);
  font-size: 10.5px;
  font-weight: 800;
  background: var(--pro-blue-soft);
}

body.bb-app-active .custom-module-page .cm-recent-list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

body.bb-app-active .custom-module-page .cm-recent-row {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: inherit;
  text-align: left;
  background: var(--pro-surface-soft);
  cursor: pointer;
}

body.bb-app-active .custom-module-page .cm-recent-row:hover {
  border-color: var(--pro-line);
  background: var(--pro-surface);
  box-shadow: 0 4px 12px rgba(15, 35, 66, 0.06);
}

body.bb-app-active .cm-recent-avatar {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 18%, var(--pro-line));
  border-radius: 9px;
  color: var(--pro-blue);
  font-size: 11px;
  font-weight: 850;
  background: var(--pro-blue-soft);
}

body.bb-app-active .cm-recent-content {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body.bb-app-active .cm-recent-name {
  overflow: hidden;
  color: var(--pro-ink-soft);
  font-size: 11.5px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.bb-app-active .cm-recent-date {
  color: var(--pro-muted);
  font-size: 9.5px;
}

body.bb-app-active .cm-recent-arrow {
  color: var(--pro-muted-soft);
  transition: transform 140ms ease, color 140ms ease;
}

body.bb-app-active .cm-recent-row:hover .cm-recent-arrow {
  color: var(--pro-blue);
  transform: translateX(2px);
}

body.bb-app-active .custom-module-page .custom-module-list {
  gap: 15px;
  overflow: hidden;
  padding: 0 18px 18px;
}

body.bb-app-active .cm-list-heading {
  position: relative;
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -18px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--pro-line);
  background: linear-gradient(90deg, var(--pro-surface), color-mix(in srgb, var(--pro-blue-soft) 38%, var(--pro-surface)));
}

body.bb-app-active .cm-list-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--pro-blue), color-mix(in srgb, var(--pro-blue) 50%, #22c55e));
}

body.bb-app-active .cm-record-count {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--pro-line);
  border-radius: 999px;
  color: var(--pro-muted);
  font-size: 10.5px;
  background: color-mix(in srgb, var(--pro-surface) 90%, var(--pro-blue-soft));
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .cm-record-count strong {
  color: var(--pro-ink);
  font-size: 11px;
}

body.bb-app-active .custom-module-page .custom-module-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 9px;
  border: 1px solid var(--pro-line);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--pro-surface-soft), color-mix(in srgb, var(--pro-surface-soft) 74%, var(--pro-blue-soft)));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 60%, transparent);
}

body.bb-app-active .custom-module-page .custom-module-controls .report-search input,
body.bb-app-active .custom-module-page .custom-module-controls .stg-input {
  min-height: 42px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 10px;
  color: var(--pro-ink);
  background-color: var(--pro-surface);
}

body.bb-app-active .cm-record-search {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

body.bb-app-active .cm-record-search > svg {
  position: absolute;
  z-index: 1;
  left: 12px;
  color: var(--pro-muted);
  pointer-events: none;
}

body.bb-app-active .custom-module-page .cm-record-search input {
  width: 100%;
  padding-left: 38px;
  padding-right: 12px;
}

body.bb-app-active .custom-module-page .custom-module-controls .report-search input:focus,
body.bb-app-active .custom-module-page .custom-module-controls .stg-input:focus {
  border-color: var(--pro-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 13%, transparent);
}

body.bb-app-active .custom-module-page .cm-filter-bar {
  flex-wrap: nowrap;
  gap: 7px;
}

body.bb-app-active .custom-module-page .cm-filter-bar .stg-input {
  font-size: 11.5px;
  font-weight: 650;
}

body.bb-app-active .custom-module-page .cm-columns-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-inline: 14px;
  border-color: var(--pro-line-strong);
  background: var(--pro-surface);
}

body.bb-app-active .custom-module-page .cm-column-chooser {
  margin-top: 0;
  padding: 13px 14px;
  border-color: var(--pro-line);
  border-radius: 11px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .custom-module-page .cm-column-option {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--pro-ink-soft);
}

body.bb-app-active .custom-module-page .cm-column-option:hover {
  border-color: var(--pro-line);
  background: var(--pro-surface);
}

body.bb-app-active .custom-module-page .cm-bulk-bar {
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 27%, var(--pro-line));
  border-radius: 10px;
  color: var(--pro-ink-soft);
  background: var(--pro-blue-soft);
}

body.bb-app-active .custom-module-page .cm-table-wrap .table-shell {
  overflow: auto;
  border: 1px solid var(--pro-line);
  border-radius: 14px;
  background: var(--pro-surface);
  box-shadow: 0 8px 22px rgba(30, 64, 120, 0.055);
}

body.bb-app-active .custom-module-page .cm-table-wrap table {
  margin: 0;
}

body.bb-app-active .custom-module-page .cm-table-wrap thead {
  background: linear-gradient(180deg, color-mix(in srgb, var(--pro-surface-soft) 82%, var(--pro-blue-soft)), var(--pro-surface-soft));
}

body.bb-app-active .custom-module-page .cm-table-wrap th {
  height: 46px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pro-line);
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body.bb-app-active .custom-module-page .cm-table-wrap td {
  height: 60px;
  padding: 11px 12px;
  border-bottom-color: var(--pro-line);
  color: var(--pro-ink-soft);
  font-size: 12.5px;
  vertical-align: middle;
}

body.bb-app-active .custom-module-page .cm-record-row {
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

body.bb-app-active .custom-module-page .cm-record-row:hover {
  background: color-mix(in srgb, var(--pro-blue-soft) 52%, var(--pro-surface));
  box-shadow: inset 3px 0 0 var(--pro-blue);
}

body.bb-app-active .custom-module-page .cm-table-wrap input[type="checkbox"] {
  accent-color: var(--pro-blue);
}

body.bb-app-active .custom-module-page .cm-record-row td[data-label="Actions"] .inline-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

body.bb-app-active .custom-module-page .cm-record-row:last-child td {
  border-bottom: 0;
}

body.bb-app-active .custom-module-page .cm-record-row > td:nth-child(2) {
  color: var(--pro-ink);
  font-weight: 720;
}

body.bb-app-active .custom-module-page .cm-record-row .table-action {
  min-height: 30px;
  padding: 4px 10px;
  border-color: var(--pro-line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--pro-surface);
}

body.bb-app-active .custom-module-page .cm-record-row .table-action[data-action="view-custom-module-record"] {
  border-color: color-mix(in srgb, var(--pro-blue) 21%, var(--pro-line));
  color: var(--pro-blue-strong);
  background: color-mix(in srgb, var(--pro-blue-soft) 68%, var(--pro-surface));
}

body.bb-app-active .custom-module-page .cm-record-row .table-action:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 34%, var(--pro-line));
  transform: translateY(-1px);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .custom-module-page .cm-record-row .cm-reorder-btn {
  width: 30px;
  padding-inline: 0;
}

body.bb-app-active .custom-module-page .cm-pager {
  min-height: 42px;
  margin-top: 0;
  padding: 12px 2px 0;
  border-top: 0;
}

/* Notion-inspired custom status property */

body.bb-app-active .cm-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

body.bb-app-active .cm-status-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.76;
}

body.bb-app-active .cm-status-chip--empty,
body.bb-app-active .cm-status-chip--neutral {
  color: #526071;
  background: #eef1f4;
}

body.bb-app-active .cm-status-chip--amber {
  color: #87530d;
  background: #ffefc5;
}

body.bb-app-active .cm-status-chip--blue {
  color: #1f5d9e;
  background: #dcecff;
}

body.bb-app-active .cm-status-chip--violet {
  color: #70449a;
  background: #eee2fb;
}

body.bb-app-active .cm-status-chip--success {
  color: #246b4c;
  background: #dcefe4;
}

body.bb-app-active .cm-status-chip--danger {
  color: #a6463e;
  background: #f9dfdc;
}

html[data-theme="dark"] body.bb-app-active .cm-status-chip--empty,
html[data-theme="dark"] body.bb-app-active .cm-status-chip--neutral {
  color: #c4ceda;
  background: #303946;
}

html[data-theme="dark"] body.bb-app-active .cm-status-chip--amber {
  color: #ffd47f;
  background: rgba(170, 105, 18, 0.34);
}

html[data-theme="dark"] body.bb-app-active .cm-status-chip--blue {
  color: #9fc8ff;
  background: rgba(37, 103, 174, 0.36);
}

html[data-theme="dark"] body.bb-app-active .cm-status-chip--violet {
  color: #d3aff5;
  background: rgba(112, 68, 154, 0.37);
}

html[data-theme="dark"] body.bb-app-active .cm-status-chip--success {
  color: #91d6b5;
  background: rgba(36, 107, 76, 0.4);
}

html[data-theme="dark"] body.bb-app-active .cm-status-chip--danger {
  color: #ffaaa3;
  background: rgba(166, 70, 62, 0.4);
}

body.bb-app-active .cm-status-open {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 2px 3px 2px 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--pro-muted);
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-status-open:hover,
body.bb-app-active .cm-status-open:focus-visible {
  border-color: var(--pro-line-strong);
  outline: none;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 10%, transparent);
}

body.bb-app-active .cm-status-picker {
  position: relative;
  width: 100%;
}

body.bb-app-active .cm-status-picker--inline {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  vertical-align: middle;
}

body.bb-app-active .cm-status-trigger {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 9px;
  color: var(--pro-ink);
  background: var(--pro-surface);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

body.bb-app-active .cm-status-trigger--inline {
  width: auto;
  min-height: 32px;
  max-width: 100%;
  gap: 4px;
  padding: 2px 5px 2px 2px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
}

body.bb-app-active .cm-status-trigger--inline:hover {
  border-color: var(--pro-line-strong);
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 9%, transparent);
}

body.bb-app-active .cm-status-trigger:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 45%, var(--pro-line-strong));
  background: color-mix(in srgb, var(--pro-blue-soft) 24%, var(--pro-surface));
}

body.bb-app-active .cm-status-picker.is-open .cm-status-trigger,
body.bb-app-active .cm-status-picker.field-error .cm-status-trigger {
  border-color: var(--pro-blue);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 13%, transparent);
}

body.bb-app-active .cm-status-picker.field-error .cm-status-trigger {
  border-color: var(--pro-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-red) 12%, transparent);
}

body.bb-app-active .cm-status-chevron {
  flex: 0 0 auto;
  color: var(--pro-muted);
  transition: transform 140ms ease;
}

body.bb-app-active .cm-status-picker.is-open .cm-status-chevron {
  transform: rotate(180deg);
}

body.bb-app-active .cm-status-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  left: 0;
  width: min(330px, calc(100vw - 48px));
  max-height: 370px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 12px;
  color: var(--pro-ink);
  background: var(--pro-surface-raised);
  box-shadow: var(--pro-shadow-lg);
}

body.bb-app-active .cm-status-menu--inline {
  position: fixed;
  z-index: 2200;
  top: auto;
  left: auto;
  transform-origin: top center;
  animation: cm-status-menu-in 120ms ease-out;
}

body.bb-app-active .cm-status-picker--inline.is-dropup .cm-status-menu--inline {
  transform-origin: bottom center;
}

@keyframes cm-status-menu-in {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.bb-app-active .cm-status-menu-title {
  padding: 6px 7px 7px;
  border-bottom: 1px solid var(--pro-line);
  color: var(--pro-ink-soft);
  font-size: 12px;
  font-weight: 800;
}

body.bb-app-active .cm-status-menu-group {
  padding: 7px 0;
  border-bottom: 1px solid var(--pro-line);
}

body.bb-app-active .cm-status-menu-group:last-child {
  border-bottom: 0;
}

body.bb-app-active .cm-status-menu-heading {
  display: flex;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 8px 5px;
  color: var(--pro-muted);
  font-size: 10.5px;
  font-weight: 750;
}

body.bb-app-active .cm-status-add-toggle {
  display: inline-grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--pro-muted);
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-status-add-toggle:hover,
body.bb-app-active .cm-status-add-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--pro-blue) 28%, var(--pro-line));
  outline: none;
  color: var(--pro-blue);
  background: var(--pro-blue-soft);
}

body.bb-app-active .cm-status-create-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px 8px;
}

body.bb-app-active .cm-status-create-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--pro-blue);
  border-radius: 8px;
  color: var(--pro-ink);
  font: inherit;
  font-size: 12px;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 12%, transparent);
}

body.bb-app-active .cm-status-create-input::placeholder {
  color: var(--pro-muted-soft);
}

body.bb-app-active .cm-status-create-input:focus {
  outline: none;
}

body.bb-app-active .cm-status-create-save {
  flex: 0 0 auto;
  min-width: 48px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--pro-blue);
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  background: var(--pro-blue);
  cursor: pointer;
}

body.bb-app-active .cm-status-create-save:hover,
body.bb-app-active .cm-status-create-save:focus-visible {
  outline: none;
  background: var(--pro-blue-strong);
}

body.bb-app-active .cm-status-option {
  display: flex;
  width: 100%;
  min-height: 37px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  color: var(--pro-ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-status-option:hover,
body.bb-app-active .cm-status-option:focus-visible,
body.bb-app-active .cm-status-option.is-selected {
  outline: none;
  background: var(--pro-surface-soft);
}

body.bb-app-active .cm-status-check {
  flex: 0 0 auto;
  color: var(--pro-blue);
  opacity: 0;
}

body.bb-app-active .cm-status-option.is-selected .cm-status-check {
  opacity: 1;
}

body.bb-app-active .cm-status-combobox {
  position: relative;
  width: 100%;
}

body.bb-app-active .cm-status-combobox > .cm-status-text-input {
  padding-right: 44px;
}

body.bb-app-active .cm-written-status-toggle {
  position: absolute;
  z-index: 2;
  top: 1px;
  right: 1px;
  display: grid;
  width: 40px;
  height: 41px;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--pro-line);
  border-radius: 0 8px 8px 0;
  color: var(--pro-muted);
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-written-status-toggle:hover,
body.bb-app-active .cm-written-status-toggle:focus-visible {
  outline: none;
  color: var(--pro-blue);
  background: var(--pro-blue-soft);
}

body.bb-app-active .cm-status-combobox.is-open > .cm-status-text-input {
  border-color: var(--pro-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 13%, transparent);
}

body.bb-app-active .cm-status-combobox.is-open .cm-status-chevron {
  transform: rotate(180deg);
}

body.bb-app-active .cm-written-status-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 7px);
  left: 0;
  width: min(340px, calc(100vw - 48px));
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 12px;
  color: var(--pro-ink);
  background: var(--pro-surface-raised);
  box-shadow: var(--pro-shadow-lg);
  animation: cm-status-menu-in 120ms ease-out;
}

body.bb-app-active .cm-written-status-menu--inline {
  position: fixed;
  z-index: 2200;
  top: auto;
  left: auto;
}

body.bb-app-active .cm-status-combobox--inline {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  vertical-align: middle;
}

body.bb-app-active .cm-status-inline-trigger {
  display: inline-flex;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 4px;
  padding: 2px 5px 2px 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--pro-ink);
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-status-inline-trigger:hover,
body.bb-app-active .cm-status-inline-trigger:focus-visible,
body.bb-app-active .cm-status-combobox--inline.is-open .cm-status-inline-trigger {
  border-color: var(--pro-line-strong);
  outline: none;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro-blue) 10%, transparent);
}

body.bb-app-active .cm-status-combobox--inline > .cm-written-status-toggle {
  position: static;
  width: auto;
  height: auto;
}

body.bb-app-active .cm-written-status-label,
body.bb-app-active .cm-written-status-menu-heading {
  display: block;
  margin: 2px 4px 7px;
  color: var(--pro-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

body.bb-app-active .cm-written-status-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pro-line);
}

body.bb-app-active .cm-written-status-entry .primary-button {
  min-height: 40px;
  padding-inline: 13px;
}

body.bb-app-active .cm-written-status-groups {
  display: grid;
  gap: 0;
}

body.bb-app-active .cm-written-status-group {
  padding: 4px 0 9px;
  border-bottom: 1px solid var(--pro-line);
}

body.bb-app-active .cm-written-status-group:last-child {
  border-bottom: 0;
}

body.bb-app-active .cm-written-status-group-heading {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 6px 2px 7px;
  color: var(--pro-muted);
  font-size: 11.5px;
  font-weight: 750;
}

body.bb-app-active .cm-written-status-add {
  display: inline-grid;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--pro-muted);
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-written-status-add:hover,
body.bb-app-active .cm-written-status-add:focus-visible {
  outline: none;
  color: var(--pro-ink);
  background: var(--pro-surface-soft);
}

body.bb-app-active .cm-written-status-add[hidden],
body.bb-app-active .cm-written-status-create-row[hidden] {
  display: none;
}

body.bb-app-active .cm-written-status-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin: 3px 6px 7px;
}

body.bb-app-active .cm-written-status-create-row .stg-input,
body.bb-app-active .cm-written-status-create-row .primary-button {
  min-height: 40px;
}

body.bb-app-active .cm-written-status-create-row .primary-button {
  padding-inline: 13px;
}

body.bb-app-active .cm-written-status-group-options {
  display: grid;
  gap: 2px;
}

body.bb-app-active .cm-written-status-option {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 7px 5px 5px;
  border: 0;
  border-radius: 8px;
  color: var(--pro-ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

body.bb-app-active .cm-written-status-option-main {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

body.bb-app-active .cm-written-status-grip {
  flex: 0 0 12px;
  color: var(--pro-muted-soft);
  opacity: 0.76;
}

body.bb-app-active .cm-written-status-row-chevron {
  flex: 0 0 auto;
  color: var(--pro-muted-soft);
}

body.bb-app-active .cm-written-status-option:hover,
body.bb-app-active .cm-written-status-option:focus-visible,
body.bb-app-active .cm-written-status-option.is-selected {
  outline: none;
  background: var(--pro-surface-soft);
}

body.bb-app-active .cm-written-status-option.is-selected .cm-status-check {
  opacity: 1;
}

body.bb-app-active .cm-written-status-empty,
body.bb-app-active .cm-written-status-hint {
  margin: 5px 7px;
  color: var(--pro-muted);
  font-size: 11px;
  line-height: 1.45;
}

body.bb-app-active .cm-written-status-hint {
  padding-top: 9px;
  border-top: 1px solid var(--pro-line);
}

/* Record form and detail */

body.bb-app-active .custom-module-page .custom-record-form-panel {
  overflow: visible;
  padding: 0;
}

body.bb-app-active .custom-module-page .custom-record-form-panel .section-header,
body.bb-app-active .custom-module-page .cm-detail-panel .section-header {
  min-height: 75px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--pro-line);
  background: linear-gradient(115deg, var(--pro-surface), color-mix(in srgb, var(--pro-blue-soft) 48%, var(--pro-surface)));
}

body.bb-app-active .custom-module-page .custom-record-form-panel .section-header h3,
body.bb-app-active .custom-module-page .cm-detail-panel .section-header h3 {
  margin-top: 3px;
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 19px;
  letter-spacing: -0.02em;
}

body.bb-app-active .custom-module-page .custom-record-form {
  padding: 22px 22px 0;
}

body.bb-app-active .custom-module-page .custom-record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body.bb-app-active .custom-module-page .custom-record-grid .stg-field {
  gap: 7px;
  min-width: 0;
}

body.bb-app-active .custom-module-page .custom-record-grid .stg-field > label {
  color: var(--pro-ink-soft);
  font-size: 11.5px;
  font-weight: 750;
}

body.bb-app-active .custom-module-page .custom-record-grid .stg-input {
  min-height: 43px;
  border-color: var(--pro-line-strong);
  border-radius: 9px;
  color: var(--pro-ink);
  background: var(--pro-surface);
}

body.bb-app-active .custom-module-page .custom-record-grid textarea.stg-input {
  min-height: 96px;
  padding-block: 10px;
}

body.bb-app-active .custom-module-page .custom-record-actions {
  min-height: 67px;
  margin: 22px -22px 0;
  padding: 13px 22px;
  border-top: 1px solid var(--pro-line);
  border-radius: 0 0 var(--pro-radius-lg) var(--pro-radius-lg);
  background: var(--pro-surface-soft);
}

body.bb-app-active .custom-module-page .cm-detail-panel {
  padding: 0 22px 22px;
}

body.bb-app-active .custom-module-page .cm-detail-panel .section-header {
  margin-inline: -22px;
}

body.bb-app-active .custom-module-page .cm-detail-fields {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 12px;
}

body.bb-app-active .custom-module-page .cm-detail-field {
  min-height: 78px;
  padding: 14px 15px;
  border-right: 1px solid var(--pro-line);
  border-bottom: 1px solid var(--pro-line);
  background: var(--pro-surface);
}

body.bb-app-active .custom-module-page .cm-detail-label {
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
}

body.bb-app-active .custom-module-page .cm-detail-value {
  color: var(--pro-ink);
  font-size: 13.5px;
  font-weight: 600;
}

body.bb-app-active .custom-module-page .cm-comments-section {
  padding-top: 18px;
  border-color: var(--pro-line);
}

body.bb-app-active .custom-module-page .cm-comment,
body.bb-app-active .custom-module-page .cm-attachment {
  border: 1px solid var(--pro-line);
  border-radius: 9px;
  background: var(--pro-surface-soft);
}

/* Custom module builder in Settings */

body.bb-app-active .custom-module-card {
  overflow: hidden;
  margin-bottom: 14px;
}

body.bb-app-active .custom-module-card .custom-module-card-header {
  min-height: 66px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--pro-line);
  background: linear-gradient(115deg, var(--pro-surface), color-mix(in srgb, var(--pro-blue-soft) 38%, var(--pro-surface)));
}

body.bb-app-active .custom-module-card .cs-item-name {
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 15px;
  font-weight: 800;
}

body.bb-app-active .custom-module-card .cs-item-body {
  padding: 14px 16px 16px;
}

body.bb-app-active .custom-module-field-row {
  min-height: 54px;
  padding: 10px 11px;
  border: 1px solid var(--pro-line);
  border-radius: 10px;
  background: var(--pro-surface);
}

body.bb-app-active .custom-module-field-row:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 26%, var(--pro-line));
  background: color-mix(in srgb, var(--pro-blue-soft) 22%, var(--pro-surface));
}

body.bb-app-active .cm-field-status-groups {
  display: grid;
  width: 100%;
  gap: 5px;
  margin-top: 4px;
}

body.bb-app-active .cm-field-status-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

body.bb-app-active .cm-field-status-label {
  flex: 0 0 74px;
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

body.bb-app-active .custom-module-add-field {
  margin-top: 12px;
  padding: 13px;
  border: 1px dashed var(--pro-line-strong);
  border-radius: 11px;
  background: var(--pro-surface-soft);
}

@media (max-width: 1320px) {
  body.bb-app-active .custom-module-page .module-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  body.bb-app-active .cm-module-identity {
    flex: 0 1 auto;
  }

  body.bb-app-active .custom-module-page .module-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1080px) {
  body.bb-app-active .custom-module-page .module-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  body.bb-app-active .custom-module-page .module-actions {
    width: 100%;
    justify-content: flex-start;
  }

  body.bb-app-active .cm-overview-layout {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .custom-module-page .cm-recent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.bb-app-active .custom-module-page .custom-module-controls {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  body.bb-app-active .custom-module-page .custom-module-controls .report-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  body.bb-app-active .custom-module-page {
    gap: 12px;
  }

  body.bb-app-active .custom-module-page .module-toolbar {
    min-height: 0;
    padding: 18px 16px;
    border-radius: 14px;
  }

  body.bb-app-active .cm-module-identity {
    align-items: flex-start;
  }

  body.bb-app-active .cm-module-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  body.bb-app-active .custom-module-page .module-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.bb-app-active .custom-module-page .module-actions button {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  body.bb-app-active .custom-module-page .cm-new-record-button {
    grid-column: 1 / -1;
  }

  body.bb-app-active .custom-module-page .module-actions .cm-toolbar-button:last-child {
    grid-column: 1 / -1;
  }

  body.bb-app-active .custom-module-page .cm-overview {
    padding: 0;
  }

  body.bb-app-active .cm-overview-heading {
    min-height: 72px;
    padding: 14px;
  }

  body.bb-app-active .cm-overview-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 13px 14px 14px;
  }

  body.bb-app-active .custom-module-page .cm-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
  }

  body.bb-app-active .custom-module-page .cm-recent-list {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .custom-module-page .cm-overview-card {
    min-height: 96px;
    padding: 13px;
  }

  body.bb-app-active .custom-module-page .custom-module-list {
    padding: 0 13px 13px;
  }

  body.bb-app-active .cm-list-heading {
    min-height: 76px;
    margin-inline: -13px;
    padding: 14px 13px;
  }

  body.bb-app-active .custom-module-page .custom-module-controls {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 9px;
  }

  body.bb-app-active .custom-module-page .cm-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.bb-app-active .custom-module-page .cm-filter-bar .stg-input {
    width: 100%;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.bb-app-active .custom-module-page .cm-column-chooser {
    width: 100%;
  }

  body.bb-app-active .custom-module-page .cm-table-wrap .table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body.bb-app-active .custom-module-page .cm-table-wrap table,
  body.bb-app-active .custom-module-page .cm-table-wrap tbody {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  body.bb-app-active .custom-module-page .cm-table-wrap thead {
    display: none;
  }

  body.bb-app-active .custom-module-page .cm-table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  body.bb-app-active .custom-module-page .cm-record-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--pro-line);
    border-radius: 12px;
    background: var(--pro-surface);
    box-shadow: var(--pro-shadow-xs);
  }

  body.bb-app-active .custom-module-page .cm-record-row:hover {
    box-shadow: var(--pro-shadow-sm);
  }

  body.bb-app-active .custom-module-page .cm-record-row td {
    display: block;
    height: auto;
    min-height: 62px;
    padding: 12px;
    border-right: 1px solid var(--pro-line);
    border-bottom: 1px solid var(--pro-line);
  }

  body.bb-app-active .custom-module-page .cm-record-row td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--pro-muted);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
  }

  body.bb-app-active .custom-module-page .cm-record-row .cm-check-col {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 11px;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
  }

  body.bb-app-active .custom-module-page .cm-record-row > td:nth-child(2),
  body.bb-app-active .custom-module-page .cm-record-row > td[data-label="Actions"] {
    grid-column: 1 / -1;
  }

  body.bb-app-active .custom-module-page .cm-record-row > td:nth-child(2) {
    padding-right: 42px;
    background: color-mix(in srgb, var(--pro-blue-soft) 28%, var(--pro-surface));
  }

  body.bb-app-active .custom-module-page .cm-record-row > td[data-label="Actions"] {
    min-height: 56px;
    border-right: 0;
    border-bottom: 0;
    background: var(--pro-surface-soft);
  }

  body.bb-app-active .custom-module-page .cm-record-row > td[data-label="Actions"] .inline-actions {
    justify-content: flex-start;
  }

  body.bb-app-active .custom-module-page .cm-table-wrap tbody > tr:not(.cm-record-row) {
    display: block;
  }

  body.bb-app-active .custom-module-page .cm-table-wrap tbody > tr:not(.cm-record-row) td {
    display: block;
    height: auto;
  }

  body.bb-app-active .custom-module-page .custom-record-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.bb-app-active .custom-module-page .custom-record-form {
    padding: 17px 16px 0;
  }

  body.bb-app-active .custom-module-page .custom-record-actions {
    margin: 18px -16px 0;
    padding: 12px 16px;
  }

  body.bb-app-active .custom-module-page .cm-status-menu {
    width: min(330px, calc(100vw - 56px));
  }

  body.bb-app-active .custom-module-page .cm-detail-panel {
    padding: 0 16px 16px;
  }

  body.bb-app-active .custom-module-page .cm-detail-panel .section-header {
    align-items: flex-start;
    flex-direction: column;
    margin-inline: -16px;
    padding: 15px 16px;
  }

  body.bb-app-active .custom-module-page .cm-detail-fields {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .custom-module-page .cm-detail-field {
    border-right: 0;
  }

  body.bb-app-active .custom-module-field-row,
  body.bb-app-active .custom-module-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  body.bb-app-active .custom-module-card-actions,
  body.bb-app-active .cm-field-row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  body.bb-app-active .cm-field-status-label {
    flex-basis: 100%;
  }
}

@media (max-width: 480px) {
  body.bb-app-active .custom-module-page .module-toolbar h3 {
    font-size: 21px;
  }

  body.bb-app-active .custom-module-page .module-description {
    font-size: 11.5px;
  }

  body.bb-app-active .cm-module-meta {
    gap: 5px;
    margin-top: 10px;
  }

  body.bb-app-active .cm-module-meta > span {
    min-height: 24px;
    padding-inline: 7px;
    font-size: 9.5px;
  }

  body.bb-app-active .cm-overview-heading,
  body.bb-app-active .cm-list-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  body.bb-app-active .cm-overview-live,
  body.bb-app-active .cm-record-count {
    align-self: flex-start;
  }

  body.bb-app-active .custom-module-page .cm-overview-card {
    min-height: 105px;
    padding: 12px;
  }

  body.bb-app-active .custom-module-page .cm-overview-card strong {
    font-size: 21px;
  }

  body.bb-app-active .cm-overview-card-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
  }

  body.bb-app-active .custom-module-page .cm-filter-bar {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .custom-module-page .cm-record-row {
    border-radius: 13px;
  }
}

html[data-theme="dark"] body.bb-app-active {
  --pro-canvas: #080e18;
  --pro-surface: #101a28;
  --pro-surface-soft: #141f30;
  --pro-surface-raised: #152235;
  --pro-line: #24344b;
  --pro-line-strong: #344861;
  --pro-ink: #e9f0fa;
  --pro-ink-soft: #c7d4e5;
  --pro-muted: #91a2b9;
  --pro-muted-soft: #6f829c;
  --pro-blue: #79aaff;
  --pro-blue-strong: #9cc0ff;
  --pro-blue-soft: rgba(78, 137, 235, 0.15);
  --pro-green: #6bd1ad;
  --pro-green-soft: rgba(35, 155, 113, 0.14);
  --pro-amber: #efbc6d;
  --pro-amber-soft: rgba(193, 122, 24, 0.14);
  --pro-red: #f18b98;
  --pro-red-soft: rgba(196, 66, 82, 0.14);
  --pro-navy: #07111f;
  --pro-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
  --pro-shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.20);
  --pro-shadow-md: 0 14px 36px rgba(0, 0, 0, 0.26);
  --pro-shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.42);
}

body.bb-app-active *,
body.bb-app-active *::before,
body.bb-app-active *::after {
  box-sizing: border-box;
}

body.bb-app-active #sync-bar[hidden],
body.bb-app-active #trial-banner[hidden],
body.bb-app-active [hidden] {
  display: none !important;
}

/* Application frame ------------------------------------------------------- */

body.bb-app-active .app-shell {
  grid-template-columns: 258px minmax(0, 1fr);
  background: var(--pro-canvas);
}

body.bb-app-active .workspace {
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 20px 28px 48px;
  background:
    radial-gradient(circle at 94% 0%, rgba(61, 119, 218, 0.055), transparent 27rem),
    var(--pro-canvas);
}

body.bb-app-active .page-section {
  width: min(100%, 1640px);
  min-width: 0;
  max-width: 100%;
  margin-inline: auto;
}

body.bb-app-active .sidebar {
  gap: 13px;
  padding: 15px 10px 18px;
  border-right: 1px solid rgba(129, 157, 196, 0.14);
  background:
    radial-gradient(circle at 12% 0%, rgba(51, 116, 213, 0.16), transparent 18rem),
    linear-gradient(180deg, #0b1425 0%, #0d1829 58%, #0b1423 100%);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.015);
}

body.bb-app-active .brand-block {
  gap: 11px;
  min-height: 76px;
  padding: 7px 8px 15px;
  border-bottom-color: rgba(151, 175, 208, 0.12);
}

body.bb-app-active .brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  filter: drop-shadow(0 7px 16px rgba(0, 0, 0, 0.20));
}

body.bb-app-active .brand-block .eyebrow {
  margin-bottom: 3px;
  color: #8193ac;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

body.bb-app-active .brand-block h1 {
  color: #f7faff;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.025em;
}

body.bb-app-active .nav-list {
  gap: 9px;
}

body.bb-app-active .nav-group {
  gap: 3px;
}

body.bb-app-active .nav-group + .nav-group {
  padding-top: 8px;
  border-top-color: rgba(145, 165, 195, 0.075);
}

body.bb-app-active .nav-group-label {
  min-height: 30px;
  padding: 6px 10px;
  color: #7f90a8;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.105em;
}

body.bb-app-active .nav-item {
  min-height: 38px;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #a9b7ca;
  font-size: 12.5px;
  font-weight: 570;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

body.bb-app-active .nav-item svg {
  width: 16px;
  height: 16px;
  color: #7f91aa;
  opacity: 0.82;
}

body.bb-app-active .nav-item:hover {
  border-color: rgba(142, 177, 226, 0.10);
  background: rgba(135, 168, 212, 0.075);
  color: #eef4fc;
  transform: translateX(1px);
}

body.bb-app-active .nav-item.active {
  border-color: rgba(85, 156, 255, 0.20);
  background: linear-gradient(90deg, rgba(39, 109, 214, 0.24), rgba(39, 109, 214, 0.12));
  color: #ffffff;
  font-weight: 690;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

body.bb-app-active .nav-item.active::after {
  top: 8px;
  bottom: 8px;
  left: -1px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #4f98ff;
  box-shadow: 0 0 12px rgba(79, 152, 255, 0.55);
}

body.bb-app-active .nav-item.active svg {
  color: #79aaff;
}

body.bb-app-active .sidebar .nav-group[data-nav-group]:not(.collapsed) {
  border-color: rgba(137, 167, 206, 0.12) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  box-shadow: none !important;
}

body.bb-app-active .sidebar-card {
  border-color: rgba(142, 169, 207, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

body.bb-app-active .sidebar-account {
  border-top-color: rgba(145, 165, 195, 0.10);
}

/* Header and actions ------------------------------------------------------- */

body.bb-app-active .topbar {
  position: sticky;
  top: 14px;
  z-index: 700;
  min-height: 68px;
  padding: 12px 15px 12px 18px;
  border: 1px solid rgba(207, 218, 232, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--pro-shadow-md);
  backdrop-filter: blur(20px) saturate(150%);
}

html[data-theme="dark"] body.bb-app-active .topbar {
  border-color: rgba(116, 153, 203, 0.16);
  background: rgba(15, 25, 39, 0.94);
}

body.bb-app-active .topbar .eyebrow {
  margin-bottom: 2px;
  color: var(--pro-muted);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.09em;
}

body.bb-app-active .topbar h2 {
  color: var(--pro-ink);
  font-size: 21px;
  font-weight: 790;
  letter-spacing: -0.035em;
}

body.bb-app-active .topbar-search {
  max-width: 460px;
}

body.bb-app-active .topbar-search input {
  min-height: 40px;
  padding-inline: 14px;
  border-color: var(--pro-line);
  border-radius: 11px;
  background: var(--pro-surface-soft);
  color: var(--pro-ink);
  box-shadow: inset 0 1px 2px rgba(16, 33, 58, 0.025);
}

body.bb-app-active .topbar-search input::placeholder {
  color: var(--pro-muted-soft);
}

body.bb-app-active .topbar-search input:focus {
  border-color: #4c83dc;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px rgba(31, 99, 216, 0.12);
}

body.bb-app-active :is(.topbar-theme-toggle, .topbar-account-btn, .topbar-logout, .sidebar-toggle) {
  min-height: 40px;
  border-color: var(--pro-line);
  border-radius: 11px;
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active :is(.topbar-theme-toggle, .topbar-account-btn, .sidebar-toggle):hover {
  border-color: #b5c8e2;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active .topbar-account-avatar {
  background: linear-gradient(145deg, #2b72e2, #1956bd);
  box-shadow: 0 4px 10px rgba(31, 99, 216, 0.24);
}

body.bb-app-active .topbar-logout {
  border-color: rgba(196, 66, 82, 0.20);
  background: var(--pro-red-soft);
  color: var(--pro-red);
}

body.bb-app-active :is(.primary-button, .ghost-button, .danger-button, .table-action) {
  border-radius: 10px;
  font-weight: 680;
  letter-spacing: -0.005em;
}

body.bb-app-active .primary-button {
  border: 1px solid #1d5dc8;
  background: linear-gradient(180deg, #2b71df 0%, #1e5fcf 100%);
  box-shadow: 0 5px 13px rgba(31, 99, 216, 0.20), inset 0 1px rgba(255, 255, 255, 0.18);
}

body.bb-app-active .primary-button:hover {
  border-color: #164ba7;
  background: linear-gradient(180deg, #2468d3 0%, #194fac 100%);
  box-shadow: 0 8px 18px rgba(31, 99, 216, 0.25);
  transform: translateY(-1px);
}

body.bb-app-active .ghost-button {
  border-color: var(--pro-line-strong);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .ghost-button:hover {
  border-color: #a9bedc;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active .table-action {
  border-color: var(--pro-line);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
}

/* Universal product surfaces --------------------------------------------- */

body.bb-app-active :is(.panel, .metric-card, .zoho-widget) {
  border-color: var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .panel {
  padding: 21px;
}

body.bb-app-active .section-header {
  margin-bottom: 16px;
}

body.bb-app-active .section-header h3 {
  color: var(--pro-ink);
  font-size: 18px;
  font-weight: 770;
  letter-spacing: -0.025em;
}

body.bb-app-active .section-header p,
body.bb-app-active :is(.muted-copy, .muted-block, .metric-label, .mini-stat-label) {
  color: var(--pro-muted);
}

body.bb-app-active .metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

body.bb-app-active .metric-card strong {
  color: var(--pro-ink);
  font-weight: 790;
  letter-spacing: -0.025em;
}

body.bb-app-active .metric-trend {
  background: var(--pro-green-soft);
  color: var(--pro-green);
}

body.bb-app-active .metric-trend.alert {
  background: var(--pro-red-soft);
  color: var(--pro-red);
}

/* Dashboard --------------------------------------------------------------- */

body.bb-app-active .dash-header {
  min-height: 132px;
  padding: 23px 25px;
  overflow: hidden;
  border: 1px solid rgba(105, 153, 225, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 20%, rgba(103, 157, 255, 0.27), transparent 19rem),
    linear-gradient(118deg, #10213c 0%, #173b74 57%, #1e5dc0 100%);
  box-shadow: 0 16px 38px rgba(20, 57, 111, 0.17);
}

body.bb-app-active .dash-greeting {
  color: #b8cae4;
  font-size: 12.5px;
}

body.bb-app-active .dash-company {
  color: #ffffff;
  font-size: 24px;
  font-weight: 790;
  letter-spacing: -0.035em;
}

body.bb-app-active .dash-period-pill {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.10);
  color: #dce8f8;
  backdrop-filter: blur(8px);
}

body.bb-app-active .dash-header-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #f4f8ff;
  box-shadow: none;
}

body.bb-app-active .dash-header-actions .ghost-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body.bb-app-active .dash-header-actions .primary-button {
  border-color: #ffffff;
  background: #ffffff;
  color: #174ea6;
  box-shadow: 0 8px 20px rgba(2, 16, 40, 0.18);
}

body.bb-app-active .dash-header-actions .primary-button:hover {
  border-color: #ffffff;
  background: #f2f6fd;
  color: #123f89;
}

body.bb-app-active .dash-kpi-grid {
  gap: 12px;
  margin-block: 12px 14px;
}

body.bb-app-active .dash-kpi-grid > div {
  --dash-accent: var(--pro-blue);
  position: relative !important;
  min-height: 132px;
  padding: 18px 18px 16px !important;
  overflow: hidden !important;
  border: 1px solid var(--pro-line) !important;
  border-radius: 16px !important;
  background: var(--pro-surface) !important;
  color: var(--pro-ink) !important;
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .dash-kpi-grid > div:nth-child(1) { --dash-accent: #17845f; }
body.bb-app-active .dash-kpi-grid > div:nth-child(2) { --dash-accent: #c44856; }
body.bb-app-active .dash-kpi-grid > div:nth-child(3) { --dash-accent: #2869d5; }
body.bb-app-active .dash-kpi-grid > div:nth-child(4) { --dash-accent: #147f84; }

body.bb-app-active .dash-kpi-grid > div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--dash-accent);
}

body.bb-app-active .dash-kpi-grid > div::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--dash-accent);
  opacity: 0.055;
}

body.bb-app-active .dash-kpi-grid > div > div:first-child {
  color: var(--pro-muted) !important;
  opacity: 1 !important;
}

body.bb-app-active .dash-kpi-grid > div > div:nth-child(2) {
  color: var(--pro-ink) !important;
  font-size: clamp(21px, 1.8vw, 26px) !important;
  letter-spacing: -0.035em;
}

body.bb-app-active .dash-kpi-grid > div > div:nth-child(n+3):not(:last-child) {
  color: var(--pro-muted) !important;
  opacity: 1 !important;
}

body.bb-app-active .dash-kpi-grid > div > div:last-child {
  display: none !important;
}

body.bb-app-active .dash-cfi-row {
  gap: 12px;
  margin-bottom: 18px;
}

body.bb-app-active .dash-cfi-card {
  min-height: 104px;
  padding: 17px;
  border-color: var(--pro-line);
  border-radius: 15px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .dash-cfi-label {
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 790;
  letter-spacing: 0.075em;
}

body.bb-app-active .dash-cfi-value {
  color: var(--pro-ink);
  font-weight: 780;
  letter-spacing: -0.025em;
}

body.bb-app-active .dash-cfi-hint {
  color: var(--pro-muted);
  line-height: 1.4;
}

body.bb-app-active #dashboard [style*="background:var(--surface);border:1px solid var(--line);border-radius:14px"] {
  border-color: var(--pro-line) !important;
  border-radius: 16px !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active #dashboard button[style*="width:100%;display:flex"] {
  min-height: 39px;
  border-color: var(--pro-line) !important;
  border-radius: 10px !important;
  background: var(--pro-surface-soft) !important;
  color: var(--pro-ink-soft) !important;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

body.bb-app-active #dashboard button[style*="width:100%;display:flex"]:hover {
  border-color: #aebfd6 !important;
  background: var(--pro-blue-soft) !important;
  transform: translateX(2px);
}

body.bb-app-active :is(.dashboard-setup-panel, .dashboard-empty-guide) {
  border-color: var(--pro-line);
  border-radius: 17px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .dashboard-setup-step {
  border-color: var(--pro-line);
  border-radius: 11px;
  background: var(--pro-surface-soft);
}

/* Register/list screens ---------------------------------------------------- */

body.bb-app-active .page-section .panel:has(> .inv-list-header) {
  overflow: hidden;
  padding: 0;
  border-radius: 18px;
  box-shadow: var(--pro-shadow-md);
}

body.bb-app-active .inv-list-header {
  gap: 18px;
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--pro-line);
  background:
    linear-gradient(180deg, var(--pro-surface) 0%, var(--pro-surface-soft) 100%);
}

body.bb-app-active .inv-list-kicker {
  color: var(--pro-blue);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.10em;
}

body.bb-app-active .inv-list-title {
  color: var(--pro-ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

body.bb-app-active .inv-list-subtitle {
  color: var(--pro-muted);
  font-size: 12.5px;
}

body.bb-app-active .inv-list-actions {
  gap: 8px;
}

body.bb-app-active .inv-kpi-grid {
  gap: 11px;
  padding: 16px 24px 18px;
  background: var(--pro-surface);
}

body.bb-app-active .inv-kpi-card {
  min-height: 96px;
  border-color: var(--pro-line) !important;
  border-radius: 14px;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .inv-kpi-card--blue  { border-top: 3px solid #3d7ddd !important; }
body.bb-app-active .inv-kpi-card--amber { border-top: 3px solid #d49a35 !important; }
body.bb-app-active .inv-kpi-card--red   { border-top: 3px solid #d45a66 !important; }
body.bb-app-active .inv-kpi-card--green { border-top: 3px solid #35a079 !important; }

body.bb-app-active .inv-kpi-icon {
  border-radius: 11px;
}

body.bb-app-active .inv-kpi-label {
  color: var(--pro-muted);
  font-weight: 780;
  letter-spacing: 0.07em;
}

body.bb-app-active .inv-kpi-sub {
  color: var(--pro-muted);
}

body.bb-app-active :is(.inv-empty-state, .empty-state, .zoho-empty-small) {
  color: var(--pro-muted);
}

body.bb-app-active :is(.inv-empty-state, .empty-state) > svg {
  color: var(--pro-blue);
  background: var(--pro-blue-soft);
  border-radius: 18px;
}

/* Forms and document editors --------------------------------------------- */

body.bb-app-active .page-section > [id$="-create-panel"].open,
body.bb-app-active .page-section [id$="-create-panel"].open {
  overflow: hidden;
  padding: 0;
  border-color: var(--pro-line);
  border-radius: 18px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-lg);
}

body.bb-app-active :is(
  .quote-form-title,
  .customer-form-title,
  .bill-form-header,
  .pmt-form-header,
  .exp-form-header,
  .coa-form-header
) {
  min-height: 70px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--pro-line);
  background: var(--pro-surface);
  box-shadow: none;
}

body.bb-app-active :is(
  .quote-form-title,
  .customer-form-title,
  .bill-form-header,
  .pmt-form-header,
  .exp-form-header,
  .coa-form-header
) h3 {
  color: var(--pro-ink);
  font-size: 22px;
  font-weight: 790;
  letter-spacing: -0.035em;
}

body.bb-app-active :is(.inv-title-icon, .customer-title-icon) {
  border: 1px solid rgba(61, 125, 221, 0.13);
  border-radius: 11px;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active :is(
  .quote-form-body,
  .customer-form-body,
  .bill-form-body,
  .pmt-form-body,
  .exp-form-body,
  .coa-form-body
) {
  background: var(--pro-surface);
}

body.bb-app-active .quote-form-body {
  padding: 24px 30px 32px;
}

body.bb-app-active .quote-band {
  padding: 24px 28px;
  border: 1px solid var(--pro-line);
  border-radius: 15px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .quote-details-grid {
  overflow: hidden;
  border-color: var(--pro-line);
  border-radius: 14px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .quote-details-grid > * {
  border-color: var(--pro-line) !important;
}

body.bb-app-active :is(.field label, .quote-form-line > label, .customer-form-line label, .customer-line-label) {
  color: var(--pro-ink-soft);
  font-size: 12.5px;
  font-weight: 680;
}

body.bb-app-active :is(
  .field input,
  .field select,
  .field textarea,
  .quote-form-line input,
  .quote-form-line select,
  .quote-form-line textarea,
  .line-editor input,
  .line-editor select,
  .customer-form-line input,
  .customer-form-line select,
  .customer-form-line textarea
) {
  min-height: 42px;
  border-color: var(--pro-line-strong);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-ink);
  box-shadow: inset 0 1px 2px rgba(16, 33, 58, 0.025);
}

body.bb-app-active :is(
  .field input,
  .field select,
  .field textarea,
  .quote-form-line input,
  .quote-form-line select,
  .quote-form-line textarea,
  .line-editor input,
  .line-editor select,
  .customer-form-line input,
  .customer-form-line select,
  .customer-form-line textarea
):hover {
  border-color: #acbdd3;
}

body.bb-app-active :is(
  .field input,
  .field select,
  .field textarea,
  .quote-form-line input,
  .quote-form-line select,
  .quote-form-line textarea,
  .line-editor input,
  .line-editor select,
  .customer-form-line input,
  .customer-form-line select,
  .customer-form-line textarea
):focus {
  outline: none;
  border-color: #4d83d8;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px rgba(31, 99, 216, 0.12);
}

body.bb-app-active :is(input, textarea)::placeholder {
  color: var(--pro-muted-soft);
}

body.bb-app-active .sell-from-bar {
  border-color: var(--pro-line);
  border-radius: 13px;
  background: var(--pro-blue-soft);
  box-shadow: none;
}

body.bb-app-active :is(.quote-form-actions, .customer-form-actions, .bill-form-actions) {
  padding: 14px 24px;
  border-top: 1px solid var(--pro-line);
  background: rgba(247, 249, 252, 0.96);
  box-shadow: 0 -8px 22px rgba(15, 35, 66, 0.04);
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] body.bb-app-active :is(.quote-form-actions, .customer-form-actions, .bill-form-actions) {
  background: rgba(16, 26, 40, 0.96);
}

body.bb-app-active :is(.bill-totals-box, .quote-upload-block, .inline-customer-fields) {
  border-color: var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .bill-total-final {
  color: var(--pro-ink);
  font-weight: 800;
}

body.bb-app-active .customer-upload-button > span {
  border-color: var(--pro-line-strong);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
}

/* Tables, filters and tabs ------------------------------------------------- */

body.bb-app-active :is(
  .data-table-wrap,
  .table-shell,
  .report-table-shell,
  .items-table-wrap,
  .pmade-table-wrap,
  .bk-txn-table-wrap,
  .coa-table-wrap
) {
  border: 1px solid var(--pro-line);
  border-radius: 14px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active :is(.data-table, .items-table, .report-table) {
  color: var(--pro-ink-soft);
}

body.bb-app-active :is(.data-table, .items-table, .report-table) thead th,
body.bb-app-active :is(.data-table-wrap, .table-shell, .report-table-shell) table thead th {
  height: 42px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body.bb-app-active :is(.data-table, .items-table, .report-table) tbody td,
body.bb-app-active :is(.data-table-wrap, .table-shell, .report-table-shell) table tbody td {
  padding: 12px 13px;
  border-bottom-color: var(--pro-line);
  color: var(--pro-ink-soft);
}

body.bb-app-active :is(.data-table, .items-table, .report-table) tbody tr:hover td,
body.bb-app-active :is(.data-table-wrap, .table-shell, .report-table-shell) table tbody tr:hover td {
  background: var(--pro-blue-soft);
}

body.bb-app-active :is(
  .filter-chip,
  .inv-filter-btn,
  .quote-filter-btn,
  .tab-button,
  .settings-tab,
  .report-tab
) {
  border-color: var(--pro-line);
  border-radius: 999px;
  background: var(--pro-surface);
  color: var(--pro-muted);
  font-weight: 680;
}

body.bb-app-active :is(
  .filter-chip,
  .inv-filter-btn,
  .quote-filter-btn,
  .tab-button,
  .settings-tab,
  .report-tab
):hover {
  border-color: #adc0dc;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active :is(
  .filter-chip.active,
  .inv-filter-btn.active,
  .quote-filter-btn.active,
  .tab-button.active,
  .settings-tab.active,
  .report-tab.active
) {
  border-color: var(--pro-blue);
  background: var(--pro-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(31, 99, 216, 0.18);
}

body.bb-app-active :is(.status-pill, .status-badge, .vendor-terms-pill, .landed-cost-badge) {
  border-radius: 999px;
  font-weight: 720;
}

/* Dialogs and transient surfaces ----------------------------------------- */

body.bb-app-active .modal-overlay {
  background: rgba(6, 17, 34, 0.54);
  backdrop-filter: blur(5px);
}

body.bb-app-active .modal-card {
  overflow: hidden;
  border: 1px solid rgba(220, 228, 239, 0.90);
  border-radius: 19px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-lg);
}

html[data-theme="dark"] body.bb-app-active .modal-card {
  border-color: var(--pro-line);
}

body.bb-app-active .modal-header {
  min-height: 66px;
  padding: 16px 20px;
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface);
}

body.bb-app-active .modal-header h3 {
  color: var(--pro-ink);
  font-weight: 780;
  letter-spacing: -0.025em;
}

body.bb-app-active .modal-body {
  padding: 20px;
}

body.bb-app-active .modal-footer {
  padding: 13px 20px;
  border-top-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active .modal-close {
  border-radius: 9px;
  color: var(--pro-muted);
}

body.bb-app-active .modal-close:hover {
  background: var(--pro-red-soft);
  color: var(--pro-red);
}

body.bb-app-active :is(.toast, .notification-toast) {
  border: 1px solid var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface-raised);
  color: var(--pro-ink);
  box-shadow: var(--pro-shadow-lg);
}

body.bb-app-active .ai-chat-fab {
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  background: linear-gradient(145deg, #2c73e5, #1854bd);
  box-shadow: 0 13px 28px rgba(31, 99, 216, 0.30);
}

body.bb-app-active :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid rgba(66, 139, 239, 0.72);
  outline-offset: 2px;
}

html[data-theme="dark"] body.bb-app-active .ai-chat-fab {
  border-color: #101a28;
}

/* Dark-mode surface corrections ------------------------------------------ */

html[data-theme="dark"] body.bb-app-active .workspace {
  background:
    radial-gradient(circle at 94% 0%, rgba(62, 117, 207, 0.08), transparent 28rem),
    var(--pro-canvas);
}

html[data-theme="dark"] body.bb-app-active :is(
  .panel,
  .metric-card,
  .zoho-widget,
  .inv-kpi-card,
  .dash-cfi-card,
  .modal-card
) {
  border-color: var(--pro-line);
  background: var(--pro-surface);
  color: var(--pro-ink);
}

html[data-theme="dark"] body.bb-app-active :is(
  .quote-band,
  .bill-totals-box,
  .quote-upload-block,
  .inline-customer-fields
) {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

html[data-theme="dark"] body.bb-app-active .inv-list-header {
  border-color: var(--pro-line);
  background: linear-gradient(180deg, #121e2e 0%, #101a28 100%);
}

html[data-theme="dark"] body.bb-app-active :is(
  .field input,
  .field select,
  .field textarea,
  .quote-form-line input,
  .quote-form-line select,
  .quote-form-line textarea,
  .line-editor input,
  .line-editor select,
  .customer-form-line input,
  .customer-form-line select,
  .customer-form-line textarea
) {
  border-color: var(--pro-line-strong);
  background: #0c1522;
  color: var(--pro-ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] body.bb-app-active :is(.data-table, .items-table, .report-table) thead th,
html[data-theme="dark"] body.bb-app-active :is(.data-table-wrap, .table-shell, .report-table-shell) table thead th {
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
}

html[data-theme="dark"] body.bb-app-active .dash-kpi-grid > div {
  border-color: var(--pro-line) !important;
  background: linear-gradient(180deg, #111d2d 0%, #0f1927 100%) !important;
}

html[data-theme="dark"] body.bb-app-active .dash-header-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f4f8ff !important;
}

html[data-theme="dark"] body.bb-app-active .dash-header-actions .primary-button {
  border-color: #ffffff !important;
  background: #f5f8ff !important;
  color: #15468f !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22) !important;
}

/* Responsive desktop/tablet ---------------------------------------------- */

@media (max-width: 1180px) {
  body.bb-app-active .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  body.bb-app-active .workspace {
    padding-inline: 20px;
  }

  body.bb-app-active .topbar-account-email {
    display: none;
  }

  body.bb-app-active .dash-kpi-grid,
  body.bb-app-active .dash-cfi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone and small tablet -------------------------------------------------- */

@media (max-width: 768px) {
  body.bb-app-active {
    --pro-canvas: #f3f6fb;
  }

  html[data-theme="dark"] body.bb-app-active {
    --pro-canvas: #080e18;
  }

  body.bb-app-active .app-shell {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 100dvh;
    width: 100% !important;
    background: var(--pro-canvas);
  }

  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active .workspace {
    gap: 11px !important;
    padding: 8px 10px calc(104px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--pro-canvas) !important;
  }

  body.bb-app-active .page-section {
    width: 100%;
  }

  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active .topbar {
    top: max(6px, env(safe-area-inset-top, 0px)) !important;
    min-height: 66px !important;
    padding: 9px 10px !important;
    border-color: var(--pro-line) !important;
    border-radius: 17px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 10px 26px rgba(15, 35, 66, 0.09) !important;
  }

  html[data-theme="dark"]:not(.native-app-mode):not(.pwa-mode) body.bb-app-active .topbar {
    border-color: var(--pro-line) !important;
    background: rgba(15, 25, 39, 0.96) !important;
  }

  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active :is(
    .sidebar-toggle,
    .topbar-theme-toggle,
    .topbar-account-btn
  ) {
    width: 41px !important;
    height: 41px !important;
    min-width: 41px !important;
    min-height: 41px !important;
    border-color: var(--pro-line) !important;
    border-radius: 12px !important;
    background: var(--pro-surface-soft) !important;
  }

  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active .topbar-search input {
    height: 43px !important;
    min-height: 43px !important;
    border-color: var(--pro-line) !important;
    border-radius: 12px !important;
    background: var(--pro-surface-soft) !important;
  }

  body.bb-app-active .dash-header {
    min-height: 0;
    gap: 17px !important;
    padding: 20px 17px !important;
    border-radius: 17px !important;
    box-shadow: 0 14px 30px rgba(20, 57, 111, 0.17) !important;
  }

  body.bb-app-active .dash-company {
    font-size: 22px;
  }

  body.bb-app-active .dash-header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.bb-app-active .dash-header-actions > * {
    width: 100% !important;
    min-height: 45px !important;
    justify-content: center !important;
  }

  body.bb-app-active .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    margin-block: 10px 11px !important;
  }

  body.bb-app-active .dash-kpi-grid > div {
    min-height: 126px !important;
    padding: 15px 13px 14px !important;
    border-radius: 15px !important;
  }

  body.bb-app-active .dash-kpi-grid > div > div:nth-child(2) {
    font-size: clamp(18px, 5.2vw, 22px) !important;
  }

  body.bb-app-active .dash-kpi-grid > div > div:nth-child(n+3):not(:last-child) {
    font-size: 10px !important;
  }

  body.bb-app-active .dash-cfi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  body.bb-app-active .dash-cfi-card {
    min-height: 114px;
    padding: 14px;
    border-radius: 14px;
  }

  body.bb-app-active .page-section .panel {
    border-color: var(--pro-line) !important;
    border-radius: 17px !important;
    background: var(--pro-surface) !important;
    box-shadow: var(--pro-shadow-sm) !important;
  }

  body.bb-app-active .inv-list-header {
    padding: 18px 16px 15px !important;
    background: var(--pro-surface) !important;
  }

  body.bb-app-active .inv-list-title {
    font-size: 23px !important;
  }

  body.bb-app-active .inv-kpi-grid {
    gap: 9px !important;
    padding: 12px 16px 16px !important;
  }

  body.bb-app-active .inv-kpi-card {
    min-height: 105px !important;
    border-radius: 14px !important;
  }

  body.bb-app-active .quote-form-body {
    padding: 16px 13px 24px !important;
  }

  body.bb-app-active .quote-band {
    padding: 16px 13px !important;
    border-radius: 14px !important;
  }

  body.bb-app-active :is(
    .quote-form-title,
    .customer-form-title,
    .bill-form-header,
    .pmt-form-header,
    .exp-form-header,
    .coa-form-header
  ) {
    min-height: 64px;
    padding: 13px 15px !important;
  }

  body.bb-app-active :is(
    .quote-form-title,
    .customer-form-title,
    .bill-form-header,
    .pmt-form-header,
    .exp-form-header,
    .coa-form-header
  ) h3 {
    font-size: 20px;
  }

  body.bb-app-active input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  body.bb-app-active select,
  body.bb-app-active textarea {
    min-height: 48px !important;
    border-color: var(--pro-line-strong) !important;
    border-radius: 12px !important;
    background: var(--pro-surface-soft) !important;
    color: var(--pro-ink) !important;
    font-size: 16px !important;
  }

  body.bb-app-active .mobile-bottom-nav {
    border-color: rgba(197, 211, 228, 0.90) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 16px 38px rgba(15, 35, 66, 0.17), 0 3px 9px rgba(15, 35, 66, 0.05) !important;
  }

  html[data-theme="dark"] body.bb-app-active .mobile-bottom-nav {
    border-color: var(--pro-line) !important;
    background: rgba(15, 25, 39, 0.96) !important;
  }

  html[data-theme="dark"] body.bb-app-active .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html[data-theme="dark"] body.bb-app-active .dash-header-actions .ghost-button {
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f4f8ff !important;
  }

  html[data-theme="dark"] body.bb-app-active .dash-header-actions .primary-button {
    border-color: #2f73df !important;
    background: linear-gradient(135deg, #347df0 0%, #1d5fcf 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 9px 20px rgba(18, 74, 165, 0.30) !important;
  }

  html[data-theme="dark"] body.bb-app-active .inv-list-actions .ghost-button {
    border-color: var(--pro-line-strong) !important;
    background: var(--pro-surface-soft) !important;
    color: var(--pro-ink-soft) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"] body.bb-app-active :is(.inv-list-subtitle, .inv-kpi-sub) {
    color: var(--pro-muted) !important;
  }

  body.bb-app-active .mobile-bottom-nav .mob-nav-btn.active:not(.mob-nav-btn--primary) {
    background: var(--pro-blue-soft) !important;
    color: var(--pro-blue) !important;
  }

  body.bb-app-active .mobile-bottom-nav .mob-nav-primary-icon {
    border-color: var(--pro-surface) !important;
    border-radius: 17px !important;
    background: linear-gradient(145deg, #347aea, #1854b8) !important;
    box-shadow: 0 10px 22px rgba(31, 99, 216, 0.31) !important;
  }

  body.bb-app-active .modal-card {
    border-radius: 24px 24px 0 0 !important;
  }

  body.bb-app-active .sidebar {
    border-radius: 0 22px 22px 0 !important;
  }
}

@media (max-width: 390px) {
  body.bb-app-active .dash-kpi-grid > div {
    min-height: 120px !important;
    padding-inline: 11px !important;
  }

  body.bb-app-active .dash-kpi-grid > div > div:first-child {
    font-size: 8.5px !important;
  }

  body.bb-app-active .dash-kpi-grid > div > div:nth-child(2) {
    font-size: 18px !important;
  }

  body.bb-app-active .inv-list-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.bb-app-active .inv-list-actions .primary-button {
    grid-column: 1 / -1 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.bb-app-active *,
  body.bb-app-active *::before,
  body.bb-app-active *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Complete product surface system
   The rules below bring specialized screens into the same visual language as
   the main dashboard and transaction editors. They remain presentation-only.
   ========================================================================== */

/* Shared fields used by Settings, Reports, inventory and operations -------- */

body.bb-app-active :is(
  .stg-field label,
  .report-filter-bar label,
  .item-field-line label,
  .pmade-label,
  .pr-form-field label,
  .pos-cart-field label,
  .etims-mark-label
) {
  color: var(--pro-ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.005em;
}

body.bb-app-active :is(
  .stg-input,
  .report-search input,
  .report-filter-bar input,
  .report-filter-bar select,
  .item-field-line input,
  .item-field-line select,
  .item-field-line textarea,
  .item-transaction-filter select,
  .pmade-input,
  .pmade-notes textarea,
  .pr-form-field input,
  .pr-form-field select,
  .pr-ov-inp,
  .pos-search-input,
  .pos-select,
  .landed-cost-control,
  .landed-basis-input,
  .landed-allocation-toolbar select,
  .etims-config-fields input,
  .etims-config-fields select
) {
  min-height: 42px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-ink);
  box-shadow: inset 0 1px 2px rgba(16, 33, 58, 0.025);
  font-family: inherit;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

body.bb-app-active :is(
  .stg-input,
  .report-search input,
  .report-filter-bar input,
  .report-filter-bar select,
  .item-field-line input,
  .item-field-line select,
  .item-field-line textarea,
  .item-transaction-filter select,
  .pmade-input,
  .pmade-notes textarea,
  .pr-form-field input,
  .pr-form-field select,
  .pr-ov-inp,
  .pos-search-input,
  .pos-select,
  .landed-cost-control,
  .landed-basis-input,
  .landed-allocation-toolbar select,
  .etims-config-fields input,
  .etims-config-fields select
):hover {
  border-color: #aebed2;
}

body.bb-app-active :is(
  .stg-input,
  .report-search input,
  .report-filter-bar input,
  .report-filter-bar select,
  .item-field-line input,
  .item-field-line select,
  .item-field-line textarea,
  .item-transaction-filter select,
  .pmade-input,
  .pmade-notes textarea,
  .pr-form-field input,
  .pr-form-field select,
  .pr-ov-inp,
  .pos-search-input,
  .pos-select,
  .landed-cost-control,
  .landed-basis-input,
  .landed-allocation-toolbar select,
  .etims-config-fields input,
  .etims-config-fields select
):focus {
  outline: none;
  border-color: #4d83d8;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px rgba(31, 99, 216, 0.12);
}

html[data-theme="dark"] body.bb-app-active :is(
  .stg-input,
  .report-search input,
  .report-filter-bar input,
  .report-filter-bar select,
  .item-field-line input,
  .item-field-line select,
  .item-field-line textarea,
  .item-transaction-filter select,
  .pmade-input,
  .pmade-notes textarea,
  .pr-form-field input,
  .pr-form-field select,
  .pr-ov-inp,
  .pos-search-input,
  .pos-select,
  .landed-cost-control,
  .landed-basis-input,
  .landed-allocation-toolbar select,
  .etims-config-fields input,
  .etims-config-fields select
) {
  border-color: var(--pro-line-strong);
  background: #0c1522;
  color: var(--pro-ink);
  color-scheme: dark;
}

/* Settings ---------------------------------------------------------------- */

body.bb-app-active .stg-layout {
  gap: 18px;
  min-height: auto;
  background: transparent;
}

body.bb-app-active .stg-sidebar {
  width: 270px;
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .stg-sidebar-header {
  padding: 19px 20px 16px;
  border-bottom-color: var(--pro-line);
  background: linear-gradient(180deg, var(--pro-surface) 0%, var(--pro-surface-soft) 100%);
}

body.bb-app-active .stg-sidebar-kicker {
  color: var(--pro-blue);
  font-size: 9px;
  letter-spacing: 0.13em;
}

body.bb-app-active .stg-sidebar-title {
  color: var(--pro-ink);
  font-size: 17px;
  font-weight: 800;
}

body.bb-app-active .stg-nav {
  padding: 10px;
}

body.bb-app-active .stg-nav-group {
  margin-bottom: 9px;
}

body.bb-app-active .stg-nav-group-label {
  padding: 10px 10px 5px;
  color: var(--pro-muted-soft);
  font-size: 9px;
  letter-spacing: 0.11em;
}

body.bb-app-active .stg-nav-item {
  min-height: 40px;
  margin: 1px 0;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--pro-muted);
  font-weight: 620;
}

body.bb-app-active .stg-nav-item:hover {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-ink);
}

body.bb-app-active .stg-nav-item.stg-nav-active {
  border-color: rgba(31, 99, 216, 0.18);
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
  box-shadow: inset 3px 0 var(--pro-blue);
}

body.bb-app-active .stg-nav-icon {
  width: 30px;
  height: 30px;
  border: 1px solid var(--pro-line);
  border-radius: 9px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .stg-nav-item.stg-nav-active .stg-nav-icon {
  border-color: rgba(31, 99, 216, 0.15);
  background: var(--pro-surface);
}

body.bb-app-active .stg-main {
  min-width: 0;
  padding: 4px 0 44px;
}

body.bb-app-active .stg-breadcrumb {
  margin: 2px 0 14px;
  color: var(--pro-muted-soft);
}

body.bb-app-active .stg-panel {
  max-width: 860px;
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .stg-content-header {
  min-height: 78px;
  padding: 19px 22px;
  border-bottom-color: var(--pro-line);
  background: linear-gradient(180deg, var(--pro-surface) 0%, rgba(247, 249, 252, 0.82) 100%);
}

html[data-theme="dark"] body.bb-app-active .stg-content-header {
  background: linear-gradient(180deg, var(--pro-surface) 0%, var(--pro-surface-soft) 100%);
}

body.bb-app-active .stg-content-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(31, 99, 216, 0.14);
  border-radius: 12px;
  background: var(--pro-blue-soft) !important;
  color: var(--pro-blue) !important;
}

body.bb-app-active .stg-content-title {
  color: var(--pro-ink);
  font-size: 16px;
  font-weight: 790;
  letter-spacing: -0.02em;
}

body.bb-app-active .stg-content-desc,
body.bb-app-active .stg-copy,
body.bb-app-active .stg-hint {
  color: var(--pro-muted);
}

body.bb-app-active .stg-form {
  gap: 18px;
  padding: 22px;
}

body.bb-app-active :is(.stg-card, .stg-danger-zone) {
  border-color: var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .stg-card-header {
  padding: 11px 15px;
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  letter-spacing: 0.09em;
}

body.bb-app-active .stg-card-body {
  padding: 18px;
}

body.bb-app-active .stg-form-section-label {
  border-bottom-color: var(--pro-line);
  color: var(--pro-muted);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

body.bb-app-active :is(.team-member-row, .stg-backup-meta, .stg-info-row) {
  border: 1px solid var(--pro-line);
  border-radius: 11px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .team-member-row {
  min-height: 62px;
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .team-member-avatar {
  border: 1px solid rgba(31, 99, 216, 0.14);
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active .stg-form-actions {
  padding: 14px 22px;
  border-top-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active :is(.stg-save-btn, .stg-discard-btn) {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 720;
}

body.bb-app-active .stg-save-btn {
  background: linear-gradient(135deg, #2f73df, #1958bc);
  box-shadow: 0 7px 16px rgba(31, 99, 216, 0.18);
}

body.bb-app-active .stg-discard-btn {
  border-color: var(--pro-line-strong);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
}

body.bb-app-active .stg-danger-header {
  background: var(--pro-red-soft);
  color: var(--pro-red);
}

body.bb-app-active .stg-danger-body {
  background: var(--pro-surface);
}

body.bb-app-active :is(.role-card, .health-card, .myplan-cta-card) {
  border-color: var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active :is(.cf-table, .myplan-table) th {
  height: 42px;
  padding: 10px 13px;
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  letter-spacing: 0.075em;
}

body.bb-app-active :is(.cf-table, .myplan-table) td {
  padding: 12px 13px;
  border-bottom-color: var(--pro-line);
  color: var(--pro-ink-soft);
}

/* Reports ----------------------------------------------------------------- */

body.bb-app-active .reports-module {
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  min-width: 0;
}

body.bb-app-active .reports-catalog {
  top: 12px;
  max-height: calc(100vh - 92px);
  padding: 15px;
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .catalog-title h3 {
  color: var(--pro-ink);
  font-size: 16px;
  font-weight: 790;
  letter-spacing: -0.02em;
}

body.bb-app-active .report-search input {
  width: 100%;
  padding-inline: 12px;
}

body.bb-app-active .favorite-strip {
  padding: 10px;
  border-color: var(--pro-line);
  border-radius: 11px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .favorite-strip button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--pro-blue);
}

body.bb-app-active .favorite-strip button:hover {
  border-color: var(--pro-line);
  background: var(--pro-surface);
}

body.bb-app-active .report-group + .report-group {
  border-top-color: var(--pro-line);
}

body.bb-app-active .report-group h4 {
  color: var(--pro-muted);
  font-size: 9.5px;
  letter-spacing: 0.09em;
}

body.bb-app-active .report-link {
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-left-width: 1px;
  border-radius: 9px;
}

body.bb-app-active .report-link:hover {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active .report-link.active {
  border-color: rgba(31, 99, 216, 0.18);
  background: var(--pro-blue-soft);
  box-shadow: inset 3px 0 var(--pro-blue);
}

body.bb-app-active .report-link span {
  color: var(--pro-ink-soft);
  font-weight: 680;
}

body.bb-app-active .report-link.active span {
  color: var(--pro-blue);
}

body.bb-app-active .report-link small {
  color: var(--pro-muted);
}

body.bb-app-active .report-workspace {
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.bb-app-active .reports-module > *,
body.bb-app-active .report-workspace > *,
body.bb-app-active .report-filter-bar > * {
  min-width: 0;
  max-width: 100%;
}

body.bb-app-active :is(
  .reports-home-header,
  .reports-home-card,
  .rpt-core-card,
  .report-action-bar,
  .report-filter-bar,
  .report-customize,
  .report-paper,
  .report-chart-panel
) {
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .reports-home-header {
  padding: 18px 20px;
}

body.bb-app-active .reports-home-card {
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

body.bb-app-active .reports-home-card:hover,
body.bb-app-active .rpt-core-card:hover {
  border-color: rgba(31, 99, 216, 0.32);
  box-shadow: var(--pro-shadow-md);
  transform: translateY(-1px);
}

body.bb-app-active .reports-home-card-title {
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-ink-soft);
  font-size: 10px;
  letter-spacing: 0.075em;
}

body.bb-app-active .report-home-link {
  min-height: 34px;
  border-radius: 8px;
  color: var(--pro-blue);
}

body.bb-app-active .rpt-core-card {
  min-height: 76px;
  border-radius: 14px;
}

body.bb-app-active .rpt-core-icon {
  border: 1px solid var(--pro-line);
}

body.bb-app-active .report-action-bar {
  min-height: 76px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

body.bb-app-active .report-action-bar h3 {
  color: var(--pro-ink);
  font-size: 19px;
  font-weight: 790;
  letter-spacing: -0.025em;
}

body.bb-app-active .rpt-breadcrumb {
  min-width: 220px;
  flex: 1 1 260px;
}

body.bb-app-active .report-actions {
  min-width: 0;
  flex: 1 1 520px;
}

body.bb-app-active .report-catalog-toggle,
body.bb-app-active .report-view-toggle {
  border-color: var(--pro-line-strong);
  border-radius: 10px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .report-filter-bar {
  padding: 15px 17px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .report-filter-context {
  border: 1px solid rgba(31, 99, 216, 0.18);
  border-radius: 11px;
  background: var(--pro-blue-soft);
  color: var(--pro-ink-soft);
}

body.bb-app-active .report-paper {
  padding: 30px 32px 24px;
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .report-paper-title {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--pro-line);
}

body.bb-app-active .report-paper-title h3 {
  color: var(--pro-ink);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

body.bb-app-active :is(.report-table-shell, .report-chart-panel) {
  border-color: var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
}

body.bb-app-active :is(.report-statement, .report-table, .bs-statement) th {
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
}

body.bb-app-active :is(.report-statement, .report-table, .bs-statement) td {
  border-bottom-color: var(--pro-line);
  color: var(--pro-ink-soft);
}

body.bb-app-active :is(.report-section-row, .report-total-row, .bs-group-label, .bs-subtotal-row, .bs-grand-row) td {
  background: var(--pro-surface-soft);
}

body.bb-app-active .report-chart-track {
  background: var(--pro-line);
}

/* Inventory, purchasing and landed cost ---------------------------------- */

body.bb-app-active :is(
  .item-create-panel,
  .item-detail-card,
  .item-details-shell,
  .pmade-create-panel,
  .pmade-register-panel,
  .landed-cost-card,
  .landed-allocation-card
) {
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active :is(.item-modal-header, .pmade-form-title, .landed-cost-header) {
  border-bottom-color: var(--pro-line);
  background: linear-gradient(180deg, var(--pro-surface) 0%, var(--pro-surface-soft) 100%);
}

body.bb-app-active :is(.item-modal-header h3, .pmade-form-title h3, .landed-cost-heading h4) {
  color: var(--pro-ink);
  font-weight: 790;
  letter-spacing: -0.025em;
}

body.bb-app-active :is(.item-title-icon, .pmade-title-icon, .landed-cost-icon) {
  border: 1px solid rgba(31, 99, 216, 0.14);
  border-radius: 11px;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active :is(.item-modal-section, .item-image-drop, .pmade-bills-section, .pmade-summary-notes) {
  border-color: var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .item-image-drop {
  border-style: dashed;
}

body.bb-app-active :is(.pmade-summary-row, .pmade-filter-row, .landed-cost-notice, .landed-allocation-toolbar) {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active :is(
  .pmade-table-wrap,
  .pmade-bills-table-wrap,
  .landed-cost-table-wrap,
  .landed-allocation-card
) {
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
}

body.bb-app-active :is(
  .pmade-table,
  .pmade-bills-table,
  .landed-cost-table,
  .landed-allocation-table
) th {
  height: 42px;
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body.bb-app-active :is(
  .pmade-table,
  .pmade-bills-table,
  .landed-cost-table,
  .landed-allocation-table
) td {
  border-bottom-color: var(--pro-line);
  color: var(--pro-ink-soft);
}

body.bb-app-active .landed-cost-body {
  background: var(--pro-surface);
}

body.bb-app-active .landed-cost-notice {
  border: 1px solid rgba(31, 99, 216, 0.18);
  border-radius: 10px;
  background: var(--pro-blue-soft);
  color: var(--pro-ink-soft);
}

body.bb-app-active .landed-cost-running-total strong,
body.bb-app-active .landed-allocation-table td strong {
  color: var(--pro-ink);
}

html[data-theme="dark"] body.bb-app-active :is(
  .landed-cost-card,
  .landed-allocation-card,
  .landed-cost-body,
  .landed-cost-header,
  .landed-cost-table-wrap
) {
  border-color: var(--pro-line);
  background: var(--pro-surface);
}

/* Banking and reconciliation --------------------------------------------- */

body.bb-app-active .bk-root {
  gap: 18px;
}

body.bb-app-active :is(
  .bk-toolbar,
  .bk-reconcile-strip,
  .bk-accounts-card,
  .bk-active-section,
  .bk-detail-topbar,
  .bk-tabs-bar,
  .bk-txn-panel,
  .bk-txn-side-panel
) {
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .bk-toolbar {
  padding: 15px 17px;
}

body.bb-app-active .bk-reconcile-strip {
  overflow: hidden;
}

body.bb-app-active .bk-reconcile-card {
  border-color: var(--pro-line);
  background: var(--pro-surface);
}

body.bb-app-active .bk-banner {
  overflow: hidden;
  border: 1px solid rgba(31, 99, 216, 0.20);
  border-radius: var(--pro-radius-lg);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .bk-account-card {
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 14px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .bk-account-card:hover {
  border-color: rgba(31, 99, 216, 0.28);
  box-shadow: var(--pro-shadow-md);
  transform: translateY(-1px);
}

body.bb-app-active :is(.bk-account-card-footer, .bk-active-header, .bk-txn-header, .bk-tabs-bar) {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active .bk-tab {
  color: var(--pro-muted);
  font-weight: 680;
}

body.bb-app-active .bk-tab.active {
  color: var(--pro-blue);
  border-bottom-color: var(--pro-blue);
}

body.bb-app-active .bk-txn-table-wrap {
  border-radius: 0 0 13px 13px;
}

/* Payroll and point of sale ---------------------------------------------- */

body.bb-app-active .pr-tab-bar {
  overflow-x: auto;
  border: 1px solid var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .pr-tab {
  color: var(--pro-muted);
}

body.bb-app-active .pr-tab--active {
  color: var(--pro-blue);
  border-bottom-color: var(--pro-blue);
}

body.bb-app-active .pr-form-panel {
  border-color: var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active :is(.pr-period-selector, .pr-deductions-strip, .pr-advance-info, .pr-advance-banner) {
  border-color: var(--pro-line);
  border-radius: 12px;
  background: var(--pro-surface-soft);
}

body.bb-app-active .pos-shell {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
  border-color: var(--pro-line);
  border-radius: 19px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-md);
}

body.bb-app-active .pos-catalog {
  border-right-color: var(--pro-line);
}

body.bb-app-active :is(.pos-catalog-header, .pos-cart-header) {
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active .pos-cart {
  background: var(--pro-surface-soft);
}

body.bb-app-active .pos-item-card {
  border: 1px solid var(--pro-line);
  border-radius: 15px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .pos-item-card:hover:not(:disabled) {
  border-color: rgba(31, 99, 216, 0.38);
  box-shadow: var(--pro-shadow-md);
  transform: translateY(-2px);
}

body.bb-app-active .pos-cart-line-controls {
  border-color: var(--pro-line);
  border-radius: 10px;
  background: var(--pro-surface);
}

body.bb-app-active .pos-cart-line {
  border-bottom-color: var(--pro-line);
}

body.bb-app-active .pos-cart-line-body {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

body.bb-app-active .pos-cart-line-name {
  width: 100%;
}

body.bb-app-active .pos-cart-line--over-stock {
  border: 1px solid #dc2626;
  border-radius: 10px;
  background: #fef2f2;
}

body.bb-app-active .pos-line-stock-alert {
  display: block;
  width: 100%;
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

body.bb-app-active .pos-cart-line-meta {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(132px, 1fr) 82px;
  align-items: end;
  gap: 9px;
}

body.bb-app-active .pos-line-entry,
body.bb-app-active .pos-cart-line-control-group,
body.bb-app-active .pos-cart-line-total-group {
  display: grid;
  gap: 5px;
}

body.bb-app-active .pos-line-entry-label {
  color: var(--pro-ink-muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

body.bb-app-active .pos-line-entry-control {
  position: relative;
  display: flex;
  align-items: center;
}

body.bb-app-active .pos-line-entry-control :is(.pos-price-input, .pos-line-disc) {
  width: 100% !important;
  height: 34px !important;
  border: 1px solid var(--pro-line) !important;
  border-radius: 9px !important;
  background: var(--pro-surface) !important;
  color: var(--pro-ink) !important;
  font-size: 12px !important;
  font-weight: 700;
}

body.bb-app-active .pos-line-entry-control--money .pos-price-input {
  padding: 0 38px 0 36px !important;
  text-align: right;
}

body.bb-app-active .pos-line-entry--discount .pos-line-disc {
  padding: 0 25px 0 9px !important;
  text-align: right;
}

/* Installed-app (native/PWA) input overrides force `padding: 0 13px` on every
   input, which slides the price and discount values underneath their "each"
   and "%" markers. Restore the reserved space with matching specificity. */
html.native-app-mode body.bb-app-active .pos-cart-line .pos-line-entry-control--money input.pos-price-input,
html.pwa-mode body.bb-app-active .pos-cart-line .pos-line-entry-control--money input.pos-price-input {
  padding: 0 40px 0 40px !important;
}

html.native-app-mode body.bb-app-active .pos-cart-line .pos-line-entry--discount input.pos-line-disc,
html.pwa-mode body.bb-app-active .pos-cart-line .pos-line-entry--discount input.pos-line-disc {
  padding: 0 24px 0 9px !important;
}

body.bb-app-active :is(.pos-line-entry-prefix, .pos-line-entry-hint, .pos-line-entry-suffix) {
  position: absolute;
  z-index: 1;
  color: var(--pro-ink-muted);
  font-size: 9px;
  font-weight: 700;
  pointer-events: none;
}

body.bb-app-active .pos-line-entry-prefix {
  left: 9px;
}

body.bb-app-active .pos-line-entry-hint,
body.bb-app-active .pos-line-entry-suffix {
  right: 8px;
}

body.bb-app-active .pos-cart-line-right {
  align-items: end;
}

body.bb-app-active .pos-cart-line-total-group {
  margin-left: auto;
  justify-items: end;
}

body.bb-app-active .pos-cart-line-total-group .pos-cart-line-total {
  min-height: 34px;
  display: flex;
  align-items: center;
}

/* Warehouses, projects and specialized industries ------------------------ */

body.bb-app-active :is(.wh-kpi, .wh-card, .proj-stat-card, .proj-section, .proj-detail-grid) {
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active :is(.wh-kpi, .wh-card, .proj-stat-card) {
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

body.bb-app-active :is(.wh-kpi, .wh-card, .proj-stat-card):hover {
  border-color: rgba(31, 99, 216, 0.28);
  box-shadow: var(--pro-shadow-md);
  transform: translateY(-1px);
}

body.bb-app-active :is(.wh-stock-matrix, .edu-content-panel, .resto-content-panel) {
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active :is(.wh-stock-matrix-header, .edu-content-toolbar, .resto-content-header) {
  border-bottom: 1px solid var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active :is(.edu-kpi-card, .resto-kpi-card) {
  border-color: var(--pro-line);
  border-radius: 15px;
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active :is(.edu-tabs, .resto-tabs) {
  border: 1px solid var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active :is(.edu-tab, .resto-tab) {
  color: var(--pro-muted);
}

body.bb-app-active :is(.edu-tab.is-active, .resto-tab.is-active) {
  color: var(--pro-blue);
}

body.bb-app-active :is(.edu-table-wrap, .resto-table-wrap, .myplan-table-wrap) {
  overflow: auto;
  border: 1px solid var(--pro-line);
  border-radius: 13px;
  background: var(--pro-surface);
}

body.bb-app-active :is(.edu-data-table, .resto-data-table) thead th {
  height: 42px;
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body.bb-app-active :is(.edu-data-table, .resto-data-table) tbody td {
  border-bottom-color: var(--pro-line);
  color: var(--pro-ink-soft);
}

body.bb-app-active :is(.edu-data-table, .resto-data-table) tbody tr:hover td {
  background: var(--pro-blue-soft);
}

html[data-theme="dark"] body.bb-app-active :is(
  .edu-kpi-card,
  .resto-kpi-card,
  .edu-content-panel,
  .resto-content-panel,
  .wh-kpi,
  .wh-card,
  .proj-stat-card,
  .proj-section
) {
  border-color: var(--pro-line);
  background: var(--pro-surface);
}

/* Compact layouts for specialized screens -------------------------------- */

@media (max-width: 1000px) {
  body.bb-app-active .reports-module {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  body.bb-app-active .pos-shell {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 43%);
  }
}

@media (max-width: 1380px) and (min-width: 769px) {
  body.bb-app-active .reports-module {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  body.bb-app-active .report-action-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  body.bb-app-active .report-actions {
    width: 100%;
    flex: 0 1 auto;
    justify-content: flex-start;
  }

  body.bb-app-active .report-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.bb-app-active .stg-layout {
    gap: 14px;
  }

  body.bb-app-active .stg-sidebar {
    width: 100%;
    border: 1px solid var(--pro-line);
    border-radius: 15px;
  }

  body.bb-app-active .stg-sidebar-header {
    padding: 14px 15px 12px;
  }

  body.bb-app-active .stg-nav {
    flex-wrap: nowrap;
    gap: 7px;
    padding: 9px 10px 11px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  body.bb-app-active .stg-nav-item {
    min-height: 40px;
    flex: 0 0 auto;
    border: 1px solid var(--pro-line);
    border-radius: 10px;
    background: var(--pro-surface);
    box-shadow: none;
  }

  body.bb-app-active .stg-nav-item.stg-nav-active {
    border-color: var(--pro-blue);
    background: var(--pro-blue);
    color: #ffffff;
    box-shadow: none;
  }

  body.bb-app-active .stg-nav-item.stg-nav-active .stg-nav-icon {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  body.bb-app-active .stg-main {
    padding: 0 0 28px;
  }

  body.bb-app-active .stg-panel {
    max-width: none;
    border-radius: 15px;
  }

  body.bb-app-active .stg-content-header {
    padding: 16px;
  }

  body.bb-app-active .stg-form {
    padding: 16px;
  }

  body.bb-app-active .stg-form-actions {
    position: sticky;
    bottom: 74px;
    z-index: 4;
    padding: 12px 16px;
    box-shadow: 0 -8px 22px rgba(15, 35, 66, 0.08);
  }

  body.bb-app-active .reports-module,
  body.bb-app-active .reports-module.catalog-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  body.bb-app-active .reports-catalog {
    position: relative;
    top: auto;
    max-height: 360px;
    border-radius: 15px;
  }

  body.bb-app-active .reports-home-grid,
  body.bb-app-active .rpt-core-grid {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .report-action-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
  }

  body.bb-app-active .report-actions {
    width: 100%;
    flex: 0 1 auto;
    justify-content: flex-start;
  }

  body.bb-app-active .report-filter-bar,
  body.bb-app-active .report-customize {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .report-paper {
    padding: 22px 14px 18px;
  }

  body.bb-app-active .report-table-shell {
    border-radius: 11px;
  }

  body.bb-app-active .pos-shell {
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: column;
    border-radius: 15px;
  }

  body.bb-app-active .pos-catalog {
    min-height: 430px;
    border-right: 0;
    border-bottom: 1px solid var(--pro-line);
  }

  body.bb-app-active .pos-cart {
    min-height: 470px;
  }

  body.bb-app-active .pos-cart-line-meta {
    width: 100%;
    grid-template-columns: minmax(125px, 1fr) minmax(76px, 0.62fr);
  }

  body.bb-app-active .pos-cart-line-right {
    gap: 8px;
  }

  body.bb-app-active .pos-cart-line-total-group {
    min-width: 94px;
  }

  body.bb-app-active .pos-items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  body.bb-app-active .pr-form-grid {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .wh-kpi-row,
  body.bb-app-active .wh-cards-grid,
  body.bb-app-active .edu-kpi-grid,
  body.bb-app-active .resto-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.bb-app-active :is(
    .stg-input,
    .report-search input,
    .report-filter-bar input,
    .report-filter-bar select,
    .item-field-line input,
    .item-field-line select,
    .item-field-line textarea,
    .pmade-input,
    .pmade-notes textarea,
    .pr-form-field input,
    .pr-form-field select,
    .pos-search-input,
    .pos-select,
    .landed-cost-control,
    .landed-basis-input
  ) {
    min-height: 48px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  body.bb-app-active .stg-content-icon {
    width: 38px;
    height: 38px;
  }

  body.bb-app-active .stg-content-title {
    font-size: 15px;
  }

  body.bb-app-active .stg-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body.bb-app-active .reports-catalog {
    max-height: 320px;
    padding: 12px;
  }

  body.bb-app-active .report-paper-title h3 {
    font-size: 20px;
  }

  body.bb-app-active .pos-items-grid,
  body.bb-app-active .wh-kpi-row,
  body.bb-app-active .wh-cards-grid,
  body.bb-app-active .edu-kpi-grid,
  body.bb-app-active .resto-kpi-grid {
    grid-template-columns: 1fr;
  }

  body.bb-app-active .pos-item-card {
    min-height: 132px;
  }
}

/* Bill line-item editor --------------------------------------------------- */

body.bb-app-active .bill-zoho-form .bill-item-section {
  --bill-line-border: var(--pro-line);
  --bill-line-control: var(--pro-line-strong);
  margin: 20px 0 22px;
  overflow: hidden;
  border: 1px solid var(--bill-line-border);
  border-radius: 16px;
  background: var(--pro-surface);
  box-shadow: 0 10px 28px rgba(15, 35, 66, 0.065), var(--pro-shadow-xs);
}

body.bb-app-active .bill-zoho-form .bill-item-header {
  min-height: 72px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--bill-line-border);
  background:
    linear-gradient(90deg, rgba(31, 99, 216, 0.035), transparent 38%),
    var(--pro-surface);
}

body.bb-app-active .bill-zoho-form .line-item-heading {
  gap: 12px;
}

body.bb-app-active .bill-zoho-form .line-item-icon {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(31, 99, 216, 0.16);
  border-radius: 11px;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.62);
}

body.bb-app-active .bill-zoho-form .line-item-copy {
  gap: 3px;
}

body.bb-app-active .bill-zoho-form .line-item-copy strong {
  color: var(--pro-ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.018em;
}

body.bb-app-active .bill-zoho-form .line-item-copy span {
  color: var(--pro-muted);
  font-size: 11.5px;
  font-weight: 550;
}

body.bb-app-active .bill-zoho-form .bill-bulk-actions-btn {
  min-height: 38px;
  padding-inline: 13px;
  border: 1px solid var(--bill-line-border);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-blue);
  box-shadow: var(--pro-shadow-xs);
  font-size: 12.5px;
  font-weight: 750;
}

body.bb-app-active .bill-zoho-form .bill-bulk-actions-btn:hover {
  border-color: rgba(31, 99, 216, 0.30);
  background: var(--pro-blue-soft);
  color: var(--pro-blue-strong);
}

body.bb-app-active .bill-zoho-form .bill-item-table {
  width: 100%;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--pro-surface);
}

body.bb-app-active .bill-zoho-form .bill-item-table th {
  height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bill-line-border);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 820;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body.bb-app-active .bill-zoho-form .bill-item-table th:nth-child(3) { text-align: center; }
body.bb-app-active .bill-zoho-form .bill-item-table th:nth-child(4),
body.bb-app-active .bill-zoho-form .bill-item-table th:nth-child(6) { text-align: right; }

body.bb-app-active .bill-zoho-form .bill-item-table td {
  height: 92px;
  padding: 12px;
  border-bottom: 1px solid var(--bill-line-border);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
  vertical-align: top;
  transition: background 0.14s ease;
}

body.bb-app-active .bill-zoho-form .bill-item-table tr:last-child td {
  border-bottom: 0;
}

body.bb-app-active .bill-zoho-form .bill-item-table tbody tr:hover td {
  background: color-mix(in srgb, var(--pro-blue-soft) 42%, var(--pro-surface));
}

body.bb-app-active .bill-zoho-form .bill-item-inner {
  gap: 10px;
}

body.bb-app-active .bill-zoho-form .bill-item-img {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(31, 99, 216, 0.16);
  border-radius: 10px;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
}

body.bb-app-active .bill-zoho-form .bill-item-fields {
  min-width: 0;
  gap: 7px;
}

body.bb-app-active .bill-zoho-form :is(
  .bill-item-select,
  .bill-item-desc,
  .bill-account-select,
  .bill-num-input,
  .bill-vat-select
) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--bill-line-control);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-ink);
  box-shadow: inset 0 1px 2px rgba(16, 33, 58, 0.025);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

body.bb-app-active .bill-zoho-form .bill-item-select {
  padding: 8px 11px;
  font-weight: 620;
}

body.bb-app-active .bill-zoho-form .bill-item-desc {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--pro-ink-soft);
  font-size: 12.5px;
}

body.bb-app-active .bill-zoho-form :is(.bill-account-select, .bill-vat-select) {
  padding: 8px 10px;
}

body.bb-app-active .bill-zoho-form .bill-num-input {
  padding: 8px 9px;
  appearance: textfield;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

body.bb-app-active .bill-zoho-form .bill-num-input::-webkit-outer-spin-button,
body.bb-app-active .bill-zoho-form .bill-num-input::-webkit-inner-spin-button {
  display: none !important;
  margin: 0;
  appearance: none !important;
  -webkit-appearance: none !important;
}

body.bb-app-active .bill-zoho-form .bill-qty-cell .bill-num-input {
  text-align: center;
}

body.bb-app-active .bill-zoho-form .bill-rate-cell .bill-num-input {
  padding-inline: 6px;
  text-align: right;
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

body.bb-app-active .bill-zoho-form :is(
  .bill-item-select,
  .bill-item-desc,
  .bill-account-select,
  .bill-num-input,
  .bill-vat-select
):hover {
  border-color: #aebed2;
}

body.bb-app-active .bill-zoho-form :is(
  .bill-item-select,
  .bill-item-desc,
  .bill-account-select,
  .bill-num-input,
  .bill-vat-select
):focus {
  outline: none;
  border-color: #4d83d8;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px rgba(31, 99, 216, 0.12);
}

body.bb-app-active .bill-zoho-form .bill-amount-cell {
  text-align: right;
}

body.bb-app-active .bill-zoho-form .bill-amount-cell span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(31, 99, 216, 0.16);
  border-radius: 10px;
  background: var(--pro-blue-soft);
  color: var(--pro-ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 830;
  letter-spacing: -0.012em;
}

body.bb-app-active .bill-zoho-form .bill-add-row-wrap {
  padding: 13px 16px;
  border-top: 1px solid var(--bill-line-border);
  background: var(--pro-surface-soft);
}

body.bb-app-active .bill-zoho-form .bill-add-row-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px dashed rgba(31, 99, 216, 0.38);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-blue);
  font-size: 12.5px;
  font-weight: 780;
}

body.bb-app-active .bill-zoho-form .bill-add-row-btn:hover {
  border-color: var(--pro-blue);
  background: var(--pro-blue-soft);
  color: var(--pro-blue-strong);
}

html[data-theme="dark"] body.bb-app-active .bill-zoho-form .bill-item-section {
  --bill-line-border: var(--pro-line);
  --bill-line-control: var(--pro-line-strong);
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

html[data-theme="dark"] body.bb-app-active .bill-zoho-form :is(
  .bill-item-header,
  .bill-item-table,
  .bill-item-table td,
  .bill-item-select,
  .bill-item-desc,
  .bill-account-select,
  .bill-num-input,
  .bill-vat-select
) {
  border-color: var(--pro-line);
  background: var(--pro-surface);
  color: var(--pro-ink);
}

html[data-theme="dark"] body.bb-app-active .bill-zoho-form .bill-item-table th,
html[data-theme="dark"] body.bb-app-active .bill-zoho-form .bill-add-row-wrap {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

html[data-theme="dark"] body.bb-app-active .bill-zoho-form .bill-item-table tbody tr:hover td {
  background: var(--pro-blue-soft);
}

@media (max-width: 1050px) and (min-width: 769px) {
  body.bb-app-active .bill-zoho-form .bill-item-table {
    min-width: 820px;
  }
}

@media (max-width: 768px) {
  body.bb-app-active .bill-zoho-form .bill-item-section {
    margin: 16px 0 18px;
    padding: 12px !important;
    overflow: hidden !important;
    border-color: var(--pro-line) !important;
    border-radius: 16px !important;
    background: var(--pro-surface) !important;
    box-shadow: var(--pro-shadow-sm) !important;
  }

  body.bb-app-active .bill-zoho-form .bill-item-header {
    padding: 0 0 12px !important;
    margin: 0 0 12px !important;
    border-bottom-color: var(--pro-line) !important;
    background: transparent !important;
  }

  body.bb-app-active .bill-zoho-form .bill-item-table tr.bill-line-row {
    gap: 11px !important;
    padding: 48px 11px 11px !important;
    border-color: var(--pro-line) !important;
    border-radius: 14px !important;
    background: var(--pro-surface-soft) !important;
    box-shadow: var(--pro-shadow-xs) !important;
  }

  body.bb-app-active .bill-zoho-form .bill-item-table tr.bill-line-row::before {
    top: 11px !important;
    left: 11px !important;
    border-color: rgba(31, 99, 216, 0.16) !important;
    background: var(--pro-blue-soft) !important;
    color: var(--pro-blue) !important;
  }

  body.bb-app-active .bill-zoho-form :is(
    .bill-item-select,
    .bill-item-desc,
    .bill-account-select,
    .bill-num-input,
    .bill-vat-select
  ) {
    height: 48px !important;
    min-height: 48px !important;
    border-color: var(--pro-line-strong) !important;
    border-radius: 12px !important;
    background: var(--pro-surface) !important;
    color: var(--pro-ink) !important;
    font-size: 16px !important;
  }

  body.bb-app-active .bill-zoho-form .bill-item-img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 11px !important;
  }

  body.bb-app-active .bill-zoho-form .bill-amount-cell {
    min-height: 50px !important;
    border-color: rgba(31, 99, 216, 0.18) !important;
    border-radius: 12px !important;
    background: var(--pro-blue-soft) !important;
  }

  body.bb-app-active .bill-zoho-form .bill-amount-cell span {
    min-height: 0;
    padding: 0 !important;
    border: 0;
    background: transparent;
    font-size: 16px !important;
  }

  body.bb-app-active .bill-zoho-form .bill-add-row-wrap {
    padding: 12px 0 0 !important;
    border-top: 0 !important;
    background: transparent !important;
  }

  body.bb-app-active .bill-zoho-form .bill-add-row-btn {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
    border-radius: 12px !important;
    background: var(--pro-surface-soft) !important;
  }
}

/* ==========================================================================
   Unified create-record experience
   Presentation only: shared visual treatment for every existing new-record
   form. No validation, submission, accounting, or persistence behavior lives
   in this layer.
   ========================================================================== */

body.bb-app-active :is(
  .quote-create-panel,
  .customer-create-panel,
  .bill-create-panel,
  .pmt-create-panel,
  .exp-create-panel,
  .coa-create-panel,
  .item-create-panel,
  .pmade-create-panel,
  .vc-create-panel,
  .re-create-panel,
  .po-create-panel,
  .recurring-bill-create-panel
).open {
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(31, 99, 216, 0.025), transparent 150px),
    var(--pro-surface);
  box-shadow: var(--pro-shadow-lg);
}

body.bb-app-active :is(
  .quote-form-title,
  .customer-form-title,
  .bill-form-header,
  .pmt-form-header,
  .exp-form-title,
  .coa-form-title,
  .item-modal-header,
  .pmade-form-title,
  .po-form-title,
  .rb-form-title,
  .re-form-title
) {
  min-height: 72px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--pro-line);
  background:
    linear-gradient(180deg, var(--pro-surface) 0%, var(--pro-surface-soft) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.bb-app-active :is(
  .quote-form-title,
  .customer-form-title,
  .bill-form-title-row,
  .pmt-form-header,
  .exp-form-title,
  .coa-form-title,
  .item-modal-header,
  .pmade-form-title,
  .po-form-title,
  .rb-form-title,
  .re-form-title
) h3 {
  margin: 0;
  color: var(--pro-ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

body.bb-app-active :is(
  .customer-form-subtitle,
  .pmt-form-title-text > span,
  .section-header p,
  .item-section-hd-note
) {
  color: var(--pro-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

body.bb-app-active :is(
  .quote-title-icon,
  .retainer-title-icon,
  .so-title-icon,
  .inv-title-icon,
  .sr-title-icon,
  .cn-title-icon,
  .customer-title-icon,
  .bill-title-icon,
  .pmt-title-icon,
  .exp-title-icon,
  .coa-title-icon,
  .item-title-icon,
  .pmade-title-icon,
  .po-title-icon,
  .rb-title-icon,
  .vc-title-icon
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(31, 99, 216, 0.15);
  border-radius: 12px;
  background: var(--pro-blue-soft);
  color: var(--pro-blue);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.6);
}

body.bb-app-active :is(
  .quote-close-button,
  .retainer-close-button,
  .so-close-button,
  .inv-close-button,
  .invoice-close-button,
  .sr-close-button,
  .cn-close-button,
  .customer-close-button,
  .bill-close-button,
  .exp-close-button,
  .coa-close-button,
  .item-modal-close,
  .pmade-close-button,
  .po-close-button,
  .rb-close-button
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--pro-muted);
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

body.bb-app-active :is(
  .quote-close-button,
  .retainer-close-button,
  .so-close-button,
  .inv-close-button,
  .invoice-close-button,
  .sr-close-button,
  .cn-close-button,
  .customer-close-button,
  .bill-close-button,
  .exp-close-button,
  .coa-close-button,
  .item-modal-close,
  .pmade-close-button,
  .po-close-button,
  .rb-close-button
):hover {
  border-color: var(--pro-line);
  background: var(--pro-surface);
  color: var(--pro-ink);
  transform: translateY(-1px);
}

body.bb-app-active :is(
  .quote-form-body,
  .customer-form-body,
  .bill-form-body,
  .pmt-form-body,
  .exp-form-body,
  .coa-form-body,
  .item-modal-body,
  .pmade-form-body,
  .rb-form-body
) {
  color: var(--pro-ink-soft);
  background: var(--pro-surface);
}

body.bb-app-active :is(
  .quote-band,
  .quote-details-grid,
  .quote-item-table,
  .quote-notes-grid,
  .quote-terms-grid,
  .customer-main-fields,
  .customer-tab-panel,
  .bill-form-section,
  .bill-details-grid,
  .bill-item-section,
  .bill-bottom-section,
  .pmt-top-fields,
  .pmt-amount-section,
  .pmt-details-section,
  .pmt-invoices-section,
  .exp-form-fields,
  .exp-receipt-card,
  .item-modal-section,
  .pmade-bills-section,
  .pmade-summary-notes,
  .rb-details-section,
  .rb-notes-section,
  .rb-totals-section,
  .recurring-bill-item-section,
  .vc-details-section,
  .vc-item-section,
  .vc-bottom-section
) {
  border: 1px solid var(--pro-line);
  border-radius: 15px;
  background: var(--pro-surface-soft);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active .customer-main-fields,
body.bb-app-active .exp-form-fields {
  padding: 20px;
}

body.bb-app-active .customer-tab-panel {
  padding: 18px 20px;
}

body.bb-app-active .exp-receipt-card {
  padding: 18px;
  align-self: stretch;
}

body.bb-app-active :is(
  .exp-receipt-dropzone,
  .item-image-drop,
  .quote-upload-block,
  .customer-upload-button > span
) {
  border: 1px dashed var(--pro-line-strong);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(31, 99, 216, 0.035), transparent 58%),
    var(--pro-surface);
  color: var(--pro-muted);
}

body.bb-app-active :is(
  .customer-tab-strip,
  .item-type-tabs,
  .pmt-tabs,
  .po-tabs
) {
  border-color: var(--pro-line);
  background: var(--pro-surface-soft);
}

body.bb-app-active :is(
  .quote-create-panel,
  .customer-create-panel,
  .bill-create-panel,
  .pmt-create-panel,
  .exp-create-panel,
  .coa-create-panel,
  .item-create-panel,
  .pmade-create-panel,
  .vc-create-panel,
  .re-create-panel,
  .po-create-panel,
  .recurring-bill-create-panel,
  .je-form-card,
  .fa-form-panel,
  .pr-form-panel,
  .tr-form-panel,
  .proj-form-wrap,
  .budget-form-card,
  .custom-record-form-panel,
  .bk-forms-section,
  .bk-txn-side-panel,
  .modal-card
) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  select,
  textarea
) {
  min-height: 44px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-ink);
  box-shadow: inset 0 1px 2px rgba(15, 35, 66, 0.025);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

body.bb-app-active :is(
  .quote-create-panel,
  .customer-create-panel,
  .bill-create-panel,
  .pmt-create-panel,
  .exp-create-panel,
  .coa-create-panel,
  .item-create-panel,
  .pmade-create-panel,
  .vc-create-panel,
  .re-create-panel,
  .po-create-panel,
  .recurring-bill-create-panel,
  .je-form-card,
  .fa-form-panel,
  .pr-form-panel,
  .tr-form-panel,
  .proj-form-wrap,
  .budget-form-card,
  .custom-record-form-panel,
  .bk-forms-section,
  .bk-txn-side-panel,
  .modal-card
) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  select,
  textarea
):hover {
  border-color: #aebed2;
}

body.bb-app-active :is(
  .quote-create-panel,
  .customer-create-panel,
  .bill-create-panel,
  .pmt-create-panel,
  .exp-create-panel,
  .coa-create-panel,
  .item-create-panel,
  .pmade-create-panel,
  .vc-create-panel,
  .re-create-panel,
  .po-create-panel,
  .recurring-bill-create-panel,
  .je-form-card,
  .fa-form-panel,
  .pr-form-panel,
  .tr-form-panel,
  .proj-form-wrap,
  .budget-form-card,
  .custom-record-form-panel,
  .bk-forms-section,
  .bk-txn-side-panel,
  .modal-card
) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  select,
  textarea
):focus {
  outline: none;
  border-color: #4d83d8;
  background: var(--pro-surface);
  box-shadow: 0 0 0 3px rgba(31, 99, 216, 0.12);
}

body.bb-app-active :is(
  .quote-create-panel,
  .customer-create-panel,
  .bill-create-panel,
  .pmt-create-panel,
  .exp-create-panel,
  .coa-create-panel,
  .item-create-panel,
  .pmade-create-panel,
  .vc-create-panel,
  .re-create-panel,
  .po-create-panel,
  .recurring-bill-create-panel,
  .je-form-card,
  .fa-form-panel,
  .pr-form-panel,
  .tr-form-panel,
  .proj-form-wrap,
  .budget-form-card,
  .custom-record-form-panel,
  .bk-forms-section,
  .bk-txn-side-panel,
  .modal-card
) :is(
  .field > label,
  .quote-form-line > label,
  .customer-form-line > label,
  .customer-line-label,
  .bill-label,
  .pmt-form-line > label,
  .exp-form-line > label,
  .item-field-line > label,
  .item-line-label,
  .pmade-field-row > label,
  .rb-field-row > label,
  .coa-field-row > label,
  .je-label,
  .fa-form-field > label,
  .pr-form-field > label,
  .stg-field > label
) {
  color: var(--pro-ink-soft);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

body.bb-app-active :is(
  .je-form-card,
  .fa-form-panel,
  .pr-form-panel,
  .tr-form-panel,
  .proj-form-wrap,
  .budget-form-card,
  .custom-record-form-panel
) {
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--pro-line);
  border-radius: 18px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active .bk-forms-section.open > .split-layout > .panel,
body.bb-app-active .bk-txn-side-panel,
body.bb-app-active .modal-card {
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 18px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-md);
}

body.bb-app-active :is(
  .je-form-topbar,
  .fa-form-topbar,
  .section-header,
  .modal-header,
  .item-section-hd
) {
  border-color: var(--pro-line);
}

body.bb-app-active :is(
  .je-form-heading,
  .fa-form-topbar h3,
  .section-header h3,
  .modal-header h3,
  .proj-section-title,
  .item-section-hd-title
) {
  color: var(--pro-ink);
  font-weight: 800;
  letter-spacing: -0.025em;
}

body.bb-app-active :is(
  .je-lines-section,
  .tr-items-section,
  .pmt-invoices-section,
  .pmade-bills-section,
  .rb-details-section,
  .recurring-bill-item-section,
  .vc-item-section
) {
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 14px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active :is(
  .je-lines-table,
  .pmade-bills-table,
  .recurring-bill-item-table
) thead th {
  min-height: 42px;
  border-bottom-color: var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

body.bb-app-active :is(
  .quote-form-actions,
  .customer-form-actions,
  .bill-form-actions,
  .pmt-form-actions,
  .exp-form-actions,
  .pmade-form-actions,
  .po-form-actions,
  .rb-form-actions,
  .coa-form-actions,
  .item-modal-actions,
  .fa-form-actions,
  .je-form-footer,
  .stg-form-actions,
  .modal-footer
) {
  gap: 10px;
  min-height: 68px;
  padding: 13px 24px;
  border-top: 1px solid var(--pro-line);
  background: rgba(247, 249, 252, 0.96);
  box-shadow: 0 -8px 24px rgba(15, 35, 66, 0.045);
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] body.bb-app-active :is(
  .quote-form-actions,
  .customer-form-actions,
  .bill-form-actions,
  .pmt-form-actions,
  .exp-form-actions,
  .pmade-form-actions,
  .po-form-actions,
  .rb-form-actions,
  .coa-form-actions,
  .item-modal-actions,
  .fa-form-actions,
  .je-form-footer,
  .stg-form-actions,
  .modal-footer
) {
  background: rgba(16, 26, 40, 0.96);
}

html[data-theme="dark"] body.bb-app-active :is(
  .quote-form-actions,
  .customer-form-actions,
  .bill-form-actions,
  .pmt-form-actions,
  .exp-form-actions,
  .pmade-form-actions,
  .po-form-actions,
  .rb-form-actions,
  .coa-form-actions,
  .item-modal-actions,
  .fa-form-actions,
  .je-form-footer,
  .stg-form-actions,
  .modal-footer
) .ghost-button {
  border-color: var(--pro-line-strong) !important;
  background: var(--pro-surface-soft) !important;
  color: var(--pro-ink-soft) !important;
}

body.bb-app-active :is(
  .quote-form-actions,
  .customer-form-actions,
  .bill-form-actions,
  .pmt-form-actions,
  .exp-form-actions,
  .pmade-form-actions,
  .po-form-actions,
  .rb-form-actions,
  .coa-form-actions,
  .item-modal-actions,
  .fa-form-actions,
  .je-form-footer,
  .stg-form-actions,
  .modal-footer
) :is(.primary-button, .ghost-button, button) {
  min-height: 42px;
  border-radius: 10px;
  font-weight: 750;
}

html[data-theme="dark"] body.bb-app-active :is(
  .quote-create-panel,
  .customer-create-panel,
  .bill-create-panel,
  .pmt-create-panel,
  .exp-create-panel,
  .coa-create-panel,
  .item-create-panel,
  .pmade-create-panel,
  .vc-create-panel,
  .re-create-panel,
  .po-create-panel,
  .recurring-bill-create-panel
).open,
html[data-theme="dark"] body.bb-app-active :is(
  .quote-form-title,
  .customer-form-title,
  .bill-form-header,
  .pmt-form-header,
  .exp-form-title,
  .coa-form-title,
  .item-modal-header,
  .pmade-form-title,
  .po-form-title,
  .rb-form-title,
  .re-form-title,
  .quote-form-body,
  .customer-form-body,
  .bill-form-body,
  .pmt-form-body,
  .exp-form-body,
  .coa-form-body,
  .item-modal-body,
  .pmade-form-body,
  .rb-form-body
) {
  border-color: var(--pro-line);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
}

@media (max-width: 768px) {
  body.bb-app-active:has(
    .quote-create-panel.open,
    .customer-create-panel.open,
    .bill-create-panel.open,
    .pmt-create-panel.open,
    .exp-create-panel.open,
    .coa-create-panel.open,
    .item-create-panel.open,
    .pmade-create-panel.open,
    .vc-create-panel.open,
    .re-create-panel.open,
    .po-create-panel.open,
    .recurring-bill-create-panel.open
  ) :is(.mobile-bottom-nav, .ai-chat-fab, .scroll-to-top) {
    display: none !important;
  }

  body.bb-app-active :is(
    .quote-create-panel,
    .customer-create-panel,
    .bill-create-panel,
    .pmt-create-panel,
    .exp-create-panel,
    .coa-create-panel,
    .item-create-panel,
    .pmade-create-panel,
    .vc-create-panel,
    .re-create-panel,
    .po-create-panel,
    .recurring-bill-create-panel
  ).open {
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--pro-canvas) !important;
    box-shadow: none !important;
  }

  body.bb-app-active :is(
    .quote-form-title,
    .customer-form-title,
    .bill-form-header,
    .pmt-form-header,
    .exp-form-title,
    .coa-form-title,
    .item-modal-header,
    .pmade-form-title,
    .po-form-title,
    .rb-form-title,
    .re-form-title
  ) {
    position: sticky !important;
    top: 0 !important;
    z-index: 40 !important;
    min-height: 64px !important;
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--pro-line) !important;
    background: color-mix(in srgb, var(--pro-surface) 96%, transparent) !important;
    box-shadow: 0 8px 24px rgba(15, 35, 66, 0.08) !important;
    backdrop-filter: blur(16px) !important;
  }

  body.bb-app-active :is(
    .quote-form-title,
    .customer-form-title,
    .bill-form-title-row,
    .pmt-form-header,
    .exp-form-title,
    .coa-form-title,
    .item-modal-header,
    .pmade-form-title,
    .po-form-title,
    .rb-form-title,
    .re-form-title
  ) h3 {
    font-size: 18px !important;
    letter-spacing: -0.025em !important;
  }

  body.bb-app-active :is(
    .quote-title-icon,
    .retainer-title-icon,
    .so-title-icon,
    .inv-title-icon,
    .sr-title-icon,
    .cn-title-icon,
    .customer-title-icon,
    .bill-title-icon,
    .pmt-title-icon,
    .exp-title-icon,
    .coa-title-icon,
    .item-title-icon,
    .pmade-title-icon,
    .po-title-icon,
    .rb-title-icon,
    .vc-title-icon
  ) {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    border-radius: 11px !important;
  }

  body.bb-app-active :is(
    .quote-form-body,
    .customer-form-body,
    .bill-form-body,
    .pmt-form-body,
    .exp-form-body,
    .coa-form-body,
    .item-modal-body,
    .pmade-form-body,
    .rb-form-body
  ) {
    width: min(calc(100vw - 20px), 460px) !important;
    max-width: min(calc(100vw - 20px), 460px) !important;
    margin-inline: auto !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
    background: transparent !important;
  }

  body.bb-app-active :is(
    .quote-band,
    .quote-details-grid,
    .quote-item-table,
    .quote-notes-grid,
    .quote-terms-grid,
    .customer-main-fields,
    .customer-tab-panel,
    .bill-form-section,
    .bill-details-grid,
    .bill-item-section,
    .bill-bottom-section,
    .pmt-top-fields,
    .pmt-amount-section,
    .pmt-details-section,
    .pmt-invoices-section,
    .exp-form-fields,
    .exp-receipt-card,
    .item-modal-section,
    .pmade-bills-section,
    .pmade-summary-notes,
    .rb-details-section,
    .rb-notes-section,
    .rb-totals-section,
    .recurring-bill-item-section,
    .vc-details-section,
    .vc-item-section,
    .vc-bottom-section
  ) {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding: 14px !important;
    border: 1px solid var(--pro-line) !important;
    border-radius: 16px !important;
    background: var(--pro-surface) !important;
    box-shadow: var(--pro-shadow-sm) !important;
  }

  body.bb-app-active :is(
    .quote-create-panel,
    .customer-create-panel,
    .bill-create-panel,
    .pmt-create-panel,
    .exp-create-panel,
    .coa-create-panel,
    .item-create-panel,
    .pmade-create-panel,
    .vc-create-panel,
    .re-create-panel,
    .po-create-panel,
    .recurring-bill-create-panel,
    .je-form-card,
    .fa-form-panel,
    .pr-form-panel,
    .tr-form-panel,
    .proj-form-wrap,
    .budget-form-card,
    .custom-record-form-panel,
    .bk-forms-section,
    .bk-txn-side-panel,
    .modal-card
  ) :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
    select,
    textarea
  ) {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    border: 1px solid var(--pro-line-strong) !important;
    border-radius: 12px !important;
    background: var(--pro-surface) !important;
    color: var(--pro-ink) !important;
    font-size: 16px !important;
  }

  body.bb-app-active :is(
    .je-form-card,
    .fa-form-panel,
    .pr-form-panel,
    .tr-form-panel,
    .proj-form-wrap,
    .budget-form-card,
    .custom-record-form-panel,
    .bk-forms-section.open > .split-layout > .panel,
    .bk-txn-side-panel,
    .modal-card
  ) {
    padding: 16px !important;
    border-color: var(--pro-line) !important;
    border-radius: 16px !important;
    background: var(--pro-surface) !important;
    box-shadow: var(--pro-shadow-sm) !important;
  }

  body.bb-app-active :is(
    .je-header-grid,
    .fa-form-grid,
    .pr-form-grid,
    .tr-form-grid,
    .form-row-2col,
    .field-row
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.bb-app-active :is(
    .quote-form-actions,
    .customer-form-actions,
    .bill-form-actions,
    .pmt-form-actions,
    .exp-form-actions,
    .pmade-form-actions,
    .po-form-actions,
    .rb-form-actions,
    .coa-form-actions,
    .item-modal-actions,
    .fa-form-actions,
    .je-form-footer,
    .stg-form-actions,
    .modal-footer
  ) {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 50 !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--pro-line) !important;
    background: color-mix(in srgb, var(--pro-surface) 96%, transparent) !important;
    box-shadow: 0 -10px 30px rgba(15, 35, 66, 0.1) !important;
    backdrop-filter: blur(16px) !important;
  }

  body.bb-app-active :is(
    .quote-form-actions,
    .customer-form-actions,
    .bill-form-actions,
    .pmt-form-actions,
    .exp-form-actions,
    .pmade-form-actions,
    .po-form-actions,
    .rb-form-actions,
    .coa-form-actions,
    .item-modal-actions,
    .fa-form-actions,
    .je-form-footer,
    .stg-form-actions,
    .modal-footer
  ) :is(.primary-button, .ghost-button, button) {
    min-height: 48px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
  }
}

/* Desktop scrolling -------------------------------------------------------
   Browser tabs use the document as the single vertical scroll owner. The
   installed desktop shell keeps its fixed viewport and scrolls the workspace.
   Keeping those modes explicit prevents wheel input from being trapped by an
   accidental nested overflow container. */
@media (min-width: 769px) {
  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
  }

  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active .app-shell {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html:not(.native-app-mode):not(.pwa-mode) body.bb-app-active .workspace {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
  }

  html.native-app-mode body.bb-app-active .workspace,
  html.pwa-mode body.bb-app-active .workspace {
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    scrollbar-gutter: stable;
  }
}

/* Analyze dashboard --------------------------------------------------------
   Visual analytics inside Reports: stat tiles, range chips, and chart cards.
   Colors ride the app's theme tokens so dark mode needs no extra work. */
body.bb-app-active .anz-header {
  align-items: flex-start;
}

body.bb-app-active .anz-range-field {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

body.bb-app-active .anz-range-field span {
  color: var(--ink3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.bb-app-active .anz-range-field select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

body.bb-app-active .anz-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

body.bb-app-active .anz-tile {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-top: 3px solid var(--line);
}

body.bb-app-active .anz-tile--revenue { border-top-color: #2a78d6; }
body.bb-app-active .anz-tile--expense { border-top-color: #eb6834; }
body.bb-app-active .anz-tile--profit  { border-top-color: #0ca30c; }
body.bb-app-active .anz-tile--loss    { border-top-color: #d03b3b; }
body.bb-app-active .anz-tile--margin  { border-top-color: #4a3aa7; }

body.bb-app-active .anz-tile-label {
  color: var(--ink3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body.bb-app-active .anz-tile-value {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.bb-app-active .anz-delta {
  font-size: 12px;
  font-weight: 700;
}

body.bb-app-active .anz-delta small {
  color: var(--ink3);
  font-weight: 600;
}

body.bb-app-active .anz-delta--good { color: #0a7d0a; }
body.bb-app-active .anz-delta--bad  { color: #c43a3a; }

body.bb-app-active .anz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.bb-app-active .anz-card {
  padding: 16px 18px 12px;
  min-width: 0;
}

body.bb-app-active .anz-card-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

body.bb-app-active .anz-card-title span {
  margin-left: 6px;
  color: var(--ink3);
  font-size: 11px;
  font-weight: 600;
}

body.bb-app-active .anz-chart-wrap {
  position: relative;
  height: 240px;
}

body.bb-app-active .anz-table {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

body.bb-app-active .anz-table summary {
  color: var(--ink3);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

body.bb-app-active .anz-table table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 12px;
}

body.bb-app-active .anz-table th,
body.bb-app-active .anz-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

body.bb-app-active .anz-table th {
  color: var(--ink3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.bb-app-active .anz-table td:last-child,
body.bb-app-active .anz-table th:last-child {
  text-align: right;
}

body.bb-app-active .anz-empty-note {
  color: var(--ink3);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

body.bb-app-active .anz-empty-state {
  padding: 44px 24px;
  text-align: center;
}

body.bb-app-active .anz-empty-state h4 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

body.bb-app-active .anz-empty-state p {
  margin: 0 auto;
  max-width: 440px;
  color: var(--ink3);
  font-size: 13px;
}

@media (max-width: 900px) {
  body.bb-app-active .anz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.bb-app-active .anz-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  body.bb-app-active .anz-tiles { grid-template-columns: 1fr; }
}

body.bb-app-active .anz-range-controls {
  display: grid;
  gap: 8px;
  justify-items: end;
}

body.bb-app-active .anz-custom-range {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body.bb-app-active .anz-custom-range label {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.bb-app-active .anz-custom-range label span {
  color: var(--ink3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.bb-app-active .anz-custom-range input[type="date"] {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

body.bb-app-active .anz-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

body.bb-app-active .anz-card-head .anz-card-title {
  margin: 0;
}

body.bb-app-active .anz-viz-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body.bb-app-active .anz-viz-field span {
  color: var(--ink3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.bb-app-active .anz-viz-field select {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

body.bb-app-active .anz-table--full {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
  max-height: 300px;
  overflow-y: auto;
}

/* Platform owner console --------------------------------------------------
   This dense operational surface needs stronger hierarchy than standard
   record lists. Everything remains scoped to #admin. */
body.bb-app-active:has(#admin.active) .topbar {
  border-color: color-mix(in srgb, var(--pro-blue) 14%, var(--pro-line)) !important;
  background: color-mix(in srgb, var(--pro-surface) 98%, transparent) !important;
  box-shadow: 0 12px 32px rgba(15, 35, 66, 0.09) !important;
}

body.bb-app-active #admin .admin-page {
  gap: 20px;
}

body.bb-app-active #admin .admin-hero {
  position: relative;
  isolation: isolate;
  min-height: 146px;
  padding: 26px 28px !important;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pro-blue) 18%, var(--pro-line)) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 88% -30%, color-mix(in srgb, var(--pro-blue) 17%, transparent), transparent 18rem),
    linear-gradient(135deg, color-mix(in srgb, var(--pro-blue) 7%, var(--pro-surface)) 0%, var(--pro-surface) 62%) !important;
  box-shadow: var(--pro-shadow-md) !important;
}

body.bb-app-active #admin .admin-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -34px -58px auto;
  width: 190px;
  aspect-ratio: 1;
  border: 34px solid color-mix(in srgb, var(--pro-blue) 7%, transparent);
  border-radius: 50%;
}

body.bb-app-active #admin .admin-hero .eyebrow {
  margin: 0 0 7px;
  color: var(--pro-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

body.bb-app-active #admin .admin-hero h3 {
  margin: 0 0 9px;
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

body.bb-app-active #admin .admin-hero p:not(.eyebrow) {
  max-width: 820px;
  color: var(--pro-muted);
  font-size: 13px;
  line-height: 1.65;
}

body.bb-app-active #admin .admin-hero .primary-button {
  min-width: 142px;
  min-height: 43px;
  border-radius: 11px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--pro-blue) 22%, transparent);
}

body.bb-app-active #admin .admin-setup-panel {
  padding: 22px 24px !important;
  border-radius: 18px !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-sm) !important;
}

body.bb-app-active #admin .admin-setup-header {
  align-items: center;
  margin-bottom: 18px;
}

body.bb-app-active #admin .admin-setup-header h4 {
  margin-bottom: 5px;
  color: var(--pro-ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

body.bb-app-active #admin .admin-setup-header p {
  color: var(--pro-muted);
  line-height: 1.5;
}

body.bb-app-active #admin .admin-setup-header > div:last-child {
  gap: 9px !important;
}

body.bb-app-active #admin .admin-setup-header .ghost-button {
  min-height: 37px;
  padding-inline: 13px;
  border-color: var(--pro-line-strong);
  border-radius: 10px;
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active #admin .admin-setup-header .ghost-button:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 45%, var(--pro-line));
  background: var(--pro-blue-soft);
  color: var(--pro-blue-strong);
}

body.bb-app-active #admin .admin-setup-checks {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.bb-app-active #admin .admin-setup-check {
  min-height: 48px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--pro-surface-soft);
}

body.bb-app-active #admin .admin-setup-check.is-ok {
  border-color: color-mix(in srgb, var(--pro-green) 24%, var(--pro-line));
  background: color-mix(in srgb, var(--pro-green) 7%, var(--pro-surface));
}

body.bb-app-active #admin .admin-setup-check.is-missing {
  border-color: color-mix(in srgb, var(--pro-red) 28%, var(--pro-line));
  background: color-mix(in srgb, var(--pro-red) 7%, var(--pro-surface));
}

body.bb-app-active #admin .admin-setup-check .asc-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  font-size: 13px;
}

body.bb-app-active #admin .admin-setup-check strong {
  overflow-wrap: anywhere;
  color: var(--pro-ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}

body.bb-app-active #admin .admin-summary-grid {
  gap: 12px;
}

body.bb-app-active #admin .admin-summary-card {
  position: relative;
  min-height: 118px;
  padding: 18px 20px 17px;
  overflow: hidden;
  border: 1px solid var(--pro-line);
  border-radius: 16px;
  background: var(--pro-surface);
  box-shadow: var(--pro-shadow-sm);
}

body.bb-app-active #admin .admin-summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--pro-blue);
}

body.bb-app-active #admin .admin-summary-card:nth-child(2)::before {
  background: var(--pro-green);
}

body.bb-app-active #admin .admin-summary-card:nth-child(3)::before {
  background: #6f5bd3;
}

body.bb-app-active #admin .admin-summary-card:nth-child(4)::before {
  background: var(--pro-amber);
}

body.bb-app-active #admin .admin-summary-card:nth-child(5)::before {
  background: #1687a7;
}

body.bb-app-active #admin .admin-summary-card--good,
body.bb-app-active #admin .admin-summary-card--warn {
  background: var(--pro-surface);
}

body.bb-app-active #admin .admin-summary-card span {
  color: var(--pro-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body.bb-app-active #admin .admin-summary-card strong {
  margin: 10px 0 6px;
  color: var(--pro-ink);
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

body.bb-app-active #admin .admin-summary-card small {
  color: var(--pro-muted);
  font-size: 11px;
  line-height: 1.4;
}

body.bb-app-active #admin .admin-panel {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--pro-line) !important;
  border-radius: 18px !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-md) !important;
}

body.bb-app-active #admin .admin-toolbar {
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 16px;
  padding: 18px 20px;
  border-bottom-color: var(--pro-line);
  background: color-mix(in srgb, var(--pro-surface-soft) 72%, var(--pro-surface));
}

body.bb-app-active #admin .admin-search {
  position: relative;
}

body.bb-app-active #admin .admin-search::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 15px;
  height: 15px;
  border: 1.8px solid var(--pro-muted);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-58%);
}

body.bb-app-active #admin .admin-search::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(50% + 5px);
  left: 28px;
  width: 6px;
  height: 1.8px;
  border-radius: 2px;
  background: var(--pro-muted);
  pointer-events: none;
  transform: rotate(45deg);
  transform-origin: left center;
}

body.bb-app-active #admin .admin-search input {
  min-height: 45px;
  padding: 0 16px 0 43px;
  border: 1px solid var(--pro-line-strong);
  border-radius: 11px;
  background: var(--pro-surface);
  color: var(--pro-ink);
  font-size: 13px;
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active #admin .admin-search input::placeholder {
  color: var(--pro-muted-soft);
}

body.bb-app-active #admin .admin-search input:focus {
  border-color: color-mix(in srgb, var(--pro-blue) 62%, var(--pro-line));
  outline: 3px solid color-mix(in srgb, var(--pro-blue) 12%, transparent);
}

body.bb-app-active #admin .admin-status-tabs {
  gap: 7px;
}

body.bb-app-active #admin .admin-status-tabs button {
  min-height: 37px;
  padding-inline: 12px;
  border-color: var(--pro-line);
  border-radius: 999px;
  background: var(--pro-surface);
  color: var(--pro-muted);
  font-size: 11px;
  font-weight: 750;
  box-shadow: var(--pro-shadow-xs);
}

body.bb-app-active #admin .admin-status-tabs button:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 35%, var(--pro-line));
  color: var(--pro-blue-strong);
}

body.bb-app-active #admin .admin-status-tabs button.active {
  border-color: var(--pro-blue);
  background: var(--pro-blue);
  color: #fff;
  box-shadow: 0 5px 13px color-mix(in srgb, var(--pro-blue) 24%, transparent);
}

body.bb-app-active #admin .admin-table-shell {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: var(--pro-surface);
  box-shadow: none;
}

body.bb-app-active #admin .admin-table-shell table {
  width: 100%;
  min-width: 1380px;
  table-layout: fixed;
}

body.bb-app-active #admin .admin-table-shell th:nth-child(1),
body.bb-app-active #admin .admin-table-shell td:nth-child(1) { width: 19%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(2),
body.bb-app-active #admin .admin-table-shell td:nth-child(2) { width: 7%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(3),
body.bb-app-active #admin .admin-table-shell td:nth-child(3) { width: 8.5%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(4),
body.bb-app-active #admin .admin-table-shell td:nth-child(4) { width: 9.5%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(5),
body.bb-app-active #admin .admin-table-shell td:nth-child(5) { width: 6%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(6),
body.bb-app-active #admin .admin-table-shell td:nth-child(6) { width: 5%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(7),
body.bb-app-active #admin .admin-table-shell td:nth-child(7) { width: 10%; }
body.bb-app-active #admin .admin-table-shell th:nth-child(8),
body.bb-app-active #admin .admin-table-shell td:nth-child(8) { width: 35%; }

body.bb-app-active #admin .admin-table-shell thead th {
  height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid var(--pro-line);
  background: var(--pro-surface-soft);
  color: var(--pro-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

body.bb-app-active #admin .admin-table-shell tbody td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--pro-line);
  color: var(--pro-ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

body.bb-app-active #admin .admin-table-shell tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--pro-surface-soft) 52%, transparent);
}

body.bb-app-active #admin .admin-table-shell tbody tr:hover {
  background: color-mix(in srgb, var(--pro-blue) 5%, var(--pro-surface));
}

body.bb-app-active #admin .admin-table-shell td:first-child strong {
  overflow-wrap: anywhere;
  color: var(--pro-ink);
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -0.012em;
}

body.bb-app-active #admin .admin-table-shell td small {
  margin-top: 5px;
  color: var(--pro-muted);
  font-size: 10.5px;
}

body.bb-app-active #admin .admin-table-shell .status-pill {
  min-height: 23px;
  padding: 4px 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

body.bb-app-active #admin .admin-team {
  gap: 4px;
  padding: 6px 9px;
  border: 1px solid var(--pro-line);
  border-radius: 9px;
  background: var(--pro-surface-soft);
}

body.bb-app-active #admin .admin-team strong {
  color: var(--pro-ink);
  font-size: 13px;
}

body.bb-app-active #admin .admin-actions {
  display: grid;
  grid-template-columns: max-content minmax(224px, 1fr) max-content;
  align-items: end;
  gap: 10px 12px;
}

body.bb-app-active #admin .admin-actions .aa-field {
  gap: 6px;
}

body.bb-app-active #admin .admin-actions .aa-field:nth-child(4) {
  grid-column: 1 / 3;
}

body.bb-app-active #admin .admin-actions .aa-field:nth-child(5) {
  grid-column: 3;
}

body.bb-app-active #admin .aa-label {
  color: var(--pro-muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 1;
}

body.bb-app-active #admin .aa-control {
  min-width: 0;
}

body.bb-app-active #admin .aa-control--gap {
  gap: 6px;
}

body.bb-app-active #admin .aa-num,
body.bb-app-active #admin .aa-select {
  height: 34px;
  border-color: var(--pro-line-strong);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
  font-size: 11px;
}

body.bb-app-active #admin .aa-num {
  width: 50px;
  border-radius: 9px 0 0 9px;
}

body.bb-app-active #admin .aa-num--wide {
  width: 56px;
}

body.bb-app-active #admin .aa-select {
  min-width: 72px;
  border-radius: 0 9px 9px 0;
}

body.bb-app-active #admin .aa-num:focus,
body.bb-app-active #admin .aa-select:focus {
  border-color: var(--pro-blue);
  outline: 2px solid color-mix(in srgb, var(--pro-blue) 14%, transparent);
}

body.bb-app-active #admin .aa-seg {
  width: 100%;
  min-width: 224px;
  border-color: var(--pro-line-strong);
  border-radius: 9px;
  background: var(--pro-surface);
}

body.bb-app-active #admin .admin-actions .table-action {
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
}

body.bb-app-active #admin .admin-actions .aa-seg-btn {
  flex: 1 1 auto;
  padding-inline: 8px;
  border-radius: 0;
}

body.bb-app-active #admin .admin-actions .aa-seg-btn.is-current {
  background: var(--pro-blue);
  color: #fff;
}

body.bb-app-active #admin .admin-actions .aa-btn--quiet {
  border-color: var(--pro-line-strong);
  background: var(--pro-surface);
  color: var(--pro-ink-soft);
}

body.bb-app-active #admin .admin-actions .aa-btn--quiet:hover {
  border-color: color-mix(in srgb, var(--pro-blue) 40%, var(--pro-line));
  background: var(--pro-blue-soft);
  color: var(--pro-blue-strong);
}

body.bb-app-active #admin .admin-actions .aa-btn--danger {
  border-color: color-mix(in srgb, var(--pro-red) 45%, var(--pro-line));
  background: color-mix(in srgb, var(--pro-red) 5%, var(--pro-surface));
  color: var(--pro-red);
}

body.bb-app-active #admin .admin-actions .table-action.admin-owner-action {
  border-color: color-mix(in srgb, #7c3aed 50%, var(--pro-line));
  background: color-mix(in srgb, #7c3aed 5%, var(--pro-surface));
  color: #7c3aed;
}

body.bb-app-active #admin .admin-loading,
body.bb-app-active #admin .admin-error {
  margin: 14px 20px 0;
  border-radius: 11px;
}

@media (max-width: 1400px) {
  body.bb-app-active #admin .admin-setup-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.bb-app-active #admin .admin-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.bb-app-active #admin .admin-toolbar {
    grid-template-columns: 1fr;
  }

  body.bb-app-active #admin .admin-status-tabs {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  body.bb-app-active #admin .admin-page {
    gap: 14px;
  }

  body.bb-app-active #admin .admin-hero {
    min-height: 0;
    align-items: stretch;
    padding: 20px 18px !important;
    border-radius: 15px !important;
  }

  body.bb-app-active #admin .admin-hero .primary-button {
    width: 100%;
  }

  body.bb-app-active #admin .admin-setup-panel {
    padding: 18px 16px !important;
    border-radius: 15px !important;
  }

  body.bb-app-active #admin .admin-setup-header {
    align-items: stretch;
  }

  body.bb-app-active #admin .admin-setup-header > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  body.bb-app-active #admin .admin-setup-header .ghost-button {
    min-width: 0;
    padding-inline: 9px;
    white-space: normal;
  }

  body.bb-app-active #admin .admin-setup-checks {
    grid-template-columns: 1fr;
  }

  body.bb-app-active #admin .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  body.bb-app-active #admin .admin-summary-card {
    min-height: 108px;
    padding: 16px 14px 14px 17px;
    border-radius: 13px;
  }

  body.bb-app-active #admin .admin-summary-card:nth-child(5) {
    grid-column: 1 / -1;
  }

  body.bb-app-active #admin .admin-summary-card strong {
    font-size: 26px;
  }

  body.bb-app-active #admin .admin-panel {
    border-radius: 15px !important;
  }

  body.bb-app-active #admin .admin-toolbar {
    gap: 13px;
    padding: 14px;
  }

  body.bb-app-active #admin .admin-status-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.bb-app-active #admin .admin-status-tabs::-webkit-scrollbar {
    display: none;
  }

  body.bb-app-active #admin .admin-status-tabs button {
    flex: 0 0 auto;
  }

  body.bb-app-active #admin .admin-table-shell {
    padding: 12px;
    overflow: visible;
    background: var(--pro-surface-soft);
  }

  body.bb-app-active #admin .admin-table-shell table,
  body.bb-app-active #admin .admin-table-shell tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body.bb-app-active #admin .admin-table-shell thead {
    display: none;
  }

  body.bb-app-active #admin .admin-table-shell tbody {
    display: grid;
    gap: 12px;
  }

  body.bb-app-active #admin .admin-table-shell tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--pro-line);
    border-radius: 14px;
    background: var(--pro-surface);
    box-shadow: var(--pro-shadow-sm);
  }

  body.bb-app-active #admin .admin-table-shell tbody tr:nth-child(even),
  body.bb-app-active #admin .admin-table-shell tbody tr:hover {
    background: var(--pro-surface);
  }

  body.bb-app-active #admin .admin-table-shell tbody td {
    display: block;
    width: auto !important;
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid var(--pro-line);
  }

  body.bb-app-active #admin .admin-table-shell tbody td::before {
    content: "";
    display: block;
    margin-bottom: 5px;
    color: var(--pro-muted);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(1),
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(8) {
    grid-column: 1 / -1;
  }

  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(1) {
    padding-block: 15px;
    background: color-mix(in srgb, var(--pro-blue) 5%, var(--pro-surface));
  }

  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(2)::before { content: "Provider"; }
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(3)::before { content: "Subscription"; }
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(4)::before { content: "Access until"; }
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(5)::before { content: "Team"; }
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(6)::before { content: "Records"; }
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(7)::before { content: "Last activity"; }
  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(8)::before { content: "Owner controls"; }

  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(7) {
    border-right: 0;
  }

  body.bb-app-active #admin .admin-table-shell tbody td:nth-child(8) {
    padding: 15px 14px 16px;
    border-bottom: 0;
    background: var(--pro-surface-soft);
  }

  body.bb-app-active #admin .admin-actions {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    grid-template-areas:
      "term users"
      "plan plan"
      "account account"
      "override override";
    gap: 12px 10px;
  }

  body.bb-app-active #admin .admin-actions .aa-field:nth-child(1) { grid-area: term; }
  body.bb-app-active #admin .admin-actions .aa-field:nth-child(2) { grid-area: plan; }
  body.bb-app-active #admin .admin-actions .aa-field:nth-child(3) { grid-area: users; }
  body.bb-app-active #admin .admin-actions .aa-field:nth-child(4) { grid-area: account; }
  body.bb-app-active #admin .admin-actions .aa-field:nth-child(5) { grid-area: override; }

  body.bb-app-active #admin .admin-actions .aa-field,
  body.bb-app-active #admin .aa-control,
  body.bb-app-active #admin .aa-seg {
    width: 100%;
    min-width: 0;
  }

  body.bb-app-active #admin .aa-num,
  body.bb-app-active #admin .aa-select,
  body.bb-app-active #admin .admin-actions .table-action {
    min-height: 38px;
  }

  body.bb-app-active #admin .aa-num,
  body.bb-app-active #admin .aa-num--wide,
  body.bb-app-active #admin .aa-select,
  body.bb-app-active #admin .admin-actions .aa-btn {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
  }
}
