/* =========================================================
   Year At-A-Glance
   ========================================================= */

   .yaga-card{
     border: 1px solid #d2d6d2;
     border-radius: 16px;
     background: #fff;
     overflow: visible;
   }

    .yaga-grid-header,
    .yaga-row {
      display: grid;
      grid-template-columns: minmax(280px, 1.25fr) minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr);
      gap: 0;
      border-bottom: 1px solid #e5e8e5;
    }

     .yaga-row:last-child { border-bottom: none; }

    .yaga-grid-header {
      background: #596e5e;
      border-bottom: 1px solid #596e5e;
    }

    .yaga-hcell {
      padding: 12px 14px;
      font-size: 12px;
      letter-spacing: .02em;
      text-transform: uppercase;
      color: #596e5e;
      font-weight: 650;
      border-right: 1px solid #e5e8e5;
    }
    .yaga-hcell:last-child { border-right: none; }

    .yaga-cell {
      padding: 12px 14px;
      border-right: none;
    }

    .yaga-subject {
        grid-column: 1 / -1;
        padding: 10px 14px;
      
        background: #bdc5bf;   /* subject bar background */
        color: #3b413b;        /* subject bar text */
      
        font-size: 12px;
        font-weight: 650;
        letter-spacing: .02em;
        text-transform: uppercase;
      
        border-bottom: 1px solid #d2d6d2;
      }

    .yaga-title {
      font-weight: 650;
      color: #262b26;
      line-height: 1.2;
    }

    .yaga-title.topic{
        font-weight: 550;          
        font-size: 13px;          
        padding-left: 18px;
        position: relative;
      }
      .yaga-title.topic:before{
        content: none;    
      }

      .yaga-sched.topic{
        padding-left: 18px;
        font-size: 11.5px;
        opacity: .82;
        white-space: pre-line;
      }

    .yaga-sched {
      margin-top: 4px;
      font-size: 12px;
      color: #666d66;
      opacity: .85;
      line-height: 1.3;
      white-space: pre-line;
    }

    .yaga-term {
      font-size: 12.5px;
      color: #262b26;
      line-height: 1.35;
      white-space: pre-line; /* preserves Airtable new lines */
    }
    .yaga-term.muted {
      color: #666d66;
      opacity: .9;
    }

    /* Smaller screens: allow horizontal scroll instead of cramming */
    .yaga-scroll {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    /* Print tweaks */
    @media print {
      .yaga-scroll { overflow: visible; }
      .yaga-card { border-radius: 0; }
      .yaga-hcell { font-size: 10px; padding: 8px 10px; }
      .yaga-cell { padding: 8px 10px; }
      .yaga-term { font-size: 11px; }
      .yaga-sched { font-size: 10px; }
    }
/* =========================================================
   AAG spacing + filter block alignment
   ========================================================= */

.aag-filters{
  margin-top: 0;   /* space between intro text + filter block */
  margin-bottom: 24px;/* space between filter block + grid */
}

.aag-filters .filter-state-bar{
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* panel should visually attach to the bar */
.aag-filters .filter-panel{
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;

  /* pull up 1px so borders touch cleanly */
  position: relative;
  top: -1px;
}

/* space before the grid (chart) */
.aag-grid-section{
  margin-top: 18px
}


/* =========================================================
   AAG filter layout: match Course List spacing
   ========================================================= */

/* Grade + Students + Manage Students in one row on desktop */
.aag-filters .filter-grid{
  grid-template-columns: 1fr 1fr auto;
  column-gap: 16px;
  row-gap: 12px;
  align-items: end;
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-actions-left {
  display: flex;
  gap: 12px;
}

.filter-actions-right {
  display: flex;
  align-items: center;
}

.yaga-hcell{
  padding: 12px 14px;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #ffffff;
  font-weight: 650;

  /* remove vertical dividers */
  border-right: none;
}

/* Header alignment helpers */
.yaga-hcell-left{ text-align: left; }
.yaga-hcell-center{ text-align: center; }

/* Base row reset */
.yaga-row {
  border-bottom: none;
}

/* Course divider — stronger */
.yaga-row.course-row {
  border-top: 2px solid #c3cbc3;
}

/* Topic dividers — lighter */
.yaga-row.topic-row {
  border-top: 1px solid #e5e8e5;
}

.yaga-body tr:first-child {
  border-top: 2px solid #c3cbc3;
}

/* Lock all term column body text color */
.yaga-table td.term-cell {
  color: #262b26;
}

.yaga-table td.term-cell * {
  color: inherit;
}

@media (max-width: 900px) {
  .aag-filters .filter-grid{ grid-template-columns: 1fr; }
  .aag-filters .manage-students-toggle{ justify-self: start; }

   .yaga-grid-header,
   .yaga-row {grid-template-columns: 320px 260px 260px 260px;}
}

@media print{
  .filter-state-wrapper{ position: static !important; }
  .yaga-grid-header{ position: static !important; }
}

/* Keep header visuals clean */
.yaga-header-sticky .yaga-grid-header{
  border-radius: 10px 10px 0 0;
}

/* =========================
   AAG: Sticky filter bar (match Courses behavior)
   ========================= */
#aagFilterSticky,
/* Match Courses page sticky behavior (do NOT customize separately) */
.filter-state-wrapper.aag-filters{
  position: sticky;
  top: var(--app-header-h, 64px);
  z-index: 1200;
}

/* keep the bar “solid” when sticky */
.aag-filters .filter-state-bar{
  background: var(--brand-bg) !important;
}

.av-intro-flex{
  margin-bottom: 40px; /* tweak: 24–48px */
}

/* =========================
   AAG: Sticky chart header (under sticky filter bar)
   ========================= */
.yaga-header-sticky{
  position: static;   /* or just remove position/top entirely */
  top: auto;
  z-index: auto;           /* below filters, above table rows */
  background: transparent;
}

.aag-filter-section{
  overflow: visible;
}

/* Safety lock: keep the filter sticky */
.filter-state-wrapper.aag-filters{
  position: sticky !important;
}

/* AAG: Manage Students — toggle stays in row 1 col 3, panel spans full width on next row */
.aag-filters .filter-grid{
  grid-template-columns: 1fr 1fr auto;
  grid-auto-flow: row; /* IMPORTANT: ensures new items go to next row */
}

.aag-filters .manage-students-cell{
  display: contents; /* lets button + panel act as separate grid items */
}

.aag-filters .manage-students-toggle{
  grid-column: 3;
  justify-self: start;
}

.aag-filters .student-manager--full{
  grid-column: 1 / -1; /* full width */
  grid-row: 2;         /* FORCE: below the whole first row */
  width: 100%;
  margin-top: 12px;
}

/* On tablet/mobile (2 columns or 1 column), let it span full width */
@media (max-width: 1024px){
  .aag-filters .manage-students-cell{
    grid-column: 1 / -1;
  }
}

/* AAG: keep the Manage Students toggle in column 3 */
.aag-filters .aag-manage-toggle{
  grid-column: 3;
  justify-self: start;
}

/* AAG: make the manager panel span the entire filter grid width */
.aag-filters .aag-student-manager{
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 12px;
}
/* =========================
   AAG PRINT ONLY OVERRIDES
   ========================= */
@media print {
  @page {
    size: 11in 8.5in; /* Letter landscape (AAG only, because this file is only loaded on AAG page) */
    margin: 0.5in;
  }

   /* Re-assert AAG table header styling in print (overrides global "all text black") */
  .yaga-grid-header {
    background: #596e5e !important;
  }
  .yaga-grid-header .yaga-hcell {
    color: #ffffff !important;
  }
}
