/* BB105.1 UI Polish Pass 1
   Uses design tokens and keeps global rules to shell/shared components.
   Module-specific detail remains scoped under module body classes. */

/* Shared shell cards */
.card,
.badgersclaw-card,
.dashboard-ref-panel,
.nxt-module-installer-widget,
.module-card,
.api-helper-card{
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  box-shadow:var(--bc-shadow-sm), var(--bc-shadow-inner)!important;
}
.card > .card-header,
.badgersclaw-card > .card-header,
.dashboard-ref-cardhead{
  padding:var(--bc-header-pad-y) var(--bc-header-pad-x)!important;
  border-bottom:var(--bc-line-soft)!important;
}
.card > .card-body,
.badgersclaw-card > .card-body{
  padding:var(--bc-card-pad)!important;
}

/* Page/module title spacing; keeps icon away from faded left edge. */
.page-title-box,
.module-title-row,
.panel-page-heading,
.dashboard-ref-header{
  padding-left:var(--bc-header-pad-x)!important;
  padding-right:var(--bc-header-pad-x)!important;
}
.page-title-box img,
.page-title-box .module-icon,
.module-title-row img,
.module-title-row .module-icon,
.panel-page-heading img,
.panel-page-heading .module-icon{
  margin-left:var(--bc-gap-sm)!important;
  margin-right:var(--bc-gap-md)!important;
  width:var(--bc-icon-lg)!important;
  height:var(--bc-icon-lg)!important;
  max-width:var(--bc-icon-lg)!important;
  max-height:var(--bc-icon-lg)!important;
  object-fit:contain!important;
  flex:0 0 var(--bc-icon-lg)!important;
}

/* Common controls */
.form-control,
.form-select,
.custom-select,
select,
input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
textarea{
  border-radius:var(--bc-radius-md)!important;
  border:var(--bc-line-strong)!important;
  min-height:var(--bc-control-height)!important;
}
.form-control:focus,
.form-select:focus,
.custom-select:focus,
select:focus,
input:focus,
textarea:focus{
  box-shadow:var(--bc-ring)!important;
  border-color:color-mix(in srgb, var(--bc-accent) 55%, var(--panel-border, #64748b))!important;
}
.btn,
button.btn,
.btn-sm,
button.btn-sm{
  border-radius:var(--bc-radius-md)!important;
  min-height:var(--bc-control-height-sm);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--bc-gap-xs);
}
.badge,
.pill,
.theme-state-info,
.theme-state-success,
.theme-state-warning,
.theme-state-danger{
  border-radius:var(--bc-radius-pill)!important;
  display:inline-flex;
  align-items:center;
  gap:var(--bc-gap-xs);
}

/* Shared table rhythm; module-specific tables may override in module.css. */
.table-responsive{
  border-radius:var(--bc-radius-lg);
}
.table thead th,
.dataTable thead th,
table.table thead th{
  font-size:var(--bc-font-xs)!important;
  letter-spacing:.035em!important;
  text-transform:uppercase!important;
  font-weight:800!important;
  border-bottom:var(--bc-line-soft)!important;
  box-shadow:none!important;
}
.table thead th::before,
.table thead th::after,
.dataTable thead th::before,
.dataTable thead th::after{
  display:none!important;
  content:none!important;
}
.table td,
.table th{
  vertical-align:middle!important;
}

/* Module Manager card/icon polish. */
.module-manager .module-card,
.module-card,
.modules-grid .card,
.installed-module-card{
  min-height:unset!important;
}
.module-manager .module-card img,
.module-card img.module-icon,
.installed-module-card img,
.modules-grid .card img{
  width:var(--bc-module-icon)!important;
  height:var(--bc-module-icon)!important;
  max-width:var(--bc-module-icon)!important;
  max-height:var(--bc-module-icon)!important;
  object-fit:contain!important;
  flex:0 0 var(--bc-module-icon)!important;
}

/* API Helper scoped polish without duplicating icon rendering. */
body.module-api_link_helper .api-helper-card,
body.api-link-helper-page .api-helper-card,
body.module-api_link_helper .endpoint-card,
body.api-link-helper-page .endpoint-card{
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  padding:var(--bc-card-pad-sm)!important;
}
body.module-api_link_helper .api-helper-icon,
body.module-api_link_helper .endpoint-app-icon,
body.api-link-helper-page .api-helper-icon,
body.api-link-helper-page .endpoint-app-icon{
  width:42px!important;
  height:42px!important;
  max-width:42px!important;
  max-height:42px!important;
  object-fit:contain!important;
  flex:0 0 42px!important;
}

/* Smarters Pro scoped polish. */
body.module-smarterspro .spro-card,
body.module-smarterspro .spro-workspace-card,
body.module-smarterspro .smarterspro-card{
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  box-shadow:var(--bc-shadow-sm), var(--bc-shadow-inner)!important;
}
body.module-smarterspro .spro-table thead th,
body.module-smarterspro .smarterspro-module table thead th{
  border-bottom:var(--bc-line-soft)!important;
  box-shadow:none!important;
}
body.module-smarterspro .spro-table thead th::before,
body.module-smarterspro .spro-table thead th::after,
body.module-smarterspro .smarterspro-module table thead th::before,
body.module-smarterspro .smarterspro-module table thead th::after{
  display:none!important;
  content:none!important;
}
body.module-smarterspro .media-preview,
body.module-smarterspro .spro-media-preview{
  border-radius:var(--bc-radius-lg)!important;
  border:var(--bc-line-soft)!important;
  background:var(--bc-surface-soft)!important;
  min-height:320px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
body.module-smarterspro .media-preview img,
body.module-smarterspro .media-preview video,
body.module-smarterspro .spro-media-preview img,
body.module-smarterspro .spro-media-preview video{
  max-width:100%;
  max-height:640px;
  width:auto;
  height:auto;
  object-fit:contain;
}

/* Builder polish: compact, predictable controls. */
body.module-badgerbuilder .builder-card,
body.module-badgerbuilder .badger-builder-card,
body.module-badgerbuilder .card{
  border-radius:var(--bc-radius-lg)!important;
}
body.module-badgerbuilder .form-control,
body.module-badgerbuilder .form-select{
  min-height:var(--bc-control-height)!important;
}

/* Dashboard polish, constrained to dashboard only. */
body.dashboard-page .dashboard-shell{
  gap:var(--bc-gap-lg);
}
body.dashboard-page .dashboard-launch-grid,
body.dashboard-page .dashboard-overview-grid,
body.dashboard-page .dashboard-login-watch-summary{
  gap:var(--bc-gap-md)!important;
}
body.dashboard-page .dashboard-ref-panel img,
body.dashboard-page .dashboard-ref-stat img{
  max-width:var(--bc-module-icon)!important;
  max-height:var(--bc-module-icon)!important;
  object-fit:contain!important;
}
