/* SJCS Curriculum Admin Module
   Does not modify style_admin.css.
*/

#curriculumAdminRoot.ca-page {
  --ca-deep:#063d2e;
  --ca-deep2:#07513d;
  --ca-gold:#d49a22;
  --ca-gold2:#f0bd43;
  --ca-ink:#18352d;
  --ca-muted:#71817a;
  --ca-line:#e5ebe8;
  --ca-bg:#f6f8f7;
  color:var(--ca-ink);
  padding:4px;
}

.ca-hero {
  background:linear-gradient(135deg,var(--ca-deep),var(--ca-deep2));
  color:#fff;
  border-radius:22px;
  padding:30px 34px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  margin-bottom:20px;
  box-shadow:0 18px 40px rgba(6,61,46,.16);
}

.ca-eyebrow {
  display:block;
  color:#f4ce78;
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
  margin-bottom:8px;
}

.ca-hero h1 {
  margin:0 0 6px;
  font-size:30px;
}

.ca-hero p {
  margin:0;
  color:rgba(255,255,255,.78);
}

.ca-hero-icon {
  width:70px;
  height:70px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:20px;
  display:grid;
  place-items:center;
  font-size:28px;
  color:var(--ca-gold2);
  flex:none;
}

.ca-toolbar {
  background:#fff;
  border:1px solid var(--ca-line);
  border-radius:18px;
  padding:18px;
  display:flex;
  align-items:end;
  gap:12px;
  margin-bottom:16px;
}

.ca-field {
  flex:1;
  max-width:330px;
}

.ca-field label {
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:7px;
}

.ca-field select {
  width:100%;
  height:44px;
  border:1px solid #dbe3df;
  border-radius:10px;
  padding:0 12px;
  background:#fff;
  color:var(--ca-ink);
}

.ca-btn {
  border:0;
  border-radius:10px;
  min-height:42px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
}

.ca-btn-primary {
  background:var(--ca-deep);
  color:#fff;
}

.ca-btn-secondary {
  background:#f1f5f3;
  color:var(--ca-deep);
  border:1px solid #dce5e1;
}

.ca-btn-view {
  background:#eef5f2;
  color:var(--ca-deep);
  flex:1;
}

.ca-btn-danger {
  width:44px;
  padding:0;
  background:#fff0f0;
  color:#b3261e;
}

.ca-btn-wide {
  width:100%;
}

.ca-stats {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin-bottom:16px;
}

.ca-stat {
  background:#fff;
  border:1px solid var(--ca-line);
  border-radius:16px;
  padding:18px;
}

.ca-stat span {
  display:block;
  font-size:12px;
  color:var(--ca-muted);
  margin-bottom:5px;
}

.ca-stat strong {
  font-size:23px;
}

.ca-controls {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin:20px 0;
}

.ca-search {
  position:relative;
  width:300px;
}

.ca-search i {
  position:absolute;
  left:13px;
  top:14px;
  color:#87958f;
}

.ca-search input {
  width:100%;
  height:44px;
  border:1px solid #dce5e1;
  border-radius:11px;
  padding:0 14px 0 38px;
  outline:none;
}

.ca-search input:focus {
  border-color:var(--ca-gold);
}

.ca-filters {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.ca-filter {
  border:1px solid #dce5e1;
  background:#fff;
  color:#56675f;
  border-radius:999px;
  padding:9px 13px;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}

.ca-filter.active {
  background:var(--ca-deep);
  color:#fff;
  border-color:var(--ca-deep);
}

.ca-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.ca-card {
  background:#fff;
  border:1px solid var(--ca-line);
  border-radius:18px;
  padding:18px;
  transition:.2s ease;
}

.ca-card:hover {
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(0,0,0,.07);
}

.ca-card-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.ca-stage,
.ca-status {
  font-size:10px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.ca-stage {
  color:var(--ca-deep);
}

.ca-status {
  padding:5px 8px;
  border-radius:999px;
}

.ca-status.published {
  background:#e8f6ef;
  color:#18734b;
}

.ca-status.pending {
  background:#f7f2e8;
  color:#8b641b;
}

.ca-class-icon {
  width:48px;
  height:48px;
  border-radius:14px;
  background:#f0f6f3;
  color:var(--ca-deep);
  display:grid;
  place-items:center;
  font-size:22px;
  margin:18px 0 12px;
}

.ca-card h2 {
  margin:0;
  font-size:20px;
}

.ca-code {
  margin:3px 0 15px;
  color:var(--ca-muted);
  font-size:11px;
}

.ca-file {
  min-height:58px;
  border:1px solid #e6ece9;
  border-radius:12px;
  padding:10px;
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
}

.ca-file > i {
  color:#b3261e;
  font-size:21px;
}

.ca-file strong,
.ca-file small {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:220px;
}

.ca-file strong {
  font-size:12px;
}

.ca-file small {
  margin-top:3px;
  color:var(--ca-muted);
  font-size:10px;
}

.ca-file-empty > i {
  color:#8b9993;
}

.ca-actions {
  display:flex;
  gap:8px;
}

.ca-actions label {
  cursor:pointer;
  flex:1;
}

.ca-actions .ca-btn {
  min-width:0;
}

.ca-empty,
.ca-loading {
  padding:60px 20px;
  text-align:center;
  color:var(--ca-muted);
}

.ca-empty i {
  font-size:34px;
  margin-bottom:12px;
}

.ca-empty h3 {
  color:var(--ca-ink);
  margin:0 0 5px;
}

.ca-toast {
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:99999;
  max-width:380px;
  padding:13px 17px;
  border-radius:11px;
  color:#fff;
  background:var(--ca-deep);
  box-shadow:0 14px 30px rgba(0,0,0,.2);
  opacity:0;
  transform:translateY(15px);
  pointer-events:none;
  transition:.25s ease;
  font-size:13px;
}

.ca-toast.show {
  opacity:1;
  transform:translateY(0);
}

.ca-toast-error {
  background:#a82720;
}

@media (max-width:1100px) {
  .ca-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .ca-stats {
    grid-template-columns:repeat(2,1fr);
  }

  .ca-controls {
    align-items:flex-start;
    flex-direction:column;
  }

  .ca-search {
    width:100%;
  }
}

@media (max-width:700px) {
  .ca-hero {
    padding:24px;
  }

  .ca-hero-icon {
    display:none;
  }

  .ca-toolbar {
    flex-direction:column;
    align-items:stretch;
  }

  .ca-field {
    max-width:none;
  }

  .ca-stats,
  .ca-grid {
    grid-template-columns:1fr;
  }

  .ca-filters {
    width:100%;
    overflow:auto;
    flex-wrap:nowrap;
    padding-bottom:4px;
  }

  .ca-filter {
    flex:none;
  }
}


/* ==========================================================
   CURRICULUM PAGE — LAYOUT / BOTTOM VISIBILITY FIX
   ----------------------------------------------------------
   The existing admin shell has a sticky top bar and a flex
   content area. The curriculum page contains multiple rows of
   cards, so it must be allowed to extend below the first viewport.
   These rules are intentionally scoped to Curriculum only.
   ========================================================== */

.main:has(#curriculumAdminRoot) {
  overflow: visible !important;
}

.content:has(#curriculumAdminRoot) {
  overflow: visible !important;
  padding-bottom: 42px !important;
  min-width: 0;
}

#curriculumAdminRoot.ca-page {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px 4px 36px;
  overflow: visible;
}

#curriculumAdminRoot .ca-grid {
  padding-bottom: 12px;
}

#curriculumAdminRoot .ca-card {
  min-width: 0;
}

#curriculumAdminRoot .ca-actions {
  min-height: 42px;
  align-items: stretch;
}

#curriculumAdminRoot .ca-actions .ca-btn {
  min-height: 42px;
}

@media (max-width: 820px) {
  .content:has(#curriculumAdminRoot) {
    padding-bottom: 30px !important;
  }

  #curriculumAdminRoot.ca-page {
    padding-bottom: 30px;
  }
}


/* SJCS UNIFIED ADMIN HERO THEME — Leadership & Management reference */
.sjcs-leadership-hero, .sjad-hero, .sjac-hero, .sjfs-hero, .sjcb-hero, .ca-hero, .sj-ach-hero, .sjce-hero, .sj-gallery-hero, .sj-video-hero, .sjnb-hero, .sa-hero, .sjdb-hero, .sj-event-hero {
  min-height:140px !important;
  height:140px !important;
  box-sizing:border-box !important;
  padding:28px 30px !important;
  margin:0 0 18px !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,#0f5132,#176b43) !important;
  color:#fff !important;
  box-shadow:0 12px 30px rgba(15,81,50,.14) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:20px !important;
  overflow:hidden !important;
}
.sjcs-leadership-hero h1, .sjad-hero h1, .sjac-hero h1, .sjfs-hero h1, .sjcb-hero h1, .ca-hero h1, .sj-ach-hero h1, .sjce-hero h1, .sj-gallery-hero h1, .sj-video-hero h1, .sjnb-hero h1, .sa-hero h1, .sjdb-hero h1, .sj-event-hero h1 {
  margin:0 0 6px !important;
  color:#fff !important;
  font-family:inherit !important;
  font-size:27px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  letter-spacing:-.4px !important;
  max-width:calc(100vw - 260px) !important;
}
.sjcs-eyebrow, .sjad-eyebrow, .sjac-kicker, .sjcb-eyebrow, .sjcb-kicker, .ca-eyebrow, .sj-ach-kicker, .sjce-eyebrow, .sj-gallery-eyebrow, .sjg-kicker, .sj-video-eyebrow, .sjnb-eyebrow, .sa-eyebrow, .sjdb-eyebrow {
  color:rgba(255,255,255,.78) !important;
  font-size:11px !important;
  line-height:1.4 !important;
  font-weight:800 !important;
  letter-spacing:1.5px !important;
  margin:0 0 7px !important;
}
.sjcs-leadership-hero p, .sjad-hero p, .sjac-hero p, .sjfs-hero p, .sjcb-hero p, .ca-hero p, .sj-ach-hero p, .sjce-hero p, .sj-gallery-hero p, .sj-video-hero p, .sjnb-hero p, .sa-hero p, .sjdb-hero p, .sj-event-hero p {
  margin:0 !important;
  color:rgba(255,255,255,.86) !important;
  font-family:inherit !important;
  font-size:14px !important;
  line-height:1.35 !important;
  max-width:900px !important;
}
.sjcs-leadership-hero > div:first-child, .sjad-hero > div:first-child, .sjac-hero > div:first-child, .sjfs-hero > div:first-child, .sjcb-hero-copy, .ca-hero > div:first-child, .sj-ach-hero > div:first-child, .sjce-hero-copy, .sj-gallery-hero > div:first-child, .sj-video-hero > div:first-child, .sjnb-hero-content, .sa-hero-content, .sjdb-hero-content, .sj-event-hero > div:first-child {
  min-width:0 !important;
  max-width:calc(100% - 100px) !important;
}
.sjcs-leadership-hero .sjcs-primary-btn, .sjad-hero button, .sjac-hero button, .sjfs-hero button, .sjcb-hero button, .ca-hero button, .sj-ach-hero .sj-ach-btn, .sjce-hero button, .sj-gallery-hero .sjg-btn-primary, .sj-video-hero .svg-btn-gold, .sjnb-hero button, .sa-hero button, .sjdb-hero .sjdb-hero-btn.primary, .sj-event-hero button {
  flex:0 0 auto !important;
}
@media(max-width:760px){
  .sjcs-leadership-hero, .sjad-hero, .sjac-hero, .sjfs-hero, .sjcb-hero, .ca-hero, .sj-ach-hero, .sjce-hero, .sj-gallery-hero, .sj-video-hero, .sjnb-hero, .sa-hero, .sjdb-hero, .sj-event-hero {height:140px !important;min-height:140px !important;padding:22px !important;}
  .sjcs-leadership-hero h1, .sjad-hero h1, .sjac-hero h1, .sjfs-hero h1, .sjcb-hero h1, .ca-hero h1, .sj-ach-hero h1, .sjce-hero h1, .sj-gallery-hero h1, .sj-video-hero h1, .sjnb-hero h1, .sa-hero h1, .sjdb-hero h1, .sj-event-hero h1 {font-size:23px !important;max-width:calc(100% - 20px) !important;}
}

/* ============================================================
   SJCS ADMIN — CURRICULUM & SYLLABUS
   EXACT PAGE FRAME + HERO MATCH WITH LEADERSHIP & MANAGEMENT
   ============================================================ */

body:has(#curriculumAdminRoot) .main .content{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:19px 20px 28px !important;
  box-sizing:border-box !important;
}

body:has(#curriculumAdminRoot) #curriculumAdminRoot.ca-page{
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  margin:0 !important;
  padding:0 0 30px !important;
  box-sizing:border-box !important;
}

/* Exact Leadership hero standard. */
body:has(#curriculumAdminRoot) .ca-hero{
  width:100% !important;
  min-height:140px !important;
  height:140px !important;
  box-sizing:border-box !important;
  padding:28px 30px !important;
  margin:0 0 18px !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,#0f5132,#176b43) !important;
  box-shadow:0 12px 30px rgba(15,81,50,.14) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:20px !important;
  overflow:hidden !important;
}

body:has(#curriculumAdminRoot) .ca-hero > div:first-child{
  min-width:0 !important;
  max-width:calc(100% - 100px) !important;
}

body:has(#curriculumAdminRoot) .ca-eyebrow{
  display:block !important;
  margin:0 0 7px !important;
  color:rgba(255,255,255,.78) !important;
  font-size:11px !important;
  line-height:1.4 !important;
  font-weight:800 !important;
  letter-spacing:1.5px !important;
}

body:has(#curriculumAdminRoot) .ca-hero h1{
  margin:0 0 6px !important;
  color:#fff !important;
  font-family:inherit !important;
  font-size:27px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  letter-spacing:-.4px !important;
  max-width:calc(100% - 100px) !important;
}

body:has(#curriculumAdminRoot) .ca-hero p{
  margin:0 !important;
  color:rgba(255,255,255,.86) !important;
  font-family:inherit !important;
  font-size:14px !important;
  line-height:1.35 !important;
  max-width:900px !important;
}

/* Leadership has no separate hero icon competing with the heading. */
body:has(#curriculumAdminRoot) .ca-hero-icon{
  flex:0 0 auto !important;
  width:52px !important;
  height:52px !important;
  border-radius:12px !important;
  border:1px solid rgba(255,255,255,.20) !important;
  color:#c9a227 !important;
  background:rgba(255,255,255,.06) !important;
}

@media(max-width:760px){
  body:has(#curriculumAdminRoot) .main .content{
    padding:19px 20px 24px !important;
  }

  body:has(#curriculumAdminRoot) .ca-hero{
    height:140px !important;
    min-height:140px !important;
    padding:22px !important;
  }

  body:has(#curriculumAdminRoot) .ca-hero h1{
    font-size:23px !important;
    max-width:calc(100% - 20px) !important;
  }

  body:has(#curriculumAdminRoot) .ca-hero-icon{
    display:none !important;
  }
}

/* Academic-year lifecycle controls */
.ca-year-notice {
  margin: 12px 0 18px;
  padding: 12px 15px;
  border: 1px solid #f0c36d;
  border-radius: 10px;
  background: #fff8e8;
  color: #7a4b00;
  font-size: 0.92rem;
}
.ca-toolbar .ca-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

/* Fix academic-year toolbar overflow: keep lifecycle actions readable and separated. */
body:has(#curriculumAdminRoot) .ca-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  gap: 12px !important;
}

body:has(#curriculumAdminRoot) .ca-toolbar > .ca-field {
  flex: 1 1 260px !important;
  min-width: 220px !important;
  max-width: 330px !important;
}

body:has(#curriculumAdminRoot) .ca-toolbar > .ca-btn {
  flex: 0 0 auto !important;
  max-width: 100% !important;
}

body:has(#curriculumAdminRoot) .ca-toolbar #caDeleteYear {
  width: auto !important;
  min-width: 0 !important;
  padding: 0 14px !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  body:has(#curriculumAdminRoot) .ca-toolbar > .ca-field {
    flex: 1 1 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 520px) {
  body:has(#curriculumAdminRoot) .ca-toolbar > .ca-btn {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  body:has(#curriculumAdminRoot) .ca-toolbar #caDeleteYear {
    justify-content: center !important;
  }
}
