:root {
  --bg: #eef4ff;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: rgba(255,255,255,.58);
  --brand: #0b4fd8;
  --brand-2: #f8b423;
  --accent: #16b8a6;
  --pink: #e546a3;
  --purple: #7c3aed;
  --danger: #d92d20;
  --glass: rgba(255,255,255,.78);
  --shadow: 0 24px 70px rgba(15, 23, 42, .16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(248, 180, 35, .35), transparent 22rem),
    radial-gradient(circle at 88% 4%, rgba(229, 70, 163, .24), transparent 24rem),
    radial-gradient(circle at 50% 45%, rgba(22, 184, 166, .18), transparent 28rem),
    linear-gradient(135deg, #f8fbff 0%, #eef4ff 38%, #fff7e3 100%);
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 79, 216, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 79, 216, .045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
}
a { color: var(--brand); }
.wrap {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid rgba(255,255,255,.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 34px rgba(15, 23, 42, .08);
}
.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  min-width: 240px;
}
.brand img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 12px 28px rgba(11, 79, 216, .25), 0 0 0 4px rgba(248, 180, 35, .18);
}
.brand span {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}
.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
nav .nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(11, 79, 216, .08);
}
nav .nav-group b {
  padding: 0 6px 0 8px;
  color: #0b4fd8;
  font-size: 12px;
  white-space: nowrap;
}
nav a {
  text-decoration: none;
  color: #344054;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(11, 79, 216, .08);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
nav a:hover {
  background: linear-gradient(135deg, #ffffff, #edf4ff);
  color: var(--brand);
  border-color: #cfe0ff;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(11, 79, 216, .12);
}
main { padding: 28px 0 48px; }
h1 { margin: 0 0 18px; font-size: clamp(28px, 4vw, 42px); }
h2 { margin: 0 0 16px; font-size: 22px; }
h3 { margin: 20px 0 12px; color: #1d2939; }
p { color: var(--muted); line-height: 1.7; }
.app-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 190px;
  margin: 24px 0 22px;
  padding: clamp(22px, 4vw, 36px);
  overflow: hidden;
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 20%, rgba(248, 180, 35, .62), transparent 12rem),
    radial-gradient(circle at 10% 90%, rgba(22, 184, 166, .42), transparent 16rem),
    linear-gradient(135deg, #063b9f 0%, #0b4fd8 44%, #7c3aed 100%);
  box-shadow: 0 28px 80px rgba(11, 79, 216, .28);
}
.app-hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 140deg, transparent, rgba(255,255,255,.18), transparent 34%);
  animation: heroGlow 10s linear infinite;
}
.app-hero > * {
  position: relative;
  z-index: 1;
}
.app-hero h1 {
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 0 10px 26px rgba(0,0,0,.18);
}
.app-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.86);
}
.app-hero img {
  width: clamp(96px, 16vw, 150px);
  height: clamp(96px, 16vw, 150px);
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,.92);
  box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 8px rgba(248, 180, 35, .24);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff7d6;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
@keyframes heroGlow {
  to { transform: rotate(360deg); }
}
.card, .kpi {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 26px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  backdrop-filter: blur(14px);
}
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.72));
}
.card:hover {
  box-shadow: 0 28px 82px rgba(15, 23, 42, .18);
}
.narrow { max-width: 520px; margin: 40px auto; }
.muted { color: var(--muted); }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.kpi { margin: 0; position: relative; overflow: hidden; }
.kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(248, 180, 35, .28), rgba(229, 70, 163, .15));
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--brand), var(--accent), var(--brand-2), var(--pink)) 1;
  opacity: .95;
}
.kpi span { color: var(--muted); display: block; margin-bottom: 10px; }
.kpi strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
  background: linear-gradient(135deg, #0b4fd8, #7c3aed 55%, #e546a3);
  -webkit-background-clip: text;
  color: transparent;
}
.kpi small { color: var(--accent); font-weight: 700; }
.grid-2, .chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.chart-grid {
  grid-template-columns: 1fr;
}
.finance-executive {
  background:
    radial-gradient(circle at 12% 8%, rgba(248, 180, 35, .22), transparent 18rem),
    radial-gradient(circle at 88% 18%, rgba(20, 163, 139, .20), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.76));
}
.finance-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.finance-chart-grid h3 {
  margin: 0 0 10px;
  color: var(--primary);
}
.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .10);
  backdrop-filter: blur(12px);
}
label { display: grid; gap: 6px; font-weight: 700; color: var(--muted); }
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
input, select, textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: rgba(255,255,255,.92);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(8, 73, 184, .16);
  border-color: var(--brand);
}
.stack { display: grid; gap: 14px; }
.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(135deg, var(--brand), var(--purple), var(--pink));
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(11, 79, 216, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(124, 58, 237, .26);
}
.btn:disabled {
  cursor: wait;
  opacity: .78;
  transform: none;
}
.btn.light {
  background: linear-gradient(135deg, #eef5ff, #ffffff);
  color: var(--brand);
  border: 1px solid rgba(11, 79, 216, .12);
}
.mail-login {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 14px 22px;
  overflow: hidden;
  font-size: 17px;
  letter-spacing: .01em;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.34), transparent 6rem),
    linear-gradient(135deg, #0b4fd8 0%, #16b8a6 46%, #f8b423 100%);
  box-shadow: 0 22px 48px rgba(11, 79, 216, .28), 0 0 0 6px rgba(11, 79, 216, .08);
}
.mail-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.34), transparent);
  transform: translateX(-120%);
  transition: transform .7s ease;
}
.mail-login:hover::before {
  transform: translateX(120%);
}
.mail-login span {
  position: relative;
  z-index: 1;
}
.local-login {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(11, 79, 216, .12);
}
.local-login-btn {
  width: 100%;
  min-height: 54px;
  font-size: 18px;
  letter-spacing: .02em;
  box-shadow: 0 18px 40px rgba(124, 58, 237, .24);
}
.notice {
  border: 1px solid #b7ebc6;
  background: #ecfdf3;
  color: #067647;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.notice.error {
  border-color: #fecdca;
  background: #fff1f0;
  color: var(--danger);
}
.table-wrap {
  overflow: auto;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 22px;
  margin-bottom: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  background: linear-gradient(135deg, #edf5ff, #fff7df);
  color: #1d2939;
  font-size: 13px;
}
tbody tr:nth-child(even) td {
  background: rgba(244, 248, 255, .58);
}
tbody tr:hover td {
  background: rgba(255, 247, 223, .75);
}
.table-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid rgba(11, 79, 216, .10);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(237,245,255,.82), rgba(255,247,223,.62));
}
.table-tools label {
  flex: 1 1 280px;
}
.table-tools input {
  width: 100%;
}
.table-search-count {
  align-self: center;
  font-weight: 800;
  white-space: nowrap;
}
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 26px;
}
th.sortable::after {
  content: "↕";
  position: absolute;
  right: 9px;
  color: rgba(29, 41, 57, .42);
  font-size: 12px;
}
th.sortable[data-sort-direction="asc"]::after {
  content: "↑";
  color: var(--brand);
}
th.sortable[data-sort-direction="desc"]::after {
  content: "↓";
  color: var(--brand);
}
th.static-row-number {
  cursor: default;
  user-select: none;
}
td:nth-child(n+2) { text-align: right; }
th:nth-child(n+2) { text-align: right; }
td:first-child, th:first-child { text-align: left; }
.student-list td:nth-child(3),
.student-list th:nth-child(3) {
  text-align: left;
}
.student-list td:nth-child(4),
.student-list th:nth-child(4) {
  text-align: left;
}
.student-list td:nth-child(2),
.student-list th:nth-child(2) {
  text-align: center;
}
.table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(11, 99, 206, .12), rgba(247, 144, 9, .14));
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(11, 99, 206, .12);
}
.table-link:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}
.loading-card {
  text-align: center;
  padding: 36px 28px;
  overflow: hidden;
}
.processing-orb {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 6px auto 22px;
  display: grid;
  place-items: center;
}
.processing-orb span,
.processing-rings span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  animation: spin 1.4s linear infinite;
}
.processing-orb span:nth-child(2),
.processing-rings span:nth-child(2) {
  inset: 14px;
  border-top-color: #14a38b;
  border-right-color: #7a5af8;
  animation-duration: 1.9s;
  animation-direction: reverse;
}
.processing-orb span:nth-child(3),
.processing-rings span:nth-child(3) {
  inset: 28px;
  border-top-color: #f79009;
  border-right-color: #0b63ce;
  animation-duration: 2.3s;
}
.processing-orb img {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(11, 99, 206, .24);
}
.loading-steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.loading-steps b {
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(11, 99, 206, .08);
  color: var(--primary);
}
.progress-line {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(11, 99, 206, .08);
}
.progress-line span {
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent), #14a38b);
  animation: progress-slide 1.25s ease-in-out infinite alternate;
}
.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .36);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.processing-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.processing-box {
  position: relative;
  width: min(92vw, 360px);
  padding: 28px;
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 26px 70px rgba(15, 23, 42, .24);
}
.processing-box strong {
  display: block;
  margin-top: 16px;
  font-size: 22px;
  color: var(--primary);
}
.processing-box small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.processing-rings {
  position: relative;
  width: 94px;
  height: 94px;
  margin: 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes progress-slide {
  from { transform: translateX(-20%); }
  to { transform: translateX(125%); }
}
.chart {
  display: block;
  width: 100%;
  height: 380px !important;
  min-height: 380px;
  max-height: 380px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 24px;
  padding: 10px;
  margin-bottom: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}
.foot {
  color: #475467;
  font-size: 13px;
  padding: 0 0 32px;
}
@media (prefers-reduced-motion: reduce) {
  .app-hero::before {
    animation: none;
  }
  *, *::before, *::after {
    transition: none !important;
  }
}
@media (max-width: 900px) {
  .hero-grid, .grid-2, .chart-grid, .grid-form { grid-template-columns: 1fr; }
  .nav { align-items: flex-start; flex-direction: column; padding: 12px 0; }
}
@media (max-width: 640px) {
  .wrap {
    width: min(100% - 20px, 1220px);
  }
  main {
    padding: 18px 0 32px;
  }
  h1 {
    font-size: 25px;
  }
  h2 {
    font-size: 19px;
  }
  .nav {
    gap: 12px;
  }
  .brand {
    min-width: 0;
    width: 100%;
  }
  .brand img {
    width: 44px;
    height: 44px;
  }
  .app-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    margin: 14px 0 16px;
    padding: 20px;
    border-radius: 24px;
  }
  .app-hero img {
    width: 82px;
    height: 82px;
    justify-self: end;
    margin-top: -8px;
  }
  .app-hero p {
    font-size: 14px;
  }
  nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  nav a {
    white-space: nowrap;
    min-height: 38px;
  }
  nav .nav-group {
    flex: 0 0 auto;
  }
  .card, .kpi {
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 14px;
  }
  .kpi strong {
    font-size: 26px;
  }
  .filters {
    display: grid;
    align-items: stretch;
    padding: 12px;
  }
  .filters label,
  .filters select,
  .filters .btn,
  .table-tools label,
  .table-tools .btn,
  .grid-form label,
  .grid-form .btn {
    width: 100%;
  }
  input, select, textarea, .btn {
    min-height: 44px;
    font-size: 16px;
  }
  .table-wrap {
    margin-left: -2px;
    margin-right: -2px;
  }
  table {
    min-width: 620px;
  }
  th, td {
    padding: 10px;
    font-size: 13px;
  }
  .chart {
    height: 320px !important;
    min-height: 320px;
    max-height: 320px;
    padding: 6px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
  body {
    background: #fff !important;
    color: #111827 !important;
    font-size: 12px;
  }
  .top,
  .app-hero,
  .filters,
  .table-tools,
  .foot,
  .btn,
  .processing-overlay {
    display: none !important;
  }
  .wrap {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }
  .card,
  .kpi {
    break-inside: avoid;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
    color: #111827 !important;
    padding: 10px !important;
    margin: 0 0 8px !important;
    border-radius: 8px !important;
  }
  .hero-grid,
  .grid-2 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .kpi span,
  .kpi small,
  .muted {
    color: #374151 !important;
  }
  .kpi strong {
    color: #111827 !important;
    font-size: 18px !important;
  }
  .table-wrap {
    overflow: visible !important;
    border: 0 !important;
  }
  table {
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: collapse !important;
  }
  th,
  td {
    border: 1px solid #d1d5db !important;
    padding: 5px 6px !important;
    font-size: 10.5px !important;
  }
  th {
    background: #f3f4f6 !important;
    color: #111827 !important;
  }
  a {
    color: #111827 !important;
    text-decoration: none !important;
  }
}
