/* Import a clean professional font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background-color: #f4f6f8;
  margin: 0;
  padding: 0;
  color: #2c3e50;
}

/* Main Layout */
.container {
  display: flex;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  width: 100%;
}

/* Sidebar */


/* Match main content background */
.main-content {
  background-color: #ffffff;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

/* Set body and container to white */
body, .container {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}
  /* border-right: 1px solid #ddd; */ /* ← Remove or comment this */
.sidebar {
  width: 60px;
  overflow: hidden;
  background-color: #ffffff !important;
  color: #000000 !important;
  padding: 20px 10px;
  transition: width 0.3s ease;
  position: relative;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 20px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar-logo img {
  max-width: 70px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: all 0.3s ease;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar:hover .sidebar-logo img {
  max-width: 150px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar:hover {
  width: 220px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar button {
  background-color: #333;
  color: white;
  border: none;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 15px;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  transition: all 0.3s ease;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar button:hover {
  background-color: #007BFF;
  transform: translateY(-1px);
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar.collapsed .home-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  width: 100%;
  height: 60px;
  padding: 0;
  margin: 0 auto;
  background-color: transparent;
  border: none;
  box-shadow: none;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar .home-btn {
  background-color: #333;
  color: white;
  border: none;
  padding: 10px;
  margin: 8px auto 20px auto;
  font-size: 14px;
  border-radius: 8px;
  width: 100%;
  max-width: 120px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}


.sidebar .menu-btn {
  height: 0;
  opacity: 0;
  visibility: hidden;
  padding: 0;
  margin: 0;
  border: none;
  transition: none;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar:hover .menu-btn {
  height: auto;
  opacity: 1;
  padding: 10px 14px;
  margin: 8px 0;
  visibility: visible;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar .label {
  display: none;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar:hover .label {
  display: inline;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px;
  background-color: #ffffff;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

h2, h3 {
  color: #2c3e50;
  margin-top: 0;
}

/* Forms & Inputs */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #007BFF;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
  background-color: #f0f8ff;
}

/* Global Buttons */
button {
  background: linear-gradient(to right, #007BFF, #0056b3);
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  max-width: 240px;
  transition: all 0.25s ease;
}

button:hover {
  background: linear-gradient(to right, #0056b3, #003f7f);
  transform: scale(1.03);
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Small Icon Buttons */
button[title] {
  padding: 6px 10px;
  font-size: 13px;
  min-width: auto;
}

/* Card Boxes */
form, .main-content > div {
  background-color: #ffffff;
  padding: 30px;
  margin-top: 25px;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}

/* Locations Grouping */
#locations {
  display: flex;
  flex-direction: column;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.location-row input {
  flex: 1;
  min-width: 0;
}

.location-row button {
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  background-color: #e74c3c;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

.location-row button:hover {
  background-color: #c0392b;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  font-size: 14px;
}

th, td {
  padding: 10px 14px;
  border: 1px solid #ddd;
  text-align: left;
}

th {
  background-color: #f1f3f5;
  color: #2c3e50;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

tr:hover {
  background-color: #eef6ff;
  transition: background 0.2s ease-in-out;
}

/* Practice Login Filter Grid */
#practiceLoginSearch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 25px;
}

#practiceLoginSearch input {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  font-size: 14px;
  table-layout: fixed;   /* ✅ Ensure columns fit the container */
  word-wrap: break-word; /* ✅ Allow content to wrap */
}

td, th {
  word-break: break-word;
  white-space: normal;
}

/* Responsive */
.chart-container-grid {
    grid-template-columns: 1fr !important;
}

.sidebar:hover {
    width: 200px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar button {
    font-size: 14px;
    padding: 8px 12px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

  
.report-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Chart Popup */
#chartPopup canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 800px;
}

.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f7f9fb;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.login-card {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-logo {
  width: 200px;
  margin-bottom: 10px;
}

.login-subtext {
  color: #6c757d;
  margin-bottom: 25px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
}

.login-button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to right, #007BFF, #0056b3);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.login-button:hover {
  background: linear-gradient(to right, #0056b3, #004080);
}

.login-link {
  display: inline-block;
  margin-top: 15px;
  font-size: 14px;
  color: #007BFF;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.login-error {
  color: red;
  margin-bottom: 10px;
  font-size: 14px;
}

/* Mobile Sidebar open toggle */
.sidebar.open-mobile {
  width: 220px !important;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar.open-mobile .menu-btn {
  height: auto;
  opacity: 1;
  padding: 10px 14px;
  margin: 8px 0;
  visibility: visible;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar.open-mobile .label {
  display: inline;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.container {
    flex-direction: row; /* ⬅️ Keep sidebar on left, content on right */
  display: flex;
  flex-direction: row;
  width: 100%;
}

.sidebar {
    width: 220px !important;
    position: relative;
    height: auto;
    overflow: visible;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.main-content {
    padding: 20px;
    flex: 1;
    overflow-x: auto;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

#mobileMenuToggle {
    display: none !important;
}


.sidebar:hover {
    width: 220px !important;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar .label {
    display: inline !important;
    opacity: 1 !important;
    height: auto !important;
    padding: 10px 14px;
    margin: 8px 0;
    visibility: visible !important;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar.collapsed {
    width: 220px !important;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}


.main-content {
    padding-left: 220px;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

/* ==== FINAL MOBILE FIXES (FOR iOS + Android) ==== */
body, html {
    overflow-x: hidden;
}

.main-content {
    padding: 15px !important;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

.container {
    flex-direction: column;
  display: flex;
  flex-direction: row;
  width: 100%;
}

.sidebar {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 !important;
    background-color: #ffffff;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar .home-btn {
    width: 90% !important;
    max-width: 240px;
    min-width: 240px;
    font-size: 14px;
    padding: 12px 16px;
    margin: 6px 0;
    text-align: center;
    display: block;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.login-card {
    padding: 20px;
}

.login-logo {
    width: 150px;
}

input, select, textarea {
    font-size: 14px;
    padding: 10px;
}

button {
    font-size: 14px;
    padding: 10px 12px;
}

table {
    font-size: 13px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

#content h3 {
    font-size: 18px;
}

.location-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.location-row button {
    width: 100%;
    margin: 5px 0;
}

/* Remove unintentional space above and below buttons */
button[onclick="renderContractPreview()"] {
  margin-top: 0;
}

.edit-client-section {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
  margin-top: 30px;
}
.contract-log-entry {
  margin: 8px 0;
  background: #f8f8f8;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
.contract-log-entry select, .contract-log-entry button {
  margin-left: 10px;
}

#insuranceNameDropdown {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.container {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent sideways overflow */
  display: flex;
  flex-direction: row;
  width: 100%;
}

.main-content {
  flex: 1;
  padding: 40px;
  background-color: #ffffff;
  max-width: 1500px;   /* ✅ Prevents overflow */
  margin-left: auto;   /* ✅ Centers the content */
  margin-right: auto;
  overflow-x: auto;    /* ✅ Scrolls internally if content exceeds width */
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

/* ---------- Theme tokens ---------- */
:root{
  --bg: #f8fafc;          /* page bg */
  --card: #ffffff;        /* cards / navbar */
  --text: #0f172a;        /* slate-900 */
  --muted: #64748b;       /* slate-500 */
  --line: #e5e7eb;        /* border */
  --accent: #2563eb;      /* blue-600 */
  --accent-50:  #eff6ff;
  --accent-100: #dbeafe;
  --accent-200: #bfdbfe;
}

/* Page background + text */

/* ---------- Tabs (Practice | Locations | Providers) ---------- */
.tabs button{
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f1f5f9;            /* slate-100 */
  color: #334155;                  /* slate-700 */
  font-weight: 600;
  cursor: pointer;
  transition: .15s ease;
}
.tabs button.active{
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ---------- Sidebar (hover expand, cleaner look) ---------- */
.sidebar{
  position:fixed; top:0; left:0; bottom:0;
  width:72px;                     /* collapsed */
  background:#0b1220;             /* deep slate/navy */
  color:#e5e7eb;
  padding:12px 8px;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: width .2s ease;
  display:flex; flex-direction:column; gap:6px;
  z-index: 20;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar button{
  all: unset;
  color:#cbd5e1;
  font-weight:600;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  display:flex; align-items:center; gap:10px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

.sidebar button.active{
  background: rgba(37,99,235,.18);
  color:#fff;
  box-shadow: inset 3px 0 0 var(--accent);
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Push content to the right of sidebar */

/* ---------- Top bar (email chip + logout) ---------- */
.main-content .topbar{
  position: sticky; top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 8px 20px rgba(2,6,23,.04);
  margin-bottom: 16px;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

/* Email “chip” */
.user-chip{
  display:inline-flex; align-items:center; gap:8px;
  background: var(--accent-50);
  border:1px solid var(--accent-200);
  color:#1e3a8a;                 /* blue-800 */
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
}

/* Logout button more polished */
#logoutBtn{
  background: var(--accent);
  color:#fff;
  border:0; border-radius:10px;
  padding:8px 12px;
  font-weight:600;
  cursor:pointer;
  transition: filter .12s ease, transform .05s ease;
}

/* ---------- Cards & headings (slightly sharper) ---------- */
.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 8px 22px rgba(2,6,23,.03);
}

/* Tables */

/* ------- Global look & tokens ------- */
:root{
  --brand: #2ca01c;      /* QuickBooks green */
  --ink:   #0f172a;      /* slate-900 */
  --muted: #64748b;      /* slate-500 */
  --line:  #e5e7eb;      /* borders */
  --bg:    #f6f7f8;      /* app background */
  --panel: #ffffff;      /* cards/topbar */
  --pill:  #eef2f6;      /* soft gray */
}

/* ------- Top bar (QuickBooks-style) ------- */
.topbar.qb{
  position: sticky; top: 8px;
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 10px 24px rgba(2,6,23,.05);
  margin-bottom: 16px;
}
.qb-left .qb-breadcrumb{
  font-weight: 600; color: #111827; letter-spacing:.2px;
}

/* Profile chip */
.profile-chip{
  display:flex; align-items:center; gap:10px;
  background: var(--pill);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  cursor: pointer; user-select: none;
}
.profile-chip .avatar{
  width:28px; height:28px; border-radius:50%;
  display:grid; place-items:center;
  font-weight:700; color:#fff; background: var(--brand);
}

/* Profile dropdown */
.profile-menu{
  position:absolute; right:0; top:44px;
  background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:6px;
  width: 170px; box-shadow: 0 16px 34px rgba(2,6,23,.15);
  display:none; z-index: 50;
}
.profile-menu button{
  all:unset; display:block; width:100%;
  padding:8px 10px; border-radius:8px; cursor:pointer;
  color:#111827; font-weight:500;
}

/* ------- Sidebar (light, crisp, active border) ------- */
.sidebar{
  background: #ffffff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  width: 80px; /* collapsed */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}
.sidebar button{
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 12px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}
.sidebar button.active{
  background: #eaf7ea;                    /* pale green */
  color: #065f46;                          /* teal-800 */
  box-shadow: inset 4px 0 0 var(--brand);  /* left border */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* ------- Tabs (readable) ------- */
.tabs button{
  padding: 9px 14px; border-radius:12px; font-weight:600;
  border: 1px solid var(--line); background:#f1f5f9; color:#334155;
}
.tabs button.active{
  background:#eaf7ea; color:#065f46;
  border-color: #b9e0b3; box-shadow: inset 0 0 0 1px #b9e0b3;
}

/* ------- Cards/Headings/Tables (slight polish) ------- */
.card{
  background: var(--panel); border:1px solid var(--line);
  border-radius: 16px; padding: 16px;
  box-shadow: 0 10px 26px rgba(2,6,23,.04);
}

/* Make profile avatar match our blue button */
.profile-chip .avatar{
  background: #2563eb;            /* blue */
}

/* Optional: blue focus ring on the chip */
.profile-chip:focus{
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Sidebar active = blue (light background, blue border/label) */
.sidebar button.active{
  background: #EEF2FF;          /* light blue background */
  color: #1E3A8A;               /* blue-800 text */
  box-shadow: inset 4px 0 0 #2563EB; /* blue left border */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Tabs: make active pill blue to match sidebar */
.tabs button.active{
  background: #EEF2FF;            /* light blue */
  color: #1E3A8A;                  /* blue-800 text */
  border-color: #BFDBFE;           /* blue-200 border */
  box-shadow: inset 0 0 0 1px #BFDBFE, 0 0 0 3px rgba(37,99,235,.10);
}

/* Optional: nicer hover even when active */
.tabs button.active:hover{
  background: #E0E7FF;            /* slightly darker light blue */
}

/* ========= Layout constants ========= */
:root{
  --sidebar-collapsed: 72px;
  --sidebar-expanded: 240px;
}

/* ========= Sidebar: overlay (no content push) ========= */
.sidebar{
  width: var(--sidebar-collapsed);
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}
.sidebar:hover{
  width: var(--sidebar-expanded);
  position: fixed;            /* overlay the content instead of pushing it */
  left: 0; top: 0; bottom: 0;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}
.main-content{
  margin-left: var(--sidebar-collapsed);   /* constant margin */
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}
.sidebar:hover ~ .main-content{
  margin-left: var(--sidebar-collapsed);   /* keep content steady (no big gap) */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* ========= Top bar: tighten up ========= */
.topbar.qb{
  padding: 6px 10px;          /* was larger */
  border-radius: 12px;
  margin-bottom: 8px;         /* reduce dead space under top bar */
  box-shadow: 0 6px 16px rgba(2,6,23,.04);
}

/* Breadcrumb: look like plain text (not a pill) */
.qb-left .qb-breadcrumb{
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;
  font-weight: 700;
}

/* OPTIONAL: completely hide duplicate page title under the top bar */

/* ========= Tabs: slimmer & closer to top ========= */
.tabs button{
  padding: 6px 10px;                                /* slimmer pills */
  border-radius: 10px;
}
.tabs button.active{
  background: #EEF2FF;                              /* light blue (matches your theme) */
  color: #1E3A8A;
  border-color: #BFDBFE;
  box-shadow: inset 0 0 0 1px #BFDBFE;
}

/* ========= Cards: a touch tighter ========= */

/* ========= Sidebar logo: tidy (hide placeholder) ========= */
/* OR show initials instead — uncomment to use:
.sidebar-logo::before{
  content: "AW";
  display:inline-grid; place-items:center;
  width:32px; height:32px; border-radius:50%;
  background:#2563EB; color:#fff; font-weight:700;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* ====== SIDEBAR: fixed width, no expand, icon-only ====== */
:root{
  --sidebar-collapsed: 72px;
}

.sidebar{
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-collapsed) !important;          /* fixed */
  overflow: visible;                                    /* let tooltip overflow */
  z-index: 20;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Never change width on hover */

/* Keep content margin constant (no overlap/gap) */
.main-content{
  margin-left: var(--sidebar-collapsed) !important;
  flex-grow: 1;
  width: calc(100% - 60px);
  overflow-x: auto;
}

/* Make all menu buttons visible in collapsed mode (icons only) */
.sidebar .menu-btn{
  height: 48px !important;
  opacity: 1 !important;
  visibility: visible !important;
  padding: 10px 12px !important;
  margin: 6px 0 !important;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Hide inline labels; we'll show a floating tooltip instead */

/* ====== ICON TOOLTIP NEXT TO SIDEBAR ====== */
.sidebar button::after{
  content: attr(data-label);               /* we’ll set data-label via HTML below */
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 8px 20px rgba(2,6,23,.18);
  z-index: 999;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}
.sidebar button:hover::after{
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Optional: tiny arrow on the tooltip */
.sidebar button:hover::before{
  content: "";
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #0f172a;
  opacity: 1;
  z-index: 999;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* ===== Brand logo placements ===== */

/* Login page logo (big, centered) */
.login-card .login-logo{
  width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}

/* Sidebar tiny logo (overrides any earlier 'display:none') */
.sidebar-logo{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}
.sidebar-logo img{
  display: block !important;   /* override any previous hide */
  width: 40px;                 /* tidy square */
  height: auto;
  border-radius: 8px;          /* soft corners; remove if you want square */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Top bar mini mark next to "Info" */
.topbar.qb .qb-left{
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark{
  height: 22px;                /* small, unobtrusive */
  width: auto;
  display: block;
}

/* ---- Sidebar: lock width, tidy spacing, icon-only buttons ---- */

.sidebar{
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-fixed) !important;
  padding: 12px 8px !important;      /* give it a little top padding */
  overflow: visible;
  z-index: 20;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Do NOT expand on hover */

/* Content stays put (no overlap gap) */

/* Unify all sidebar buttons (kills the special "big Home" style) */
.sidebar.collapsed .home-btn{
  all: unset;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 48px;
  margin: 6px 0; border-radius: 12px; cursor: pointer;
  color: #334155; font-size: 22px;         /* icon size */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Hide inline text labels so only the icon shows */

/* Active highlight (blue) */
.sidebar button.active{
  background: #EEF2FF;
  color: #1E3A8A;
  box-shadow: inset 4px 0 0 #2563EB;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* Login page logo */
.login-card .login-logo{
  width: 180px; height: auto; display:block; margin: 0 auto 10px;
}

/* Sidebar tiny logo */

/* Top bar mini mark */

/* Final lock for the fixed, icon-only sidebar */
.sidebar .menu-btn{ all:unset; display:flex; align-items:center; justify-content:center;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  flex-shrink: 0;
}

/* === Appt F/U alignment — FINAL OVERRIDE (paste at end of style.css) === */
:root {
  --fu-acct: 110px;
  --fu-name: 220px;
  --fu-ins: 200px;
  --fu-status: 140px;
  --fu-rem: 140px;
}

section#page-apptfu .fu-filters select{
  width: 100% !important;
  height: 34px !important;
  min-width: 0 !important;           /* prevents select/input from overflowing */
  box-sizing: border-box !important;
  margin: 0 !important;
}

.fu-table{
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}


.fu-table th, .fu-table td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
}

/* === Appt F/U: border + track sync (FINAL) === */
  /* we already set the same column widths via CSS vars */

  /* draw the same left/right frame as the table so edges align */


  /* draw vertical separators to match table's collapsed borders */

  /* ensure inputs don't stretch tracks */


/* first cell needs a left border to match the table's first column */
.fu-filters > :first-child{
  border-left: 1px solid #e5e7eb !important;
}

/* table stays fixed + variable-driven widths */

/* === APPT F/U — final lock (leave at very end) === */
section#page-apptfu .fu-filters > *{
  border-top:1px solid #e5e7eb !important;
  border-bottom:1px solid #e5e7eb !important;
  border-right:1px solid #e5e7eb !important;
  border-left:none !important;
  width:100% !important;
  height:34px !important;
  margin:0 !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
section#page-apptfu .fu-table{
  width:100% !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
  border-spacing:0 !important;
}


.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 60px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  width: calc(100% - 60px);
  padding: 20px;
  overflow-x: auto;
}

.table-container {
  width: 100%;
  max-width: 100%;
}


/* Main Layout */
.container {
  display: flex;
  width: 100%;
}

.sidebar {
  width: 60px;
  background-color: #ffffff;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow: hidden;
  transition: width 0.3s;
  z-index: 1000;
}

.main-content {
  flex-grow: 1;
  padding: 20px;
  margin-left: 60px;
  width: calc(100% - 60px);
  max-width: none !important;
  margin-right: 0 !important;
}

.table-wrapper,
.content-wrapper,
.page-wrapper {
  width: 100%;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding: 0;
}

/* Filters and Headings alignment */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.filter-input,
.filter-select,
.filter-date {
  padding: 5px 10px;
  font-size: 14px;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
}

th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #ccc;
}

/* Utilities */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #f4f6f8;
  color: #2c3e50;
}

h2 {
  margin-top: 0;
}


/* === FINAL FIX: Appt F/U Table auto-sizing === */
.main-content table,
.fu-table {
  width: 100% !important;         /* full width, no extra gap */
  max-width: 100% !important;
  table-layout: auto !important;  /* auto-adjust columns based on content */
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

.main-content table th,
.main-content table td,
.fu-table th,
.fu-table td {
  white-space: normal !important;  /* allow wrapping */
  word-break: break-word !important;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 14px;
}

/* === Simplify top bar: only show profile chip === */
.topbar .qb-left {
  display: none !important;   /* hide logo + Welcome Back */
}

.topbar.qb {
  justify-content: flex-end !important;
  padding: 8px 16px !important;
}

/* === Remove topbar layout background, keep only profile chip === */
.topbar.qb {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

.topbar .qb-left {
  display: none !important;
}


/* ============================================================
   Profile dropdown — non-scroll, professional placement
   ============================================================ */
.topbar.qb {
  position: relative !important;   /* anchor only if needed */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  overflow: visible !important;    /* let dropdown escape */
}

/* Ensure the main content doesn't clip the dropdown vertically */
.main-content {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Base menu look */
.profile-menu {
  display: none;
  position: fixed;                 /* fixed to viewport for no-scroll behavior */
  right: 0;                        /* will be overridden by JS */
  top: 40px;                       /* will be overridden by JS */
  z-index: 9999 !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Shown state toggled by JS */
.profile-menu.open { display: block !important; }

/* Optional: small visual hint for drop-up */
.profile-menu.drop-up::after {
  content: "";
  position: absolute;
  left: calc(100% - 18px);
  bottom: -6px;
  border: 6px solid transparent;
  border-top-color: rgba(0,0,0,0.08);
  display: none; /* subtle; keep hidden unless you want an arrow */
}


/* =============================================================
   FULL-WIDTH MAIN CONTENT (override) — 2025-09-11
   - Sidebar locked to 60px (fixed)
   - Main content fills the entire remaining width
   - Remove inner wrappers' max-width and centering gaps
   ============================================================= */

/* Layout baseline */
.container{ display:flex !important; width:100% !important; min-height:100vh !important; }
.sidebar{ position:fixed !important; left:0; top:0; bottom:0; width:60px !important; min-width:60px !important; max-width:60px !important; }
.main-content{
  margin-left:60px !important;              /* account for fixed sidebar */
  width:calc(100% - 60px) !important;
  max-width:none !important;
  min-width:0 !important;
  padding:20px !important;                  /* tweak as you like */
  margin-right:0 !important;
  overflow-x:auto !important;
}

/* Kill centering/max-width caps inside main area */
.main-content,
.main-content *:where(.content,.contents,.content-wrapper,.wrapper,.wrap,.page,.page-body,.page-content,.inner,.inner-wrap,.container-inner,.grid,.sheet,.card-container,.table-container,.table-wrapper,.page-wrapper){
  max-width:none !important;
  width:100% !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

/* Cards/forms stretch to full width */
.main-content > .card,
.main-content > form,
.main-content > div{
  width:100% !important;
  max-width:none !important;
}

/* Top bar stays minimal (no white bar), but provides positioning context */
.topbar.qb{
  position:relative !important;
  background:transparent !important; border:none !important; box-shadow:none !important;
  padding:0 !important; margin:0 !important; height:auto !important;
  display:flex !important; justify-content:flex-end !important; align-items:center !important;
}

/* Tables: use full width; allow wrapping so no wasted gap */
.main-content table{
  width:100% !important;
  max-width:100% !important;
  table-layout:auto !important;
  border-collapse:collapse !important;
}
.main-content table th,
.main-content table td{
  white-space:normal !important;
  word-break:break-word !important;
}

/* If previous mobile rules forced table to block/nowrap, undo on desktop */
@media (min-width: 768px){
  .main-content table{ display:table !important; white-space:normal !important; }
}

/* Ensure nothing clips the profile dropdown */
.main-content{ overflow-y:visible !important; }


/* =============================================================
   FINAL OVERRIDES — Sidebar overlap + Filter width
   Date: 2025-09-11
   ============================================================= */
:root{
  --sidebar-w: 60px;
}

/* Keep sidebar fixed at 60px */
.sidebar{
  position: fixed !important;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w) !important;
  min-width: var(--sidebar-w) !important;
  max-width: var(--sidebar-w) !important;
  z-index: 1000 !important;
}

/* Push ALL app content to the right of the fixed sidebar */
.container{
  display: block !important;
  padding-left: var(--sidebar-w) !important;   /* <-- avoids overlap under sidebar */
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Main content now occupies the rest, no extra left margins */
.main-content{
  margin-left: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 20px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;  /* so profile dropdown isn't clipped */
  box-sizing: border-box !important;
}

/* Kill any inner wrappers that re-center/cap width */
.main-content,
.main-content *:where(.content,.contents,.content-wrapper,.wrapper,.wrap,.page,.page-body,.page-content,.inner,.inner-wrap,.container-inner,.grid,.sheet,.card-container,.table-container,.table-wrapper,.page-wrapper){
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Cards and forms stretch */
.main-content > .card,
.main-content > form,
.main-content > div{
  width: 100% !important;
  max-width: none !important;
}

/* Top bar stays minimal */
.topbar.qb{
  position: relative !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

/* Tables fill width, columns auto-size */
.main-content table,
.fu-table{
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}
.fu-table col{ width: auto !important; }

/* === Appt F/U filters: expand like table === */


/* Inputs/selects fill their grid track and don't overflow */
.fu-filters > *{
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  box-sizing: border-box !important;
}

/* If any previous mobile rule forced table to block/nowrap, undo on desktop */
@media (min-width: 768px){
  .main-content table{ display: table !important; white-space: normal !important; }
}


/* =============================================================
   APPT F/U — Expand & Align Filters with Table (High Specificity)
   Date: 2025-09-11
   ============================================================= */

/* Column proportions (sum = 100%) */
#page-apptfu {
   --fu-acct: 8%;
  --fu-name: 14%;
  --fu-dob: 10%;     /* ✅ new */
  --fu-ins: 19%;
  --fu-prov: 15%;
  --fu-apptdate: 14%;
  --fu-status: 10%;
  --fu-rem: 10%;
}

/* Make the card and its contents full-width */
#page-apptfu .card{
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}



/* Inputs/selects fill their grid tracks */
#page-apptfu .card .fu-filters > *{
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  box-sizing: border-box !important;
}

/* Apply the SAME column proportions to the table via <colgroup> */
#page-apptfu .fu-table{
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;           /* respect our column widths */
  border-collapse: collapse !important;
}
#page-apptfu .fu-table col.col-acct   { width: var(--fu-acct)   !important; }
#page-apptfu .fu-table col.col-name   { width: var(--fu-name)   !important; }
#page-apptfu .fu-table col.col-dob    { width: var(--fu-dob) !important; }
#page-apptfu .fu-table col.col-ins    { width: var(--fu-ins)    !important; }
#page-apptfu .fu-table col.col-prov   { width: var(--fu-prov) !important; }
#page-apptfu .fu-table col.col-apptdate { width: var(--fu-apptdate) !important; }
#page-apptfu .fu-table col.col-status { width: var(--fu-status) !important; }
#page-apptfu .fu-table col.col-rem    { width: var(--fu-rem)    !important; }

/* Friendly wrapping so long values don't overflow */
#page-apptfu .fu-table th,
#page-apptfu .fu-table td{
  white-space: normal !important;
  word-break: break-word !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}


/* Pager styling */
.pager { width: 100%; margin-top: 10px; }
.pager-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; }
.pager-left { font-size: 13px; color: #64748b; }
.pager-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-btn, .pg-num {
  background: #a8bdeb;
  border: 1px solid #a8bdeb;;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.pg-btn[disabled], .pg-num[disabled] { opacity: 0.5; cursor: default; }
.pg-num.active { background: #064bdf; color: #fff; border-color: #064bdf; }
.pg-ellipsis { padding: 0 6px; color: #94a3b8; }

/* make modal scrollable if content is too tall */
.modal {
  max-height: 90vh;       /* don’t exceed viewport height */
  overflow-y: auto;       /* enable vertical scroll */
  display: flex;
  flex-direction: column;
}

.modal h3 {
  flex-shrink: 0;         /* keep header fixed */
}

.modal .row {
  flex: 1;                /* take available space */
  overflow-y: auto;       /* scrollable content */
  margin-bottom: 12px;
}

.modal-actions {
  flex-shrink: 0;         /* keep actions fixed at bottom */
  background: #fff;       /* white background so buttons are visible */
  position: sticky;
  bottom: 0;
  padding-top: 10px;
}

/* Style for read-only inputs */
input[readonly], textarea[readonly] {
  background-color: #f3f4f6;   /* light grey */
  color: #26282a;              /* muted text */
  cursor: not-allowed;         /* shows they can't type */
  border: 1px solid #d1d5db;   /* softer border */
}

/* =============================================================
   RECALLS — Expand & Align Filters with Table
   ============================================================= */
#page-recalls {
  --rec-acct: 8%;
  --rec-name: 13%;
  --rec-dob: 9%;
  --rec-ins: 16%;
  --rec-prov: 14%;
  --rec-apptdate: 12%;
  --rec-status: 9%;
  --rec-rem: 9%;
  --rec-due: 10%;
}

/* Filters */

#page-recalls .card .fu-filters > *{
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  box-sizing: border-box !important;
}

/* Table */
#page-recalls .fu-table{
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}
#page-recalls .fu-table col.col-acct   { width: var(--rec-acct)   !important; }
#page-recalls .fu-table col.col-name   { width: var(--rec-name)   !important; }
#page-recalls .fu-table col.col-dob    { width: var(--rec-dob) !important; }
#page-recalls .fu-table col.col-ins    { width: var(--rec-ins)    !important; }
#page-recalls .fu-table col.col-prov   { width: var(--rec-prov)   !important; }
#page-recalls .fu-table col.col-apptdate { width: var(--rec-apptdate) !important; }
#page-recalls .fu-table col.col-status { width: var(--rec-status) !important; }
#page-recalls .fu-table col.col-rem    { width: var(--rec-rem)    !important; }
#page-recalls .fu-table col.col-due { width: var(--rec-due) !important; } /* NEW */

/* =============================================================
   NOT IN ECW — Expand & Align Filters with Table
   ============================================================= */
#page-notinecw {
  --niecw-acct: 12%;   /* Patient Acc# */
  --niecw-name: 28%;   /* Patient Name */
  --niecw-dob: 15%;    /* DOB */
  --niecw-ins: 20%;    /* Insurance */
  --niecw-prov: 25%;   /* Provider */
}



#page-notinecw .card .fu-filters > * {
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  box-sizing: border-box !important;
}

#page-notinecw .fu-table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

#page-notinecw .fu-table col.col-acct { width: var(--niecw-acct) !important; }
#page-notinecw .fu-table col.col-name { width: var(--niecw-name) !important; }
#page-notinecw .fu-table col.col-dob  { width: var(--niecw-dob)  !important; }
#page-notinecw .fu-table col.col-ins  { width: var(--niecw-ins)  !important; }
#page-notinecw .fu-table col.col-prov { width: var(--niecw-prov) !important; }

/* =============================================================
   FINAL FILTER GRID ALIGNMENT (Appt F/U, Recalls, Not In ECW)
   ============================================================= */

/* Appt F/U: 8 columns */
#page-apptfu .card .fu-filters {
  display: grid !important;
  grid-template-columns: 
    var(--fu-acct)
    var(--fu-name)
    var(--fu-dob)
    var(--fu-ins)
    var(--fu-prov)
    var(--fu-apptdate)
    var(--fu-status)
    var(--fu-rem) !important;
  gap: 0 !important;
}

/* Recalls: 8 columns */
#page-recalls .card .fu-filters {
  display: grid !important;
  grid-template-columns:
    var(--rec-acct)
    var(--rec-name)
    var(--rec-dob)
    var(--rec-ins)
    var(--rec-prov)
    var(--rec-apptdate)
    var(--rec-status)
    var(--rec-rem)
    var(--rec-due) !important;  /* NEW */
  gap: 0 !important;
}

/* Not In ECW: 5 columns */
#page-notinecw .card .fu-filters {
  display: grid !important;
  grid-template-columns:
    var(--niecw-acct)
    var(--niecw-name)
    var(--niecw-dob)
    var(--niecw-ins)
    var(--niecw-prov) !important;
  gap: 0 !important;
}

/* =============================================================
   TERMED PATIENTS — Expand & Align Filters with Table
   ============================================================= */
#page-termed-patients {
  --termed-acct: 8%;
  --termed-name: 14%;
  --termed-dob: 10%;
  --termed-ins: 19%;
  --termed-prov: 15%;
  --termed-apptdate: 14%;
  --termed-status: 10%;
  --termed-rem: 10%;
}

/* Filters */
#page-termed-patients .card .fu-filters {
  display: grid !important;
  grid-template-columns:
    var(--termed-acct)
    var(--termed-name)
    var(--termed-dob)
    var(--termed-ins)
    var(--termed-prov)
    var(--termed-apptdate)
    var(--termed-status)
    var(--termed-rem) !important;
  gap: 0 !important;
}

#page-termed-patients .card .fu-filters > * {
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  box-sizing: border-box !important;
}

/* Table */
#page-termed-patients .fu-table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

#page-termed-patients .fu-table col.col-acct     { width: var(--termed-acct) !important; }
#page-termed-patients .fu-table col.col-name     { width: var(--termed-name) !important; }
#page-termed-patients .fu-table col.col-dob      { width: var(--termed-dob) !important; }
#page-termed-patients .fu-table col.col-ins      { width: var(--termed-ins) !important; }
#page-termed-patients .fu-table col.col-prov     { width: var(--termed-prov) !important; }
#page-termed-patients .fu-table col.col-apptdate { width: var(--termed-apptdate) !important; }
#page-termed-patients .fu-table col.col-status   { width: var(--termed-status) !important; }
#page-termed-patients .fu-table col.col-rem      { width: var(--termed-rem) !important; }

/* =============================================================
   ACTIVE & TERMED PT SUMMARY — Consistent Filters + Summary Boxes
   ============================================================= */
/* --- Active & Termed Pt Summary Filters --- */
/* ===== Unify Active & Termed checkbox grids (no JS changes) ===== */

/* 1) Make all four wrappers flow as a responsive grid */
#apsProvBox,
#apsInsBox,
#termedSummaryProviderWrap,
#termedSummaryInsuranceWrap {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
}

/* 2) Normalize label + checkbox alignment (override inline display:block) */
#apsProvBox label,
#apsInsBox label,
#termedSummaryProviderWrap label,
#termedSummaryInsuranceWrap label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  cursor: pointer;
}

/* 3) Tidy up the controls */
#apsProvBox input[type="checkbox"],
#apsInsBox input[type="checkbox"],
#termedSummaryProviderWrap input[type="checkbox"],
#termedSummaryInsuranceWrap input[type="checkbox"] {
  transform: scale(1.1);
  margin: 0;
}

/* 4) Termed-only: hide the extra headings injected by JS */
#termedSummaryProviderWrap > b,
#termedSummaryInsuranceWrap > b {
  display: none;
}

@media (max-width: 900px) {
  #apsProvBox,
  #apsInsBox,
  #termedSummaryProviderWrap,
  #termedSummaryInsuranceWrap {
    grid-template-columns: 1fr;   /* single column on narrow screens */
  }
}

#userReportFilters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
#userReportFilters input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
}
#userReportFilters button {
  padding: 8px 12px;
}

.leaderboard {
  margin-top: 20px;
}
.leaderboard table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard th, .leaderboard td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}
.leaderboard th {
  background: var(--accent-50, #eef);
  font-weight: 600;
}
.top-performer {
  background: #e0f7fa;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #00796b;
}



/* =========================
   ROSTER – Clean Professional Style
   ========================= */

#page-roster .card {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

/* Header */
#page-roster .collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--accent-50);
  border-bottom: 1px solid var(--line);
}
#page-roster .collapse-header h3 {
  margin: 0;
  font: 700 18px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0.2px;
  color: var(--text);
}
#page-roster .collapse-header .caret {
  font-size: 18px;
  color: #64748b;
}

/* Body container */
#page-roster .collapse-body {
  background: #fff;
  padding: 12px 18px 18px;
}

/* Vertical list */
#page-roster .roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

/* Item buttons */
#page-roster .roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  color: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Hover effect */
#page-roster .roster-item:hover {
  background: #f8fbff;
  border-color: var(--accent-200);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

/* Chevron on the right */
#page-roster .roster-item::after {
  content: "›";
  font-size: 18px;
  color: #64748b;
  margin-left: auto;
}

/* Remove circular icons */
#page-roster .roster-item::before {
  content: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  #page-roster .collapse-header {
    padding: 12px 14px;
  }
  #page-roster .roster-item {
    padding: 10px 12px;
  }
}

/* ===== Sidebar chevron on Roster ===== */
.menu-btn { position: relative; }
#sidebarRoster::after{
  content:"›";
  position:absolute;
  right:14px;
  top:50%;
  transform: translateY(-50%);
  font-size:16px;
  opacity:.6;
}

/* ===== Roster Flyout (QuickBooks-like) ===== */
#roster-flyout{
  position: fixed;
  z-index: 50;      /* above page content */
  left: 260px;      /* JS will override with exact value */
  top: 80px;        /* JS will override with exact value */
}

#roster-flyout .flyout-card{
  width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15,23,42,.18);
  overflow: hidden;
}

#roster-flyout .flyout-header{
  padding: 12px 16px;
  font: 700 14px/1.2 Inter, system-ui, sans-serif;
  letter-spacing:.3px;
  color: var(--text);
  background: var(--accent-50);
  border-bottom: 1px solid var(--line);
}

#roster-flyout .flyout-list{
  display:flex; flex-direction:column;
  padding: 8px;
  gap: 6px;
}

#roster-flyout .flyout-item{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px;
  background:#fff; color:#000;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
}

#roster-flyout .flyout-item:hover{
  background:#f8fbff;
  border-color: var(--accent-200);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15,23,42,.08);
}

#roster-flyout .flyout-item::after{
  content:"›";
  font-size:16px;
  color:#64748b;
  margin-left:auto;
}

/* Mobile safety */
@media (max-width: 640px){
  #roster-flyout .flyout-card{ width: 94vw; }
}

/* Sidebar Roster chevron: closed = ▸, open = ▾ */
#sidebarRoster { position: relative; }
#sidebarRoster::after{
  content:"▸";
  position:absolute; right:14px; top:50%;
  transform: translateY(-50%);
  font-size:16px; opacity:.6;
}
#sidebarRoster.open::after{ content:"▾"; }

/* Flyout header caret (clickable to collapse) */
#roster-flyout .flyout-header{
  position:relative;
  padding-right:28px;   /* room for the caret */
  cursor:pointer;
}
#roster-flyout.open .flyout-header::after{
  content:"▴";
  position:absolute; right:12px; top:50%;
  transform:translateY(-50%);
  font-size:16px; color:#64748b;
}

/* ==== ROSTER sidebar expand/collapse chevron (always visible) ==== */
aside.sidebar #sidebarRoster {
  position: relative !important;
  padding-right: 28px !important;   /* space for chevron */
}

/* Closed state: ▸  */
aside.sidebar #sidebarRoster::after{
  content: "▸";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 1;
  opacity: .7;
  pointer-events: none;
}

/* Open state: ▾  — this class is toggled by JS */
aside.sidebar #sidebarRoster.open::after{
  content: "▾";
  opacity: .9;
}

/* Keep visible even when your sidebar has other button resets */
aside.sidebar .menu-btn#sidebarRoster {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  opacity: 1 !important;
}

/* Roster caret style */
#sidebarRoster {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding-right: 14px;
}
#sidebarRoster .roster-caret{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .5px;
  color: #64748b;          /* slate-ish */
}
#sidebarRoster.open .roster-caret{
  color: #111827;          /* a bit darker when open */
}







