/* Shared visual language for the portal and its journal.
   Supports both Light (:root) and Dark ([data-theme="dark"]) themes. */
:root {
  color-scheme: light;
  --ink: #131c2e;
  --muted: #55637d;
  --faint: #7d8ca6;
  --canvas: #f2f5fb;
  --surface: #ffffff;
  --soft: #e8eef8;
  --line: #d5dfef;
  --blue: #1659e6;
  --cyan: #0e94b8;
  --violet: #6352e3;
  --success: #0f9468;
  --navy: #121d38;
  --danger: #d92d47;
  --shadow: 0 18px 42px rgba(19, 28, 46, .08);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Manrope", system-ui, sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8f9fc;
  --muted: #b9c6de;
  --faint: #8497b6;
  --canvas: #0a0e1a;
  --surface: #151d30;
  --soft: #202b43;
  --line: #34446b;
  --blue: #6fa3ff;
  --cyan: #65b6ee;
  --violet: #adbaff;
  --success: #72c6a5;
  --navy: #0d1428;
  --danger: #ef6070;
  --shadow: 0 24px 55px rgba(0, 0, 0, .26);
}
body { background: var(--canvas); color: var(--ink); transition: background-color .2s ease, color .2s ease; }
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 42% 35% at 72% 15%, rgba(22,91,225,.09), transparent 80%),
              radial-gradient(ellipse 40% 40% at 12% 82%, rgba(174,31,55,.04), transparent 82%);
}
[data-theme="dark"] body::before {
  background: radial-gradient(ellipse 42% 35% at 72% 15%, rgba(22,91,225,.13), transparent 80%),
              radial-gradient(ellipse 40% 40% at 12% 82%, rgba(174,31,55,.06), transparent 82%);
}
.ambient::before { background: radial-gradient(circle, rgba(12,94,233,.1), transparent 70%); }
.ambient::after { background: radial-gradient(circle, rgba(229,35,56,.06), transparent 70%); }
.app-sidebar {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 16px 0 44px rgba(19, 28, 46, .06);
}
[data-theme="dark"] .app-sidebar {
  background: #11182a;
  box-shadow: 16px 0 50px #0003;
}
.app-header {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-color: var(--line);
}
[data-theme="dark"] .app-header {
  background: rgba(10, 15, 29, .9);
}
.nav-icon {
  color: var(--blue);
  background: var(--soft);
}
[data-theme="dark"] .nav-icon {
  color: #f2f6ff;
  background: #1b2d58;
}
.sidebar-nav button.is-active .nav-icon, .sidebar-nav .is-active .nav-icon {
  color: #fff;
  background: #0b5be7;
  box-shadow: 0 7px 25px rgba(8,86,228,.23);
}
.content-card, .card, .student-overview article, .student-averages,
.student-entry-journal, .material-stat, .journal-subject {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.content-card, .card, .student-overview article, .journal-subject {
  transition: border-color .25s, box-shadow .25s, background-color .2s;
}
.student-overview article:hover, .journal-subject:hover {
  border-color: #597bd1;
  box-shadow: 0 18px 40px rgba(12,87,222,.14);
  transform: translateY(-2px);
}
.student-overview article:nth-child(1) {
  background: linear-gradient(135deg, #1659e6, #2b73ff);
  border: 1px solid rgba(255,255,255,.16);
}
.student-overview article:nth-child(2) {
  background: linear-gradient(135deg, #0f7490, #1693b2);
  border: 1px solid rgba(255,255,255,.16);
}
.student-overview article:nth-child(3) {
  background: linear-gradient(135deg, #273659, #3b4f7d);
  border: 1px solid rgba(255,255,255,.16);
}
[data-theme="dark"] .student-overview article:nth-child(1) {
  background: #16356d;
  border: 1px solid var(--line);
}
[data-theme="dark"] .student-overview article:nth-child(2) {
  background: #172844;
  border: 1px solid var(--line);
}
[data-theme="dark"] .student-overview article:nth-child(3) {
  background: #232840;
  border: 1px solid var(--line);
}
.student-overview article span, .student-overview article b { color: #f8f9fc; }
.student-tabs a.is-active, .student-tabs button.is-active, .sidebar-admin, body:not(.student-app) button:not(.secondary-button):not(.danger-button):not(.icon-button) {
  background: #075ee9;
  color: #fff;
}
.student-tabs a:not(.is-active), .student-tabs button:not(.is-active) { color: var(--muted); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.student-entry-table, .student-averages__table, .journal-table-wrap {
  border-color: var(--line);
  background: var(--surface);
}
[data-theme="dark"] .student-entry-table,
[data-theme="dark"] .student-averages__table,
[data-theme="dark"] .journal-table-wrap {
  background: #101a2d;
}
.student-entry-table__head, .student-averages__head, .journal-table thead th {
  background: var(--soft);
  color: var(--ink);
}
[data-theme="dark"] .student-entry-table__head,
[data-theme="dark"] .student-averages__head,
[data-theme="dark"] .journal-table thead th {
  background: #213159;
  color: #dce7ff;
}
.student-entry-row:hover, .student-averages__row:hover { background: rgba(35,99,220,.08); }
.journal-chart__bar i { background: #1266ec; }
.journal-chart--attendance .journal-chart__bar i { background: #e72e49; }
.journal-absence { color: var(--danger) !important; }
.view-heading h1, body:not(.student-app) h1, .student-entry-journal h2 {
  letter-spacing: -.065em;
}
body:not(.student-app) > header {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}
[data-theme="dark"] body:not(.student-app) > header {
  background: rgba(10,15,30,.9);
}
body:not(.student-app) main { color: var(--ink); }
body:not(.student-app) .card { background: var(--surface); }
:focus-visible { outline: 2px solid #95b8ff; outline-offset: 3px; }
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}
.app-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.app-brand__mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  margin: auto;
}
.brand-mark { display:inline-grid; width:38px; height:38px; margin-right:10px; place-items:center; vertical-align:middle; border-radius:50%; background:#fff; }
.brand-mark img { width:30px; height:30px; object-fit:contain; }
body:not(.student-app) > header .brand::before {
  content: "";
  display: inline-block;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 50%;
  background: #fff url("assets/pgups-logo.webp") center / 78% no-repeat;
}
.login-brand { width:50px; height:50px; margin-bottom:17px; }
.login-brand img { width:40px; height:40px; }
.admin-header-actions a:hover, .sidebar-nav a:hover { color: #fff; border-color: #4d85ed; }
@media (prefers-reduced-motion: reduce) {
  .content-card, .card, .student-overview article, .journal-subject { transition: none; }
  .content-card:hover, .student-overview article:hover, .journal-subject:hover { transform: none; }
}

/* Modern Accessible UI Switch */
.ui-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.ui-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  margin: 0;
}
.ui-switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ui-switch-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}
.ui-switch input:checked + .ui-switch-slider {
  background: var(--accent, #3b82f6);
  border-color: var(--accent, #3b82f6);
}
.ui-switch input:checked + .ui-switch-slider:before {
  transform: translateX(20px);
}
.ui-switch input:focus-visible + .ui-switch-slider {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}
.notify-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.notify-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}
.notify-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.notify-item-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.notify-item-text {
  min-width: 0;
}
.notify-item-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.3;
}
.notify-item-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
}

