/*
  Badgers Claw Pit - Global UI Contract v1
  Purpose: final panel-wide visual normalizer loaded last.
  Scope: tables/DataTables, page headers, cards, inputs, buttons, badges, sidebars.
  Notes: uses theme variables where present and falls back safely.
*/
:root{
  --bdg-bg: var(--panel-bg, var(--bs-body-bg, #111722));
  --bdg-surface: var(--panel-surface, var(--card-bg, #1d2531));
  --bdg-surface-2: var(--panel-surface-2, rgba(255,255,255,.035));
  --bdg-border: var(--panel-border, rgba(148,163,184,.20));
  --bdg-border-soft: var(--panel-border-soft, rgba(148,163,184,.12));
  --bdg-border-strong: var(--panel-border-strong, rgba(148,163,184,.34));
  --bdg-text: var(--panel-text, var(--bs-body-color, #f8fafc));
  --bdg-muted: var(--panel-muted, #9fb0c6);
  --bdg-accent: var(--panel-accent, var(--bs-primary, #4f8cff));
  --bdg-accent-soft: var(--panel-accent-soft, rgba(79,140,255,.18));
  --bdg-ring: var(--panel-ring, rgba(79,140,255,.26));
  --bdg-radius-sm: 10px;
  --bdg-radius: 14px;
  --bdg-radius-lg: 18px;
  --bdg-gap: 14px;
}

/* ------------------------------------------------------------
   Page/module title bars: fix icon too close to left edge
------------------------------------------------------------ */
.page-title-box,
.module-title-row,
.panel-page-heading,
.module-header,
.bdg-module-header,
.card .page-title-box{
  padding-left: 18px !important;
  padding-right: 18px !important;
}
.page-title-box .d-flex,
.module-title-row .d-flex,
.panel-page-heading .d-flex,
.module-header .d-flex,
.bdg-module-header .d-flex{
  gap: 10px !important;
}
.page-title-box img,
.page-title-box .module-icon,
.page-title-box .page-icon,
.module-title-row img,
.module-title-row .module-icon,
.panel-page-heading img,
.panel-page-heading .module-icon,
.module-header img,
.module-header .module-icon,
.bdg-module-header img,
.bdg-module-header .module-icon{
  margin-left: 8px !important;
  margin-right: 10px !important;
  flex: 0 0 auto !important;
}
.page-title-box h4,
.module-title-row h4,
.panel-page-heading h4,
.module-header h4,
.bdg-module-header h4{
  margin: 0 !important;
  line-height: 1.25 !important;
}

/* ------------------------------------------------------------
   Cards / surfaces
------------------------------------------------------------ */
.card,
.bdg-card,
.module-card,
.summary-tile,
.stat-card,
.panel-card{
  border: 1px solid var(--bdg-border-soft) !important;
  border-radius: var(--bdg-radius) !important;
  box-shadow: none !important;
}
.card-header,
.card-footer{
  border-color: var(--bdg-border-soft) !important;
  box-shadow: none !important;
}
.card-body{
  border-radius: inherit !important;
}

/* ------------------------------------------------------------
   Tables / DataTables: remove double dark divider lines
------------------------------------------------------------ */
.table,
.dataTable,
table.table,
table.dataTable{
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
  border-color: var(--bdg-border-soft) !important;
}
.table-responsive{
  border-radius: var(--bdg-radius-sm) !important;
}
.table thead,
.dataTable thead,
table thead,
.table > :not(caption) > * > *,
.dataTable > :not(caption) > * > *{
  box-shadow: none !important;
}
.table thead tr,
.dataTable thead tr,
table thead tr{
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.table thead th,
.dataTable thead th,
table.table thead th,
table.dataTable thead th,
.table > thead > tr > th,
.dataTable > thead > tr > th{
  background: var(--bdg-surface-2) !important;
  color: var(--bdg-text) !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid var(--bdg-border) !important;
  box-shadow: none !important;
  outline: 0 !important;
  text-shadow: none !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 9px 12px !important;
  font-size: .78rem !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
  vertical-align: middle !important;
  line-height: 1.15 !important;
}
.table thead th::before,
.table thead th::after,
.dataTable thead th::before,
.dataTable thead th::after,
table thead th::before,
table thead th::after{
  box-shadow: none !important;
  border: 0 !important;
}
.table tbody tr,
.dataTable tbody tr,
table.table tbody tr{
  box-shadow: none !important;
  border-color: var(--bdg-border-soft) !important;
}
.table tbody td,
.dataTable tbody td,
table.table tbody td{
  border-top: 1px solid var(--bdg-border-soft) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  padding: 10px 12px !important;
  vertical-align: middle !important;
}
.table-bordered,
.table-bordered td,
.table-bordered th{
  border-color: var(--bdg-border-soft) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped tbody tr:nth-of-type(odd) td{
  box-shadow: none !important;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate{
  color: var(--bdg-muted) !important;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select{
  border: 1px solid var(--bdg-border) !important;
  border-radius: var(--bdg-radius-sm) !important;
  background: rgba(0,0,0,.22) !important;
  color: var(--bdg-text) !important;
  min-height: 34px !important;
  box-shadow: none !important;
}

/* Remove old donor heavy line classes without touching content */
.table-dark-line,
.table-divider,
.datatable-divider,
thead .divider,
.table-head-divider{
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ------------------------------------------------------------
   Inputs/selects/textareas
------------------------------------------------------------ */
.form-control,
.form-select,
.custom-select,
input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="datetime-local"],
select,
textarea{
  border: 1px solid var(--bdg-border) !important;
  border-radius: var(--bdg-radius-sm) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
}
.form-control:focus,
.form-select:focus,
.custom-select:focus,
input:focus,
select:focus,
textarea:focus{
  border-color: var(--bdg-border-strong) !important;
  box-shadow: 0 0 0 3px var(--bdg-ring), inset 0 1px 0 rgba(255,255,255,.03) !important;
  outline: 0 !important;
}

/* ------------------------------------------------------------
   Buttons / badges / pills
------------------------------------------------------------ */
.btn,
button.btn,
.btn-sm,
button.btn-sm{
  border-radius: var(--bdg-radius-sm) !important;
  box-shadow: none !important;
}
.badge,
.badge-soft,
.status-pill,
.summary-count,
.nav-pills .nav-link,
.pill{
  border-radius: 999px !important;
  border: 1px solid var(--bdg-border-soft) !important;
  box-shadow: none !important;
}

/* ------------------------------------------------------------
   Module sidebars / active selectors
------------------------------------------------------------ */
.module-sidebar .nav-link,
.smarters-sidebar .nav-link,
.module-nav .nav-link,
.workspace-sidebar .nav-link{
  border-radius: var(--bdg-radius) !important;
  border: 1px solid var(--bdg-border-soft) !important;
  box-shadow: none !important;
}
.module-sidebar .nav-link.active,
.smarters-sidebar .nav-link.active,
.module-nav .nav-link.active,
.workspace-sidebar .nav-link.active,
.module-sidebar .nav-link[aria-selected="true"],
.smarters-sidebar .nav-link[aria-selected="true"]{
  background: rgba(255,255,255,.025) !important;
  color: var(--bdg-text) !important;
  border-color: var(--bdg-border-strong) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 0 0 2px var(--bdg-ring) !important;
}
.module-sidebar .nav-link.active::before,
.module-sidebar .nav-link.active::after,
.smarters-sidebar .nav-link.active::before,
.smarters-sidebar .nav-link.active::after,
.module-nav .nav-link.active::before,
.module-nav .nav-link.active::after{
  display: none !important;
}

/* ------------------------------------------------------------
   Modals
------------------------------------------------------------ */
.modal-content{
  border: 1px solid var(--bdg-border) !important;
  border-radius: var(--bdg-radius-lg) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.35) !important;
}
.modal-header,
.modal-footer{
  border-color: var(--bdg-border-soft) !important;
}
