:root {
  --ink: #354024;
  --muted: #889063;
  --line: #CFBB99;
  --surface: #E5D7C4;
  --canvas: color-mix(in srgb, #E5D7C4 78%, #CFBB99);
  --forest: #354024;
  --forest-dark: #4C3D19;
  --green-soft: color-mix(in srgb, #889063 24%, #E5D7C4);
  --gold: #CFBB99;
  --gold-soft: color-mix(in srgb, #CFBB99 55%, #E5D7C4);
  --blue: #889063;
  --blue-soft: color-mix(in srgb, #889063 22%, #E5D7C4);
  --coral: #4C3D19;
  --coral-soft: color-mix(in srgb, #CFBB99 42%, #E5D7C4);
  --shadow: 0 10px 30px rgba(76, 61, 25, .12);
}

.sbo-sanction-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 145px;
}

.sbo-sanction-field span {
  color: var(--olive);
  font-size: 12px;
  font-weight: 700;
}

.sbo-sanction-field input {
  width: 105px;
  min-height: 38px;
  padding: 7px 9px;
}

.sbo-session-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(68px, 1fr));
  gap: 5px;
  min-width: 0;
  max-width: 620px;
}

.sbo-session-grid label {
  display: grid;
  gap: 3px;
  margin: 0;
}

.sbo-session-grid label > span {
  color: var(--olive);
  font-size: 9px;
  font-weight: 700;
}

.sbo-session-grid select {
  width: 100%;
  min-height: 30px;
  padding: 4px 22px 4px 7px;
  border-radius: 6px;
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  min-height: 42px;
  color: var(--olive);
  font-size: 13px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-pages button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--forest);
  cursor: pointer;
  font-weight: 700;
}

.pagination-pages button.active {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.pagination-pages button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.pagination-gap { padding: 0 3px; }
.pagination-count { min-width: 90px; }

.pagination > label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.pagination > label select {
  min-height: 34px;
  padding: 5px 28px 5px 8px;
}

@media (max-width: 700px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .sbo-session-grid {
    grid-template-columns: repeat(2, minmax(96px, 1fr));
    min-width: 0;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 61, 25, .45) transparent;
  color: #fff;
  background: #354024;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(76, 61, 25, .42); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(76, 61, 25, .65); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark {
  width: 50px; height: 42px; display: grid; place-items: center;
  overflow: hidden; background: #E5D7C4; border: 1px solid #CFBB99;
}
.brand-mark img {
  width: 100%; height: 100%; display: block; object-fit: contain;
}
.brand strong, .brand span { display: block; }
.brand strong { font: 700 16px "Manrope", sans-serif; }
.brand span { margin-top: 2px; color: #CFBB99; font-size: 11px; }
.nav-list { display: grid; gap: 5px; }
.nav-item {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border: 0; border-radius: 6px;
  color: #CFBB99; background: transparent; text-align: left;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active { box-shadow: inset 3px 0 #CFBB99; }
.nav-icon { width: 22px; font-size: 18px; text-align: center; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; }
.term-chip { padding: 13px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.05); }
.term-chip span, .term-chip strong { display: block; }
.term-chip span { color: #CFBB99; font-size: 11px; text-transform: uppercase; }
.term-chip strong { margin-top: 4px; font-size: 13px; }

.main { grid-column: 2; min-width: 0; }
.topbar {
  min-height: 86px; display: flex; justify-content: space-between; align-items: center;
  gap: 20px; padding: 18px 30px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar-left, .topbar-actions, .profile { display: flex; align-items: center; }
.topbar-left { gap: 12px; }
.topbar-actions { gap: 12px; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 800 23px "Manrope", sans-serif; }
h2 { margin-bottom: 7px; font: 800 26px "Manrope", sans-serif; }
h3 { margin-bottom: 0; font: 700 17px "Manrope", sans-serif; }
.icon-button {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); background: #fff;
}
.menu-button { display: none; }
.notification-button {
  position: relative;
  display: grid;
  place-items: center;
}
.topbar-notification-icon {
  display: grid;
  place-items: center;
}
.topbar-notification-icon svg {
  width: 19px;
  height: 19px;
}
.notification-button:hover .topbar-notification-icon {
  transform: rotate(-7deg);
}
.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid #fffaf2;
  border-radius: 50%;
  background: #4C3D19;
}
.notification-count {
  position: absolute;
  top: -7px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fffaf2;
  border-radius: 10px;
  color: #fff;
  background: #4C3D19;
  box-shadow: 0 2px 8px rgba(76, 61, 25, .35);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
.notification-count[hidden] { display: none; }
.notification-button.has-unread {
  border-color: #4C3D19;
  background: #E5D7C4;
  box-shadow: 0 0 0 3px rgba(207, 187, 153, .45);
}
.notification-button.has-unread .topbar-notification-icon { animation: notification-ring 1.8s ease-in-out infinite; }
@keyframes notification-ring {
  0%, 55%, 100% { transform: rotate(0); }
  62% { transform: rotate(10deg); }
  69% { transform: rotate(-9deg); }
  76% { transform: rotate(5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .notification-button.has-unread .topbar-notification-icon { animation: none; }
}
.global-search, .table-search {
  height: 40px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.global-search input, .table-search input { min-width: 0; border: 0; outline: 0; background: transparent; }
.global-search { width: min(280px, 25vw); }
.global-search input { width: 100%; }
.profile { gap: 10px; margin-left: 5px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--forest); font-weight: 700; font-size: 12px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile strong, .profile span { display: block; }
.profile strong { font-size: 13px; }
.profile span { color: var(--muted); font-size: 10px; }

.page { display: none; padding: 28px 30px 42px; }
.page.active { display: block; }
.welcome-band, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.welcome-band {
  min-height: 138px; padding: 26px 30px; overflow: hidden; position: relative;
  color: #E5D7C4; background: #4C3D19;
}
.welcome-band::after {
  content: "CEAT"; position: absolute; right: 26px; bottom: -24px;
  color: rgba(255,255,255,.055); font: 800 100px "Manrope", sans-serif;
}
.welcome-band p { margin: 0; color: #CFBB99; }
.welcome-band .section-label { color: #E5D7C4; }
.welcome-band > * { position: relative; z-index: 1; }
.section-label { display: block; margin-bottom: 5px; color: var(--forest); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.primary-button, .secondary-button {
  min-height: 40px; padding: 9px 15px; border-radius: 5px; font-weight: 700; border: 1px solid transparent;
}
.primary-button { color: #4C3D19; background: #CFBB99; border-color: #CFBB99; }
.primary-button:hover { color: #E5D7C4; background: #889063; border-color: #889063; }
.secondary-button { color: var(--forest); background: #fff; border-color: #cbd8d0; }
.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: .62;
  transform: none;
  box-shadow: none;
}
.full-width { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
#dashboard > .metric-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.metric-card {
  min-height: 118px; display: flex; align-items: center; gap: 14px;
  padding: 18px; border: 1px solid var(--line); background: #fff; box-shadow: 0 4px 16px rgba(20,52,38,.035);
}
.metric-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 6px; font-weight: 800; }
.metric-icon svg { width: 20px; height: 20px; }
.metric-icon.green { color: var(--forest); background: var(--green-soft); }
.metric-icon.yellow { color: #8d6412; background: var(--gold-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.coral { color: var(--coral); background: var(--coral-soft); }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { margin: 2px 0; font: 800 27px "Manrope", sans-serif; }
.metric-card small { color: #8b9891; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.new-students-panel { grid-column: 1 / -1; }
.recent-student-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.recent-student-item { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; padding: 16px; border-right: 1px solid var(--line); }
.recent-student-item:last-child { border-right: 0; }
.recent-student-item strong, .recent-student-item span, .recent-student-item time { display: block; }
.recent-student-item strong { overflow: hidden; color: #354024; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recent-student-item span { margin-top: 3px; overflow: hidden; color: #6b5a35; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.recent-student-item time { grid-column: 2; color: #889063; font-size: 9px; }
@media (max-width: 1100px) { .recent-student-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .recent-student-item { border-bottom: 1px solid var(--line); } }
@media (max-width: 600px) { .recent-student-list { grid-template-columns: 1fr; } .recent-student-item { border-right: 0; } }
.panel { border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.text-button, .more-button { border: 0; color: var(--forest); background: transparent; font-weight: 700; font-size: 12px; }
.more-button { color: var(--muted); font-size: 16px; }
.schedule-list { padding: 4px 20px 10px; }
.schedule-item { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #edf0ee; }
.schedule-item:last-child { border-bottom: 0; }
.date-tile { padding: 7px 5px; text-align: center; background: var(--green-soft); }
.date-tile strong, .date-tile span { display: block; }
.date-tile strong { font: 800 18px "Manrope", sans-serif; color: var(--forest); }
.date-tile span { color: var(--forest); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.schedule-item h4 { margin: 0 0 4px; font-size: 13px; }
.schedule-item p { margin: 0; color: var(--muted); font-size: 11px; }
.pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.pill.active, .pill.published, .pill.present { color: #14613c; background: #daf0e3; }
.pill.paid { color: #14613c; background: #daf0e3; }
.pill.planning, .pill.review, .pill.excused { color: #8a651c; background: #f6edcf; }
.pill.completed { color: #41667e; background: #e1edf3; }
.pill.draft, .pill.absent { color: #9a4d42; background: #f4dfdb; }
.pill.unpaid { color: #8a5b18; background: #f4e8c9; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 30px 20px; }
.donut { width: 136px; height: 136px; display: grid; place-items: center; border-radius: 50%; position: relative; background: conic-gradient(var(--forest) 0 72%, var(--gold) 72% 86%, #dfe5e1 86%); }
.donut::after { content: ""; position: absolute; width: 88px; height: 88px; border-radius: 50%; background: #fff; }
.donut span { position: relative; z-index: 1; font: 800 23px "Manrope", sans-serif; }
.donut-legend { min-width: 125px; display: grid; gap: 13px; }
.donut-legend div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.present { background: var(--forest); }
.legend-dot.absent { background: #cad4ce; }
.legend-dot.excused { background: var(--gold); }
.legend-dot.not-recorded { background: #dfe5e1; border: 1px solid #aebbb3; }
.dashboard-event-select { max-width: 230px; margin-top: 5px; padding: 4px 24px 4px 7px; border: 1px solid #d7c7aa; border-radius: 5px; color: var(--forest); background: #fff; font-size: 10px; }
.attendance-panel .secondary-button { width: calc(100% - 40px); margin: 0 20px 20px; }
.article-preview-list { padding: 5px 20px; }
.article-preview { display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf0ee; }
.article-preview:last-child { border-bottom: 0; }
.article-thumb { height: 46px; display: grid; place-items: center; color: #fff; background: var(--forest); font: 800 15px "Manrope", sans-serif; }
.article-preview h4 { margin: 0 0 4px; font-size: 13px; }
.article-preview p { margin: 0; color: var(--muted); font-size: 10px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px; }
.quick-grid button {
  min-height: 88px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #f8faf9;
}
.quick-grid button:hover { border-color: #8ab39d; background: #eef6f1; }
.quick-grid span { color: var(--forest); font-size: 22px; }
.quick-grid strong { font-size: 11px; }

.page-heading { margin-bottom: 18px; }
.page-heading p { margin: 0; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar .table-search { width: min(360px, 100%); }
select { min-height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; }
.table-panel { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid #e9eeeb; text-align: left; white-space: nowrap; }
th { color: #738078; background: #f7f9f8; font-size: 10px; text-transform: uppercase; }
td { font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.table-title { display: flex; align-items: center; gap: 10px; }
.initials { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: #fff; background: var(--forest); font-weight: 800; font-size: 10px; }
.table-title strong, .table-title span { display: block; }
.table-title strong { font-size: 12px; }
.table-title span { color: var(--muted); font-size: 10px; }
.row-action { border: 0; color: var(--muted); background: transparent; font-size: 18px; }

.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.article-card { min-height: 240px; display: flex; flex-direction: column; border: 1px solid var(--line); background: #fff; }
.article-cover { min-height: 86px; padding: 18px; color: #fff; background: var(--forest); position: relative; }
.article-cover::after { content: "CSC"; position: absolute; right: 14px; bottom: -8px; color: rgba(255,255,255,.12); font: 800 50px "Manrope"; }
.article-cover span { position: relative; z-index: 1; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pin-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pin-label-inline {
  display: inline-flex;
  margin-left: 6px;
  color: #8a651c;
  font-size: 10px;
  font-style: normal;
}
.sanction-amount {
  color: #9a4d42;
  font-weight: 800;
}
.sanction-event-list,
.sanction-action-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.sanction-event-item,
.sanction-action-item {
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(207, 187, 153, .55);
}
.sanction-event-item:last-child,
.sanction-action-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.sanction-event-item strong,
.sanction-action-item span {
  color: #354024;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.sanction-event-item span {
  color: #6f7655;
  font-size: 10px;
  font-weight: 700;
}
.sanction-action-item {
  grid-template-columns: 1fr;
  align-items: start;
  justify-items: start;
}
.sanction-action-item .text-button {
  padding: 2px 0;
}
.sanction-table-panel table {
  min-width: 1180px;
}
.sanction-table-panel th:nth-child(1),
.sanction-table-panel td:nth-child(1) {
  min-width: 190px;
}
.sanction-table-panel th:nth-child(2),
.sanction-table-panel td:nth-child(2) {
  min-width: 330px;
  max-width: 420px;
}
.sanction-table-panel th:nth-child(7),
.sanction-table-panel td:nth-child(7) {
  min-width: 170px;
  max-width: 210px;
}
.student-sanction-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #CFBB99;
  border-radius: 8px;
  background: #fff;
}
.student-sanction-summary span {
  color: #6b5a35;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
}
.student-sanction-summary strong {
  color: #9a4d42;
  font: 800 24px "Manrope", sans-serif;
}
.student-attendance-qr-access {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #CFBB99;
  border-radius: 8px;
  background: #fff;
}
.student-attendance-qr-heading h3 { margin: 4px 0 5px; font-size: 18px; }
.student-attendance-qr-heading p,
.student-attendance-qr-empty p { margin: 0; color: #6b5a35; font-size: 12px; line-height: 1.5; }
.student-attendance-qr-events { display: grid; gap: 9px; }
.student-attendance-qr-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 0;
  border-top: 1px solid #e3d6be;
}
.student-attendance-qr-event strong,
.student-attendance-qr-event span { display: block; }
.student-attendance-qr-event strong { color: #354024; font-size: 13px; }
.student-attendance-qr-event span { margin-top: 3px; color: #7a6b4d; font-size: 11px; }
.student-attendance-qr-event .primary-button { min-height: 40px; padding: 9px 14px; white-space: nowrap; }
.student-attendance-qr-empty { display: grid; gap: 6px; }
@media (max-width: 620px) {
  .student-attendance-qr-access { padding: 16px; }
  .student-attendance-qr-event { align-items: stretch; flex-direction: column; gap: 12px; }
  .student-attendance-qr-event .primary-button { width: 100%; }
}
.student-profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.student-department-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 12px rgba(53, 64, 36, .14));
}
.notification-pin {
  align-self: center;
  white-space: nowrap;
}
.term-chip small {
  display: block;
  margin-top: 3px;
  color: #E5D7C4;
  font-size: 11px;
}
.article-card:nth-child(3n+2) .article-cover { background: #9f7620; }
.article-card:nth-child(3n+3) .article-cover { background: #356a81; }
.article-body { flex: 1; padding: 18px; }
.article-body h3 { margin-bottom: 8px; line-height: 1.4; }
.article-body p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.article-meta { display: flex; justify-content: space-between; align-items: center; padding: 0 18px 17px; color: var(--muted); font-size: 10px; }
.article-actions { display: flex; justify-content: flex-end; padding: 0 18px 17px; }

.event-layout { display: grid; grid-template-columns: 1.35fr .9fr; gap: 18px; }
.calendar-panel { padding: 20px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.calendar-header button { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; font-size: 20px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays span { padding: 8px 4px; color: var(--muted); text-align: center; font-size: 10px; font-weight: 700; }
.calendar-day { min-height: 76px; padding: 8px; border: 1px solid #edf0ee; margin: -1px 0 0 -1px; font-size: 11px; }
.calendar-day.muted { color: #b7c0bb; background: #fafbfa; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.calendar-event { display: block; margin-top: 5px; padding: 3px 4px; overflow: hidden; color: #fff; background: var(--forest); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.event-list { padding: 0 20px 12px; }
.event-item { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid #edf0ee; }
.event-item:last-child { border: 0; }
.event-item h4 { margin: 0 0 5px; font-size: 12px; }
.event-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.event-edit-button {
  margin-top: 9px; padding: 5px 9px; border: 1px solid #889063; border-radius: 6px;
  color: #354024; background: color-mix(in srgb, #889063 20%, #E5D7C4);
  font-size: 9px; font-weight: 800;
}
.event-edit-button:hover { background: color-mix(in srgb, #889063 34%, #E5D7C4); }
.event-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.event-actions .event-edit-button { margin-top: 0; }
.event-delete-action { grid-column: 2; margin-top: -5px; }
.delete-record-button {
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, #4C3D19 55%, #CFBB99);
  border-radius: 6px;
  color: #4C3D19;
  background: color-mix(in srgb, #CFBB99 28%, #fff);
  font-size: 9px;
  font-weight: 800;
}
.delete-record-button:hover {
  color: #fff;
  border-color: #4C3D19;
  background: #4C3D19;
}
.compact-delete-button {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.attendance-controls { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr .8fr; align-items: end; gap: 15px; padding: 18px; margin-bottom: 14px; box-shadow: none; }
.attendance-controls label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.attendance-controls select { width: 100%; }
.attendance-summary { grid-column: 1 / -1; min-height: 34px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 4px; font-size: 11px; }
.attendance-summary span { display: flex; align-items: center; gap: 5px; }
.legend-dot.excused { background: #CFBB99; }
.status-select { min-height: 34px; padding-left: 10px; font-size: 11px; }

.profile-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.profile-summary {
  padding: 28px 22px;
  text-align: center;
}

.profile-avatar-large {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 4px solid #CFBB99;
  border-radius: 50%;
  color: #E5D7C4;
  background: #354024;
  font: 800 25px "Manrope", sans-serif;
  overflow: hidden;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-image-form {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: -5px 0 20px;
}

.profile-image-button {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 34px;
  margin: 0 auto;
  padding: 7px 12px;
  font-size: 10px;
  cursor: pointer;
}

.profile-image-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.profile-image-button.disabled {
  opacity: .55;
  pointer-events: none;
}

.profile-image-form small {
  color: #889063;
  font-size: 9px;
}

.profile-summary h2 {
  margin-bottom: 7px;
  font-size: 20px;
}

.profile-role {
  display: inline-flex;
  padding: 5px 9px;
  color: #354024;
  background: color-mix(in srgb, #889063 35%, #E5D7C4);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-meta {
  margin: 26px 0 0;
  text-align: left;
}

.profile-meta div {
  padding: 14px 0;
  border-top: 1px solid #CFBB99;
}

.profile-meta dt {
  margin-bottom: 4px;
  color: #889063;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #4C3D19;
  font-size: 12px;
  font-weight: 700;
}

.profile-forms {
  display: grid;
  gap: 18px;
}

.settings-panel form {
  max-width: 680px;
}

.read-only-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #CFBB99;
  background: color-mix(in srgb, #E5D7C4 72%, #CFBB99);
}

.read-only-field span {
  color: #889063;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.read-only-field strong {
  color: #4C3D19;
  font-size: 12px;
}

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(8, 30, 20, .55); }
.modal.open { display: grid; }
.modal-card { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: #fff; box-shadow: 0 20px 70px rgba(0,0,0,.25); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.close-modal { border: 0; color: var(--muted); background: transparent; font-size: 24px; }
form { padding: 22px; }
form > label, .form-row label { display: grid; gap: 7px; color: #4c5b53; font-size: 11px; font-weight: 700; }
form > label { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 15px; }
form input, form select, form textarea { width: 100%; padding: 10px 11px; border: 1px solid #ccd6d0; border-radius: 4px; outline: 0; color: var(--ink); background: #fff; }
form input:focus, form select:focus, form textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(20,92,58,.09); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.modal-actions .close-modal { font-size: 13px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; padding: 12px 16px; transform: translateY(20px); opacity: 0; color: #fff; background: var(--forest-dark); box-shadow: var(--shadow); font-size: 12px; transition: .2s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.empty-state { padding: 34px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: 1fr 1fr; }
  .global-search { display: none; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { width: 100%; }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { padding: 14px 18px; }
  .profile div:last-child { display: none; }
  .page { padding: 20px 16px 34px; }
  .dashboard-grid, .event-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .attendance-controls { grid-template-columns: 1fr; align-items: stretch; }
}
@media (max-width: 560px) {
  .topbar .eyebrow { display: none; }
  h1 { font-size: 19px; }
  .welcome-band, .page-heading { align-items: flex-start; flex-direction: column; }
  .welcome-band { padding: 24px 20px; }
  .metric-grid, .article-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .toolbar { flex-direction: column; }
  .toolbar select { width: 100%; }
  .schedule-item { grid-template-columns: 45px 1fr; }
  .schedule-item .pill { display: none; }
  .donut-wrap { flex-direction: column; }
  .calendar-day { min-height: 54px; padding: 5px; }
  .calendar-event { width: 8px; height: 8px; padding: 0; border-radius: 50%; color: transparent; }
  .form-row { grid-template-columns: 1fr; }
}

/* Article publishing and reader */
.article-card {
  display: grid;
  min-height: 410px;
  grid-template-rows: auto 1fr auto auto;
}

.article-cover {
  min-height: 0;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.article-cover.has-image::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(53,64,36,.16), rgba(53,64,36,.72));
  content: "";
}

.article-cover.has-image::after { display: none; }
.article-body { min-width: 0; }

.article-body h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-body p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.article-read-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--forest);
  background: transparent;
  font-weight: 700;
}

.publication-form-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 82%, white);
}

.publication-form-section + .publication-form-section { margin-top: 16px; }
.publication-form-section > h3 { margin: 0; font-size: 13px; text-transform: uppercase; }

.article-reader-modal {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: none;
  overflow-y: auto;
  place-items: start center;
  padding: 36px 18px;
  background: rgba(28, 32, 22, .58);
}

.article-reader-modal.open { display: grid; }
.article-reader-modal[aria-hidden="true"] { display: none; }

.article-reader-card {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100dvh - 72px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(28, 32, 22, .28);
}

.article-reader-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 50%;
  color: white;
  background: rgba(53,64,36,.82);
  font-size: 23px;
}

.article-reader-cover {
  display: block;
  width: 100%;
  height: clamp(190px, 30vw, 320px);
  min-height: 0;
  object-fit: cover;
  background: #889063;
}

.article-reader-content { padding: clamp(22px, 5vw, 48px); }
.article-reader-content h2 { max-width: 680px; margin: 7px 0 12px; line-height: 1.25; }
.article-reader-byline { color: var(--muted); font-size: 12px; }
.article-reader-summary { margin: 24px 0; padding-left: 16px; border-left: 3px solid #889063; font-weight: 700; line-height: 1.6; }
.article-reader-body p { margin: 0 0 18px; line-height: 1.75; }

@media (max-width: 640px) {
  .article-card { min-height: 360px; }
  .publication-form-section { padding: 12px; }
  .article-reader-modal.open { padding: 0; place-items: stretch; }
  .article-reader-card { width: 100%; min-height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .article-reader-cover { height: 190px; }
  .article-reader-content { padding: 24px 18px 40px; }
}

/* Consolidated tablet and mobile layout */
.table-panel { max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-panel table { min-width: 760px; }

@media (max-width: 1180px) {
  .page { padding: 22px 20px 40px; }
  .topbar { padding-inline: 20px; }
  .dashboard-grid,
  .event-layout,
  .report-grid,
  .collection-breakdown-grid,
  .notification-management-layout { grid-template-columns: 1fr; }
  .qr-event-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashboard > .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { flex-wrap: wrap; align-items: stretch; }
  .toolbar .table-search { flex: 1 1 280px; width: auto; }
  .toolbar .student-filter-group { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .student-filter-group select { width: 100%; min-width: 0; }
  .new-students-panel { grid-column: auto; }
  .recent-student-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-main { width: min(100% - 28px, 1180px); }
  .student-header-main { width: min(100% - 28px, 1240px); }
  .student-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-event-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .collection-summary-grid {
    grid-template-columns: 1fr;
  }
  .collection-breakdown-panel .compact-table table {
    min-width: 500px;
  }
}

@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .topbar { min-height: 68px; padding: 11px 14px; }
  .topbar-left { min-width: 0; }
  .topbar-left h1 { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 8px; }
  .icon-button { width: 42px; height: 42px; flex: 0 0 42px; }
  .page { padding: 18px 12px 34px; }
  .page-heading { gap: 12px; }
  .page-heading > button,
  .page-heading .report-actions { width: 100%; }
  .report-actions { display: grid; grid-template-columns: 1fr; }
  .report-actions button,
  .report-actions a { width: 100%; }
  .collection-summary-grid { grid-template-columns: 1fr; padding-inline: 12px; }
  .collection-breakdown-grid { padding-inline: 12px; }
  .metric-grid,
  #dashboard > .metric-grid,
  .membership-metrics,
  .article-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .welcome-band { min-height: 210px; padding: 22px 18px; }
  .welcome-band .primary-button { width: 100%; justify-content: center; }
  .toolbar,
  .membership-toolbar { gap: 10px; }
  .toolbar .table-search { flex-basis: 100%; width: 100%; }
  .toolbar .student-filter-group { grid-template-columns: 1fr; }
  .table-panel { border-radius: 7px; }
  .table-panel table { min-width: 700px; }
  .sanction-action-item { grid-template-columns: 1fr; justify-items: start; }
  .modal { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 94dvh; border-radius: 10px 10px 0 0; }
  .modal-header { padding: 16px 18px; }
  .modal-card form { padding: 18px; }
  .modal-actions { position: sticky; bottom: 0; margin: 0 -18px -18px; padding: 12px 18px; background: #fff; border-top: 1px solid var(--line); }
  .modal-actions button { flex: 1; min-height: 44px; }
  form input,
  form select,
  form textarea,
  select,
  .primary-button,
  .secondary-button { min-height: 44px; }
  .toast { right: 12px; bottom: 12px; left: 12px; text-align: center; }
  .recent-student-list { grid-template-columns: 1fr; }
  .recent-student-item { border-right: 0; }
  .student-header-main { width: calc(100% - 20px); gap: 8px; }
  .student-account { gap: 6px; }
  .student-logout button { min-height: 38px; padding-inline: 10px; }
  .student-nav { min-height: 52px; padding: 7px 10px; }
  .student-nav-item { min-height: 38px; padding: 8px 10px; font-size: 11px; }
  .student-main { width: calc(100% - 20px); padding-top: 18px; }
  .student-metrics { grid-template-columns: 1fr; }
  .student-welcome { min-height: 290px; padding: 22px; }
  .student-id-card { width: 100%; min-width: 0; }
  .student-event-card { grid-template-columns: 50px minmax(0, 1fr); padding: 16px; }
  .student-event-actions { grid-column: 1 / -1; width: 100%; }
  .student-event-actions .primary-button,
  .student-event-actions .secondary-button { width: 100%; }
  .concern-layout,
  .profile-layout,
  .membership-student-summary { grid-template-columns: 1fr; }
}

/* Requested CSC Connect palette */
body,
.calendar-day.muted {
  background: var(--canvas);
}

.sidebar,
.nav-item:hover,
.nav-item.active,
.avatar {
  color: #E5D7C4;
}

.brand strong,
.nav-item,
.profile strong,
.profile span,
th {
  color: inherit;
}

.notification-dot {
  background: #889063;
}

.welcome-band::after,
.article-cover::after {
  color: rgba(229, 215, 196, .12);
}

.topbar,
.panel,
.metric-card,
.table-panel,
.article-card,
.modal-card,
.icon-button,
.global-search,
.table-search,
select,
form input,
form select,
form textarea,
.secondary-button,
.donut::after {
  background: #E5D7C4;
}

.topbar,
.panel,
.metric-card,
.table-panel,
.article-card,
.modal-card,
.icon-button,
.global-search,
.table-search,
select,
form input,
form select,
form textarea,
.secondary-button,
.quick-grid button,
.calendar-header button {
  border-color: #CFBB99;
}

.metric-icon.green,
.metric-icon.yellow,
.metric-icon.blue,
.metric-icon.coral,
.date-tile {
  color: #4C3D19;
  background: color-mix(in srgb, #CFBB99 58%, #E5D7C4);
}

.date-tile strong,
.date-tile span,
.text-button,
.quick-grid span,
.secondary-button {
  color: #4C3D19;
}

.quick-grid button,
th {
  background: color-mix(in srgb, #E5D7C4 75%, #CFBB99);
}

.quick-grid button:hover {
  border-color: #889063;
  background: color-mix(in srgb, #889063 22%, #E5D7C4);
}

.pill.active,
.pill.published,
.pill.present {
  color: #354024;
  background: color-mix(in srgb, #889063 38%, #E5D7C4);
}

.pill.planning,
.pill.review,
.pill.excused {
  color: #4C3D19;
  background: color-mix(in srgb, #CFBB99 65%, #E5D7C4);
}

.pill.completed {
  color: #E5D7C4;
  background: #889063;
}

.pill.draft,
.pill.absent {
  color: #E5D7C4;
  background: #4C3D19;
}
.pill.approved { color: #354024; background: color-mix(in srgb, #889063 32%, #E5D7C4); }
.pill.pending { color: #4C3D19; background: #CFBB99; }
.pill.rejected { color: #E5D7C4; background: #4C3D19; }

.article-thumb,
.article-cover,
.article-card:nth-child(3n+2) .article-cover,
.article-card:nth-child(3n+3) .article-cover,
.initials,
.calendar-event {
  color: #E5D7C4;
  background: #354024;
}

.article-card:nth-child(3n+2) .article-cover {
  background: #4C3D19;
}

.article-card:nth-child(3n+3) .article-cover {
  background: #889063;
}

.legend-dot.present {
  background: #354024;
}

.legend-dot.absent {
  background: #CFBB99;
}

.legend-dot.excused {
  background: #889063;
}

.donut {
  background: conic-gradient(#354024 0 72%, #889063 72% 86%, #CFBB99 86%);
}

.toast {
  color: #E5D7C4;
  background: #4C3D19;
}

th {
  color: #4C3D19;
}

tr td,
.schedule-item,
.article-preview,
.event-item,
.panel-header,
.topbar,
.modal-header {
  border-color: color-mix(in srgb, #CFBB99 72%, #E5D7C4);
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: #889063;
  box-shadow: 0 0 0 3px rgba(136, 144, 99, .2);
}

::selection {
  color: #E5D7C4;
  background: #4C3D19;
}

.council-hero {
  min-height: 290px;
  display: flex;
  align-items: flex-end;
  padding: 34px;
  margin-bottom: 18px;
  overflow: hidden;
  color: #fff;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 64, 36, .94), rgba(53, 64, 36, .48)),
    url("../images/csc-logo.jpg") center 42% / cover no-repeat;
}
.council-hero-copy { max-width: 680px; }
.council-hero .section-label { color: #CFBB99; }
.council-hero h1 { margin: 8px 0 9px; color: #fff; font-size: 34px; }
.council-hero p { margin: 0; color: #E5D7C4; font-size: 15px; line-height: 1.6; }
.council-info-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; margin-bottom: 26px; }
.council-story, .council-work { padding: 25px; }
.council-story h2, .council-work h2 { margin: 7px 0 12px; }
.council-story > p, .council-work li { color: #4C3D19; font-size: 12px; line-height: 1.7; }
.council-principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.council-principles div { padding: 15px; border-left: 3px solid #889063; background: color-mix(in srgb, #E5D7C4 55%, #fff); }
.council-principles strong, .council-principles span { display: block; }
.council-principles strong { margin-bottom: 5px; color: #354024; font-size: 12px; }
.council-principles span { color: #4C3D19; font-size: 10px; line-height: 1.5; }
.council-work ul { padding-left: 18px; margin: 14px 0 0; }
.council-work li + li { margin-top: 8px; }
.council-directory-section { margin-top: 8px; }
.council-member-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.council-member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 17px;
  border: 1px solid color-mix(in srgb, #CFBB99 72%, #E5D7C4);
  border-radius: 8px;
  background: #fff;
}
.council-member-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  overflow: hidden;
  border-radius: 50%;
  color: #E5D7C4;
  background: #354024;
  font-weight: 800;
}
.council-member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.officer-table-photo,
.officer-photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #CFBB99;
  border-radius: 50%;
  color: #E5D7C4;
  background: #354024;
  font-weight: 800;
}
.officer-table-photo { width: 42px; height: 42px; font-size: 10px; }
.officer-photo-preview { width: 88px; height: 88px; margin: 0 auto; font-size: 22px; }
.officer-table-photo img,
.officer-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.officer-photo-field {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.officer-photo-field small { color: #889063; font-size: 9px; }
.officer-photo-button {
  position: relative;
  min-height: 34px;
  padding: 7px 12px;
  cursor: pointer;
}
.officer-photo-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.student-filter-group {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.student-filter-group select {
  min-width: 190px;
}

.membership-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.membership-toolbar {
  align-items: center;
}

.membership-toolbar .student-filter-group select {
  min-width: 150px;
}

.membership-status-card {
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 28px;
  border: 1px solid #CFBB99;
  border-left: 5px solid #889063;
  border-radius: 8px;
  background: #fff;
}

.membership-status-card.paid { border-left-color: #354024; }
.membership-status-card.unpaid { border-left-color: #CFBB99; }
.membership-status-card h3,
.membership-status-card p { margin: 0; }
.membership-status-card strong { color: #354024; font: 800 28px "Manrope", sans-serif; }
.membership-status-card p { color: #6b5a35; }
.membership-student-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .membership-metrics { grid-template-columns: 1fr; }
  .membership-student-summary { grid-template-columns: 1fr; }
  .student-filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .student-filter-group select {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .student-filter-group {
    grid-template-columns: 1fr;
  }
}
.council-member-card h3 { margin: 0 0 4px; overflow-wrap: anywhere; font-size: 13px; }
.council-member-card p { margin: 0; color: #889063; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.council-editor-panel { max-width: 980px; padding: 24px; }
.council-editor-panel form { margin-top: 18px; }
.council-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 15px; }
.field-hint { color: #889063; font-size: 9px; font-weight: 500; }

@media (max-width: 900px) {
  .council-info-grid { grid-template-columns: 1fr; }
  .council-member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .council-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .council-hero { min-height: 245px; padding: 24px; }
  .council-hero h1 { font-size: 27px; }
  .council-principles, .council-member-grid { grid-template-columns: 1fr; }
}

.logout-link {
  border-top: 1px solid rgba(229, 215, 196, .15);
}

.login-page {
  min-height: 100vh;
  background: #E5D7C4;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
}

.login-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 110px);
  overflow: hidden;
  position: relative;
  color: #E5D7C4;
  background-color: #354024;
  background-image:
    linear-gradient(90deg, rgba(53, 64, 36, .92), rgba(53, 64, 36, .64)),
    url("../images/csc-logo.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.login-brand .section-label {
  color: #CFBB99;
}

.isu-login-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.isu-login-lockup img {
  width: 52px;
  height: 52px;
  padding: 3px;
  flex: 0 0 52px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .18);
}

.isu-login-lockup div {
  display: grid;
  gap: 2px;
}

.isu-login-lockup strong {
  color: #fff;
  font: 700 12px "Manrope", sans-serif;
}

.isu-login-lockup span {
  color: #CFBB99;
  font-size: 9px;
  font-weight: 700;
}

.login-brand h1 {
  margin-bottom: 16px;
  font-size: clamp(36px, 5vw, 64px);
}

.department-logo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  margin: -4px 0 26px;
}

.department-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  opacity: .9;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.16));
}

.department-logo.ce {
  width: 58px;
  height: 58px;
}

.department-logo.ee,
.department-logo.ict,
.department-logo.git {
  width: 50px;
  height: 50px;
}

.department-logo.archi {
  width: 48px;
  height: 48px;
}

.login-brand p {
  max-width: 510px;
  margin-bottom: 42px;
  color: #CFBB99;
  font-size: 17px;
  line-height: 1.7;
}

.login-college {
  max-width: 420px;
  padding-top: 20px;
  border-top: 1px solid rgba(229, 215, 196, .2);
  font-size: 12px;
  line-height: 1.6;
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: #E5D7C4;
}

.login-form-wrap {
  width: min(430px, 100%);
}

.login-form-wrap h2 {
  margin-bottom: 8px;
  color: #4C3D19;
  font-size: 30px;
}

.login-form-wrap > p {
  margin-bottom: 26px;
  color: #889063;
}

.login-form {
  padding: 0;
}

.login-form > label {
  margin-bottom: 18px;
  color: #4C3D19;
  font-size: 12px;
}

.login-form input,
.login-form select {
  min-height: 48px;
  background: color-mix(in srgb, #E5D7C4 75%, white);
}
.login-form select {
  appearance: auto;
}

.register-form {
  display: grid;
  gap: 18px;
}

.register-section {
  min-width: 0;
  margin: 0;
  padding: 17px;
  border: 1px solid #CFBB99;
  border-radius: 8px;
  background: rgba(255, 255, 255, .32);
}

.register-section legend {
  padding: 0 6px;
  color: #354024;
  font: 800 10px "Manrope", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.register-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.register-form-grid label,
.register-full-width {
  min-width: 0;
  margin: 0 !important;
}

.register-full-width { grid-column: 1 / -1; }
.register-form-grid small {
  display: block;
  margin-top: 5px;
  color: #6b5a35;
  font-size: 10px;
  font-weight: 500;
}

.required-mark {
  color: #889063;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.register-form .login-button { margin-top: 2px; }

/* Registration is taller than the sign-in form, so it must flow from the top. */
.register-panel {
  display: block;
  padding: 52px 40px;
}

.register-panel .login-form-wrap {
  width: min(540px, 100%);
  margin: 0 auto;
}

.register-panel .login-form-wrap > p {
  margin-bottom: 20px;
}

.register-form-grid > label {
  display: block;
  color: #4C3D19;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.register-form-grid > label > input,
.register-form-grid > label > select {
  width: 100%;
  margin-top: 7px;
}

@media (max-width: 620px) {
  .register-panel { padding: 28px 14px; }
  .register-section { padding: 14px; }
  .register-form-grid { grid-template-columns: 1fr; gap: 13px; }
  .register-full-width { grid-column: auto; }
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid #CFBB99;
  background: color-mix(in srgb, #E5D7C4 75%, white);
}

.password-field input {
  border: 0;
  background: transparent;
}

.password-field button {
  padding: 0 14px;
  border: 0;
  color: #4C3D19;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.password-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.password-label-row a { color: #354024; font-size: 10px; font-weight: 800; text-decoration: none; }
.password-label-row a:hover { text-decoration: underline; }
.reset-help { margin-top: 16px; color: #889063; font-size: 10px; line-height: 1.55; text-align: center; }

.nav-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 9px;
  color: #fff;
  background: #4C3D19;
  font-size: 9px;
}
.notification-nav-item.has-unread {
  color: #354024;
  background: #E5D7C4;
  box-shadow: inset 0 0 0 1px #CFBB99;
}
.notification-nav-item.has-unread .nav-count { box-shadow: 0 2px 8px rgba(76, 61, 25, .32); }
.concern-layout, .notification-management-layout {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr);
  gap: 20px;
  align-items: start;
}
.concern-form-panel, .notification-compose { padding: 22px; }
.unframed-header { padding-left: 0; padding-right: 0; }
.concern-list, .notification-list { display: grid; gap: 12px; }
.concern-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.concern-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.concern-card-header h3 { margin: 4px 0; font-size: 15px; }
.concern-card > p { color: #4C3D19; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.concern-card small { color: #889063; font-size: 9px; }
.staff-response { padding: 12px; margin: 13px 0; border-left: 3px solid #889063; background: #E5D7C4; }
.staff-response strong { color: #354024; font-size: 10px; text-transform: uppercase; }
.staff-response p { margin: 5px 0 0; font-size: 11px; line-height: 1.55; }
.staff-concern-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.concern-response-form { display: grid; gap: 12px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.concern-response-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #354024;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow);
}
.staff-notification-item {
  position: relative;
  display: block;
  padding: 0;
}
.student-notification-item {
  position: relative;
  display: block;
  padding: 0;
}
.notification-read-target {
  width: 100%;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 12px;
  padding: 17px 48px 17px 17px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
.notification-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 61, 25, .2);
  border-radius: 7px;
  color: #4C3D19;
  background: rgba(255, 250, 242, .72);
  font-size: 18px;
  line-height: 1;
}
.notification-delete:hover {
  color: #fffaf2;
  border-color: #4C3D19;
  background: #4C3D19;
}
.notification-item.unread { border-color: #889063; background: color-mix(in srgb, #E5D7C4 60%, #fff); }
.notification-marker { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: transparent; }
.notification-item.unread .notification-marker { background: #4C3D19; }
.notification-item strong { font-size: 12px; }
.notification-item p { margin: 5px 0; color: #4C3D19; font-size: 11px; line-height: 1.55; }
.notification-item small { color: #889063; font-size: 9px; }
.officer-directory { display: grid; gap: 24px; }
.officer-group-heading { margin-bottom: 10px; }
.officer-group-heading h3 { margin-top: 4px; }
.table-subtext { display: block; margin-top: 4px; color: #889063; font-size: 9px; }
.pill.open { color: #4C3D19; background: #CFBB99; }
.pill.in-progress { color: #fff; background: #889063; }
.pill.resolved { color: #fff; background: #354024; }
.pill.closed { color: #E5D7C4; background: #4C3D19; }

@media (max-width: 1000px) {
  .concern-layout, .notification-management-layout { grid-template-columns: 1fr; }
  .staff-concern-list { grid-template-columns: 1fr; }
}

.login-button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.portal-switch {
  margin: 22px 0 0;
  color: #889063;
  text-align: center;
  font-size: 12px;
}

.portal-switch a {
  color: #4C3D19;
  font-weight: 800;
}

.portal-switch a:hover {
  text-decoration: none;
}

.register-panel {
  padding-top: 30px;
  padding-bottom: 30px;
}

.login-message {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-left: 3px solid;
  font-size: 12px;
}

.login-message.error {
  color: #E5D7C4;
  border-color: #CFBB99;
  background: #4C3D19;
}

.login-message.success {
  color: #354024;
  border-color: #354024;
  background: color-mix(in srgb, #889063 35%, #E5D7C4);
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 36px 24px;
  }

  .login-brand h1 {
    font-size: 34px;
  }

  .login-brand p {
    margin-bottom: 20px;
    font-size: 14px;
  }

  .login-panel {
    padding: 42px 24px;
  }
}

/* Brighter, high-contrast version of the CSC palette */
:root {
  --ink: #354024;
  --muted: #4C3D19;
  --line: #CFBB99;
  --surface: color-mix(in srgb, #E5D7C4 78%, white);
  --canvas: color-mix(in srgb, #E5D7C4 88%, white);
  --shadow: 0 8px 24px rgba(76, 61, 25, .09);
}

body,
.calendar-day.muted,
.login-page {
  color: #354024;
  background: var(--canvas);
}

.sidebar {
  color: #354024;
  background: color-mix(in srgb, #889063 50%, #E5D7C4);
  border-right: 1px solid #354024;
}

.brand strong,
.brand span,
.nav-item,
.term-chip span,
.term-chip strong {
  color: #354024;
}

.brand-mark {
  background: color-mix(in srgb, #E5D7C4 88%, white);
  border-color: #4C3D19;
}

.nav-item:hover {
  color: #354024;
  background: rgba(229, 215, 196, .48);
}

.nav-item.active {
  color: #4C3D19;
  background: #E5D7C4;
  box-shadow: inset 4px 0 #4C3D19;
}

.term-chip {
  border-color: rgba(53, 64, 36, .28);
  background: rgba(229, 215, 196, .28);
}

.logout-link {
  border-color: rgba(53, 64, 36, .22);
}

.topbar,
.panel,
.metric-card,
.table-panel,
.article-card,
.modal-card,
.icon-button,
.global-search,
.table-search,
select,
form input,
form select,
form textarea,
.secondary-button,
.donut::after {
  color: #354024;
  background: var(--surface);
}

.topbar {
  box-shadow: 0 2px 12px rgba(76, 61, 25, .06);
}

.eyebrow,
.profile span,
.metric-card span,
.metric-card small,
.schedule-item p,
.article-preview p,
.article-body p,
.article-meta,
.event-item p,
.empty-state,
.page-heading p,
.profile-meta dt,
.profile-image-form small,
.login-form-wrap > p,
.portal-switch {
  color: #4C3D19;
}

.welcome-band {
  color: #354024;
  background: #CFBB99;
  border: 1px solid color-mix(in srgb, #4C3D19 35%, #CFBB99);
}

.welcome-band h2,
.welcome-band p,
.welcome-band .section-label {
  color: #354024;
}

.welcome-band::after {
  color: rgba(76, 61, 25, .08);
}

.primary-button {
  color: #E5D7C4;
  background: #354024;
  border-color: #354024;
}

.primary-button:hover {
  color: #4C3D19;
  background: #CFBB99;
  border-color: #4C3D19;
}

.secondary-button,
.text-button,
.quick-grid span,
.date-tile strong,
.date-tile span {
  color: #354024;
}

.metric-icon.green,
.metric-icon.yellow,
.metric-icon.blue,
.metric-icon.coral,
.date-tile {
  color: #354024;
  background: color-mix(in srgb, #CFBB99 50%, #E5D7C4);
}

.quick-grid button,
th,
.read-only-field {
  color: #354024;
  background: color-mix(in srgb, #E5D7C4 82%, white);
}

.quick-grid button:hover {
  color: #354024;
  background: color-mix(in srgb, #889063 28%, #E5D7C4);
}

.avatar,
.profile-avatar-large,
.initials,
.article-thumb,
.calendar-event {
  color: #E5D7C4;
  background: #354024;
}

.article-cover {
  color: #E5D7C4;
  background: #889063;
}

.article-card:nth-child(3n+2) .article-cover {
  background: #4C3D19;
}

.article-card:nth-child(3n+3) .article-cover {
  background: #354024;
}

.pill.active,
.pill.published,
.pill.present {
  color: #354024;
  background: color-mix(in srgb, #889063 32%, #E5D7C4);
}

.pill.planning,
.pill.review,
.pill.excused {
  color: #4C3D19;
  background: color-mix(in srgb, #CFBB99 58%, #E5D7C4);
}

.pill.completed {
  color: #354024;
  background: #CFBB99;
}

.pill.draft,
.pill.absent {
  color: #E5D7C4;
  background: #4C3D19;
}

th {
  color: #4C3D19;
}

td,
.schedule-item h4,
.article-preview h4,
.article-body h3,
.event-item h4,
form > label,
.form-row label {
  color: #354024;
}

input::placeholder,
textarea::placeholder {
  color: #889063;
  opacity: 1;
}

.notification-dot {
  background: #4C3D19;
}

.login-panel {
  background: var(--canvas);
}

.login-brand {
  background-color: #889063;
  background-image:
    linear-gradient(90deg, rgba(53, 64, 36, .82), rgba(76, 61, 25, .52)),
    url("../images/csc-logo.jpg");
}

.login-brand h1,
.login-brand p,
.login-brand .section-label,
.login-college {
  color: #E5D7C4;
  text-shadow: 0 1px 3px rgba(76, 61, 25, .35);
}

.login-message.success {
  color: #354024;
  background: color-mix(in srgb, #889063 25%, #E5D7C4);
}

.student-shell { min-height: 100vh; background: var(--canvas); }
.student-header {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 78px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  padding: 12px 28px; position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid #CFBB99; background: var(--surface); box-shadow: 0 3px 15px rgba(76,61,25,.07);
}
.student-brand { padding: 0; color: #354024; }
.student-brand span { color: #4C3D19; }
.student-nav { display: flex; justify-content: center; gap: 5px; }
.student-nav-item {
  min-height: 38px; padding: 7px 12px; border: 0; border-bottom: 2px solid transparent;
  color: #4C3D19; background: transparent; font-size: 12px; font-weight: 700;
}
.student-nav-item.active { color: #354024; border-color: #354024; }
.student-nav-item .nav-icon { width: 17px; height: 17px; padding: 0; border: 0; background: transparent; }
.student-nav-item .nav-icon svg { width: 16px; height: 16px; }
.student-account { display: grid; justify-items: end; gap: 2px; font-size: 11px; }
.student-account a { color: #4C3D19; font-weight: 700; }
.student-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.student-page { display: none; }
.student-page.active { display: block; }
.student-welcome {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  min-height: 250px;
  padding: 32px 38px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
  border: 1px solid #CFBB99;
  background:
    linear-gradient(90deg, rgba(207, 187, 153, .95) 0%, rgba(207, 187, 153, .86) 52%, rgba(229, 215, 196, .58) 100%),
    url("../images/csc-logo.jpg") right 28% center / cover no-repeat;
}
.student-welcome > * { position: relative; z-index: 1; }
.student-welcome h1 { margin-bottom: 7px; font-size: 27px; }
.student-welcome p { margin: 0; color: #4C3D19; }
.student-id-card { min-width: 170px; padding: 15px; border: 1px solid #4C3D19; background: rgba(229, 215, 196, .9); backdrop-filter: blur(3px); }
.student-id-card span, .student-id-card strong { display: block; }
.student-id-card span { font-size: 9px; text-transform: uppercase; }
.student-id-card strong { margin-top: 4px; }
.student-metrics { grid-template-columns: repeat(3, 1fr); }
.student-event-grid { display: grid; gap: 12px; }
.student-event-grid.compact { padding: 18px; }
.student-event-card {
  display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 16px;
  padding: 18px; border: 1px solid #CFBB99; background: var(--surface);
}
.student-event-date { padding: 9px 4px; text-align: center; color: #354024; background: #CFBB99; }
.student-event-date strong, .student-event-date span { display: block; }
.student-event-date strong { font: 800 21px "Manrope"; }
.student-event-date span { font-size: 9px; text-transform: uppercase; }
.student-event-content h3 { margin-bottom: 5px; }
.student-event-content p { margin: 2px 0; color: #4C3D19; font-size: 11px; }
.student-event-actions { min-width: 112px; display: grid; justify-items: end; gap: 7px; }
.student-event-actions button { min-width: 100px; }
.student-attendance-pass-card { width: min(430px, 100%); padding: 30px; text-align: center; }
.student-attendance-pass-card h2 { margin: 7px 0; }
.student-attendance-pass-card > p { color: #6b5a35; font-size: 12px; line-height: 1.5; }
.student-attendance-pass-frame { width: min(310px, 100%); margin: 20px auto 14px; padding: 12px; border: 1px solid #CFBB99; background: #E5D7C4; }
.student-attendance-pass-frame img { display: block; width: 100%; aspect-ratio: 1; }
.student-attendance-pass-card strong { color: #354024; font-size: 13px; }
.student-attendance-pass-note { margin-bottom: 0; }
.qr-event-grid:has(.student-qr-scanner-card) { grid-template-columns: minmax(0, 680px); }
.student-qr-scanner-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 32px; max-width: 680px; padding: 30px; }
.student-qr-scanner-copy { display: grid; gap: 8px; }
.student-qr-scanner-card h3 { margin: 0; font-size: 21px; }
.student-qr-scanner-card p { max-width: 510px; margin: 0; color: #6b5a35; line-height: 1.55; }
.student-qr-scanner-action { display: grid; justify-items: end; align-content: center; gap: 8px; min-width: 175px; }
.student-qr-scanner-card .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: 19px; text-decoration: none; white-space: nowrap; }
.student-qr-scanner-action small { color: #7a6b4d; font-size: 10px; }
.student-qr-scanner-note { grid-column: 1 / -1; max-width: none !important; padding-top: 14px; border-top: 1px solid #CFBB99; font-size: 11px; }
@media (max-width: 680px) {
  .qr-event-grid:has(.student-qr-scanner-card) { grid-template-columns: 1fr; }
  .student-qr-scanner-card { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .student-qr-scanner-action { justify-items: stretch; min-width: 0; }
  .student-qr-scanner-card .primary-button { width: 100%; }
  .student-qr-scanner-action small { text-align: center; }
}
.qr-open-label { color: #354024; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.student-profile-card {
  display: grid; grid-template-columns: auto 1fr 1.4fr; align-items: center; gap: 24px; padding: 28px;
}
.student-profile-card p { margin: 0; color: #4C3D19; }
.student-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.student-details div { padding: 12px; border: 1px solid #CFBB99; }
.student-details dt { color: #4C3D19; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.student-details dd { margin: 5px 0 0; font-size: 11px; font-weight: 700; }
.student-name-form {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(150px, .6fr) minmax(0, 1.4fr) auto;
  align-items: end;
  gap: 16px;
  width: 100%;
  padding: 20px 0 0;
  border-top: 1px solid #CFBB99;
}
.student-name-form-heading {
  display: grid;
  gap: 4px;
  align-self: center;
}
.student-name-form-heading strong { color: #354024; font-size: 13px; }
.student-name-form-heading span { color: #6b5a35; font-size: 10px; line-height: 1.45; }
.student-name-form .form-row { margin: 0; }
.student-name-form .modal-actions { padding: 0; }
.student-name-form .primary-button { min-height: 40px; white-space: nowrap; }
.student-password-form {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(150px, .7fr) repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
  width: 100%;
  padding: 18px 0 0;
  border-top: 1px solid #CFBB99;
}
.student-password-form .password-field input { min-width: 0; }
.student-password-form .modal-actions { padding: 0; }
.student-password-form .secondary-button { min-height: 40px; white-space: nowrap; }
.pill.not-recorded { color: #4C3D19; background: #E5D7C4; border: 1px solid #CFBB99; }

.checkin-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--canvas); }
.checkin-card {
  width: min(460px, 100%); padding: 34px; border: 1px solid #CFBB99;
  background: var(--surface); box-shadow: var(--shadow); text-align: center;
}
.checkin-card img { width: 130px; height: 88px; object-fit: contain; margin-bottom: 18px; }
.checkin-status { margin: 20px 0; padding: 14px; font-size: 12px; }
.checkin-status.success { color: #354024; background: color-mix(in srgb, #889063 30%, #E5D7C4); }
.checkin-status.error { color: #E5D7C4; background: #4C3D19; }
.checkin-card .primary-button { display: inline-flex; align-items: center; text-decoration: none; }

.qr-event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 14px; }
.qr-event-card { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 12px; padding: 18px; overflow: hidden; align-items: start; }
.qr-event-card p { margin: 7px 0 0; color: #4C3D19; font-size: 11px; }
.qr-preview { position: relative; grid-row: 1 / span 2; grid-column: 2; min-height: 118px; display: grid; place-items: center; padding: 6px; overflow: hidden; border: 1px solid #CFBB99; background: #E5D7C4; cursor: zoom-in; }
.qr-preview img { width: 96px; height: 96px; display: block; }
.qr-expand-button {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 1;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(76, 61, 25, .35);
  border-radius: 999px;
  color: #354024;
  background: rgba(251, 248, 243, .92);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}
.qr-expand-button:hover {
  color: #fffaf2;
  background: #354024;
}
.qr-closed-state { display: grid; gap: 4px; padding: 10px; color: #4C3D19; text-align: center; }
.qr-closed-state strong { font-size: 11px; }
.qr-closed-state span { color: #889063; font-size: 8px; line-height: 1.35; }
.qr-controls { grid-column: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(78px, .45fr); align-items: center; gap: 8px; }
.qr-controls .primary-button,
.qr-controls .secondary-button { grid-column: 1 / -1; justify-self: start; min-height: 34px; padding: 8px 12px; font-size: 11px; line-height: 1.2; }
.qr-controls select { min-width: 0; width: 100%; }
.qr-network-url { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); color: #4C3D19; font-size: 10px; overflow-wrap: anywhere; }
.approval-button { padding: 5px 8px; border: 1px solid; background: transparent; font-size: 9px; font-weight: 800; }
.approval-button.approve { color: #354024; border-color: #889063; background: color-mix(in srgb, #889063 25%, #E5D7C4); }
.approval-button.reject { color: #4C3D19; border-color: #4C3D19; margin-left: 4px; }
.membership-actions { min-width: 235px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.annual-fee-table table { min-width: 100%; width: 100%; table-layout: fixed; }
.annual-fee-table th,
.annual-fee-table td { padding: 12px 16px; }
.annual-fee-table th:last-child { text-align: left; }
.annual-fee-table td { vertical-align: middle; }
.annual-fee-table td:last-child { padding-right: 16px; white-space: normal; }
.annual-fee-table th:nth-child(1) { width: 20%; }
.annual-fee-table th:nth-child(2) { width: 18%; }
.annual-fee-table th:nth-child(3) { width: 15%; }
.annual-fee-table th:nth-child(4) { width: 9%; }
.annual-fee-table th:nth-child(5) { width: 9%; }
.annual-fee-table th:nth-child(6) { width: 18%; }
.annual-fee-table th:nth-child(7) { width: 11%; }
.annual-fee-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-start; gap: 6px; white-space: normal; }
.annual-fee-actions .text-button { padding-inline: 6px; }
.annual-fee-actions .membership-status-controls { flex: 0 0 auto; }

/* Keep dense data readable on narrow screens without squeezing columns together. */
img, video, canvas { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }

@media (max-width: 760px) {
  .page { min-width: 0; }
  .page-heading { align-items: stretch; flex-wrap: wrap; }
  .page-heading > * { min-width: 0; }
  .toolbar, .membership-toolbar { align-items: stretch; }
  .toolbar .table-search, .membership-toolbar .table-search { width: 100%; min-width: 0; }
  .student-filter-group { grid-template-columns: 1fr !important; width: 100%; }
  .student-filter-group select { width: 100%; min-width: 0; }
  .annual-fee-table { overflow-x: auto; }
  .annual-fee-table table { min-width: 820px; }
  .annual-fee-table th, .annual-fee-table td { padding: 12px 13px; }
  .annual-fee-actions { flex-wrap: wrap; }
}
.membership-status-controls { display: inline-flex; align-items: center; border: 1px solid #CFBB99; border-radius: 5px; overflow: hidden; }
.membership-status-button { min-width: 52px; height: 28px; padding: 0 8px; border: 0; color: #4C3D19; background: transparent; font-size: 10px; font-weight: 700; }
.membership-status-button + .membership-status-button { border-left: 1px solid #CFBB99; }
.membership-status-button:not(:disabled):hover { background: #E5D7C4; }
.membership-status-button.paid:disabled { color: #fff; background: #354024; opacity: 1; }
.membership-status-button.unpaid:disabled { color: #4C3D19; background: #E5D7C4; opacity: 1; }
.article-approval { display: flex; gap: 5px; padding: 0 18px 17px; }
.role-select { min-height: 34px; font-size: 11px; }
.status-toggle { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.status-toggle input { width: 15px; height: 15px; }

body[data-user-role="Adviser"] [data-open-modal],
body[data-user-role="Adviser"] #markAllPresent,
body[data-user-role="Adviser"] .row-action {
  display: none;
}

@media (max-width: 800px) {
  .student-header { grid-template-columns: 1fr auto; }
  .student-nav { grid-column: 1 / -1; order: 3; overflow-x: auto; justify-content: flex-start; }
  .student-welcome {
    min-height: 325px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    background:
      linear-gradient(180deg, rgba(207, 187, 153, .94) 0%, rgba(207, 187, 153, .82) 62%, rgba(229, 215, 196, .58) 100%),
      url("../images/csc-logo.jpg") center / cover no-repeat;
  }
  .student-metrics { grid-template-columns: 1fr; }
  .student-event-card { grid-template-columns: 52px 1fr; }
  .student-event-actions { grid-column: 1 / -1; width: 100%; grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
  .student-profile-card { grid-template-columns: 1fr; }
  .student-details { grid-template-columns: 1fr; }
  .student-name-form {
    grid-column: 1;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .student-name-form .modal-actions { justify-content: stretch; }
  .student-name-form .primary-button { width: 100%; }
  .student-password-form {
    grid-column: 1;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .student-password-form .modal-actions { justify-content: stretch; }
  .student-password-form .secondary-button { width: 100%; }
  .qr-event-grid { grid-template-columns: 1fr; }
  .qr-event-card { grid-template-columns: minmax(0, 1fr) 104px; }
  .qr-preview { min-height: 104px; }
  .qr-preview img { width: 88px; height: 88px; }
}

@media (max-width: 1100px) {
  .qr-event-card { grid-template-columns: 1fr; padding: 14px; }
  .qr-preview { grid-column: 1; grid-row: auto; min-height: 96px; }
  .qr-preview img { width: 82px; height: 82px; }
  .qr-controls { grid-template-columns: auto minmax(0, 1fr) minmax(76px, .45fr); }
}

@media (max-width: 620px) {
  .qr-controls { grid-template-columns: 1fr; }
  .qr-controls .primary-button,
  .qr-controls .secondary-button { width: 100%; justify-self: stretch; }
}

/* Modern interface refinement */
:root {
  --surface: #fbf8f3;
  --canvas: #f3eee6;
  --line: #d7c7aa;
  --shadow: 0 8px 24px rgba(76, 61, 25, .08);
}

body { line-height: 1.45; }
.app-shell { grid-template-columns: 260px 1fr; }
.sidebar { width: 260px; padding: 20px 14px; background: #aeb28d; }
.main { background: var(--canvas); }
.brand { padding: 3px 10px 24px; }
.brand-mark { width: 52px; height: 46px; border-radius: 8px; }
.brand strong { font-size: 17px; }
.brand span { font-size: 10px; }
.nav-list { gap: 4px; }
.nav-item { min-height: 43px; padding: 9px 12px; border-radius: 7px; font-weight: 600; }
.nav-item.active { box-shadow: inset 3px 0 #4C3D19, 0 4px 12px rgba(76,61,25,.08); }
.nav-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 61, 25, .12);
  border-radius: 8px;
  color: #4C3D19;
  background: rgba(251, 248, 243, .48);
  font-size: 0;
  transition: transform .16s ease, color .16s ease, background .16s ease, border-color .16s ease;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}
.student-nav .student-nav-item[data-sidebar-icon] { display: inline-flex; align-items: center; gap: 6px; }
.student-nav .student-nav-item .nav-icon { width: 17px; height: 17px; flex-basis: 17px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.student-nav .student-nav-item .nav-icon svg { width: 16px; height: 16px; }

.nav-item:nth-child(3n + 1) .nav-icon { background: rgba(229, 215, 196, .72); }
.nav-item:nth-child(3n + 2) .nav-icon { background: rgba(207, 187, 153, .48); }
.nav-item:nth-child(3n) .nav-icon { background: rgba(255, 250, 242, .58); }

.nav-item:hover .nav-icon {
  transform: translateY(-1px) rotate(-3deg);
  border-color: rgba(76, 61, 25, .28);
  background: #fffaf2;
}

.nav-item.active .nav-icon {
  color: #fffaf2;
  border-color: #4C3D19;
  background: #4C3D19;
  box-shadow: 0 3px 8px rgba(76, 61, 25, .18);
}
.term-chip { border-radius: 7px; }
.logout-form, .student-logout { margin: 0; padding: 0; }
.logout-form button { font: inherit; }
.student-logout button { padding: 0; border: 0; color: #4C3D19; background: transparent; font-weight: 700; cursor: pointer; }

.topbar { min-height: 80px; padding: 16px 28px; background: rgba(251,248,243,.96); }
.page { padding: 26px 28px 46px; }
h1 { font-size: 22px; }
h2 { font-size: 24px; }
.welcome-band, .student-welcome { border-radius: 8px; box-shadow: 0 8px 22px rgba(76,61,25,.08); }
.metric-grid { gap: 15px; }
.metric-card, .panel, .table-panel, .article-card, .student-event-card {
  border-radius: 8px; border-color: var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.metric-card { min-height: 112px; padding: 18px 19px; }
.metric-icon { border-radius: 8px; }
.panel-header { padding: 18px 20px; }
.primary-button, .secondary-button { border-radius: 7px; text-decoration: none; transition: transform .16s, box-shadow .16s, background .16s; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(76,61,25,.12); }
.icon-button, .global-search, .table-search, select, form input, form textarea { border-radius: 7px; }
.quick-grid button { border-radius: 8px; }
.modal-card { border-radius: 8px; }
.modal { backdrop-filter: blur(4px); }
.toast { border-radius: 7px; }

table { font-variant-numeric: tabular-nums; }
th { padding-top: 13px; padding-bottom: 13px; background: #eee5d8; letter-spacing: .06em; }
td { padding-top: 14px; padding-bottom: 14px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(207,187,153,.13); }
.pill { border-radius: 999px; letter-spacing: .02em; }
.article-cover { min-height: 96px; }
.article-card { overflow: hidden; }
.calendar-panel, .attendance-controls { border-radius: 8px; }
.calendar-day { background: var(--surface); }

.report-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.report-list { padding: 10px 20px 18px; }
.report-row {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(100px, 1.2fr) 34px;
  align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.report-row:last-child { border-bottom: 0; }
.report-copy strong, .report-copy span { display: block; }
.report-copy strong { font-size: 12px; }
.report-copy span { margin-top: 3px; color: #4C3D19; font-size: 9px; }
.report-bar { height: 9px; overflow: hidden; border-radius: 999px; background: #e6dccd; }
.report-bar i { height: 100%; display: block; border-radius: inherit; background: #889063; }
.report-row b { font-size: 12px; text-align: right; }
.collection-breakdown-panel {
  margin-top: 18px;
  overflow: hidden;
}
.collection-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 0;
  padding: 0 20px 18px;
}
.collection-card {
  min-width: 0;
  overflow: hidden;
}
.collection-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 4.8vw, 27px);
}
.collection-breakdown-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 16px;
  padding: 0 20px 20px;
}
.collection-breakdown-grid > * {
  min-width: 0;
}
.collection-breakdown-panel .table-panel {
  overflow-x: auto;
}
.collection-breakdown-panel .compact-table table {
  width: 100%;
  min-width: 520px;
}
.compact-table { box-shadow: none; }
.compact-table th,
.compact-table td { padding: 12px 14px; }
.backup-panel { max-width: 720px; }
.restore-warning { margin: 4px 0 18px; padding: 12px 14px; border-left: 3px solid #4C3D19; background: #eee5d8; color: #4C3D19; font-size: 11px; }
.staff-note { margin: 2px 0 18px; padding: 11px 13px; border-left: 3px solid #889063; background: #eee5d8; color: #4C3D19; font-size: 10px; line-height: 1.5; }
.qr-duration, .qr-session-slot { min-height: 34px; font-size: 10px; }
.qr-controls small { color: #4C3D19; font-size: 9px; }
.qr-event-card { border-radius: 8px; }
.qr-preview { border-radius: 7px; }
.qr-display-modal {
  z-index: 1600;
  align-items: center;
  justify-items: center;
  background: rgba(24, 20, 10, .72);
}
.qr-display-card {
  position: relative;
  width: min(620px, calc(100vw - 30px));
  max-height: calc(100dvh - 30px);
  display: grid;
  gap: 18px;
  padding: 28px;
  overflow: auto;
  text-align: center;
  background: #fbf8f3;
}
.qr-display-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #CFBB99;
  border-radius: 999px;
  color: #354024;
  background: #fffaf2;
  font-size: 20px;
}
.qr-display-heading h2 {
  margin: 6px auto 4px;
  max-width: 460px;
  color: #354024;
  font-size: clamp(22px, 3vw, 32px);
}
.qr-display-heading p {
  margin: 0;
  color: #4C3D19;
  font-weight: 800;
}
.qr-display-frame {
  width: min(430px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid #CFBB99;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(76, 61, 25, .14);
}
.qr-display-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.qr-display-url {
  margin: 0;
  color: #4C3D19;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.profile-summary { border-radius: 8px; }
.settings-panel { overflow: hidden; }

.student-header { background: rgba(251,248,243,.96); backdrop-filter: blur(12px); }
.student-nav-item { border-radius: 6px; border-bottom: 0; }
.student-nav-item.active { background: #e5d7c4; }
.student-event-card { transition: transform .16s, box-shadow .16s; }
.student-event-card:hover { transform: translateY(-2px); box-shadow: 0 11px 28px rgba(76,61,25,.11); }
.student-event-date, .student-id-card, .student-details div { border-radius: 7px; }

.login-form-wrap { padding: 4px; }

/* Student portal header and navigation */
.student-header {
  min-height: auto;
  display: block;
  padding: 0;
  border-bottom: 1px solid rgba(207, 187, 153, .9);
  background: rgba(251, 248, 243, .97);
  backdrop-filter: blur(14px);
  overflow: visible;
  z-index: 500;
}

.student-header-main {
  width: min(1240px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 24px;
}

.student-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 10px;
  color: #6b5a35;
  white-space: nowrap;
}

.student-clock span {
  display: none;
}

.student-clock strong {
  font-family: "DM Sans", sans-serif;
  color: #354024;
  font-size: 12px;
  font-weight: 700;
}

.student-clock small {
  font-size: 10px;
  font-weight: 500;
}

.student-clock small::before {
  content: "•";
  margin-right: 7px;
  color: #889063;
}

.student-nav {
  width: 100%;
  min-height: 52px;
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 7px max(20px, calc((100% - 1240px) / 2));
  overflow: visible;
  border-top: 1px solid rgba(207, 187, 153, .55);
  background: rgba(229, 215, 196, .44);
  scrollbar-width: thin;
  scrollbar-color: #889063 transparent;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.student-nav-item {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #4C3D19;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
  scroll-snap-align: start;
}

.student-nav .student-nav-item[data-sidebar-icon] { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.student-nav .student-nav-item .nav-icon { color: currentColor; }

.student-nav-item:hover {
  border-color: #CFBB99;
  background: rgba(255, 255, 255, .65);
}

.student-nav-item.active {
  border-color: #354024;
  color: #fffaf2;
  background: #354024;
  box-shadow: 0 4px 12px rgba(53, 64, 36, .18);
}

.student-nav-menu {
  position: relative;
  flex: 0 0 auto;
}

.student-nav-menu > summary {
  list-style: none;
  cursor: pointer;
}

.student-nav-menu > summary::-webkit-details-marker { display: none; }

.student-nav-menu[open] > summary,
.student-nav-menu.has-active > summary {
  border-color: #354024;
  color: #fffaf2;
  background: #354024;
  box-shadow: 0 4px 12px rgba(53, 64, 36, .18);
}

.nav-caret {
  margin-left: 2px;
  color: currentColor;
  font-size: 13px;
  line-height: 1;
  transition: transform .16s ease;
}

.student-nav-menu[open] .nav-caret { transform: rotate(180deg); }

.student-nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 700;
  min-width: 230px;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid #CFBB99;
  border-radius: 8px;
  background: rgba(251, 248, 243, .98);
  box-shadow: 0 18px 38px rgba(76, 61, 25, .16);
}

.student-nav-dropdown .student-nav-item {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
}

.student-nav-dropdown .student-nav-item:hover {
  border-color: #CFBB99;
  background: #F3EEE6;
}

.student-nav-dropdown .student-nav-item.active {
  color: #354024;
  border-color: #CFBB99;
  background: #E5D7C4;
  box-shadow: none;
}

.student-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #CFBB99;
  border-radius: 7px;
  color: #354024;
  background: #fffaf2;
  font-weight: 800;
}

.student-header-bell {
  width: 40px;
  height: 40px;
  display: none;
  border: 1px solid #CFBB99;
  border-radius: 8px;
  color: #354024;
  background: #fffaf2;
}

.student-header-bell:hover {
  border-color: #889063;
  background: #F3EEE6;
}

.student-header-bell.has-unread {
  border-color: #4C3D19;
  background: #E5D7C4;
}

.student-header-bell .notification-count {
  top: -6px;
  right: -6px;
}

.student-menu-lines {
  width: 18px;
  display: grid;
  gap: 4px;
}

.student-menu-lines i {
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
}

.student-account {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: end;
  gap: 10px;
}

.student-account > strong {
  max-width: 180px;
  overflow: hidden;
  color: #354024;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-logout button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #889063;
  border-radius: 6px;
  color: #354024;
  background: #fffaf2;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.student-logout .nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.student-logout .nav-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.student-logout button:hover {
  color: #fffaf2;
  background: #4C3D19;
  border-color: #4C3D19;
}

@media (max-width: 800px) {
  .student-header-main {
    width: min(100% - 24px, 1240px);
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
  }

  .student-brand .brand-mark {
    width: 44px;
    height: 44px;
  }
  .student-brand strong {
    max-width: 120px;
    display: block;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.05;
    text-overflow: ellipsis;
  }
  .student-brand span { font-size: 10px; }
  .student-menu-toggle {
    width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-color: transparent;
    background: transparent;
  }
  .student-menu-toggle > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .student-menu-toggle[aria-expanded="true"] {
    color: #fffaf2;
    border-color: #354024;
    background: #354024;
  }

  .student-header-bell {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
  }

  .student-clock {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 3px 0 7px;
    border: 0;
    border-top: 1px solid rgba(207, 187, 153, .55);
  }

  .student-clock strong { font-size: 12px; }
  .student-clock small { font-size: 9px; }
  .student-logout button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-color: #CFBB99;
    background: transparent;
    font-size: 0;
  }
  .student-logout .logout-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .student-logout .nav-icon,
  .student-logout .nav-icon svg {
    width: 18px;
    height: 18px;
  }
  .student-nav {
    width: min(100% - 24px, 640px);
    max-height: calc(100dvh - 112px);
    display: none;
    grid-template-columns: 1fr;
    gap: 7px;
    margin: 0 auto 10px;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #CFBB99;
    border-radius: 10px;
    background: rgba(251, 248, 243, .98);
    box-shadow: 0 18px 34px rgba(76, 61, 25, .16);
    scrollbar-width: none;
  }
  .student-header.nav-open .student-nav { display: grid; }
  .student-nav::-webkit-scrollbar { display: none; }
  .student-nav-item {
    width: 100%;
    min-height: 40px;
    justify-content: flex-start;
    padding-inline: 13px;
    gap: 8px;
  }
  .student-nav-menu { width: 100%; }
  .student-nav-menu > summary { width: 100%; }
  .student-nav-dropdown {
    position: static;
    min-width: 0;
    grid-template-columns: 1fr;
    margin-top: 6px;
    padding: 6px 0 0 18px;
    border: 0;
    border-top: 1px solid rgba(207, 187, 153, .7);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .student-nav-dropdown .student-nav-item { min-width: 0; white-space: normal; }
  .student-nav .student-nav-item .nav-icon,
  .student-nav .student-nav-item .nav-icon svg { width: 15px; height: 15px; }
  .student-account > strong { max-width: 105px; }
}

@media (max-width: 480px) {
  .student-header-main {
    width: calc(100% - 20px);
    min-height: 58px;
    gap: 6px;
  }
  .student-brand {
    gap: 8px;
    min-width: 0;
  }
  .student-brand .brand-mark { width: 38px; height: 38px; }
  .student-brand strong { max-width: 90px; font-size: 13px; }
  .student-brand span { font-size: 10px; }
  .student-clock { gap: 6px; }
  .student-clock small { font-size: 10px; }
  .student-account > strong { display: none; }
  .student-menu-toggle,
  .student-header-bell,
  .student-logout button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }
  .student-logout button {
    min-width: 38px;
  }
  .student-logout button::before {
    content: none;
  }
}
.login-form input { min-height: 50px; }
.login-button { min-height: 50px; }
.password-field { border-radius: 7px; overflow: hidden; }

@media (max-width: 1050px) {
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .main { margin-left: 0; }
  .report-actions { width: 100%; }
  .report-actions a { flex: 1; text-align: center; }
  .report-row { grid-template-columns: 1fr 70px 28px; }
}

/* Student portal refresh */
.student-main {
  padding-top: 24px;
}

.student-welcome {
  min-height: 218px;
  padding: 28px 32px;
}

.student-welcome h1 {
  font-size: clamp(25px, 3vw, 34px);
}

.student-welcome p {
  max-width: 620px;
  line-height: 1.55;
}

.student-quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.student-quick-actions button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d7c7aa;
  border-radius: 8px;
  color: #354024;
  background: rgba(251, 248, 243, .82);
  box-shadow: 0 5px 14px rgba(76, 61, 25, .06);
  font-size: 12px;
  font-weight: 800;
}

.student-quick-actions button:hover {
  border-color: #889063;
  background: #fffaf2;
}

.student-quick-actions .nav-icon,
.student-quick-actions .nav-icon svg {
  width: 16px;
  height: 16px;
}

.student-attendance-table table {
  min-width: 760px;
}

.student-attendance-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid #d7c7aa;
  border-radius: 999px;
  background: rgba(251, 248, 243, .86);
  color: #4C3D19;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.student-attendance-status.present {
  border-color: rgba(20, 97, 60, .25);
  background: #daf0e3;
  color: #1f603e;
}

.student-attendance-status.absent {
  border-color: rgba(76, 61, 25, .2);
  background: #f6edcf;
  color: #725315;
}

.student-attendance-status.excused {
  border-color: rgba(93, 112, 64, .28);
  background: #e5ead4;
  color: #4d6131;
}

.student-attendance-status.not-recorded {
  color: #756a4d;
  background: #f3eee6;
}

.student-clock small::before {
  content: "";
  width: 4px;
  height: 4px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 999px;
  background: #889063;
  vertical-align: middle;
}

.student-nav-item.has-unread,
.notification-nav-item.has-unread {
  position: relative;
}

.notification-nav-item.has-unread {
  border-color: #4C3D19;
  background: rgba(207, 187, 153, .42);
}

.nav-count {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #fffaf2;
  background: #4C3D19;
  font-size: 10px;
  line-height: 1;
}

.nav-caret {
  font-size: 0;
}

.nav-caret::before {
  content: "v";
  font-size: 11px;
  font-weight: 800;
}

.article-reader-close {
  font-size: 0;
}

.article-reader-close::before {
  content: "x";
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 980px) {
  .student-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .student-main {
    width: min(100% - 24px, 640px);
    padding-top: 18px;
  }

  .student-welcome {
    min-height: 240px;
    padding: 22px;
  }

  .student-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .student-quick-actions button {
    min-height: 43px;
    justify-content: flex-start;
  }

}

@media (max-width: 480px) {
  .student-quick-actions {
    grid-template-columns: 1fr;
  }

  .student-welcome {
    min-height: 210px;
  }
}

/* CSC logo watermark in the dashboard welcome banner */
.welcome-band {
  background-color: #CFBB99;
  background-image:
    linear-gradient(90deg, rgba(207, 187, 153, .9), rgba(229, 215, 196, .68)),
    url("../images/csc-logo.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.welcome-band::after {
  display: none;
}

@media (max-width: 560px) {
  .welcome-band {
    background-position: 58% center;
  }
}

/* First-use tutorial */
.tutorial-modal-card {
  width: min(520px, 100%);
}

.tutorial-body {
  padding: 20px 24px 22px;
}

.tutorial-progress {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  color: #889063;
  font-size: 11px;
  font-weight: 700;
}

.tutorial-progress-track {
  height: 3px;
  overflow: hidden;
  background: #E5D7C4;
}

.tutorial-progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  background: #889063;
  transition: width .2s ease;
}

.tutorial-steps {
  min-height: 210px;
}

.tutorial-step {
  display: none;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 32px 0 24px;
}

.tutorial-step.active {
  display: grid;
}

.tutorial-step-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fffaf2;
  background: #889063;
  font-size: 11px;
  font-weight: 700;
}

.tutorial-step h2 {
  margin: 1px 0 8px;
  color: #354024;
  font-size: 19px;
}

.tutorial-step p {
  max-width: 430px;
  margin: 0;
  color: #4C3D19;
  font-size: 14px;
  line-height: 1.6;
}

.tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #E5D7C4;
}

.tutorial-actions button {
  min-width: 86px;
  min-height: 38px;
  padding: 8px 16px;
}

.tutorial-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.close-student-tutorial {
  border: 0;
  color: #4C3D19;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.tutorial-nav-button {
  border-color: transparent;
}

@media (max-width: 560px) {
  .tutorial-body {
    padding: 18px;
  }

  .tutorial-steps {
    min-height: 250px;
  }

  .tutorial-step {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    padding: 26px 0 20px;
  }

  .tutorial-step h2 {
    font-size: 18px;
  }
}

/* Expanded QR display override */
.qr-preview {
  position: relative;
  overflow: hidden;
}

.qr-preview .qr-expand-button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: auto;
  min-width: 0;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(76, 61, 25, .32);
  border-radius: 999px;
  color: #354024;
  background: rgba(251, 248, 243, .94);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(76, 61, 25, .12);
}

.qr-display-modal.open {
  display: grid;
  place-items: center;
  padding: 18px;
}

.qr-display-modal .qr-display-card {
  position: relative;
  width: min(560px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 26px 24px;
  overflow: auto;
  border-radius: 10px;
  background: #fbf8f3;
  text-align: center;
}

.qr-display-modal .qr-display-close {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #CFBB99;
  border-radius: 999px;
  color: #354024;
  background: #fffaf2;
  font-size: 20px;
  line-height: 1;
}

.qr-display-modal .qr-display-heading {
  width: 100%;
  padding-inline: 38px;
}

.qr-display-modal .qr-display-heading h2 {
  margin: 7px 0 2px;
  color: #354024;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
}

.qr-display-modal .qr-display-heading p {
  margin: 0;
  color: #4C3D19;
  font-size: 15px;
  font-weight: 800;
}

.qr-display-modal .qr-display-frame {
  width: min(390px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px solid #CFBB99;
  border-radius: 10px;
  background: #fff;
}

.qr-display-modal .qr-display-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-display-modal .qr-display-url {
  max-width: 100%;
  margin: 0;
  color: #4C3D19;
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .qr-display-modal.open {
    padding: 10px;
  }

  .qr-display-modal .qr-display-card {
    width: 100%;
    padding: 24px 16px 18px;
    border-radius: 10px;
  }

  .qr-display-modal .qr-display-heading {
    padding-inline: 34px;
  }

.qr-display-modal .qr-display-frame {
    width: min(330px, 100%);
    padding: 14px;
  }
}

/* Notification improvements */
.notification-menu-wrap {
  position: relative;
}

.notification-preview {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid #CFBB99;
  border-radius: 10px;
  background: #fffaf2;
  box-shadow: 0 18px 44px rgba(76, 61, 25, .18);
}

.notification-preview[hidden] {
  display: none;
}

.notification-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid #E5D7C4;
}

.notification-preview-header strong {
  display: block;
  color: #354024;
  font-size: 14px;
}

.notification-preview-header small,
.notification-preview-empty {
  color: #889063;
  font-size: 11px;
}

.notification-preview-list {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}

.notification-preview-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #E5D7C4;
  border-radius: 8px;
  color: #354024;
  background: #fbf8f3;
  text-align: left;
}

.notification-preview-item strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-preview-item small {
  color: #889063;
  font-size: 10px;
}

.compact-button {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
}

.notification-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.notification-toolbar select {
  min-width: 160px;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  border: 1px solid #CFBB99;
  border-radius: 8px;
  color: #354024;
  background-color: #fffaf2;
  font-weight: 700;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.notification-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #354024;
  background: #E5D7C4;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.notification-meta .priority-important,
.notification-preview-item.priority-important {
  border-color: #CFBB99;
  background: #fff4d8;
}

.notification-meta .priority-urgent,
.notification-preview-item.priority-urgent {
  border-color: #9b3f32;
  color: #6f241c;
  background: #ffe7df;
}

.notification-count,
.nav-count {
  color: #fffaf2;
  background: #9b3f32;
  box-shadow: 0 0 0 3px rgba(155, 63, 50, .18);
}

.notification-button.has-unread {
  border-color: #9b3f32;
  background: #fff4d8;
}

.notification-nav-item.has-unread {
  color: #354024;
}

@media (max-width: 620px) {
  .notification-preview {
    position: fixed;
    top: 78px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .notification-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notification-toolbar select {
    width: 100%;
  }
}

/* Staff notification page polish */
#notificationManagement .page-heading {
  margin-bottom: 22px;
}

#notificationManagement .notification-management-layout {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 26px;
}

#notificationManagement .notification-compose {
  padding: 24px 26px;
}

#notificationManagement .notification-compose .panel-header {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #CFBB99;
}

#notificationManagement .notification-compose form {
  display: grid;
  gap: 14px;
  padding: 0;
}

#notificationManagement .notification-compose form > label,
#notificationManagement .notification-compose .form-grid label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #354024;
  font-size: 11px;
  font-weight: 800;
}

#notificationManagement .notification-compose .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#notificationManagement .notification-compose input,
#notificationManagement .notification-compose select,
#notificationManagement .notification-compose textarea,
#notificationManagement .notification-toolbar select {
  border-color: #CFBB99;
  border-radius: 8px;
  color: #354024;
  background-color: #fffaf2;
}

#notificationManagement .notification-compose textarea {
  min-height: 132px;
  resize: vertical;
}

#notificationManagement .notification-compose .modal-actions {
  padding-top: 2px;
}

#notificationManagement .notification-compose .primary-button {
  width: 100%;
  min-height: 46px;
}

#notificationManagement .unframed-header {
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid #CFBB99;
}

#notificationManagement .notification-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

#notificationManagement .notification-toolbar select {
  width: 100%;
  min-width: 0;
}

#notificationManagement .notification-list {
  gap: 14px;
}

#notificationManagement .staff-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
}

#notificationManagement .staff-notification-item .notification-read-target {
  min-width: 0;
  padding: 18px 16px 18px 18px;
}

#notificationManagement .staff-notification-item .notification-read-target span:last-child {
  min-width: 0;
}

#notificationManagement .staff-notification-item p {
  max-width: 760px;
}

#notificationManagement .notification-pin {
  min-height: 34px;
  margin-right: 8px;
  padding: 8px 12px;
  border: 1px solid #CFBB99;
  border-radius: 999px;
  color: #354024;
  background: #fffaf2;
  font-size: 11px;
  text-decoration: none;
}

#notificationManagement .staff-notification-item .notification-delete {
  position: static;
  width: 34px;
  height: 34px;
  margin-right: 14px;
  border-radius: 999px;
}

#notificationManagement .notification-meta {
  margin-top: 10px;
}

@media (max-width: 1100px) {
  #notificationManagement .notification-management-layout {
    grid-template-columns: 1fr;
  }

  #notificationManagement .notification-compose {
    position: static;
  }
}

@media (max-width: 720px) {
  #notificationManagement .notification-compose {
    padding: 18px;
  }

  #notificationManagement .notification-compose .form-grid,
  #notificationManagement .notification-toolbar {
    grid-template-columns: 1fr;
  }

  #notificationManagement .staff-notification-item {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 14px;
  }

  #notificationManagement .notification-pin,
  #notificationManagement .staff-notification-item .notification-delete {
    margin: 0 16px 8px;
    justify-self: start;
  }
}

/* Student notification page polish */
#studentNotifications {
  max-width: 980px;
  margin-inline: auto;
}

#studentNotifications .page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

#studentNotifications .page-heading h2 {
  margin-bottom: 6px;
}

#studentNotifications #studentReadAllNotifications {
  min-height: 42px;
  padding-inline: 20px;
  border-radius: 8px;
  background: #fffaf2;
}

#studentNotifications .notification-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid #CFBB99;
  border-radius: 10px;
  background: #fbf8f3;
  box-shadow: 0 10px 28px rgba(76, 61, 25, .07);
}

#studentNotifications .notification-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border-color: #CFBB99;
  border-radius: 8px;
  color: #354024;
  background-color: #fffaf2;
}

#studentNotifications .notification-list {
  gap: 14px;
}

#studentNotifications .student-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(76, 61, 25, .07);
}

#studentNotifications .student-notification-item .notification-read-target {
  min-width: 0;
  padding: 18px;
}

#studentNotifications .student-notification-item .notification-read-target span:last-child {
  min-width: 0;
}

#studentNotifications .student-notification-item strong {
  display: inline-block;
  max-width: calc(100% - 12px);
  color: #354024;
  font-size: 14px;
  line-height: 1.35;
}

#studentNotifications .student-notification-item p {
  max-width: 760px;
  margin: 8px 0;
  font-size: 13px;
}

#studentNotifications .student-notification-item small {
  font-size: 11px;
}

#studentNotifications .student-notification-item .notification-delete {
  position: static;
  width: 34px;
  height: 34px;
  margin: 14px 14px 0 0;
  border-radius: 999px;
}

#studentNotifications .empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 44px 22px;
  border: 1px dashed #CFBB99;
  border-radius: 10px;
  color: #6b5a35;
  background: #fbf8f3;
  font-size: 14px;
}

@media (max-width: 760px) {
  #studentNotifications {
    max-width: 100%;
  }

  #studentNotifications .page-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #studentNotifications #studentReadAllNotifications {
    width: 100%;
  }

  #studentNotifications .notification-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  #studentNotifications .student-notification-item {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 12px;
  }

  #studentNotifications .student-notification-item .notification-delete {
    margin: 0 18px;
    justify-self: start;
  }
}

/* Student profile page polish */
#studentProfile {
  max-width: 1180px;
  margin-inline: auto;
}

#studentProfile .student-profile-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 34px 38px;
  border-radius: 12px;
}

#studentProfile .student-profile-hero {
  display: grid;
  grid-template-columns: 210px minmax(300px, 1fr) minmax(470px, 1.15fr);
  gap: 34px;
  align-items: center;
}

#studentProfile .student-profile-photo-block {
  display: grid;
  justify-items: center;
  gap: 12px;
}

#studentProfile .profile-avatar-large {
  width: 98px;
  height: 98px;
  margin: 0;
  border: 4px solid #E5D7C4;
  box-shadow: 0 12px 28px rgba(76, 61, 25, .14);
}

#studentProfile .profile-image-form {
  margin: 0;
}

#studentProfile .profile-image-button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 11px;
}

#studentProfile .student-profile-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  margin-bottom: 0;
}

#studentProfile .student-department-logo {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(76, 61, 25, .14));
}

#studentProfile .student-profile-heading h2 {
  margin: 4px 0 3px;
  color: #354024;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
}

#studentProfile .student-profile-heading p {
  margin: 0;
  color: #4C3D19;
  overflow-wrap: anywhere;
}

#studentProfile .profile-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #354024;
  background: #d9efdf;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

#studentProfile .student-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

#studentProfile .student-details div {
  min-height: 76px;
  display: grid;
  align-content: center;
  padding: 14px 16px;
  border: 1px solid #CFBB99;
  border-radius: 10px;
  background: #fbf8f3;
}

#studentProfile .student-details dt {
  color: #4C3D19;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#studentProfile .student-details dd {
  margin: 6px 0 0;
  color: #354024;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

#studentProfile .student-profile-sections {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid #CFBB99;
}

#studentProfile .profile-edit-panel {
  grid-column: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 20px;
  border: 1px solid #E5D7C4;
  border-radius: 10px;
  background: #fffaf2;
}

#studentProfile .student-name-form.profile-edit-panel,
#studentProfile .student-password-form.profile-edit-panel {
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  padding: 20px;
  border-top: 0;
}

#studentProfile .student-name-form-heading {
  display: grid;
  gap: 5px;
  margin: 0 0 2px;
}

#studentProfile .student-name-form-heading strong {
  color: #354024;
  font-size: 15px;
}

#studentProfile .student-name-form-heading span {
  color: #6b5a35;
  font-size: 11px;
  line-height: 1.45;
}

#studentProfile .profile-edit-panel .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

#studentProfile .profile-edit-panel label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #354024;
  font-size: 11px;
  font-weight: 800;
}

#studentProfile .profile-edit-panel input,
#studentProfile .profile-edit-panel select {
  min-height: 44px;
  border-color: #CFBB99;
  border-radius: 8px;
  background: #fbf8f3;
}

#studentProfile .profile-edit-panel .modal-actions {
  justify-content: flex-end;
  padding: 4px 0 0;
}

#studentProfile .profile-edit-panel .primary-button,
#studentProfile .profile-edit-panel .secondary-button {
  min-height: 44px;
  padding-inline: 22px;
  border-radius: 8px;
}

#studentProfile .student-password-form {
  grid-template-columns: 1fr;
  border-top: 0;
}

#studentProfile .password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

#studentProfile .password-field button {
  min-width: 62px;
  height: 100%;
  border-radius: 0 8px 8px 0;
  font-size: 11px;
}

@media (max-width: 1120px) {
  #studentProfile .student-profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  #studentProfile .student-profile-heading {
    justify-content: flex-start;
  }

  #studentProfile .student-details {
    grid-column: 1 / -1;
  }

  #studentProfile .student-profile-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #studentProfile .student-profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  #studentProfile .student-profile-heading {
    justify-content: center;
  }

  #studentProfile .student-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #studentProfile .student-profile-card {
    padding: 18px;
  }

  #studentProfile .student-profile-heading {
    flex-direction: column;
  }

  #studentProfile .profile-edit-panel {
    padding: 16px;
  }

  #studentProfile .profile-edit-panel .form-row {
    grid-template-columns: 1fr;
  }

  #studentProfile .profile-edit-panel .modal-actions,
  #studentProfile .profile-edit-panel .primary-button,
  #studentProfile .profile-edit-panel .secondary-button {
    width: 100%;
  }
}
