/* -----------------------------
   Root theme tokens (LIGHT)
   ----------------------------- */
:root {
  --bmt-bg: #f5f7fb;
  --bmt-bg-alt: #eef2ff;
  --bmt-surface: #ffffff;
  --bmt-surface-soft: #f9fafb;
  --bmt-border-subtle: rgba(148, 163, 184, 0.45);
  --bmt-border-strong: rgba(148, 163, 184, 0.8);
  --bmt-accent: #2563eb;
  --bmt-accent-soft: rgba(37, 99, 235, 0.08);
  --bmt-accent-2: #a855f7;
  --bmt-danger: #dc2626;
  --bmt-warning: #d97706;
  --bmt-info: #059669;
  --bmt-text-main: #111827;
  --bmt-text-muted: #6b7280;
  --bmt-nav-text: #374151;
}

/* -----------------------------
   Global layout
   ----------------------------- */
html, body {
  height: 100%;
}

.bmt-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--bmt-text-main);
  background:
    radial-gradient(circle at 0% 0%, rgba(221, 239, 253, 0.75) 0, transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(240, 249, 255, 0.85) 0, transparent 65%),
    var(--bmt-bg);
}

/* Avoid horizontal scrollbars */
body {
  overflow-x: hidden;
}

/* -----------------------------
   Top navbar (light)
   ----------------------------- */
.bmt-navbar {
  background: linear-gradient(120deg, #ffffff, #eef2ff);
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  z-index: 20;
}

.navbar-brand {
  padding: 0.2rem 0;
}

/* Brand icon */
.bmt-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 0%, #bfdbfe 0, #60a5fa 40%, #1d4ed8 100%);
  color: #0b1120;
  font-size: 0.9rem;
}

.bmt-brand-title {
  font-size: 1.2rem;
  line-height: 1.2;
  font-weight: 600;
  color: #111827;
}

.bmt-brand-subtitle {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--bmt-text-muted);
}

.bmt-nav-right {
  align-items: center;
}

/* Practice label & buttons on right */
.bmt-practice-label {
  color: var(--bmt-text-muted);
}

.bmt-btn-ghost {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background-color: #ffffff;
  color: #4b5563;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
}

.bmt-btn-ghost:hover {
  background-color: rgba(239, 246, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.8);
  color: #1d4ed8;
}

/* Practice dropdown width */
.bmt-practice-select {
  min-width: 240px;
  max-width: 280px;
  border-radius: 999px;
  border: 1px solid var(--bmt-border-subtle);
  background-color: #ffffff;
  color: var(--bmt-text-main);
  font-size: 0.8rem;
}

/* -----------------------------
   Nav links - icon only default
   ----------------------------- */
.bmt-nav-tabs .nav-link {
  position: relative;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem !important;
  border-radius: 999px;
  color: var(--bmt-nav-text);
  transition:
    color 0.15s ease-out,
    background-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    padding 0.15s ease-out;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

/* Icon wrapper */
.bmt-nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: transform 0.18s ease-out,
              background-color 0.18s ease-out,
              color 0.18s ease-out;
}

/* Icon itself */
.bmt-nav-icon i {
  font-size: 0.9rem;
}

/* Text label – hidden by default (desktop) */
/* Text label – always visible (desktop & mobile) */
.bmt-nav-text {
  font-size: 0.82rem;
  opacity: 1;
  max-width: 160px;
  overflow: hidden;
  transform: translateX(0);
  transition:
    opacity 0.18s ease-out,
    max-width 0.18s ease-out,
    transform 0.18s ease-out;
}


/* Hover: show background, show text, enlarge icon */
.bmt-nav-tabs .nav-link:hover {
  color: #111827;
  background-color: rgba(191, 219, 254, 0.6);
  padding-right: 0.9rem !important; /* more space when text is visible */
}

.bmt-nav-tabs .nav-link:hover .bmt-nav-icon {
  transform: scale(1.25);
  background-color: #2563eb;
  color: #ffffff;
}

.bmt-nav-tabs .nav-link:hover .bmt-nav-text {
  opacity: 1;
  max-width: 160px;
  transform: translateX(0);
}

/* Active state: gradient pill + text always visible */
/* Active state should look EXACTLY like hover */
.bmt-nav-tabs .nav-link.active {
  color: #111827;
  background-color: rgba(191, 219, 254, 0.6); /* same as hover */
  padding-right: 0.9rem !important;
  box-shadow: none; /* remove gradient pill effect */
}

/* Active icon same as hover icon */
.bmt-nav-tabs .nav-link.active .bmt-nav-icon {
  transform: scale(1.25);
  background-color: #2563eb;
  color: #ffffff;
}

/* Active text visible */
.bmt-nav-tabs .nav-link.active .bmt-nav-text {
  opacity: 1;
  max-width: 160px;
  transform: translateX(0);
}


/* Active menu keeps text visible without hover */
.bmt-nav-tabs .nav-link.active .bmt-nav-text {
  opacity: 1;
  max-width: 160px;
  transform: translateX(0);
}



/* -----------------------------
   Shell / container
   ----------------------------- */
.bmt-shell {
  padding: 1.25rem 1.5rem 2rem;
}

.bmt-container {
  max-width: 1400px;
}

/* Generic cards (light) */
.card {
  border-radius: 1rem;
  background: var(--bmt-surface);
  border: 1px solid var(--bmt-border-subtle);
  color: var(--bmt-text-main);
  box-shadow:
    0 12px 26px rgba(148, 163, 184, 0.25),
    0 0 0 1px rgba(226, 232, 240, 0.8);
  padding: 0.85rem !important;
}

.card-title {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  /* text-transform: uppercase; */
  color: var(--bmt-text-muted);
  margin-bottom: 0.45rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: #111827;
}

/* -----------------------------
   Dashboard-specific helpers
   ----------------------------- */
.bmt-page {
  padding-top: 0.25rem;
}

.bmt-page-header {
  border-radius: 1.2rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(120deg, #ffffff, #e0f2fe);
  border: 1px solid rgba(191, 219, 254, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.bmt-page-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.bmt-page-subtitle {
  font-size: 0.8rem;
  color: var(--bmt-text-muted);
}

.bmt-badge-soft {
  background-color: #eef2ff;
  color: #1f2937;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-weight: 500;
  font-size: 0.72rem;
}

/* KPI row */
.bmt-kpi-row .card {
  padding: 0.95rem !important;
}

.bmt-kpi-link {
  text-decoration: none;
}

.bmt-kpi-card {
  position: relative;
  overflow: hidden;
}

.bmt-kpi-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0% 0%, rgba(129, 199, 245, 0.25) 0, transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(191, 219, 254, 0.3) 0, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  transform: translate3d(0, 6px, 0);
  pointer-events: none;
}

.bmt-kpi-card:hover::before {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.bmt-kpi-card:hover {
  transform: translateY(-1px);
  transition: transform 0.15s ease-out;
  border-color: rgba(59, 130, 246, 0.7);
}

.bmt-kpi-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  /* text-transform: uppercase; */
  color: var(--bmt-text-muted);
}

.bmt-kpi-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111827;
}

.bmt-kpi-caption {
  font-size: 0.8rem;
  color: var(--bmt-text-muted);
}

.bmt-kpi-footer {
  font-size: 0.78rem;
  margin-top: 0.55rem;
}

.bmt-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bmt-accent-soft);
  color: var(--bmt-accent);
  font-size: 0.85rem;
}

.bmt-kpi-icon-danger {
  background-color: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
}

.bmt-kpi-icon-warning {
  background-color: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.bmt-kpi-icon-info {
  background-color: rgba(45, 212, 191, 0.18);
  color: #0f766e;
}

/* Section headers */
.bmt-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  /* text-transform: uppercase; */
  letter-spacing: 0.12em;
  color: var(--bmt-text-muted);
}

.bmt-section-accent {
  display: inline-block;
  width: 7px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #22c55e, #38bdf8, #a855f7);
}

.bmt-section-chip {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background-color: #f9fafb;
  color: var(--bmt-text-muted);
}

/* Alert cards */
.bmt-alert-link {
  text-decoration: none;
}

.bmt-alert-card {
  border-radius: 0.9rem;
  padding: 0.75rem 0.8rem;
  background: radial-gradient(circle at 0% 0%, rgba(191, 219, 254, 0.4) 0, transparent 55%),
              #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.7);
  transition: border-color 0.16s ease-out, transform 0.16s ease-out,
              box-shadow 0.16s ease-out;
  color: var(--bmt-text-main);
}

.bmt-alert-card:hover {
  border-color: rgba(59, 130, 246, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(148, 163, 184, 0.4);
}

.bmt-alert-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.12rem 0.55rem;
  letter-spacing: 0.06em;
  /* text-transform: uppercase; */
}

.bmt-alert-pill-danger {
  background-color: rgba(254, 202, 202, 0.9);
  color: #7f1d1d;
}

.bmt-alert-pill-warning {
  background-color: rgba(254, 243, 199, 0.9);
  color: #78350f;
}

.bmt-alert-pill-neutral {
  background-color: rgba(229, 231, 235, 0.9);
  color: #374151;
}

.bmt-alert-pill-info {
  background-color: rgba(204, 251, 241, 0.9);
  color: #134e4a;
}

.bmt-alert-pill-primary {
  background-color: rgba(191, 219, 254, 0.9);
  color: #1d4ed8;
}

.bmt-alert-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.bmt-alert-text {
  color: var(--bmt-text-main);
}

.bmt-alert-cta {
  font-size: 0.75rem;
  color: #1d4ed8;
}

/* AI suggestions list */
.bmt-ai-list .list-group-item {
  background-color: #ffffff;
  border-color: rgba(209, 213, 219, 0.9);
  font-size: 0.8rem;
  color: var(--bmt-text-main);
}

/* -----------------------------
   Dashboard widgets: layout / controls
   ----------------------------- */

/* Wrapper for each widget column */
.bmt-widget {
  position: relative;
}

/* Ensure card/alert surfaces can host overlay controls cleanly */
.bmt-widget .card,
.bmt-widget .bmt-alert-card {
  position: relative;
}

/* Hidden widgets */
.bmt-widget-hidden {
  display: none !important;
}

/* Tiny overlay controls inside each tile (top-right, clearly inside card) */
.bmt-widget-controls {
  position: absolute;
  /* Slightly lower & more inward so nothing hangs outside */
  top: 0.45rem;
  right: 0.6rem;
  display: inline-flex;
  gap: 0.25rem;
  z-index: 3;
  opacity: 0.4;  /* more visible by default */
  transition:
    opacity 0.16s ease-out,
    transform 0.16s ease-out;
}

/* On hover over the tile, make controls fully visible */
.bmt-widget .card:hover .bmt-widget-controls,
.bmt-widget .bmt-alert-card:hover .bmt-widget-controls {
  opacity: 1;
}

/* Small circular ghost buttons – one step bigger than before */
.bmt-widget-btn {
  border: none;
  border-radius: 999px;
  padding: 0.08rem 0.3rem;
  background-color: rgba(15, 23, 42, 0.04);
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
}

.bmt-widget-btn i {
  font-size: 0.65rem;
}

/* Hover highlight */
.bmt-widget-btn:hover {
  background-color: rgba(37, 99, 235, 0.18);
  color: #111827;
}

/* Drag handle cursor */
.bmt-widget-handle {
  cursor: grab;
}

.bmt-widget-handle:active {
  cursor: grabbing;
}


/* -----------------------------
   Charts
   ----------------------------- */
canvas {
  max-height: 260px;
  width: 100% !important;
}

/* -----------------------------
   Table wrapper (for small screens)
   ----------------------------- */
.bmt-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.bmt-table-wrapper table {
  min-width: 600px; /* allow horizontal scroll when many columns */
}

/* -----------------------------
   Login page (light)
   ----------------------------- */
.bmt-login-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(191, 219, 254, 0.9) 0, transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(221, 239, 253, 0.9) 0, transparent 70%),
    #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bmt-login-card {
  border-radius: 1.2rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #111827;
  box-shadow: 0 24px 55px rgba(148, 163, 184, 0.6);
}

.bmt-login-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}

.bmt-login-subtitle {
  font-size: 0.8rem;
  color: var(--bmt-text-muted);
}

/* Form controls */
.bmt-login-card .form-control {
  background-color: #ffffff;
  border-color: rgba(148, 163, 184, 0.8);
  color: #111827;
  font-size: 0.86rem;
}

.bmt-login-card .form-control:focus {
  background-color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
  color: #111827;
}

.bmt-login-card .btn-primary {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}

.bmt-login-card .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

.bmt-nav-tabs .dropdown-menu {
  margin-top: 6px;
}

.dropdown-menu .dropdown-item i {
  width: 18px;
  text-align: center;
}

/* -----------------------------
   Dropdown submenu should match parent nav style
   ----------------------------- */

/* Dropdown container */
.bmt-nav-tabs .dropdown-menu {
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 12px 26px rgba(148, 163, 184, 0.25);
  padding: 0.35rem;
}

/* Match font + size + weight to parent */
.bmt-nav-tabs .dropdown-menu .dropdown-item {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;       /* same as .bmt-nav-text */
  font-weight: 500;         /* same as .bmt-nav-tabs .nav-link */
  color: var(--bmt-nav-text);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
}

/* Icon alignment */
.bmt-nav-tabs .dropdown-menu .dropdown-item i {
  width: 30px;              /* match .bmt-nav-icon width */
  height: 30px;             /* match .bmt-nav-icon height */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.9rem;        /* match .bmt-nav-icon i */
}

/* Hover should feel like parent hover */
.bmt-nav-tabs .dropdown-menu .dropdown-item:hover,
.bmt-nav-tabs .dropdown-menu .dropdown-item:focus {
  background-color: rgba(191, 219, 254, 0.6); /* same as hover bg */
  color: #111827;
}

/* On hover, icon becomes like parent hover icon */
.bmt-nav-tabs .dropdown-menu .dropdown-item:hover i,
.bmt-nav-tabs .dropdown-menu .dropdown-item:focus i {
  background-color: #2563eb;
  color: #ffffff;
  transform: scale(1.1);
  transition: transform 0.18s ease-out;
}

/* Active dropdown item (optional but nice) */
.bmt-nav-tabs .dropdown-menu .dropdown-item.active {
  background-color: rgba(191, 219, 254, 0.6);
  color: #111827;
}

/* Info bubble icon styling (Acuity Ratio tooltips) */
.bmt-info-icon {
  cursor: pointer;
  color: var(--bmt-text-muted);
  font-size: 0.85rem;
  opacity: 0.85;
}

.bmt-info-icon:hover {
  color: #2563eb;
  opacity: 1;
}



/* -----------------------------
   Responsive tweaks
   ----------------------------- */

/* Tablets & down (<= 991.98px) */
@media (max-width: 991.98px) {

  .bmt-shell {
    padding: 1rem 1rem 1.5rem;
  }

  .bmt-container {
    max-width: 100%;
  }

  /* Navbar collapse: make items full width with text always visible */
  .bmt-nav-tabs {
    margin-top: 0.5rem;
  }

  .bmt-nav-tabs .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.45rem 0.7rem !important;
  }

  .bmt-nav-tabs .nav-link .bmt-nav-text {
    opacity: 1;
    max-width: 240px;
    transform: translateX(0);
  }

  .bmt-nav-tabs .nav-link:hover .bmt-nav-icon {
    transform: scale(1.1);
  }

  .bmt-nav-right {
    margin-top: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .bmt-practice-select {
    min-width: 200px;
    max-width: 100%;
  }

  .bmt-page-header {
    padding: 0.9rem 1rem;
  }

  .bmt-kpi-row .col-xl-3 {
    /* on tablets, 2 per row */
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Small devices (<= 768px) */
@media (max-width: 768px) {

  .bmt-shell {
    padding-inline: 0.75rem;
  }

  .card {
    padding: 0.75rem !important;
  }

  .bmt-page-header {
    padding: 0.85rem 0.85rem;
  }

  .bmt-page-title {
    font-size: 1.1rem;
  }

  .bmt-page-subtitle {
    font-size: 0.78rem;
  }

  .bmt-kpi-row .col-xl-3,
  .bmt-kpi-row .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  canvas {
    max-height: 220px;
  }

  /* Make login card breathing better on mobile */
  .bmt-login-card {
    padding: 1.25rem !important;
  }

  /* Smaller text for long date format inside KPI cards */
.small-date {
    font-size: 0.82rem !important;
    line-height: 1.2;
    display: block;
    margin-top: 4px;
}

/* ---------- Fix Diagnosis Widgets Consistent Size ---------- */

.dx-widget-card {
  min-height: 140px;            /* Adjust height if needed */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

/* Ensure text wraps cleanly and doesn't stretch card height excessively */
.dx-widget-card .card-title {
  line-height: 1.2;
  max-height: 3.5rem;
  overflow: hidden;
  word-break: break-word;
}

/* Center count number */
.dx-widget-card .count-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 4px;
}
/* ---- Force Diagnosis KPI Widget Fixed Height ---- */
.dx-widget-card {
  height: 160px !important;  /* <-- adjust if you want taller/shorter */
  min-height: 160px !important;
  max-height: 160px !important;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;          /* prevents text pushing height */
}

/* Lock title area to a fixed block so text can't move the card */
.dx-widget-card .card-title {
  display: block;
  height: 55px;              /* fixed space for 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* Count styling stays aligned */
.dx-widget-card p {
  margin: 0;
}
/* ---- Diagnosis Widget Count Styling ---- */
.dx-widget-card .dx-count {
  font-size: 1.6rem;
  font-weight: 700;
  color: #7c2d12 !important;  /* Deep burnt orange / copper tone */
}
/* Widget Counter Number Style Override */
.dx-widget-card .dx-widget-value,
.dx-widget-card p.fs-4 {
  font-weight: 700 !important;
  color: var(--bmt-accent) !important;
  letter-spacing: -0.5px;
}
/* Chart card header with right-side chart type button */
.bmt-chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bmt-chart-type-btn {
  border-radius: 999px;
  padding: 0.25rem 0.45rem;
}

.bmt-chart-type-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}
/* -----------------------------------
   Acuity Ratio UI Enhancements
----------------------------------- */
.bmt-chart-wrap {
  position: relative;
  height: 320px;
}

.bmt-chart-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  z-index: 5;
  border-radius: 12px;
}


}
