html, body { height: 100%; overflow: hidden; }

.user-circle {
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  text-align: center;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #7c3aed, #9333ea); /* purple gradient */
  display: inline-block;
  font-size: 0.9rem;
}

.bg-purple { background-color: #8f66ff !important; }
.bg-dark-purple {
    background: linear-gradient(to bottom, #1b1033, #111125);
}
.text-purple { color: #8f66ff; }
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}
.sidebar-collapsed {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.sidebar-expanded {
    transform: translateX(0);
    transition: transform 0.3s ease;
}
@media (max-width: 768px) {
    #sidebar {
    position: fixed;
    z-index: 1040;
    height: 100vh;
    }
    .main-wrapper {
    margin-left: 0 !important;
    }
}

.custom-tabs {
    background-color: #a88ef0;
    border-radius: 10px;
    padding: 4px;
    overflow: visible;
    white-space: nowrap;
    position: relative; 
    z-index: 200;
}

.custom-tabs .nav-link {
    color: #240046;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    margin: 2px;
    flex: 0 0 auto;
}

.custom-tabs .nav-link.active {
    background-color: #f8f9fa;
    color: #000;
    font-weight: 600;
}

pre {
  white-space: pre-wrap;      
  word-wrap: break-word;      
  overflow-wrap: break-word;  
  max-width: 100%;            
}

#studyTabContent { min-height: 0; overflow-y: auto; overflow-x: hidden; }
.min-h-0 { min-height: 0 !important; }


.findings-scroll {
  overflow: auto;
  overflow-x: hidden; 
  max-width: 100%;
  max-height: 100%;
}


.findings-table td, .findings-table th {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

#dv-scroller { 
  overflow: auto; 
  display: grid; 
  place-items: start center;
}              
#dv-canvas-wrap {
  display: block;
  width: max-content;
  height: max-content;
}

#docViewer{
  right: 1rem;
  bottom: var(--dv-bottom, 0);
  width: var(--dv-w, 600px);
  height: var(--dv-h, 70vh);
  max-width: 95vw;
  max-height: 800px;
  z-index: 200;
  color: #240046;
  transition: transform 180ms ease, right 180ms ease;
  transform: translateX(0);
}

#docViewer.doc-viewer--min { 
  --dv-bottom: 0;   
  height:2.25rem !important; 
  width:15vw !important;
  overflow:hidden; 
  border-top-left-radius: .5rem;
  border-top-right-radius: .5rem;
}

#docViewer.doc-viewer--max {
  --dv-w: 60vw;
  --dv-h: 100vh;
  --dv-bottom: 0;
  max-width: none;
  max-height: none;
  border-top-left-radius: .75rem;
  border-top-right-radius: .75rem;
}

@media (max-width: 768px) {
  #docViewer.doc-viewer--max { --dv-w: 100vw; }
}

#docViewer .doc-page { display: block; }
#docViewer .doc-page .dv-page-img,
#docViewer .doc-page canvas {
  display: block;
  max-width: none !important;
  width: auto;
  height: auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.kpi-card {
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


/* Launcher: round button in bottom-right */
#claraLauncher.clara-launcher {
  position: fixed; 
  right: 1.25rem; 
  bottom: 1.25rem;
  width: 80px; 
  height: 80px; 
  border-radius: 50%;
  display: grid; 
  place-items: center; 
  border: 0; cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
  z-index: 210;
  font-size: 3rem;
}

#claraLauncher.button {
  font-size: 3rem;
}

/* Panel: fixed above the launcher */
#claraPanel.clara-panel {
  right: 1rem; 
  bottom: 0;  /* sits above the launcher */
  width: 360px; 
  height: 800px;
  z-index: 210; 
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#claraPanel .clara-content {
  display: flex;
  flex-direction: column;
  height: 100%;            /* important so chat can flex */
  min-height: 0;           /* prevents overflow issues in flex containers */
}

/* Optional “minimized” panel size if you want a partial shrink state */
#claraPanel.is-minimized {
  height: 56px;
  overflow: hidden;
}

/* maximized: full height */
#claraPanel.is-maximized {
  width: 600px;
  height: 100vh;
  right: 0.5rem; 
  bottom: 0;
  border-radius: 10px;
  max-height: none;
}

#claraPanel .chat {
  flex: 1 1 auto;
  min-height: 0;           /* required for proper overflow in flex children */
  overflow: auto;
  padding: 0.5rem;
}

#claraPanel .toolbar {
  flex: 0 0 auto;
  display: flex;
  gap: .5rem;
  padding: .5rem;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  position: sticky;        /* keeps it visible if chat is taller than panel */
  bottom: 0;
  z-index: 1;              /* above chat content if needed */
}

#claraPanel .toolbar button{
  height:60px
}

#claraPanel .toolbar textarea{
  max-height:200px
}

.clara-open #docViewer {
  transform: translateX(calc(-1 * var(--clara-offset, 380px)));
}


.chatrow { display:flex; gap:12px; align-items:center; }
.chat { 
  padding: 24px;
  margin-top:16px;
  display:flex; 
  flex-direction:column; 
  gap:10px;
  height: var(--dv-h, 70vh);
  }
.bubble { padding:12px 14px; border-radius:12px; max-width: 90%; white-space: pre-wrap; }
.user { 
  align-self:flex-end; 
  background: linear-gradient(135deg, #7c3aed, #9333ea) ;
  color: white;
}
.bot { 
  align-self:flex-start; 
  background:linear-gradient(to bottom, #1b1033, #111125); 
  border:1px solid #202a5a; 
   color: white;
}

.bot .typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
  min-height: 1em;           /* reserve space so it doesn't jump */
}
.typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa4d1;       /* tweak for your theme */
  opacity: .6;
  animation: bounce 1s infinite ease-in-out;
}
.typing .dot:nth-child(2) { animation-delay: .15s; }
.typing .dot:nth-child(3) { animation-delay: .30s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity:.6; }
  40%          { transform: translateY(-4px); opacity:1; }
}

.sys { text-align:center; color:#9aa4d1; font-size:12px; }
.toolbar { margin-top:16px; display:flex; gap:8px; }


.icf-page {
    background-color: #f9f7ff;
    padding: 1.5rem 1.5rem 3rem;
    border-radius: 1rem;
  }

  .icf-kpi-card {
    border-radius: 1rem;
    border: 1px solid #e2d6ff;
    background-color: #ffffff;
  }

  .icf-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
  }


.icf-pill-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Purple rounded-square block */
.icf-pill {
  background: rgb(123, 42, 198);
  color: #fff;
  border-radius: 12px;
  padding: 14px 14px;
  max-width: 48px;
  max-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(142, 76, 255, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.icf-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(142, 76, 255, 0.45);
}

.icf-pill-version {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Date under the pill */
.icf-pill-date {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #000000;
}
  .visit-card {
    border-radius: 1rem;
    border: 1px solid #e2d6ff;
    background-color: #ffffff;
  }

  .visit-card-header {
    font-weight: 600;
    font-size: 1rem;
  }

  .visit-metric-label {
    font-size: 0.8rem;
    color: #6c757d;
  }

  .visit-metric-value {
    font-size: 1.1rem;
    font-weight: 600;
  }

  .visit-progress {
    height: 0.4rem;
    border-radius: 999px;
    background-color: #e8ddff;
    overflow: hidden;
  }

  .visit-progress-bar {
    height: 0.4rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #8e5bff, #b87bff);
  }

  .badge-gap {
    background-color: #f8d7da;
    color: #a94442;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
  }

  .badge-compliant {
    background-color: #d1f7df;
    color: #1f7a3b;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
  }

  .badge-placeholder {
    background-color: #eef2ff;
    color: #4b4b8f;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
  }

  .visit-attention-btn {
    background-color: #d9534f;
    color: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border: none;
  }

  .icf-legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    margin-right: 1.5rem;
  }

  .icf-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    display: inline-block;
  }

  .visit-summary-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.75rem;
}

/* Row that holds cards horizontally */
.visit-summary-row {
  display: flex;
  flex-wrap: nowrap;       /* Prevent wrapping, force horizontal */
  gap: 1rem;               /* spacing between cards */
}

/* Fix card sizing so they don’t shrink weirdly */
.visit-card-wrapper {
  flex: 0 0 260px;         /* width of card (adjust as needed) */
}

/* Optional: style the scrollbar, especially for Windows */
.visit-summary-scroll::-webkit-scrollbar {
  height: 8px;
}

.visit-summary-scroll::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 4px;
}

.visit-summary-scroll::-webkit-scrollbar-thumb {
  background: #b69df8;
  border-radius: 4px;
}

.popover {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.offcanvas {
  --bs-offcanvas-width: 45vw;  
}