:root {
  --bg-page: #F5F0F8;
  --bg-header: #4C126B;
  --header-nav-active: #350B4C;
  --color-primary-orange: #FF6A00;
  --color-secondary-gold: #FFA800;
  --text-dark: #28083B;
  --text-light: #FFFFFF;
  --border-light: #E2D8E8;
  --brand: var(--color-primary-orange);
  --brand-dark: var(--bg-header);
  --bg: var(--bg-page);
  --line: var(--border-light);
  --text: var(--text-dark);
  --muted: #6B5B75;
  --bad: #b3261e;
  --warn: #9a6700;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
h1, h2, h3 { margin: 0 0 .6rem; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
button, input, select, textarea { font: inherit; }
input, select, textarea { padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 100%; color: var(--text-dark); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary-orange); outline-offset: 1px; border-color: var(--color-primary-orange); }
textarea { width: 100%; min-height: 5rem; }
button { padding: .45rem .9rem; border: 0; border-radius: 6px; background: var(--color-primary-orange); color: var(--text-light); cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease; }
button:hover { background: var(--color-secondary-gold); box-shadow: 0 2px 8px rgba(76, 18, 107, 0.12); transform: translateY(-1px); }
button.ghost { background: #fff; color: var(--color-primary-orange); border: 1px solid var(--color-primary-orange); }
button.ghost:hover { background: var(--color-secondary-gold); border-color: var(--color-secondary-gold); color: var(--text-light); }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
.login { max-width: 380px; margin: 8vh auto; background: #fff; padding: 2rem; border: 1px solid var(--border-light); border-radius: 12px; box-shadow: 0 8px 28px rgba(76, 18, 107, 0.05); }
.login h1 { color: var(--bg-header); }
.login label { display: block; margin: .6rem 0 .2rem; font-size: .85rem; color: var(--text-dark); }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 1rem; }
.platform-login-link { margin: 1.2rem 0 0; text-align: center; font-size: .85rem; }
.platform-login-link a { color: var(--bg-header); }
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
nav { background: var(--bg-header); color: var(--text-light); padding: 1rem .6rem; display: flex; flex-direction: column; gap: .2rem; }
nav .logo { color: var(--text-light); font-size: 1.3rem; font-weight: 750; padding: .3rem .6rem 1rem; }
nav a { color: rgba(255, 255, 255, 0.88); padding: .5rem .7rem; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; cursor: pointer; text-decoration: none; }
nav a.active, nav a:hover { background: var(--header-nav-active); border-left-color: var(--color-primary-orange); color: var(--text-light); }
nav .who { margin-top: auto; font-size: .8rem; padding: .6rem; color: var(--text-light); }
nav .who-role { color: rgba(255, 255, 255, 0.8); }
nav .who button { margin-top: .5rem; width: 100%; background: var(--color-primary-orange); color: var(--text-light); }
nav .who button:hover { background: var(--color-secondary-gold); }
main { padding: 1.4rem 1.6rem; overflow-x: auto; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; box-shadow: 0 4px 18px rgba(76, 18, 107, 0.05); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; box-shadow: 0 4px 18px rgba(76, 18, 107, 0.05); }
.stat b { display: block; font-size: 1.5rem; color: var(--bg-header); }
.stat span { color: var(--muted); font-size: .85rem; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); font-size: .93rem; color: var(--text-dark); }
th { color: var(--bg-header); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--border-light); }
tbody tr:hover { background: var(--bg-page); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .8rem; }
.row > div { display: flex; flex-direction: column; gap: .2rem; }
.row label { font-size: .8rem; color: var(--bg-header); }
.muted { color: var(--muted); }
.narrow { width: 6rem; } .wide { min-width: 22rem; }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .78rem; background: #F1E8F6; color: var(--bg-header); }
.pill.bad { background: #f9dedc; color: var(--bad); } .pill.warn { background: #fff1cc; color: var(--warn); }
.toast { position: fixed; right: 1rem; bottom: 1rem; background: var(--brand-dark); color: #fff; padding: .7rem 1rem; border-radius: 8px; max-width: 340px; z-index: 9; }
.toast.bad { background: var(--bad); }
.error { color: var(--bad); margin: .5rem 0; }
.platform-header { min-height: 64px; padding: .8rem 1.5rem; background: var(--bg-header); display: flex; align-items: center; justify-content: space-between; }
.platform-brand { color: #fff; text-decoration: none; font-size: 1.2rem; font-weight: 750; letter-spacing: -.02em; }
.platform-brand span { margin-left: .4rem; color: rgba(255, 255, 255, 0.8); font-size: .9rem; font-weight: 500; }
.platform-school-link { color: rgba(255, 255, 255, 0.9); text-decoration: none; font-size: .9rem; }
.platform-main { max-width: 1180px; margin: 0 auto; padding: 2rem 1.4rem; }
.platform-login { margin-top: 8vh; }
.platform-title, .platform-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.platform-title { margin: .5rem 0 1.2rem; }
.platform-title h1 { font-size: 1.8rem; }
.platform-title > button.ghost { flex-shrink: 0; background: var(--color-primary-orange); color: var(--text-light); white-space: nowrap; }
.platform-title > button.ghost:hover { background: var(--color-secondary-gold); }
.platform-eyebrow { color: var(--brand); font-size: .75rem; font-weight: 700; letter-spacing: .14em; margin: 0 0 .3rem; }
.platform-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: 1rem; }
.platform-form label { display: flex; flex-direction: column; gap: .25rem; color: var(--bg-header); font-size: .82rem; }
.platform-form input, .platform-form select { width: 100%; min-width: 0; min-height: 40px; color: var(--text); }
.platform-form-heading, .platform-form-note { grid-column: 1 / -1; margin: .35rem 0 0; }
.platform-form-heading { color: var(--bg-header); padding-top: .7rem; border-top: 1px solid var(--border-light); }
.platform-form-note { font-size: .82rem; }
.institution-contact span { display: block; }
dialog { max-width: 560px; width: calc(100% - 2rem); border: 1px solid var(--border-light); border-radius: 12px; padding: 1.5rem; color: var(--text-dark); }
dialog::backdrop { background: rgba(40, 8, 59, .45); }
.platform-form-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.platform-form-actions p { margin: 0; font-size: .85rem; }
.platform-admin-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.platform-table-wrap { width: 100%; overflow-x: auto; margin-top: 1rem; }
.platform-table-wrap table { min-width: 680px; }
.platform-table-wrap th, .platform-table-wrap td { padding: .7rem; }
.platform-message { min-height: 1.4rem; margin: 0 0 .8rem; color: var(--brand-dark); }
.platform-footer { color: var(--muted); font-size: .82rem; padding: 1rem 0 2rem; }
.platform-password-card summary { cursor: pointer; font-weight: 650; }
@media (max-width: 760px) {
  .platform-form, .platform-admin-form { grid-template-columns: 1fr; }
  .platform-form-actions { align-items: stretch; flex-direction: column; }
  .platform-title { align-items: flex-start; }
  .platform-main { padding: 1.2rem .8rem; }
}
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } nav { flex-direction: row; flex-wrap: wrap; } nav .who { margin: 0; } nav a.active, nav a:hover { border-left-color: transparent; border-bottom: 3px solid var(--color-primary-orange); } }
