/* =========================================================
   EDUHUNT R157 — COORDINATOR CDF STATUS PARITY + DONE GREEN
   Scope: Academic Coordinator > Exam Operations > CDF only.

   Keeps R156 behaviour:
   - CDF hides OMR Sent by School + OMR Rcvd only for Coordinator.
   - Mobile CDF tests remain single-open accordions.
   - FT / CT / GT are intentionally untouched.

   R157 repair:
   - Mobile now gives the live value/action (UPLOAD, PENDING, date,
     CLICK TO UPDATE, NO, etc.) the same visual priority as desktop.
   - The stage name (DSPCHD, SCL RCVD, etc.) is a smaller heading,
     so it can no longer look like a different status/response.
   - Any completed CDF task uses a dark-green tile on both desktop
     and mobile.
   ========================================================= */

/* ---------- DESKTOP / TABLET: CDF ONLY ---------- */
@media (min-width:901px){
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table.is-cdf-compact
  .exam-v3-coordinator-table-head.is-cdf-compact,
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table.is-cdf-compact
  .exam-v3-coordinator-table-row.is-cdf-compact{
    grid-template-columns:minmax(82px,.82fr) minmax(100px,.96fr) repeat(6,minmax(0,.9fr))!important;
  }

  /* Finished task = dark green. */
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-complete{
    background:#0b5d3b!important;
    color:#ffffff!important;
    border-color:#167a52!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-complete>b{
    color:#ffffff!important;
  }
}

/* ---------- MOBILE: CDF ONLY ---------- */
@media (max-width:900px){
  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-list{
    display:grid;
    gap:8px;
    width:100%;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-item{
    border:1px solid #385777;
    border-radius:10px;
    overflow:hidden;
    background:#071b31;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-toggle{
    width:100%;
    min-height:52px;
    display:grid;
    grid-template-columns:minmax(0,1fr) 40px;
    align-items:center;
    gap:8px;
    padding:9px 12px;
    border:0;
    border-radius:0;
    background:linear-gradient(90deg,#163766,#4a3e93);
    color:#fff;
    text-align:left;
    cursor:pointer;
    box-shadow:none;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-toggle>span{
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-toggle strong{
    color:#fff!important;
    font-size:17px!important;
    font-weight:950!important;
    line-height:1.15!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-toggle small{
    color:#cce7ff!important;
    font-size:12px!important;
    font-weight:850!important;
    line-height:1.15!important;
    text-align:right;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-toggle>b{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    justify-self:end;
    border:1px solid rgba(255,255,255,.35);
    border-radius:8px;
    background:rgba(0,0,0,.15);
    color:#fff!important;
    font-size:25px!important;
    font-weight:900!important;
    line-height:1!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-item.is-open .exam-v3-mobile-cdf-toggle{
    background:linear-gradient(90deg,#204b83,#5c49aa);
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-body[hidden]{
    display:none!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-body{
    display:block;
    background:#061426;
  }

  /* Test + subject are already in the CDF accordion heading. */
  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-body .exam-v3-coordinator-subject,
  html body[data-portal-role="ACADEMIC_COORDINATOR"] .exam-v3-mobile-cdf-body .exam-v3-coordinator-test{
    display:none!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
  }

  /*
     PARITY REPAIR:
     Desktop has a column heading plus a large live value.
     Mobile now follows the same information hierarchy inside each tile:
       small stage heading -> large live value/action.
  */
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell{
    min-height:88px!important;
    padding:35px 6px 9px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell::before{
    top:8px!important;
    left:5px!important;
    right:5px!important;
    font-size:11.5px!important;
    line-height:1.1!important;
    font-weight:900!important;
    letter-spacing:0!important;
    opacity:.88!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell>b{
    display:block!important;
    width:100%!important;
    margin:0!important;
    font-size:13px!important;
    line-height:1.15!important;
    font-weight:950!important;
    color:inherit!important;
    opacity:1!important;
    visibility:visible!important;
    text-shadow:none!important;
  }

  /* Keep the old long caption hidden. The live value is the desktop-equivalent response. */
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell>small{
    display:none!important;
  }

  /* Explicit readable live-value colours for non-complete states. */
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-waiting>b{color:#8a4f00!important}

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-pending>b{color:#b42318!important}

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-date>b{color:#075ea8!important}

  /* Finished task = unmistakable dark green in mobile. */
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-complete{
    background:#0b5d3b!important;
    color:#ffffff!important;
    border-color:#167a52!important;
  }

  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-complete::before,
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-mobile-cdf-body .exam-v3-coordinator-table-row.is-cdf-compact
  .exam-v3-coordinator-cell.is-complete>b{
    color:#ffffff!important;
    opacity:1!important;
  }

  /* CDF compact stage labels after removing only the two OMR columns. */
  html body[data-portal-module="exam-monitoring"][data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact .exam-v3-coordinator-cell:nth-child(3)::before{content:'DSPCHD'!important}

  html body[data-portal-module="exam-monitoring"][data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact .exam-v3-coordinator-cell:nth-child(4)::before{content:'SCL RCVD'!important}

  html body[data-portal-module="exam-monitoring"][data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact .exam-v3-coordinator-cell:nth-child(5)::before{content:'Test Date'!important}

  html body[data-portal-module="exam-monitoring"][data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact .exam-v3-coordinator-cell:nth-child(6)::before{content:'Test Cndctd'!important}

  html body[data-portal-module="exam-monitoring"][data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact .exam-v3-coordinator-cell:nth-child(7)::before{content:'Rslt upld'!important}

  html body[data-portal-module="exam-monitoring"][data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table-row.is-cdf-compact .exam-v3-coordinator-cell:nth-child(8)::before{content:'Apprvd'!important}
}

/* Print stays aligned with SUBJECT + TEST + six CDF stages. */
@media print{
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table.is-cdf-compact .exam-v3-coordinator-table-head.is-cdf-compact,
  html body[data-portal-role="ACADEMIC_COORDINATOR"]
  .exam-v3-coordinator-table.is-cdf-compact .exam-v3-coordinator-table-row.is-cdf-compact{
    grid-template-columns:.78fr .94fr repeat(6,1fr)!important;
  }
}
