:root {
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f3f7ff;
  color: #10233f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #dbeafe 0%, #f5e7ff 100%);
  color: #172554;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(192, 38, 211, 0.22)), url('image/school-bg.jpg') center/cover no-repeat;
  z-index: -2;
  filter: saturate(0.95) brightness(0.95);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.80), rgba(245,231,255,0.72)),
    radial-gradient(circle at 8% 20%, rgba(255,255,255,0.32), transparent 28%),
    url('logo/school-logo.jpg') left center / min(34vw, 360px) auto no-repeat;
  opacity: 0.22;
  z-index: -1;
  pointer-events: none;
}

.login-screen,
.app-shell {
  position: relative;
  z-index: 1;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 440px);
  background: linear-gradient(135deg, rgba(233, 242, 255, 0.72), rgba(243, 229, 255, 0.72));
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
}

/* Dashboard shell inspired by the supplied clinical operations layout. */
.app-shell {
  max-width: none;
  min-height: 100vh;
  padding: 24px 42px 48px 258px;
  background: #f5f6fa;
}

.dashboard-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 216px;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 24px;
  background: #ffffff;
  border-right: 1px solid #e9ebf2;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px 34px;
  color: #252942;
  font-size: 1.1rem;
}

.sidebar-brand strong {
  max-width: 145px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #ffffff;
  background: linear-gradient(135deg, #13c89b, #6c2be9);
  border-radius: 7px;
  font-weight: 800;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: #8b91a8;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-nav a::before {
  content: "•";
  margin-right: 12px;
  color: #afb4c7;
  font-size: 1.25rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #5621d7;
  background: #f1eaff;
}

.sidebar-nav a.active::before {
  color: #7029eb;
}

.sidebar-footnote {
  margin-top: auto;
  padding: 14px 12px;
  color: #a1a6b7;
  border-top: 1px solid #eff0f5;
  font-size: 0.72rem;
  line-height: 1.55;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0 0 0 216px;
  z-index: -1;
  background: #f5f6fa;
}

.hero {
  position: relative;
  margin: -24px -42px 26px -42px;
  padding: 18px 42px;
  color: #252942;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #e9ebf2;
  border-radius: 0;
  box-shadow: 0 4px 18px rgba(43, 45, 73, 0.04);
}

.hero-top {
  justify-content: flex-end;
  min-height: 44px;
}

.hero-brand {
  margin-right: auto;
  opacity: 0;
  pointer-events: none;
}

.hero-logo {
  width: 36px;
  height: 36px;
}

.header-actions {
  align-items: center;
}

.role-picker span {
  color: #858ba0;
  font-size: 0.76rem;
}

.role-picker select,
.header-actions .ghost {
  border: 0;
  background: #f7f7fb;
  color: #303349;
}

.card {
  background: #ffffff;
  border: 1px solid #eceef4;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(42, 45, 70, 0.045);
  backdrop-filter: none;
}

.summary-card {
  padding: 22px;
}

.summary-card .section-title {
  margin-bottom: 20px;
}

.summary-card .eyebrow {
  color: #8c91a3;
  letter-spacing: 0.12em;
}

.summary-card h2 {
  color: #292d42;
  font-size: 1.25rem;
}

.stats-grid {
  gap: 16px;
}

.stat-card {
  min-height: 104px;
  padding: 18px;
  border: 1px solid #eceef4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.stat-card strong {
  color: #292d42;
  font-size: 1.45rem;
}

.stat-card span {
  color: #888ea3;
  font-size: 0.78rem;
}

.chart-wrapper {
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  min-height: 250px;
  padding: 20px;
  border: 1px solid #eceef4;
  border-radius: 8px;
  background: #ffffff;
}

.chart-card h3 {
  color: #35384b;
  font-size: 0.94rem;
}

.pie-chart {
  width: 170px;
  height: 170px;
}

.legend-item {
  background: #fafaff;
  border: 0;
}

.subject-compliance-trend {
  border-top-color: #eceef4;
}

@media (max-width: 920px) {
  .app-shell {
    padding-left: 24px;
  }

  .dashboard-sidebar {
    position: static;
    width: auto;
    min-height: auto;
    margin: -24px -24px 24px;
    padding: 16px 18px;
  }

  .sidebar-brand {
    padding-bottom: 14px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-nav a {
    white-space: nowrap;
  }

  .sidebar-footnote {
    display: none;
  }

  .hero {
    margin: 0 0 20px;
    padding: 16px 0;
  }

  .hero::before {
    display: none;
  }

  .hero-brand {
    display: none;
  }
}

.login-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.brand-block {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.brand-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.login-card p {
  color: #64748b;
}

.login-error {
  color: #b91c1c;
  margin-top: 10px;
  min-height: 20px;
}

.register-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5ecfb;
}

.register-message {
  margin-top: 8px;
  color: #15803d;
  min-height: 20px;
}

.password-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-input-wrap input {
  flex: 1;
}

.password-toggle {
  padding: 8px 10px;
  border-radius: 999px;
  background: #e0ebff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
}

.password-match-message {
  margin: -4px 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 18px;
}

.password-match-message.match {
  color: #15803d;
}

.password-match-message.mismatch {
  color: #b91c1c;
}

.account-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5ecfb;
}

.account-management {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-danger-zone {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(185, 28, 28, 0.2);
}

.admin-message-panel {
  border: 1px solid #eceef4;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(42, 45, 70, 0.045);
}

.admin-message-panel h2,
.admin-message-eyebrow {
  color: #292d42;
}

.admin-message-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.admin-message-item {
  border-left: 5px solid #d1d5db;
  background: #f8fafc;
}

.admin-message-item strong {
  color: #374151;
}

.admin-message-panel.has-admin-messages {
  border: 2px solid #fecaca;
  background: #fff7f7;
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.1);
}

.admin-message-panel.has-admin-messages h2,
.admin-message-panel.has-admin-messages .admin-message-eyebrow {
  color: #b91c1c;
}

.admin-message-panel.has-admin-messages .admin-message-badge {
  background: #dc2626;
  color: white;
}

.admin-message-panel.has-admin-messages .admin-message-item {
  border-left-color: #dc2626;
  background: #fff1f2;
}

.admin-message-panel.has-admin-messages .admin-message-item strong {
  color: #991b1b;
}

.delete-admin-message-btn {
  margin-top: 8px;
  color: #991b1b;
}

.account-danger-zone .register-message {
  margin: 0;
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #fdf2ff 100%);
}

.account-row strong {
  color: #1d4ed8;
}

.account-remove-btn {
  flex: 0 0 auto;
}

.weekly-admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.weekly-admin-actions .register-message {
  margin: 0;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e3eafc;
  border-radius: 10px;
  background: #f8faff;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-grid > div {
  padding: 12px;
  border-radius: 12px;
  background: #f8faff;
  border: 1px solid #e3eafc;
}

.info-grid h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.info-grid p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.hidden {
  display: none;
}

.hero {
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.84), rgba(192, 38, 211, 0.82));
  color: white;
  box-shadow: 0 20px 40px rgba(31, 78, 216, 0.18);
  backdrop-filter: blur(6px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.78rem;
  margin: 0 0 8px;
  opacity: 0.9;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.subtitle {
  margin: 0;
  max-width: 680px;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.role-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.role-picker select,
input,
select,
textarea,
button {
  font: inherit;
}

.role-picker select,
input,
select,
textarea {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.76);
  backdrop-filter: blur(6px);
}

.card {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.68), rgba(248, 240, 255, 0.68));
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
}

.card h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.summary-card {
  padding-bottom: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.warning-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.78), rgba(255, 228, 230, 0.78));
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.warning-panel:empty {
  display: none;
}

.warning-panel ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.chart-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
}

.chart-card {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.72), rgba(253, 242, 255, 0.72));
  backdrop-filter: blur(8px);
}

.pie-chart {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  margin: 10px auto;
  background: conic-gradient(#2563eb 0 25%, #7c3aed 25% 45%, #14b8a6 45% 70%, #f59e0b 70% 100%);
  position: relative;
}

.pie-chart::after {
  content: "Reports";
  position: absolute;
  inset: 50px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1d4ed8;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff 0%, #fdf2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.stat-card {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.72), rgba(253, 242, 255, 0.72));
  backdrop-filter: blur(8px);
}

.stat-card strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.stat-card.has-warning {
  position: relative;
}

.stat-warning-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.74rem;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.lower-grid {
  grid-template-columns: 1fr 1fr;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(192, 38, 211, 0.18);
}

button[type="submit"] {
  background: linear-gradient(90deg, #2563eb, #c026d3);
  color: white;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.ghost {
  background: #f1f5f9;
  color: #475569;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title p {
  margin: 0;
  color: #64748b;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-item,
.list-item {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.72), rgba(253, 242, 255, 0.72));
  backdrop-filter: blur(8px);
}

.list-item strong {
  color: #1d4ed8;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e5ecfb;
  font-size: 0.94rem;
}

.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #e0ebff;
  color: #1d4ed8;
}

.badge.approved {
  background: #dcfce7;
  color: #15803d;
}

.badge.returned {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.under-review {
  background: #fef3c7;
  color: #92400e;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.inline-filter {
  min-width: 140px;
  flex: 1;
}

.weekly-filters {
  align-items: end;
}

.weekly-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.weekly-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
}

.rank-item {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.72), rgba(253, 242, 255, 0.72));
}

.rank-item-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.rank-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.rank-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
}

.summary-pill {
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.74), rgba(253, 242, 255, 0.74));
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.summary-pill strong {
  display: block;
  font-size: 1.2rem;
  color: #1d4ed8;
}

.summary-pill span {
  color: #475569;
  font-size: 0.85rem;
}

.subject-compliance-trend {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(37, 99, 235, 0.14);
}

.subject-trend-admin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.subject-trend-admin-controls.hidden {
  display: none;
}

.subject-trend-admin-controls input {
  flex: 1;
  min-width: 220px;
}

.subject-trend-admin-controls p {
  flex-basis: 100%;
  margin: 0;
}

.subject-trend-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.subject-trend-item {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.72);
}

.subject-trend-item:hover {
  border-color: #2563eb;
}

.subject-trend-item-readonly {
  cursor: default;
}

.subject-trend-item-readonly:hover {
  border-color: rgba(37, 99, 235, 0.14);
}

.subject-trend-detail {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.72);
}

.subject-trend-entry-form,
.subject-trend-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.subject-trend-entry-form {
  margin-bottom: 14px;
}

.subject-trend-entry-form select,
.subject-trend-entry-form button,
.subject-record-status {
  min-height: 38px;
}

.subject-trend-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subject-trend-record {
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: white;
}

.subject-record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-subject-record-btn {
  color: #b91c1c;
}

.subject-trend-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.subject-trend-heading span {
  color: #1d4ed8;
  font-weight: 700;
}

.subject-trend-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.subject-trend-remove {
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 700;
}

.subject-trend-remove:hover {
  text-decoration: underline;
}

.teacher-upload-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.teacher-upload-form label {
  flex: 1;
  min-width: 240px;
  margin: 0;
}

.teacher-upload-form input[type="file"] {
  padding: 10px;
  background: white;
}

.teacher-upload-form p {
  flex-basis: 100%;
  margin: 0;
}

.teacher-upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.teacher-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.teacher-upload-actions .delete-teacher-file {
  color: #b91c1c;
}

.admin-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: white;
}

.file-kind-icon {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.7rem;
  font-weight: 700;
}

.file-image-icon {
  width: 58px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2ff;
}

.admin-file-row .admin-delete-file {
  color: #b91c1c;
}

.admin-file-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.file-open-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.file-open-dialog.hidden {
  display: none;
}

.file-open-dialog-panel {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.file-open-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.subject-trend-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.subject-trend-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.weekly-table td,
.weekly-table th {
  vertical-align: middle;
}

.weekly-checkbox-cell {
  white-space: nowrap;
}

.weekly-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.weekly-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.weekly-legend {
  margin-top: 8px;
  color: #475569;
  font-size: 0.85rem;
}

.monitoring-detail {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.72);
}

.monitoring-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assign-teacher-grade-btn::before {
  content: "◆";
  margin-right: 6px;
  color: #6d42db;
}

.monitoring-admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}

.monitoring-admin-controls input {
  flex: 1 1 220px;
  min-width: 0;
}

.monitoring-admin-controls input[type="date"] {
  flex: 0 1 170px;
}

.monitoring-admin-controls .register-message {
  flex-basis: 100%;
  margin: 0;
}

.monitoring-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.monitoring-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 10px;
  background: white;
}

.monitoring-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.monitoring-grade-row th {
  padding: 12px 10px;
  background: #eaf2ff;
  color: #1e3a8a;
  text-align: left;
}

.grade-competency-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.grade-competency-card {
  border: 1px solid #dfe7f5;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fbff;
}

.grade-competency-card:hover,
.grade-competency-card.selected {
  border-color: #6d42db;
  background: #f1eaff;
  box-shadow: 0 0 0 2px rgba(109, 66, 219, 0.12);
}

.grade-competency-card strong {
  color: #1e3a8a;
}

.grade-competency-card span {
  font-size: 1.15rem;
  font-weight: 700;
}

.grade-competency-card small {
  color: #64748b;
}

.monitoring-group-header .ghost {
  padding: 4px 8px;
  font-size: 0.78rem;
}

.monitoring-checkbox-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}

.monitoring-checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
}

.missing-teacher-item,
.perfect-teacher-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.72), rgba(253, 242, 255, 0.72));
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.missing-teacher-item strong,
.perfect-teacher-item strong {
  color: #1d4ed8;
}

.missing-teacher-item .meta,
.perfect-teacher-item .meta {
  color: #475569;
  font-size: 0.9rem;
}

.printable-weekly-report {
  display: none;
}

@media (max-width: 640px) {
  .weekly-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitoring-requirements {
    grid-template-columns: 1fr;
  }

  .subject-trend-list {
    grid-template-columns: 1fr;
  }
}

.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-item {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  padding: 10px;
  background: rgba(249, 251, 255, 0.72);
  backdrop-filter: blur(8px);
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  margin-top: 8px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

@media (max-width: 920px) {
  .stats-grid,
  .content-grid,
  .lower-grid,
  .chart-wrapper,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell {
    padding: 14px;
  }
}
/* ===== SCHOOL BACKGROUND ===== */

body {
    background-image:
        linear-gradient(
            rgba(0, 35, 80, 0.45),
            rgba(0, 35, 80, 0.45)
        ),
        url("image/school-bg.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Login screen */
#loginScreen {
    background: transparent !important;
}

/* Login card glass effect */
.login-card {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.30);
}

/* Remove the global violet wash; keep purple only for intentional accents and charts. */
body {
  background: #f5f6fa url('image/school-bg.jpg') center / cover fixed no-repeat;
}

body::before {
  background: rgba(245, 246, 250, 0.55);
  filter: none;
}

body::after {
  display: block;
  background: rgba(255, 255, 255, 0.14);
  opacity: 1;
}

/* Final dashboard layout overrides. */
.app-shell {
  max-width: none;
  min-height: 100vh;
  padding: 24px 42px 48px 258px;
  background:
    linear-gradient(rgba(245, 246, 250, 0.42), rgba(245, 246, 250, 0.42)),
    url('image/school-bg.jpg') center / cover fixed no-repeat;
}

.dashboard-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 216px;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 24px;
  background: #ffffff;
  border-right: 1px solid #e9ebf2;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px 34px;
  color: #252942;
  font-size: 1.1rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #ffffff;
  background: linear-gradient(135deg, #13c89b, #6c2be9);
  border-radius: 7px;
  font-weight: 800;
}

.sidebar-nav { display: grid; gap: 7px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: #8b91a8;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.sidebar-nav a::before { content: "•"; margin-right: 12px; color: #afb4c7; font-size: 1.25rem; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: #5621d7; background: #f1eaff; }
.sidebar-nav a.active::before { color: #7029eb; }
.sidebar-footnote { margin-top: auto; padding: 14px 12px; color: #a1a6b7; border-top: 1px solid #eff0f5; font-size: 0.72rem; line-height: 1.55; }

.hero {
  position: relative;
  margin: -24px -42px 26px -42px;
  padding: 18px 42px 18px 258px;
  color: #252942;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #e9ebf2;
  border-radius: 0;
  box-shadow: 0 4px 18px rgba(43, 45, 73, 0.04);
}
.hero::before { content: none; }
.hero-top { justify-content: flex-end; min-height: 44px; }
.hero-brand { margin-right: auto; opacity: 1; pointer-events: auto; visibility: hidden; }
.header-actions { align-items: center; }
.role-picker span { color: #858ba0; font-size: 0.76rem; }
.role-picker select, .header-actions .ghost { border: 0; background: #f7f7fb; color: #303349; }

.card { background: #ffffff; border: 1px solid #eceef4; border-radius: 9px; box-shadow: 0 8px 22px rgba(42, 45, 70, 0.045); backdrop-filter: none; }
.summary-card { padding: 22px; }
.summary-card .eyebrow { color: #8c91a3; letter-spacing: 0.12em; }
.summary-card h2 { color: #292d42; font-size: 1.25rem; }
.stats-grid { gap: 16px; }
.stat-card { min-height: 104px; padding: 18px; border: 1px solid #eceef4; border-radius: 8px; background: #ffffff; box-shadow: none; }
.stat-card strong { color: #292d42; font-size: 1.45rem; }
.stat-card span { color: #888ea3; font-size: 0.78rem; }
.chart-wrapper { grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.75fr); gap: 16px; margin-top: 16px; }
.chart-card { min-height: 250px; padding: 20px; border: 1px solid #eceef4; border-radius: 8px; background: #ffffff; }
.chart-card h3 { color: #35384b; font-size: 0.94rem; }
.pie-chart { width: 170px; height: 170px; }
.legend-item { background: #fafaff; border: 0; }

.chart-card:first-child {
  background: #ffffff;
  border-color: #eceef4;
  color: #35384b;
}

.chart-card:first-child h3 {
  color: #35384b;
}

.chart-card:first-child .pie-chart {
  width: 100%;
  height: 260px;
  margin: 10px 0 0;
  border-radius: 0;
  background: transparent;
}

.chart-card:first-child .pie-chart::after {
  display: none;
}

.combo-chart-svg {
  display: block;
  width: 100%;
  height: 260px;
  overflow: visible;
}

.combo-chart-grid line {
  stroke: #d9dce6;
  stroke-width: 1;
}

.combo-chart-grid text,
.chart-x-label {
  fill: #697086;
  font-size: 14px;
  font-family: inherit;
}

.chart-x-label {
  text-anchor: middle;
}

.chart-bar-primary {
  fill: #5539c7;
}

.chart-bar-secondary {
  fill: #48e8a8;
}

.combo-chart-line {
  fill: none;
  stroke: #facc15;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.combo-chart-point {
  fill: #facc15;
}

.chart-legend-primary {
  background: #5539c7;
}

@media (max-width: 920px) {
  .app-shell { padding: 14px 18px 36px; }
  .dashboard-sidebar { position: static; width: auto; min-height: auto; margin: -14px -18px 18px; padding: 16px 18px; }
  .sidebar-brand { padding-bottom: 14px; }
  .sidebar-nav { display: flex; overflow-x: auto; }
  .sidebar-nav a { white-space: nowrap; }
  .sidebar-footnote { display: none; }
  .hero { margin: 0 0 20px; padding: 16px 0; }
  .hero::before { display: none; }
  .hero-brand { display: none; }
  .grade-competency-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grade-competency-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
