/*
 * BPTW admin — visual refresh (loaded after the main app stylesheet).
 * Wider content on large screens, clearer typography, soft cards and tables, sticky table headers,
 * compact filter panels, and tables that scroll sideways on phones instead of breaking the page.
 */
:root {
  --bptw-red: #e2231a;
  --bptw-blue: #3f63b5;
  --bptw-ink: #1f2430;
  --bptw-muted: #6b7280;
  --bptw-line: #e5e8ef;
  --bptw-bg: #f5f7fb;
  --bptw-card: #ffffff;
  --bptw-radius: 10px;
  --bptw-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}

/* ---------- page ---------- */
body {
  background: var(--bptw-bg);
  color: var(--bptw-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 1400px) {
  body > .container, .breadcrumbs > .container, nav.navbar > .container { max-width: 1360px; }
}
@media (min-width: 1700px) {
  body > .container, .breadcrumbs > .container, nav.navbar > .container { max-width: 1600px; }
}
h1, h2, h3, h4, h5, h6, .h4, .h5 { color: var(--bptw-ink); font-weight: 600; letter-spacing: -.01em; }
h4 { font-size: 1.25rem; }
a { color: var(--bptw-blue); }
a:hover { color: #2c4a91; }
.text-muted { color: var(--bptw-muted) !important; }

/* ---------- navigation ---------- */
body > nav.navbar, body > .navbar {
  background: #fff !important;
  border-bottom: 1px solid var(--bptw-line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
  position: sticky; top: 0; z-index: 1030;
}
.navbar .nav-link { font-size: 13px; letter-spacing: .04em; border-radius: 8px; transition: background .15s, color .15s; }
.navbar .nav-link:hover, .navbar .nav-item.show > .nav-link { background: #f1f4fa; }
.navbar .nav-item.active > .nav-link { color: var(--bptw-red) !important; }
.dropdown-menu {
  border: 1px solid var(--bptw-line); border-radius: var(--bptw-radius);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .12); padding: 6px; font-size: 14px;
}
.dropdown-item { border-radius: 6px; padding: .45rem .75rem; }
.dropdown-item:hover, .dropdown-item:focus { background: #f1f4fa; }
.dropdown-item.active, .dropdown-item:active { background: #e8eefb; color: var(--bptw-blue) !important; }
.dropdown-item .fa { width: 18px; text-align: center; color: var(--bptw-muted); }

/* breadcrumb bar: light and quiet */
.breadcrumbs {
  background: #fff !important;
  border-top: 0 !important; border-bottom: 1px solid var(--bptw-line) !important;
  padding: 8px 0 !important; margin-bottom: 22px;
}
.breadcrumbs * { color: var(--bptw-muted); font-size: 12.5px !important; }
.breadcrumbs a { color: var(--bptw-blue) !important; }

/* ---------- cards & panels ---------- */
.card {
  border: 1px solid var(--bptw-line); border-radius: var(--bptw-radius);
  box-shadow: var(--bptw-shadow); background: var(--bptw-card);
}
.card-header {
  background: #fafbfd; border-bottom: 1px solid var(--bptw-line); font-weight: 600;
  border-radius: var(--bptw-radius) var(--bptw-radius) 0 0 !important;
}
.card-footer { background: #fafbfd; border-top: 1px solid var(--bptw-line); }
.insights .kpi, .acc .kpi {
  border-radius: var(--bptw-radius); box-shadow: var(--bptw-shadow); transition: transform .12s, box-shadow .12s;
}
a .kpi:hover, a.text-reset:hover .kpi { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 24, 40, .1); }

/* "Filtering options" panels */
.filters .card-body, #filters-container .card-body, .filter-container .card-body { padding: 12px 16px; }
label { font-size: 12.5px; color: #4b5563; margin-bottom: 3px; }
.form-control, .custom-select, .select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border-color: #d6dbe5 !important; border-radius: 8px !important; font-size: 13.5px;
}
.form-control:focus, .custom-select:focus { border-color: var(--bptw-blue) !important; box-shadow: 0 0 0 3px rgba(63, 99, 181, .15) !important; }

/* ---------- buttons, badges ---------- */
.btn { border-radius: 8px; font-weight: 500; }
.btn-sm { border-radius: 7px; }
.btn-primary { background: var(--bptw-blue); border-color: var(--bptw-blue); }
.btn-primary:hover { background: #34539b; border-color: #34539b; }
.badge { border-radius: 999px; font-weight: 500; padding: .3em .6em; }
.badge-light { background: #eef1f6; color: #374151; }

/* nav tabs used by the insights pages */
.chm-nav-tabs { gap: 6px; flex-wrap: wrap; }
.chm-nav-tabs .nav-link {
  border: 1px solid var(--bptw-line) !important; border-radius: 999px !important; background: #fff;
  color: #374151 !important; padding: .4rem .9rem; font-size: 13px; font-weight: 500;
}
.chm-nav-tabs .nav-link.active { background: var(--bptw-red) !important; border-color: var(--bptw-red) !important; color: #fff !important; }
.chm-nav-tabs .nav-link.active .fa { color: #fff; }

/* ---------- tables ---------- */
.table { color: var(--bptw-ink); margin-bottom: 0; }
.table thead th {
  background: #fafbfd; color: #4b5563; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  border-top: 0 !important; border-bottom: 1px solid var(--bptw-line) !important; white-space: nowrap; vertical-align: middle;
}
.table td { border-top: 1px solid #eef0f5 !important; vertical-align: middle; }
.table-hover tbody tr:hover, table.table tbody tr:hover { background: #f7f9fd; }
.table-sm td, .table-sm th { padding: .45rem .6rem; }
/* sticky headers in long lists */
.table-responsive { border-radius: 0 0 var(--bptw-radius) var(--bptw-radius); }
.card .table-responsive { max-height: none; }
.card > .table-responsive > .table thead th, .insights .table thead th, .acc .table thead th { position: sticky; top: 0; z-index: 2; }

/* pagination */
.pagination .page-link { border-radius: 7px !important; margin: 0 2px; border-color: var(--bptw-line); color: #374151; }
.pagination .page-item.active .page-link { background: var(--bptw-blue); border-color: var(--bptw-blue); color: #fff; }

/* ---------- modals ---------- */
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.modal-header { border-bottom: 1px solid var(--bptw-line); }
.modal-title { font-weight: 600; }

/* ---------- alerts ---------- */
.alert { border-radius: var(--bptw-radius); border-width: 1px; }

/* ---------- phones and tablets ---------- */
@media (max-width: 991.98px) {
  body { font-size: 13.5px; }
  body > .container { padding-left: 12px; padding-right: 12px; }
  /* wide tables scroll sideways inside their card instead of stretching the page */
  .card > table.table, .container > table.table, .chm-table table.table, [id$="TableContainer"] table.table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap;
  }
  .table td { white-space: normal; min-width: 90px; }
  .card-header { flex-wrap: wrap; gap: 6px; }
  .navbar-collapse { padding-bottom: 10px; }
  .dropdown-menu { box-shadow: none; border: 0; padding-left: 12px; }
  h4 { font-size: 1.1rem; }
  .btn-group { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
  .insights .kpi .kpi-value, .acc .kpi-value { font-size: 20px !important; }
  .filters .col-md-1, .filters .col-md-2, .filters .col-md-3 { flex: 0 0 50%; max-width: 50%; }
}

/* tab bars (insights, company pages): pills on the page background instead of a red strip */
.chm-nav-tabs { background: transparent !important; border-bottom: 0 !important; padding: 2px 0 6px; }
.chm-nav-tabs.fixed { background: var(--bptw-bg) !important; box-shadow: 0 2px 6px rgba(16, 24, 40, .06); }
.chm-nav-tabs .nav-item a { font-size: 13px !important; letter-spacing: .01em; text-transform: none; }

/* long explanations folded under a "How it works" toggle */
details.how-it-works { margin: 2px 0 10px; }
details.how-it-works > summary { cursor: pointer; color: var(--bptw-blue); font-size: 13px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.how-it-works > summary::-webkit-details-marker { display: none; }
details.how-it-works > summary::before { content: "\f05a"; font-family: FontAwesome; }
details.how-it-works[open] > summary { margin-bottom: 6px; }
details.how-it-works > p { background: #fff; border: 1px solid var(--bptw-line); border-radius: var(--bptw-radius); padding: 10px 14px; font-size: 13px; }
.chm-nav-tabs .nav-item a.nav-link { border: 1px solid var(--bptw-line) !important; background: #fff; color: #374151 !important; border-radius: 999px !important; padding: .4rem .95rem; }
.chm-nav-tabs .nav-item a.nav-link:hover { background: #f1f4fa; }
.chm-nav-tabs .nav-item a.nav-link.active { background: var(--bptw-red) !important; border-color: var(--bptw-red) !important; color: #fff !important; }

/* compact email summaries in lists */
.ex-quote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.insights td { line-height: 1.35; }

/* ---------- notification panel (bell) ---------- */
.notification-dropdown .dropdown-menu { width: 420px; max-width: calc(100vw - 24px); max-height: none !important; padding: 0; overflow: hidden; }
.notif-panel { display: flex; flex-direction: column; max-height: 70vh; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--bptw-line); background: #fafbfd; }
.notif-head .badge { position: static !important; display: inline-block !important; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f0f2f6; transition: background .15s, opacity .2s; }
.notif-item:hover { background: #f7f9fd; }
.notif-icon { flex: 0 0 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef2fb; color: var(--bptw-blue); }
.notif-prospect .notif-icon { background: #e8f6ee; color: #1e8e3e; }
.notif-planning .notif-icon { background: #fff4e5; color: #e37400; }
.notif-news .notif-icon { background: #f3e8fd; color: #8e24aa; }
.notif-body { flex: 1 1 auto; min-width: 0; color: var(--bptw-ink) !important; text-decoration: none !important; display: flex; flex-direction: column; }
.notif-type { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--bptw-muted); }
.notif-text { font-size: 13.5px; font-weight: 500; line-height: 1.3; white-space: normal; }
.notif-meta { font-size: 12px; color: var(--bptw-muted); white-space: normal; }
.notif-ok { flex: 0 0 auto; padding: 2px 10px; font-size: 12px; border-radius: 999px; }
.notif-ok:hover { background: #1e8e3e; border-color: #1e8e3e; color: #fff; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--bptw-muted); }
.notif-empty .fa { display: block; font-size: 28px; color: #1e8e3e; margin-bottom: 6px; }
.notif-item.dismissing { opacity: 0; }
@media (max-width: 991.98px) {
  .notification-dropdown { position: relative; width: 100%; }
  .notification-dropdown > .badge { left: 34px !important; right: auto !important; }
  .notification-dropdown .dropdown-menu { position: static !important; transform: none !important; float: none; width: 100% !important; max-width: none; margin-top: 8px; border: 1px solid var(--bptw-line) !important; }
  .notif-panel { max-height: 60vh; }
}

/* table footer (bulk actions, rows per page, "Showing x to y", pagination): spaced below the list, aligned */
.table-bottom { margin-top: 14px !important; padding: 10px 4px 4px; border-top: 1px solid var(--bptw-line); align-items: center; row-gap: 8px; }
.table-bottom > .col-md-7 { color: var(--bptw-muted); font-size: 13px; line-height: 32px; }
.table-bottom > .col-md-7 > .chmTable_bulk_actions, .table-bottom > .col-md-7 > select { vertical-align: middle; margin-right: 10px; }
.table-bottom .chm-table-total { white-space: nowrap; }
.table-bottom .chmTable_bulk_actions .input-group { flex-wrap: nowrap; align-items: center; gap: 6px; }
.table-bottom select { height: 32px; border: 1px solid #d6dbe5; border-radius: 7px; padding: 0 8px; background: #fff; color: var(--bptw-ink); font-size: 13px; }
.table-bottom .chmTable_bulk_actions .input-group-text { height: 32px; border-radius: 7px !important; background: #fff; border-color: #d6dbe5; }
.table-bottom .btn-xs { height: 32px; padding: 0 12px; border-radius: 7px; margin-left: 0 !important; }
.table-bottom .navigation .pagination { margin: 0; }
@media (max-width: 767.98px) { .table-bottom .navigation { float: none !important; } }

/* competitor certification badges next to a company name */
.comp-badge { display: inline-block; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 1; padding: 3px 5px; border-radius: 4px; margin-left: 4px; vertical-align: middle; cursor: help; }

/* dashboard: scrollable main tab bar (no red strip) + search button, and the second-line tabs */
.scrtabs-tab-container { background: transparent !important; height: 46px !important; }
.scrtabs-tabs-fixed-container { height: 46px !important; }
.scrtabs-tabs-movable-container { padding-top: 4px; }
.scrtabs-tabs-movable-container .chm-nav-tabs { gap: 6px; flex-wrap: nowrap; padding: 0; }
.scrtabs-tab-scroll-arrow { border: 1px solid var(--bptw-line) !important; border-radius: 8px; background: #fff !important; color: var(--bptw-muted) !important; height: 34px !important; margin-top: 4px; }
.scrollable-tabs ~ * .btn-search, .card-body .btn-search { background: #fff !important; color: var(--bptw-ink) !important; border: 1px solid var(--bptw-line) !important; border-radius: 999px !important; height: 36px; width: 40px; margin-top: 2px; }
.card-body .btn-search:hover { background: #f1f4fa !important; }
.chm-nav-tabs-light { border-bottom: 1px solid var(--bptw-line) !important; gap: 4px; margin-top: 6px; }
.chm-nav-tabs-light .nav-link { border: 0 !important; border-bottom: 3px solid transparent !important; color: var(--bptw-muted) !important; font-size: 13px; font-weight: 600; letter-spacing: .03em; padding: .55rem .9rem; background: transparent !important; }
.chm-nav-tabs-light .nav-link:hover { color: var(--bptw-ink) !important; }
.chm-nav-tabs-light .nav-link.active { color: var(--bptw-red) !important; border-bottom-color: var(--bptw-red) !important; }
.scrtabs-tabs-movable-container .chm-nav-tabs-light { flex-wrap: nowrap; margin-top: 0; }
.scrtabs-tabs-movable-container .chm-nav-tabs-light .nav-link { white-space: nowrap; }
