/* ============================================================
   BoARI Systems – Unified Dashboard – Custom CSS
   Primary: #8B0000 (WSU Maroon) | Accent: #C41E3A
   ============================================================ */

:root {
  --boari-primary:      #8B0000;
  --boari-primary-dark: #5C0000;
  --boari-accent:       #C41E3A;
  --boari-light:        #F5E6E6;
  --boari-bg:           #f0f2f5;
  --boari-card:         #ffffff;
  --boari-text:         #2c2c2c;
  --boari-muted:        #6c757d;
  --boari-border:       #e0e0e0;
  --sidebar-width:      260px;
  --header-height:      56px;
  --radius:             10px;
  --shadow-sm:          0 2px 8px rgba(0,0,0,.08);
  --shadow-md:          0 4px 20px rgba(0,0,0,.12);
  --transition:         all 0.22s ease;
}

/* ── Reset & base ── */
* { box-sizing: border-box; }
body {
  background: var(--boari-bg) !important;
  color: var(--boari-text) !important;
  font-family: "Inter", "Segoe UI", Arial, sans-serif !important;
  font-size: 14px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--boari-primary); }

/* ── HEADER ── */
.main-header .navbar,
.main-header .logo {
  background: var(--boari-primary) !important;
  border-bottom: 3px solid var(--boari-primary-dark) !important;
}
.main-header .logo {
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  color: #fff !important;
}
.main-header .navbar-nav > li > a { color: rgba(255,255,255,.85) !important; }
.main-header .navbar-nav > li > a:hover { color: #fff !important; background: rgba(255,255,255,.12) !important; }

/* Header brand */
.logo-text { display: flex; align-items: center; gap: 10px; }
.logo-text img { height: 36px; border-radius: 4px; }

/* User badge in header */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}
.user-badge .fa { opacity: .8; }

/* ── Header auth slot: "Log in" CTA / user badge + logout ── */
/* The wrapper supplies the vertical centring the badge used to do itself. */
.header-auth-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
}
.header-auth-wrap .user-badge { margin-top: 0; }

/* Matches the header facility picker pill (#6d0000, 20px radius, 36px tall) */
.boari-login-cta,
.boari-login-cta:focus {
  background: #6d0000 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 5px 16px !important;
  height: 36px !important;
  line-height: 24px !important;
  box-shadow: none !important;
}
.boari-login-cta:hover { background: #8b0000 !important; }
.boari-login-cta .fa { margin-right: 6px; opacity: .85; }

.boari-logout-link,
.boari-logout-link:focus {
  color: rgba(255,255,255,.75) !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}
.boari-logout-link:hover {
  color: #fff !important;
  text-decoration: none !important;
}

/* Hidden anchor points for post-login sidebar injection */
.boari-anchor { display: none; }

/* Caption above each donut in the Overview snapshot pair */
.boari-donut-label {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 2px;
}

/* ── PUBLIC (pre-login) LAYOUT ──
   Only three public tabs, so the sidebar is dropped and the content runs
   full width behind a top tab strip. Public is the DEFAULT state (no class)
   so an anonymous load never flashes a sidebar; server.R adds
   .boari-authed to <body> on successful login, which restores the sidebar
   and hides the strip. */
body:not(.boari-authed) .main-sidebar { display: none !important; }
body:not(.boari-authed) .content-wrapper { margin-left: 0 !important; }
body:not(.boari-authed) .main-footer { margin-left: 0 !important; }
body:not(.boari-authed) .sidebar-toggle { display: none !important; }
body.boari-authed .boari-topnav { display: none !important; }

.boari-topnav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 0 6px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow-x: auto;
}
.boari-topnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: #5a5a5a;
  text-decoration: none !important;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.boari-topnav a:hover {
  color: var(--boari-primary);
  background: rgba(139, 0, 0, .04);
}
.boari-topnav a.active {
  color: var(--boari-primary);
  border-bottom-color: var(--boari-primary);
  background: rgba(139, 0, 0, .05);
}
.boari-topnav a .fa { opacity: .85; }

/* ── Login modal (replaces the old full-screen shinymanager wall) ── */
.boari-login-head {
  background: linear-gradient(135deg, #8B0000, #C41E3A);
  padding: 26px 32px 20px;
  text-align: center;
  margin: -15px -15px 0;
  border-radius: 6px 6px 0 0;
}
.boari-login-head img { height: 60px; filter: brightness(0) invert(1); }
.boari-login-head h2 {
  color: #fff;
  font-weight: 800;
  margin: 10px 0 4px;
  font-size: 22px;
  font-family: 'Inter', sans-serif;
}
.boari-login-head p {
  color: rgba(255,255,255,.72);
  font-size: 11.5px;
  margin: 0;
  font-family: 'Inter', sans-serif;
}
.boari-login-body { padding: 24px 32px 8px; }
.boari-login-body label { font-weight: 600; color: #444; font-size: 13px; }
.boari-login-body .form-control {
  border-radius: 10px;
  border: 1.5px solid #e0e0e0;
  padding: 10px 14px;
  font-size: 14px;
}
.boari-login-body .form-control:focus {
  border-color: #8B0000;
  box-shadow: 0 0 0 3px rgba(139,0,0,.12);
  outline: none;
}
.boari-login-submit,
.boari-login-submit:focus {
  background: linear-gradient(135deg, #8B0000, #C41E3A) !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 12px !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  width: 100% !important;
  color: #fff !important;
  letter-spacing: .3px;
  margin-top: 6px;
}
.boari-login-submit:hover { opacity: .88 !important; }
.boari-login-foot {
  padding: 14px 32px 20px;
  text-align: center;
  color: #999;
  font-size: 11px;
}
.boari-login-foot a { color: #8B0000; }
.boari-login-error {
  background: #fdecec;
  border: 1px solid #f5c6cb;
  color: #8B0000;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin: 4px 0 2px;
}
/* Deepen the backdrop so the maroon card reads against the dashboard */
.modal-backdrop.in { opacity: .72; }

/* Cache status */
.cache-status-bar {
  background: rgba(0,0,0,.15);
  color: rgba(255,255,255,.75);
  font-size: 11px;
  padding: 2px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cache-dot { width: 7px; height: 7px; border-radius: 50%; background: #4caf50; display: inline-block; }
.cache-dot.stale { background: #ff9800; }

/* ── FIXED LAYOUT: header & sidebar stay pinned; only the body content scrolls ── */
.main-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

/* ── SIDEBAR ── */
.main-sidebar {
  background: #1a1a2e !important;
  width: var(--sidebar-width) !important;
  padding-top: 0;
  position: fixed !important;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  z-index: 1020;
}
.sidebar-menu > li > a {
  color: rgba(255,255,255,.75) !important;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 16px !important;
  border-left: 3px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-menu > li > a:hover {
  color: #fff !important;
  background: rgba(255,255,255,.08) !important;
  border-left-color: var(--boari-accent);
}
.sidebar-menu > li.active > a {
  color: #fff !important;
  background: linear-gradient(135deg, var(--boari-primary), var(--boari-accent)) !important;
  border-left-color: #fff !important;
  font-weight: 700;
}
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .glyphicon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: .85;
}
.sidebar-menu .header {
  color: rgba(255,255,255,.4) !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 16px 6px !important;
}

/* Header facility picker */
.header-facility-picker {
  padding: 8px 6px;
  display: flex;
  align-items: center;
}
/* The shiny-input-container and form-group wrappers must be transparent */
.header-facility-picker .shiny-input-container,
.header-facility-picker .form-group {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
/* bootstrap-select outer wrapper div (has .form-control which is white by default) */
.header-facility-picker .bootstrap-select,
.header-facility-picker .bootstrap-select.form-control {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  height: auto !important;
}
/* The actual button — solid dark so it reads on any background */
.header-facility-picker .bootstrap-select > .btn,
.header-facility-picker .bootstrap-select > button,
.header-facility-picker .btn-default {
  background: #6d0000 !important;
  background-color: #6d0000 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 5px 14px !important;
  height: 36px !important;
  line-height: 24px !important;
  box-shadow: none !important;
}
.header-facility-picker .bootstrap-select > .btn:hover,
.header-facility-picker .bootstrap-select > .btn:focus {
  background: #8b0000 !important;
  background-color: #8b0000 !important;
  outline: none !important;
  box-shadow: none !important;
}
.header-facility-picker .bootstrap-select > .btn .caret { border-top-color: #fff !important; }
/* All inner spans must be transparent so button background shows through */
.header-facility-picker .bootstrap-select .filter-option,
.header-facility-picker .bootstrap-select .filter-option-inner {
  background: transparent !important;
}
.header-facility-picker .bootstrap-select .filter-option-inner-inner { color: #fff !important; }
.header-facility-picker .bootstrap-select .bs-placeholder .filter-option-inner-inner {
  color: rgba(255,255,255,.7) !important;
}
.header-facility-picker .bootstrap-select .dropdown-menu {
  min-width: 260px !important;
  margin-top: 4px !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}

/* Sidebar version label */
.sidebar-version {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,.25);
  letter-spacing: .5px;
}

/* ── CONTENT WRAPPER ── */
/* Offset by the fixed header/sidebar so only this area scrolls with the page. */
.content-wrapper {
  background: var(--boari-bg) !important;
  margin-top: var(--header-height) !important;
  margin-left: var(--sidebar-width) !important;
  min-height: calc(100vh - var(--header-height)) !important;
}

/* ── SECTION HEADER ── */
.boari-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--boari-border);
}
.boari-section-header .icon-wrap {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--boari-primary), var(--boari-accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.boari-section-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--boari-primary);
}
.boari-section-header p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--boari-muted);
}

/* ── CARDS ── */
.boari-card {
  background: var(--boari-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--boari-border);
  transition: var(--transition);
}
.boari-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.boari-card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--boari-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.boari-card-title .fa { color: var(--boari-primary); }

/* shinydashboard box override */
.box {
  border-top: 3px solid var(--boari-primary) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius) !important;
}
.box-header { background: transparent !important; }
.box-title { font-weight: 700 !important; font-size: 14px !important; color: var(--boari-primary) !important; }

/* ── KPI VALUE BOXES ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-box {
  background: var(--boari-card);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--boari-primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-box::after {
  content: "";
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: var(--boari-light);
  border-radius: 50%;
  opacity: .5;
}
.kpi-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-box.accent { border-left-color: var(--boari-accent); }
.kpi-box.green  { border-left-color: #28a745; }
.kpi-box.blue   { border-left-color: #007bff; }
.kpi-box.orange { border-left-color: #fd7e14; }
.kpi-box.red    { border-left-color: #dc3545; }
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--boari-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--boari-text);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-sub {
  font-size: 12px;
  color: var(--boari-muted);
}
.kpi-icon {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 28px;
  color: var(--boari-primary);
  opacity: .12;
}

/* shinydashboard valueBox override */
.small-box {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}
.small-box h3 { font-weight: 800 !important; }
.small-box .icon { opacity: .25 !important; }
.small-box:hover { box-shadow: var(--shadow-md) !important; transform: translateY(-2px); }

/* ── FACILITY SELECTOR (top-right pill) ── */
.facility-selector-pill {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 24px;
  padding: 2px 6px 2px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.facility-selector-pill label { color: rgba(255,255,255,.7) !important; font-size: 12px; margin: 0; }

/* ── TABLES ── */
.dataTables_wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.dataTable thead th {
  background: var(--boari-primary) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--boari-primary-dark) !important;
  padding: 10px 12px !important;
}
table.dataTable tbody tr:hover { background-color: var(--boari-light) !important; }
table.dataTable tbody tr:nth-child(even) { background-color: #fafafa !important; }
table.dataTable tbody td { font-size: 13px !important; padding: 8px 12px !important; border-top: 1px solid #f0f0f0 !important; }
.dataTables_filter input {
  border: 1px solid var(--boari-border) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 13px !important;
}
.dataTables_filter input:focus {
  border-color: var(--boari-primary) !important;
  outline: none;
  box-shadow: 0 0 0 2px var(--boari-light);
}

/* ── SEARCH BOX ── */
.boari-search-box {
  background: #fff;
  border: 2px solid var(--boari-border);
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 15px;
  width: 100%;
  transition: var(--transition);
}
.boari-search-box:focus {
  border-color: var(--boari-primary);
  box-shadow: 0 0 0 3px var(--boari-light);
  outline: none;
}

/* ── TABS (tabsetPanel) ── */
.nav-tabs {
  border-bottom: 2px solid var(--boari-primary) !important;
  margin-bottom: 20px;
}
.nav-tabs > li > a {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--boari-muted) !important;
  border-radius: 6px 6px 0 0 !important;
  padding: 8px 18px !important;
  transition: var(--transition);
  background: transparent !important;
  border: none !important;
}
.nav-tabs > li > a:hover { color: var(--boari-primary) !important; background: var(--boari-light) !important; }
.nav-tabs > li.active > a {
  background: var(--boari-primary) !important;
  color: #fff !important;
  border-color: var(--boari-primary) !important;
}

/* ── BUTTONS ── */
.btn-boari, .btn-primary {
  background: linear-gradient(135deg, var(--boari-primary), var(--boari-accent)) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  padding: 8px 20px !important;
  transition: var(--transition);
  letter-spacing: .3px;
}
.btn-boari:hover, .btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,0,0,.3);
}
.btn-boari:active, .btn-primary:active { transform: translateY(0); }

/* ── INPUTS ── */
.selectize-input, .form-control, .bootstrap-select > .btn {
  border-radius: 6px !important;
  border: 1.5px solid var(--boari-border) !important;
  font-size: 13px !important;
  transition: var(--transition);
}
.selectize-input.focus, .form-control:focus {
  border-color: var(--boari-primary) !important;
  box-shadow: 0 0 0 3px var(--boari-light) !important;
  outline: none !important;
}

/* ── LOADING SPINNERS ── */
.loader-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}
.boari-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--boari-light);
  border-top-color: var(--boari-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PARTICIPANT RECORD CARDS ── */
.participant-card {
  background: linear-gradient(135deg, var(--boari-primary), #3a0000);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.participant-card h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.participant-card .pid { font-size: 13px; opacity: .75; letter-spacing: 1px; font-weight: 600; }
.participant-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.participant-meta-item { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 5px; }

/* ── STATUS BADGES ── */
.badge-responded    { background: #28a745; color: #fff; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-not-responded{ background: #dc3545; color: #fff; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-ra           { background: #fd7e14; color: #fff; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-ari          { background: var(--boari-accent); color: #fff; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* Weekly response grid */
.circle { display: inline-block; width: 22px; height: 22px; border-radius: 50%; text-align: center; line-height: 22px; font-size: 12px; font-weight: bold; }
.circle.win  { background: #28a745; color: #fff; }
.circle.loss { background: #dc3545; color: #fff; }
.circle.draw { background: #fd7e14; color: #fff; }

/* ── CHART CONTAINER ── */
.chart-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--boari-border);
}

/* ── ALERTS ── */
.boari-alert {
  background: var(--boari-light);
  border-left: 4px solid var(--boari-primary);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--boari-primary-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── LAB RESULT HIGHLIGHT ── */
.result-positive { color: #dc3545 !important; font-weight: 700; }
.result-negative { color: #28a745 !important; font-weight: 600; }

/* ── REFRESH BUTTON ── */
.refresh-btn {
  background: transparent;
  border: 1.5px solid var(--boari-primary);
  color: var(--boari-primary);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.refresh-btn:hover {
  background: var(--boari-primary);
  color: #fff;
}
.refresh-btn.spinning .fa { animation: spin .8s linear infinite; }

/* ── PROGRESS BARS ── */
.progress { border-radius: 20px !important; height: 10px !important; background: #e9ecef !important; }
.progress-bar { border-radius: 20px !important; background: linear-gradient(90deg, var(--boari-primary), var(--boari-accent)) !important; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .boari-section-header h2 { font-size: 17px; }
  .main-sidebar { width: 200px !important; }
  .content-wrapper { margin-left: 200px !important; }
}

/* ── LOGIN PAGE OVERRIDE ── */
.panel-auth { border-radius: 14px !important; box-shadow: var(--shadow-md) !important; }
.panel-auth .panel-heading {
  background: linear-gradient(135deg, var(--boari-primary), var(--boari-accent)) !important;
  border-radius: 14px 14px 0 0 !important;
  padding: 20px !important;
}
.btn-primary { transition: var(--transition); }

/* ── Annual FU active button state ── */
.btn-annual-active {
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.55), 0 4px 14px rgba(0,0,0,0.28) !important;
  filter: brightness(1.18);
  transform: translateY(-2px) !important;
}

/* ── SMS Tracker current-week column ── */
table.dataTable th.dt-current-week {
  background-color: #4a0000 !important;
  border-bottom: 3px solid #FFD700 !important;
}
table.dataTable td.dt-current-week {
  background-color: rgba(139,0,0,0.06) !important;
}

/* ── Download button disabled state ── */
.btn[disabled], .btn.disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ── Count badges in UI ── */
.boari-badge {
  display: inline-block;
  background: var(--boari-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.6;
}
.boari-badge.green { background: #28a745; }
.boari-badge.orange { background: #fd7e14; }
.boari-badge.blue { background: #007bff; }

/* ── Summary banner ── */
.pay-summary-banner {
  background: #f8f0f0;
  border-left: 4px solid #8B0000;
  border-radius: 0 6px 6px 0;
  padding: 12px 18px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-size: 13px;
}
.pay-summary-banner .pay-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pay-summary-banner .pay-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #8B0000;
  line-height: 1;
}
.pay-summary-banner .pay-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #6c757d;
  margin-top: 3px;
}
.pay-summary-divider {
  width: 1px;
  height: 36px;
  background: #ddd;
  flex-shrink: 0;
}

/* ── Freshness dot pulse animation ── */
@keyframes freshPulse {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,.6); }
  70%  { box-shadow: 0 0 0 6px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

/* ── Alert cards (mod_alerts) ── */
.alert-card-triggered {
  background: #fff8f8;
  border-left: 4px solid #c0392b;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.alert-card-ok {
  background: #f1f8f1;
  border-left: 4px solid #2e7d32;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
}

/* ── Participant card exit badge ── */
.pid-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.pid-status-badge.active  { background: rgba(40,167,69,.25); color: #155724; }
.pid-status-badge.exited  { background: rgba(220,53,69,.25); color: #721c24; }
.pid-status-badge.reentry { background: rgba(0,123,255,.25); color: #004085; }

/* ── Disconnect overlay ── */
#boari-disconnect-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(20,0,0,.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.boari-disconnect-card {
  background: #fff; border-radius: 14px; padding: 32px 40px;
  text-align: center; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  font-family: 'Inter', sans-serif;
}
.boari-disconnect-card .fa { font-size: 34px; color: #8B0000; margin-bottom: 10px; }
.boari-disconnect-card h3 { font-weight: 800; color: #2c3e50; margin: 0 0 8px; }
.boari-disconnect-card p  { color: #666; font-size: 13px; margin: 0 0 18px; }
.boari-disconnect-card button {
  background: linear-gradient(135deg, #8B0000, #C41E3A); color: #fff;
  border: none; border-radius: 10px; padding: 10px 28px;
  font-weight: 700; cursor: pointer;
}
/* Keep Shiny's default grey-out from stacking under our overlay */
#shiny-disconnected-overlay { display: none !important; }
