/* 
#96A78D
#B6CEB4
#D9E9CF
#F0F0F0 
*/

html, body{
  margin: 0;
  padding: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.app-shell, .app-page, .container{
  padding: 0; 
}

.app-header{
  margin: 0 !important; 
  width: 100%;
  border-radius: 0;
  box-sizing: border-box;
}

.app-header{
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 1.2rem;
  padding: 1.1rem 1.2rem;
  margin: 0.8rem 0.8rem 1rem;
  background: #96A78D;
  overflow: hidden;
}

.app-title-block{
  display:flex;
  align-items:center;
  gap: 0.9rem;
  min-width: 240px;
}

.app-logo-circle{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0b1220;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f6f8ff 35%, #d9e8ff 100%);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.7);
}

.app-title{
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ebebeb;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.app-subtitle{
  margin: 0.12rem 0 0;
  font-size: 0.9rem;
  color:#ebebeb;
}

.app-header-meta{
  display:flex;
  align-items:center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap: 0.35rem;
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.96);
  background: rgba(10,18,32,0.24);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
}

.badge-soft{
  background: rgba(255,255,255,0.18);
}

.btn-secondary{
  border: 0;
  cursor: pointer;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #0b1220;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-secondary:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.16);
  background: rgba(255,255,255,0.95);
}

.btn-secondary:active{
  transform: translateY(0px);
}

.user-status{
  font-size: 0.9rem;
  color: rgba(255,255,255,0.95);
  padding: 0.42rem 0.65rem;
  border-radius: 12px;
  background: rgba(10,18,32,0.22);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 860px){
  .app-header{
    flex-direction: column;
    align-items: stretch;
  }
  .app-header-meta{
    justify-content: space-between;
  }
}

/* ===== MAIN LAYOUT ===== */
/* .app-main{
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--c4);
} */

.app-main{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--c4);
}

/* panels */
.panel{
  background: #F0F0F0;
  border: 1px solid rgba(31,42,33,0.10);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}

.panel::before{
  content:"";
  position:absolute;
  inset: 0;
  background:
    radial-gradient(700px 220px at 20% 10%, rgba(182,206,180,0.55), rgba(182,206,180,0) 55%),
    radial-gradient(700px 220px at 85% 15%, rgba(217,233,207,0.55), rgba(217,233,207,0) 55%);
  pointer-events:none;
}

/* panel header */
.panel-header{
  position: relative;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(31,42,33,0.08);
  background: #B6CEB4;
}

.panel-title{
  margin: 0;
  font-size: 1.05rem;
  /* font-weight: 900; */
  color: var(--ink);
}

.panel-subtitle{
  margin: 0.25rem 0 0;
  font-size: 14px;
  color: rgba(31,42,33,0.72);
  /* font-weight: 700; */
}

/* chat window */
.chat-window{
  position: relative;
  padding: 1rem;
  height: calc(100vh - 320px);
  min-height: 420px;
  overflow: auto;
  scroll-behavior: smooth;
  background-image: url("../asset/chatbg1.jpg");
  background-size: cover;          /* full cover */
  background-position: center;     /* centered */
  background-repeat: no-repeat;    /* no tiling */
}

/* Optional: add a soft overlay so messages stay readable */
.chat-window::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.55); 
  pointer-events: none;
}

/* Make sure chat content stays above overlay */
.chat-window > *{
  position: relative;
  z-index: 1;
}


/* nice scrollbar */
.chat-window::-webkit-scrollbar{ width: 10px; }
.chat-window::-webkit-scrollbar-thumb{
  background: rgba(150,167,141,0.6);
  border-radius: 999px;
}
.chat-window::-webkit-scrollbar-track{ background: rgba(0,0,0,0.05); }

/* =========================
   CHAT BUBBLES (user / ai)
   ========================= */

/* base bubble */
.message{
  max-width: min(50%, 720px);
  padding: 0.75rem 0.9rem;
  margin: 0.55rem 0;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 0.98rem;
  font-weight: 700;

  position: relative;
  word-wrap: break-word;
  white-space: pre-wrap;

  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
  border: 1px solid rgba(31,42,33,0.10);
}

/* USER bubble (right) */
.message.user{
  margin-left: auto;
  background: #96A78D;
  color: #ffffff;
  border-color: rgba(255,255,255,0.22);
}

.message.user::after{
  content:"";
  position:absolute;
  right: -8px;
  bottom: 10px;
  width: 16px;
  height: 16px;
  background: #96A78D;
  transform: rotate(45deg);
  border-right: 1px solid rgba(255,255,255,0.22);
  border-bottom: 1px solid rgba(255,255,255,0.22);
}


.message.ai{
  margin-right: auto;
  background: rgba(255,255,255,0.92);
  color: rgba(31,42,33,0.92);
  border-color: rgba(31,42,33,0.12);
}

.message.ai::after{
  content:"";
  position:absolute;
  left: -8px;
  bottom: 10px;
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.92);
  transform: rotate(45deg);
  border-left: 1px solid rgba(31,42,33,0.12);
  border-bottom: 1px solid rgba(31,42,33,0.12);
}

.chat-window .message + .message{
  margin-top: 0.6rem;
}


/* status indicator */
.status-indicator{
  position: relative;
  margin: 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  background: rgba(217,233,207,0.75);
  border: 1px solid rgba(31,42,33,0.10);
  display:flex;
  align-items:center;
  gap: 0.35rem;
}

.status-indicator.hidden{ display:none; }

.status-indicator .dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c1);
  display:inline-block;
  animation: bounce 1s infinite ease-in-out;
}
.status-indicator .dot:nth-child(2){ animation-delay: .12s; }
.status-indicator .dot:nth-child(3){ animation-delay: .24s; }

.status-indicator .status-text{
  margin-left: 0.5rem;
  /* font-weight: 800; */
  color: rgba(31,42,33,0.85);
}

.hidden {
  display: none !important;
}

@keyframes bounce{
  0%, 80%, 100%{ transform: translateY(0); opacity: .6; }
  40%{ transform: translateY(-5px); opacity: 1; }
}

/* controls row */
.controls-row{
  position: relative;
  display:flex;
  gap: 0.8rem;
  padding: 0.9rem 1rem 0.6rem;
  flex-wrap: wrap;
}

.control-group{
  flex: 1;
  min-width: 180px;
  background: rgba(240,240,240,0.9);
  border: 1px solid rgba(31,42,33,0.10);
  border-radius: 16px;
  padding: 0.7rem 0.8rem;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.control-label{
  display:block;
  /* font-weight: 900; */
  font-size: 0.82rem;
  color: rgba(31,42,33,0.75);
  margin-bottom: 0.35rem;
}

/* ===== control select (better design) ===== */
.control-select{
  width: 100%;
  padding: 10px 10px 10px 10px; 
  border-radius: 15px;
  border: 1px solid rgba(31,42,33,0.18);
  background: rgba(255,255,255,0.92);
  color: rgba(31,42,33,0.92);
  outline: none;
  font-size: 16px;
  letter-spacing: 0.1px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(31,42,33,0.75) 50%),
    linear-gradient(135deg, rgba(31,42,33,0.75) 50%, transparent 50%),
    linear-gradient(to right, rgba(150,167,141,0.22), rgba(150,167,141,0.10));
  background-position:
    calc(100% - 18px) 55%,
    calc(100% - 12px) 55%,
    calc(100% - 40px) 50%;
  background-size:
    6px 6px,
    6px 6px,
    1px 60%;
  background-repeat: no-repeat;
}

.control-select:hover{
  border-color: rgba(150,167,141,0.55);
  background: rgba(255,255,255,0.98);
  transform: translateY(-1px);
}

.control-select:focus{
  border-color: rgba(150,167,141,0.95);
  box-shadow: 0 0 0 4px rgba(182,206,180,0.35), 0 12px 26px rgba(0,0,0,0.08);
}

.control-select option{
  /* border-radius: 15px; */
  border-radius: 40px;
  font-size: 14px;
  background: #ffffff;   
  color: #000;
}


/* input row */
.input-row{
  position: relative;
  display:flex;
  gap: 0.7rem;
  padding: 0.9rem 1rem 1rem;
  align-items: flex-end;
  border-top: 1px solid rgba(31,42,33,0.08);
  background: linear-gradient(90deg, rgba(240,240,240,0.55), rgba(217,233,207,0.35));
}

#user-input{
  flex: 1;
  resize: none;
  min-height: 52px;
  max-height: 140px;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(31,42,33,0.14);
  background: #fff;
  /* font-weight: 700; */
  color: var(--ink);
  outline: none;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

#user-input:focus{
  border-color: rgba(150,167,141,0.9);
  box-shadow: 0 0 0 4px rgba(182,206,180,0.35), 0 10px 24px rgba(0,0,0,0.08);
}

#send-btn{
  border: 0;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  /* font-weight: 950; */
  letter-spacing: 0.2px;
  color: #fff;
  background: #96A78D;
  box-shadow: 0 14px 30px rgba(0,0,0,0.14);
  transition: transform .15s ease, box-shadow .15s ease;
  min-width: 110px;
}

#send-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.18);
}

#send-btn:active{ transform: translateY(0); }

/* ===== RIGHT PANEL (course plan) ===== */
.panel-sources .sources-list{
  position: relative;
  padding: 1rem;
  height: calc(100vh - 210px);
  min-height: 520px;
  overflow: auto;
}

.panel-sources .sources-list p{
  margin: 0.3rem 0 0;
  color: rgba(31,42,33,0.80);
  /* font-weight: 700; */
}

/* lesson */
#lesson-container{
  margin-top: 0.5rem;
}

#lesson-page-content{
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(31,42,33,0.10);
  border-radius: 16px;
  padding: 0.95rem;
  box-shadow: 0 12px 26px rgba(0,0,0,0.06);
}

/* pagination */
.lesson-pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.suggestion{
  font-size: 18px;
}
#prev-page, #next-page{
  border: 0;
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  /* font-weight: 900; */
  color: var(--ink);
  background: rgba(217,233,207,0.95);
  border: 1px solid rgba(31,42,33,0.10);
  box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

#prev-page:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

#page-indicator{
  font-weight: 900;
  color: rgba(31,42,33,0.75);
}

/* responsive */
@media (max-width: 980px){
  .app-main{
    grid-template-columns: 1fr;
  }
  .chat-window{
    height: 52vh;
    min-height: 360px;
  }
  .panel-sources .sources-list{
    height: auto;
    min-height: 320px;
  }
}


/* Form testing */

.control-input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  font-size: 14px;
  outline: none;
}
.control-input:focus{
  border-color: rgba(0,0,0,0.25);
}


/* =========================
   DISABLED BUTTON (NEAT)
   ========================= */

/* Covers both: button disabled attribute AND your JS class */
button:disabled,
.btn-disabled{
  opacity: 0.55;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(25%);
}

/* keep shape consistent, reduce “clicky” feel */
button:disabled.btn-secondary,
.btn-secondary.btn-disabled{
  background: rgba(255,255,255,0.55) !important;
  color: rgba(31,42,33,0.55) !important;
  border: 1px solid rgba(31,42,33,0.10) !important;
}

/* prevent hover lift on disabled */
button:disabled:hover,
.btn-disabled:hover{
  transform: none !important;
  box-shadow: none !important;
  background: rgba(255,255,255,0.55) !important;
}

/* Optional: nicer spacing when multiple buttons appear in a row */
.week-actions{
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Global loading overlay ---------- */
.busy-overlay.hidden {
  display: none;
}

.busy-overlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(240,240,240,0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
}


.busy-card{
  width: min(420px, 92vw);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(31,42,33,0.12);
  box-shadow: 0 18px 40px rgba(0,0,0,0.14);
  text-align: center;
}



.busy-spinner{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid rgba(150,167,141,0.25);
  border-top-color: rgba(150,167,141,0.95);
  margin: 0 auto;
  animation: spin 0.9s linear infinite;
}
@keyframes spin{
  to { transform: rotate(360deg); }
}

@keyframes busySpin {
  to { transform: rotate(360deg); }
}

.busy-text{
  font-weight: 900;
  color: rgba(31,42,33,0.92);
  margin-top: 10px;
}

.busy-subtext{
  margin-top: 4px;
  font-size: 0.9rem;
  color: rgba(31,42,33,0.65);
}

/* Button state while busy */
/* Button busy state (app.js adds btn-busy class) */
.btn-busy{
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

/* Optional: make the first week button slightly stronger */
.btn-week-start{
  font-weight: 800;
}
/* ---------- Primary button (for Submit / Continue / Main actions) ---------- */
.btn-primary{
  border: 0;
  cursor: pointer;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.2px;
  color: #fff;
  background: #96A78D;
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.14);
}
.btn-primary:active{
  transform: translateY(0px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

/* ---------- Shared lesson/quiz buttons ---------- */
.lesson-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  line-height: 1;
  white-space: nowrap;
}

/* Disabled look (you already add btn-disabled in JS for quiz/practical) */
.btn-disabled,
.btn-week-locked{
  opacity: 0.55;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.15);
}

/* Layout for the 3 buttons under each week card */
.week-card-actions{
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.8rem;
}

/* Layout for Back / Quiz / Practical row inside lesson view */
.lesson-actions{
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.9rem;
}


/* Lab Table */
.lab-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}

.lab-table th,
.lab-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.lab-table th {
  font-weight: 600;
  background: #f6f7f6;
}


/* Lab Chart */
.lab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.lab-table th, .lab-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-align: left;
  font-size: 14px;
}

.lab-table th {
  background: rgba(150,167,141,0.18);
  font-weight: 600;
}

.lab-chart {
  margin: 18px 0 26px;
}

.lab-bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 90px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}

.lab-bar-label {
  font-size: 13px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-bar-box {
  height: 10px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.lab-bar {
  height: 100%;
  background: rgba(88, 114, 82, 0.85);
  border-radius: 999px;
}

.lab-bar-value {
  font-size: 13px;
  text-align: right;
  opacity: 0.85;
}

/* Course summary dashboard */

/* =========================================
   PROGRESS DASHBOARD (Colorful + Unique)
   used by renderProgressSummaryCard()
   ========================================= */

   .progress-dashboard{
    margin: 12px 0 14px;
    padding: 14px;
    border-radius: 18px;
    background:
      radial-gradient(900px 260px at 12% 12%, rgba(182,206,180,0.55), rgba(182,206,180,0) 55%),
      radial-gradient(900px 260px at 85% 18%, rgba(217,233,207,0.58), rgba(217,233,207,0) 55%),
      linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.86));
    border: 1px solid rgba(31,42,33,0.12);
    box-shadow: 0 18px 44px rgba(0,0,0,0.10);
  }
  
  .progress-hero{
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px 14px;
    align-items: center;
  }
  
  .progress-hero-text{
    display:flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .progress-hero-title{
    font-size: 1.1rem;
    font-weight: 900;
    color: rgba(31,42,33,0.94);
  }
  
  .progress-hero-sub{
    display:flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(31,42,33,0.74);
    font-weight: 700;
  }
  
  .progress-kpi-dot{
    opacity: 0.6;
  }
  
 
  
 
  
  .progress-chip .chip-dot{
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(31,42,33,0.25);
  }
  
  .progress-chip .chip-label{
    font-size: 0.85rem;
    color: rgba(31,42,33,0.82);
  }
  
  .progress-chip .chip-num{
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(31,42,33,0.10);
    color: rgba(31,42,33,0.88);
  }
  
  /* Donut */
  .progress-donut{
    width: 120px;
    height: 120px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  
  .donut-ring{
    width: 120px;
    height: 120px;
    position: relative;
    border-radius: 999px;
    background: conic-gradient(
      rgba(150,167,141,0.92),
      rgba(16,31,161,0.70),
      rgba(182,206,180,0.92),
      rgba(150,167,141,0.92)
    );
    padding: 8px;
    box-shadow: 0 16px 34px rgba(0,0,0,0.14);
  }
  
  .donut-svg{
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
  }
  
  .donut-track{
    fill: none;
    stroke: rgba(255,255,255,0.55);
    stroke-width: 12;
  }
  
  .donut-fill{
    fill: none;
    stroke: rgba(255,255,255,0.92);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset .5s ease;
  }
  
  .donut-center{
    position:absolute;
    inset: 0;
    display:flex;
    flex-direction: column;
    align-items:center;
    justify-content:center;
    gap: 2px;
    color: rgba(31,42,33,0.92);
    background: rgba(255,255,255,0.72);
    border-radius: 999px;
    margin: 14px;
    border: 1px solid rgba(31,42,33,0.10);
    backdrop-filter: blur(6px);
  }
  
  .donut-big{
    font-size: 1.35rem;
    font-weight: 1000;
  }
  
  .donut-small{
    font-size: 0.8rem;
    font-weight: 900;
    opacity: 0.75;
  }
  
  /* Week tiles grid */
  .progress-week-grid{
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  
  @media (max-width: 980px){
    .progress-week-grid{
      grid-template-columns: 1fr;
    }
  }
  
  .progress-week-tile{
    border-radius: 16px;
    padding: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(31,42,33,0.10);
    background: rgba(255,255,255,0.86);
    box-shadow: 0 12px 26px rgba(0,0,0,0.08);
  }
  
  .progress-week-tile::before{
    content:"";
    position:absolute;
    inset:-2px;
    background: linear-gradient(135deg, rgba(16,31,161,0.22), rgba(150,167,141,0.22), rgba(217,233,207,0.22));
    filter: blur(14px);
    opacity: 0.9;
    pointer-events:none;
  }
  
  .tile-top{
    position: relative;
    display:flex;
    align-items:flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  
  .tile-week-no{
    font-weight: 1000;
    font-size: 0.95rem;
    color: rgba(16,31,161,0.92);
  }
  
  .tile-week-name{
    margin-top: 2px;
    font-weight: 900;
    color: rgba(31,42,33,0.88);
    font-size: 0.9rem;
    line-height: 1.25;
    max-height: 2.5em;
    overflow: hidden;
  }
  
  .tile-badge{
    display:inline-flex;
    align-items:center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-weight: 1000;
    font-size: 0.82rem;
    background: rgba(240,240,240,0.92);
    border: 1px solid rgba(31,42,33,0.10);
    white-space: nowrap;
  }
  
  .tile-meters{
    position: relative;
    margin-top: 10px;
    display:flex;
    gap: 10px;
  }
  
  .tile-meter{
    flex: 1;
    min-width: 0;
  }
  
  .tile-meter-head{
    display:flex;
    justify-content: space-between;
    align-items:center;
    font-size: 0.82rem;
    font-weight: 900;
    color: rgba(31,42,33,0.78);
    margin-bottom: 6px;
  }
  
  .tile-meter-head b{
    color: rgba(31,42,33,0.92);
  }
  
  .tile-meter-bar{
    height: 10px;
    border-radius: 999px;
    background: rgba(31,42,33,0.08);
    overflow: hidden;
  }
  
  .tile-meter-fill{
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16,31,161,0.80), rgba(150,167,141,0.90));
  }
  
  /* Color rules by status */
  .progress-chip[data-status="completed"] .chip-dot,
  .progress-week-tile[data-status="completed"] .tile-badge{
    background: rgba(182,206,180,0.85);
  }
  
  .progress-chip[data-status="in_progress"] .chip-dot{
    background: rgba(16,31,161,0.70);
  }
  
  .progress-chip[data-status="lesson_completed"] .chip-dot{
    background: rgba(150,167,141,0.95);
  }
  
  .progress-chip[data-status="quiz_completed"] .chip-dot{
    background: rgba(16,31,161,0.55);
  }
  
  .progress-chip[data-status="not_started"] .chip-dot{
    background: rgba(31,42,33,0.35);
  }
  
  .progress-chip[data-status="locked"] .chip-dot{
    background: rgba(31,42,33,0.18);
  }
  
  .progress-week-tile[data-status="locked"]{
    opacity: 0.70;
    filter: grayscale(0.15);
  }
  .progress-heading-row{
    display:flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px 12px 8px;
  }
  
  .progress-heading-title{
    font-size: 1.15rem;
    font-weight: 900;
    color: rgba(31,42,33,0.94);
  }
  
  .progress-heading-sub{
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(31,42,33,0.70);
  }

  
  /* liner regression visulaization */
  /* ===================== */
/* Lab visualizations UI */
/* ===================== */
.lab-viz-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.lab-viz-card{
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.lab-viz-title{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.lab-viz-card canvas{
  width: 100% !important;
  height: 260px !important;
}

@media (max-width: 900px){
  .lab-viz-grid{
    grid-template-columns: 1fr;
  }
}


/* =========================
   LAB VISUALIZATIONS GRID
   ========================= */
   .lab-viz-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 12px 0 22px;
  }
  
  .lab-viz-card{
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(31,42,33,0.10);
    border-radius: 14px;
    padding: 12px 12px 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    overflow: hidden;
  }
  
  .lab-viz-title{
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 8px;
    color: rgba(31,42,33,0.85);
  }
  
  .lab-viz-wide{
    grid-column: 1 / -1;
  }
  
  .lab-viz-card canvas{
    width: 100% !important;
    height: 260px !important;
  }
  
  @media (max-width: 980px){
    .lab-viz-grid{
      grid-template-columns: 1fr;
    }
    .lab-viz-card canvas{
      height: 240px !important;
    }
  }

  .lab-viz-card.span-2{
    grid-column: 1 / -1;
  }

  /* ---- Linear Regression: Quick Insights ---- */
.lr-insights-wrap{
  margin-top: 14px;
  margin-bottom: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(31,42,33,0.10);
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
}

.lr-chip-row{
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 980px){
  .lr-chip-row{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

.lr-chip{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31,42,33,0.10);
  background: rgba(217,233,207,0.55);
}

.lr-chip.good{ background: rgba(182,206,180,0.65); }
.lr-chip.warn{ background: rgba(240,240,240,0.85); }
.lr-chip.bad{  background: rgba(255,255,255,0.85); }

.lr-chip-label{
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
  font-weight: 700;
}

.lr-chip-value{
  font-size: 18px;
  font-weight: 900;
}

.lr-chip-hint{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}

.lr-insight-notes{
  border-top: 1px dashed rgba(31,42,33,0.18);
  padding-top: 10px;
}

.lr-notes-title{
  font-weight: 900;
  margin-bottom: 6px;
}

.lr-notes-list{
  margin: 0;
  padding-left: 18px;
}

  
  /*End linear lab  */