/* BB105.2 Panel-Wide UI Audit Polish
   Build layer: design-token based visual refinement only.
   Scope: shared panel surfaces plus explicit module wrappers; no routing, JS, or database logic. */

:root{
  --bc-polish-card-min: 0px;
  --bc-polish-icon-card: var(--bc-module-icon,54px);
  --bc-polish-row-pad-y: 10px;
  --bc-polish-row-pad-x: 12px;
}

/* ---------- Page title/header rhythm ---------- */
.page-title-box,
.dashboard-ref-header,
.panel-page-heading,
.module-title-row{
  min-height:58px!important;
  display:flex!important;
  align-items:center!important;
  gap:var(--bc-gap-md)!important;
}
.page-title-box h4,
.dashboard-ref-header h4,
.panel-page-heading h4,
.module-title-row h4{
  margin:0!important;
  line-height:1.2!important;
  letter-spacing:.01em!important;
}
.page-title-box p,
.dashboard-ref-header p,
.panel-page-heading p,
.module-title-row p{
  margin:.18rem 0 0!important;
  color:var(--bc-muted)!important;
}

/* ---------- Tables: remove remaining stacked/donor dividers, keep compact spacing ---------- */
.table,
.dataTable,
table.table{
  margin-bottom:0!important;
}
.table thead,
.dataTable thead,
table.table thead{
  border-bottom:0!important;
  box-shadow:none!important;
}
.table thead tr,
.dataTable thead tr,
table.table thead tr{
  border-bottom:var(--bc-line-soft)!important;
  box-shadow:none!important;
}
.table thead th,
.dataTable thead th,
table.table thead th{
  padding:var(--bc-polish-row-pad-y) var(--bc-polish-row-pad-x)!important;
  background:color-mix(in srgb, var(--bc-surface) 92%, var(--bc-accent) 4%)!important;
  border-top:0!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:0!important;
  color:var(--bc-text)!important;
}
.table tbody td,
.dataTable tbody td,
table.table tbody td{
  padding:var(--bc-polish-row-pad-y) var(--bc-polish-row-pad-x)!important;
  border-color:color-mix(in srgb, var(--bc-muted) 12%, transparent)!important;
}
.table-striped tbody tr:nth-of-type(odd),
.table-striped>tbody>tr:nth-of-type(odd)>*{
  --bs-table-accent-bg:color-mix(in srgb, var(--bc-surface) 94%, #fff 2%)!important;
}

/* ---------- API Helper: consistent cards/icons/endpoint rows ---------- */
.api-helper-shell .card,
.api-helper-page .card,
body.module-api_link_helper .card,
body.api-link-helper-page .card{
  border-radius:var(--bc-radius-lg)!important;
}
.api-helper-shell .api-app-card,
.api-helper-shell .endpoint-card,
.api-helper-shell .api-helper-card,
.api-helper-page .api-app-card,
.api-helper-page .endpoint-card,
.api-helper-page .api-helper-card,
body.module-api_link_helper .api-app-card,
body.module-api_link_helper .endpoint-card,
body.module-api_link_helper .api-helper-card{
  min-height:unset!important;
  padding:var(--bc-card-pad-sm)!important;
  border:var(--bc-line-soft)!important;
  border-radius:var(--bc-radius-lg)!important;
  background:var(--bc-surface)!important;
  box-shadow:var(--bc-shadow-sm), var(--bc-shadow-inner)!important;
}
.api-helper-shell img,
.api-helper-page img,
body.module-api_link_helper .api-app-card img,
body.module-api_link_helper .endpoint-card img{
  object-fit:contain!important;
}
.api-helper-shell .api-app-card img,
.api-helper-page .api-app-card img,
body.module-api_link_helper .api-app-card img{
  width:44px!important;height:44px!important;max-width:44px!important;max-height:44px!important;flex:0 0 44px!important;
}
.api-helper-shell .endpoint-card img,
.api-helper-page .endpoint-card img,
body.module-api_link_helper .endpoint-card img{
  width:34px!important;height:34px!important;max-width:34px!important;max-height:34px!important;flex:0 0 34px!important;
}
.api-helper-shell .endpoint-row,
.api-helper-page .endpoint-row,
body.module-api_link_helper .endpoint-row{
  display:flex!important;
  align-items:center!important;
  gap:var(--bc-gap-md)!important;
  padding:var(--bc-gap-sm) var(--bc-gap-md)!important;
  border-radius:var(--bc-radius-md)!important;
  border:var(--bc-line-soft)!important;
  background:var(--bc-surface-soft)!important;
}
.api-helper-shell .category-pill,
.api-helper-page .category-pill,
body.module-api_link_helper .category-pill{
  min-height:32px!important;
  padding:0 var(--bc-gap-md)!important;
  border-radius:var(--bc-radius-pill)!important;
  border:var(--bc-line-soft)!important;
}

/* ---------- Module Manager: uniform module tiles without forcing module internals ---------- */
.module-manager .module-card,
.module-manager .installed-module-card,
.modules-grid .module-card,
.modules-grid .installed-module-card,
#module-manager .module-card,
#module-manager .installed-module-card{
  min-height:124px!important;
  display:flex!important;
  align-items:center!important;
  gap:var(--bc-gap-md)!important;
  padding:var(--bc-card-pad)!important;
}
.module-manager .module-card .module-icon-wrap,
.module-manager .installed-module-card .module-icon-wrap,
.modules-grid .module-icon-wrap,
#module-manager .module-icon-wrap{
  width:64px!important;
  height:64px!important;
  min-width:64px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  background:var(--bc-surface-soft)!important;
  overflow:hidden!important;
}
.module-manager .module-card img,
.module-manager .installed-module-card img,
.modules-grid .module-card img,
#module-manager .module-card img{
  width:54px!important;
  height:54px!important;
  max-width:54px!important;
  max-height:54px!important;
  object-fit:contain!important;
}
.module-manager .module-card .btn,
.module-manager .installed-module-card .btn,
#module-manager .module-card .btn{
  min-height:34px!important;
  padding:0 .72rem!important;
}

/* ---------- Dashboard: consistent widget gutters and compact lists ---------- */
.dashboard-shell,
.dashboard-page{
  --bc-dashboard-gap:var(--bc-gap-lg);
}
.dashboard-shell .card,
.dashboard-shell .badgersclaw-card,
.dashboard-shell .dashboard-ref-panel{
  margin-bottom:var(--bc-dashboard-gap)!important;
}
.dashboard-shell .dashboard-launch-grid,
.dashboard-shell .dashboard-overview-grid,
.dashboard-shell .dashboard-login-watch-summary,
.dashboard-shell .dashboard-visitor-log-list,
.dashboard-shell .dashboard-feed-compact{
  gap:var(--bc-gap-md)!important;
}
.dashboard-shell .dashboard-apk-row,
.dashboard-shell .dashboard-visitor-row,
.dashboard-shell .dashboard-login-watch-row,
.dashboard-shell .dashboard-feed-compact-item{
  border-radius:var(--bc-radius-md)!important;
  border:var(--bc-line-soft)!important;
  background:var(--bc-surface-soft)!important;
}

/* ---------- Builder: align generated-module forms and icon upload areas ---------- */
body.module-badgerbuilder .form-control,
body.module-badgerbuilder .form-select,
body.module-badgerbuilder select,
body.module-badgerbuilder input,
body.module-badgerbuilder textarea,
.badgerbuilder-module .form-control,
.badgerbuilder-module .form-select,
.badgerbuilder-module select,
.badgerbuilder-module input,
.badgerbuilder-module textarea{
  min-height:var(--bc-control-height)!important;
}
body.module-badgerbuilder .builder-card,
body.module-badgerbuilder .preview-card,
.badgerbuilder-module .builder-card,
.badgerbuilder-module .preview-card{
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  padding:var(--bc-card-pad)!important;
  background:var(--bc-surface)!important;
}
body.module-badgerbuilder .icon-upload-preview,
.badgerbuilder-module .icon-upload-preview{
  width:72px!important;
  height:72px!important;
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:var(--bc-surface-soft)!important;
}
body.module-badgerbuilder .icon-upload-preview img,
.badgerbuilder-module .icon-upload-preview img{
  max-width:58px!important;
  max-height:58px!important;
  object-fit:contain!important;
}

/* ---------- Smarters Pro workspace polish ---------- */
body.module-smarterspro .spro-workspace,
body.module-smarterspro .smarterspro-module{
  --spro-gap:var(--bc-gap-lg);
}
body.module-smarterspro .spro-sidebar .nav-link,
body.module-smarterspro .smarters-sidebar .nav-link{
  min-height:36px!important;
  padding:.5rem .75rem!important;
  border-radius:var(--bc-radius-md)!important;
}
body.module-smarterspro .spro-card,
body.module-smarterspro .spro-workspace-card,
body.module-smarterspro .smarterspro-card{
  margin-bottom:var(--spro-gap)!important;
}
body.module-smarterspro .spro-table-wrapper,
body.module-smarterspro .table-responsive{
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  overflow:hidden!important;
}
body.module-smarterspro .spro-table thead,
body.module-smarterspro table thead{
  box-shadow:none!important;
  border-bottom:var(--bc-line-soft)!important;
}
body.module-smarterspro .spro-table thead th,
body.module-smarterspro table thead th{
  box-shadow:none!important;
}

/* ---------- Status pills and small action bars ---------- */
.status-pill,
.module-status-pill,
.health-pill,
.api-status-pill,
.badge-soft,
.badge-outline{
  min-height:28px!important;
  padding:0 .65rem!important;
  border-radius:var(--bc-radius-pill)!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:var(--bc-gap-xs)!important;
  line-height:1!important;
}
.action-bar,
.module-action-bar,
.card-actions{
  display:flex!important;
  align-items:center!important;
  gap:var(--bc-gap-sm)!important;
  flex-wrap:wrap!important;
}
