:root{--brand:#4f86c6;--brand-deep:#2f276e;--brand-dark:#17133c;--cream:#fffdf6;--ink:#202335;--muted:#6d7285;--line:rgba(32,35,53,.12);--success:#18764c;--danger:#b33a4a;--shadow:0 24px 60px rgba(27,28,60,.18);--radius:22px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink)}
*{box-sizing:border-box}html{min-height:100%;background:#edf2f8}body{margin:0;min-height:100vh}button,input,select{font:inherit}button,a{transition:.2s ease}a{color:inherit}img{max-width:100%}.eyebrow{display:block;font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--brand-deep);margin-bottom:.45rem}.alert,.landing-alert{padding:12px 15px;border-radius:14px;margin-bottom:16px;font-weight:650}.alert.success,.landing-alert.success{background:#e6f7ef;color:#136640;border:1px solid #bde8d2}.alert.error,.landing-alert.error{background:#fff0f2;color:#9e2b3d;border:1px solid #f3c8cf}.primary-button,.secondary-button{border:0;border-radius:14px;padding:12px 18px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.primary-button{background:var(--brand-deep);color:#fff;box-shadow:0 12px 24px rgba(48,38,111,.22)}.primary-button:hover{transform:translateY(-1px);background:#241c61}.secondary-button{background:#eef0f7;color:var(--brand-deep)}.compact{padding:11px 16px;align-self:end}.tiny{padding:8px 11px;font-size:.82rem}.link-button{margin-top:12px}.text-link{color:var(--brand-deep);font-weight:800;text-decoration:none}.text-danger{border:0;background:transparent;color:var(--danger);font-weight:800;cursor:pointer}.auth-page{background:radial-gradient(circle at top left,#dce7fa,transparent 35%),linear-gradient(135deg,#f7f8fc,#e9eff8);display:grid;place-items:center;padding:26px}.auth-shell{width:min(100%,900px)}.auth-card{background:rgba(255,255,255,.86);border:1px solid rgba(255,255,255,.9);backdrop-filter:blur(20px);border-radius:28px;box-shadow:var(--shadow);padding:32px;width:min(100%,520px);margin:auto}.auth-card.wide{width:min(100%,850px)}.auth-card h1{margin:.15rem 0 .5rem}.auth-card p{color:var(--muted)}label{display:flex;flex-direction:column;gap:7px;font-size:.84rem;font-weight:750;color:#42475a}input,select{width:100%;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px 12px;color:var(--ink);outline:none}input:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 4px rgba(79,134,198,.12)}.auth-card form{display:grid;gap:15px;margin:22px 0}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-section-title{grid-column:1/-1;font-weight:900;color:var(--brand-deep)}.optional-account{grid-column:1/-1;border:1px solid var(--line);border-radius:16px;padding:14px;background:#fbfcff}.optional-account summary{cursor:pointer;font-weight:850}.details-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:15px}.form-hint{font-size:.82rem;margin:0;color:var(--muted)}.error-card{text-align:center}.error-code{font-size:3.5rem;font-weight:950;color:var(--brand-deep)}@media(max-width:700px){.form-grid,.details-grid{grid-template-columns:1fr}.auth-card{padding:24px}}

.application-required-card{max-width:600px}.application-lock{width:72px;height:72px;border-radius:24px;margin:0 auto 10px;display:grid;place-items:center;background:linear-gradient(145deg,#e7effb,#d7e6f8);box-shadow:inset 0 0 0 1px rgba(79,134,198,.18)}.application-lock svg{width:38px;height:38px;fill:var(--brand-deep)}.application-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;text-align:left;margin:22px 0 10px}.application-options>div{padding:15px;border:1px solid var(--line);border-radius:16px;background:#f8fbff}.application-options strong,.application-options small{display:block}.application-options small{margin-top:5px;color:var(--muted);line-height:1.45}@media(max-width:600px){.application-options{grid-template-columns:1fr}}
textarea{width:100%;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px 12px;color:var(--ink);outline:none;resize:vertical;font:inherit}textarea:focus{border-color:var(--brand);box-shadow:0 0 0 4px rgba(79,134,198,.12)}

/* Phase 5: calm light-blue school theme. */
:root{
  --brand:#4f9bd1;
  --brand-deep:#276d9f;
  --brand-dark:#173b57;
  --cream:#f7fbfe;
  --ink:#203244;
  --muted:#66798b;
  --line:#d7e5ef;
  --success:#287a57;
  --danger:#b34b59;
  --warning:#9a6a17;
  --surface:#ffffff;
  --page:#eef7fc;
  --shadow:0 12px 32px rgba(37,79,111,.10);
  --shadow-soft:0 6px 18px rgba(37,79,111,.07);
  --radius:16px;
}
html{background:var(--page)}
body{color:var(--ink);background:var(--page)}
.eyebrow{color:var(--brand-deep);letter-spacing:.09em}
.primary-button{background:var(--brand-deep);box-shadow:none;border:1px solid var(--brand-deep)}
.primary-button:hover{background:#215f8c;transform:none}
.primary-button:disabled{opacity:.55;cursor:not-allowed}
.secondary-button{background:#eaf4fa;color:#245f8a;border:1px solid #d3e6f2}
.secondary-button:hover{background:#ddecf6}
.text-link,.forgot-link{color:var(--brand-deep)}
input,select,textarea{border-color:var(--line);border-radius:10px;background:#fff}
input:focus,select:focus,textarea:focus{border-color:#73add4;box-shadow:0 0 0 3px rgba(79,155,209,.15)}
.alert,.landing-alert{border-radius:10px}
.auth-page{background:#eef7fc}
.auth-card{border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);backdrop-filter:none}

/* Shared accessible password visibility control. */
.password-input-shell{position:relative;display:block;width:100%;min-width:0}
.password-input-shell input{padding-right:50px!important}
.password-visibility-toggle{position:absolute;top:50%;right:7px;z-index:2;width:38px;height:38px;display:grid;place-items:center;transform:translateY(-50%);border:1px solid transparent;border-radius:9px;background:#eaf4fa;color:var(--brand-deep);cursor:pointer;padding:0;box-shadow:none}
.password-visibility-toggle:hover{background:#dcecf6;border-color:#c5deec}
.password-visibility-toggle:focus-visible{outline:3px solid rgba(79,155,209,.25);outline-offset:1px}
.password-visibility-toggle svg{width:20px;height:20px;fill:currentColor;pointer-events:none}
.password-visibility-toggle.is-visible{background:#dcecf6;color:#174f77}

/* Shared Google-style confirmation dialog. */
.global-confirm-open{overflow:hidden}
.global-confirm-backdrop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(18,35,52,.46);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.global-confirm-backdrop[hidden]{display:none}
.global-confirm-card{width:min(100%,460px);display:grid;grid-template-columns:auto 1fr;gap:15px 16px;padding:24px;border:1px solid rgba(255,255,255,.92);border-radius:20px;background:#fff;box-shadow:0 28px 80px rgba(20,43,62,.28)}
.global-confirm-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:#eaf4fa;color:var(--brand-deep);font-size:1.35rem;font-weight:950}
.global-confirm-copy h2{margin:1px 0 7px;color:var(--ink);font-size:1.25rem}
.global-confirm-copy p{margin:0;color:var(--muted);line-height:1.55}
.global-confirm-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;margin-top:5px}
.global-confirm-card[data-variant="warning"] .global-confirm-icon{background:#fff3d7;color:#8d6100}
.global-confirm-card[data-variant="danger"] .global-confirm-icon{background:#ffe8ec;color:#a32e42}
.global-confirm-card[data-variant="danger"] [data-global-confirm-accept]{background:#b34b59;border-color:#b34b59}
.global-confirm-card[data-variant="danger"] [data-global-confirm-accept]:hover{background:#9e3e4c}
.global-confirm-actions button:disabled{opacity:.62;cursor:wait;transform:none}
@media(max-width:560px){.global-confirm-backdrop{padding:12px;align-items:end}.global-confirm-card{grid-template-columns:1fr;padding:21px 18px;border-radius:20px 20px 14px 14px}.global-confirm-icon{width:40px;height:40px}.global-confirm-actions{grid-column:1;flex-direction:column-reverse}.global-confirm-actions button{width:100%}}

/* Shared record actions: the same compact 2-column placement in every module. */
.record-actions-heading{
  width:230px;
  min-width:230px;
  text-align:center;
}
.record-actions-cell{
  width:230px;
  min-width:230px;
  vertical-align:middle;
}
.record-action-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  width:100%;
  min-width:0;
}
.record-action-item,
.record-action-grid form{
  min-width:0;
  width:100%;
  margin:0;
}
.record-action-button,
.record-action-grid button,
.record-action-grid a{
  width:100%;
  min-width:0;
  min-height:36px;
  padding:8px 9px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  white-space:normal;
  line-height:1.15;
  font-size:.76rem;
  font-weight:850;
  text-decoration:none;
  box-shadow:none;
}
.record-action-view{
  color:#245f8a!important;
  background:#f8fcff!important;
  border:1px solid #cfe3ef!important;
}
.record-action-edit{
  color:#fff!important;
  background:var(--brand-deep)!important;
  border:1px solid var(--brand-deep)!important;
}
.record-action-secondary{
  color:#315a78!important;
  background:#edf5fa!important;
  border:1px solid #d2e5f0!important;
}
.record-action-success{
  color:#136640!important;
  background:#e8f8ef!important;
  border:1px solid #bde8d2!important;
}
.record-action-danger{
  color:#a0273c!important;
  background:#fff1f3!important;
  border:1px solid #f1c8cf!important;
}
.record-action-button:hover,
.record-action-grid button:hover,
.record-action-grid a:hover{
  transform:translateY(-1px);
  filter:brightness(.98);
}
.record-action-grid .muted-value{
  grid-column:1/-1;
  display:flex;
  min-height:36px;
  align-items:center;
  justify-content:center;
  padding:8px;
  border:1px dashed var(--line);
  border-radius:10px;
  text-align:center;
}

/* Shared modern read-only view. The same calm layout is used by every record module. */
.record-view-modal{
  width:min(880px,calc(100vw - 28px));
  max-height:calc(100dvh - 28px);
  padding:0;
  overflow:hidden;
  background:#fff;
}
.record-view-header{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:start;
  gap:18px;
  padding:24px 26px 21px;
  border-bottom:1px solid var(--line);
  background:#f8fbfd;
}
.record-view-heading{min-width:0;padding-right:22px}
.record-view-heading h2{margin:.08rem 0 .35rem;color:var(--brand-dark);font-size:clamp(1.3rem,2.4vw,1.72rem);line-height:1.2}
.record-view-heading>p{margin:0;color:var(--muted);font-size:.9rem;line-height:1.45}
.record-view-media{
  position:relative;
  width:94px;
  height:112px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid #cfe0ea;
  border-radius:14px;
  background:#eaf4fa;
  color:var(--brand-deep);
  font-size:1.35rem;
  font-weight:900;
  letter-spacing:.04em;
}
.record-view-media[hidden]{display:none}
.record-view-media img{width:100%;height:100%;object-fit:cover;display:block}
.record-view-media span{display:grid;place-items:center;width:100%;height:100%}
.record-view-status{
  align-self:start;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:6px 11px;
  border:1px solid #d4e3eb;
  border-radius:999px;
  background:#eef4f7;
  color:#536778;
  font-size:.72rem;
  font-weight:850;
  line-height:1;
  white-space:nowrap;
}
.record-view-status[hidden]{display:none}
.record-view-status.is-active,
.record-view-status.is-approved,
.record-view-status.is-completed,
.record-view-status.is-restored{background:#e8f7ef;border-color:#bfe3ce;color:#1d6846}
.record-view-status.is-pending,
.record-view-status.is-warning,
.record-view-status.is-for-review{background:#fff5dc;border-color:#ead7a3;color:#805b13}
.record-view-status.is-archived,
.record-view-status.is-rejected,
.record-view-status.is-inactive,
.record-view-status.is-revoked,
.record-view-status.is-absent{background:#fff0f2;border-color:#efc7ce;color:#9d3345}
.record-view-meta{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.record-view-meta[hidden]{display:none}
.record-view-meta>span{min-width:145px;padding:8px 10px;border:1px solid #d8e6ee;border-radius:10px;background:#fff}
.record-view-meta small,.record-view-meta strong{display:block}
.record-view-meta small{margin-bottom:2px;color:var(--muted);font-size:.65rem;font-weight:800;letter-spacing:.045em;text-transform:uppercase}
.record-view-meta strong{color:var(--ink);font-size:.8rem;line-height:1.3;overflow-wrap:anywhere}
.record-view-sections{
  max-height:calc(100dvh - 245px);
  overflow:auto;
  padding:20px 26px 8px;
  scrollbar-gutter:stable;
}
.record-view-section{padding:16px 17px;border:1px solid var(--line);border-radius:14px;background:#fff}
.record-view-section+.record-view-section{margin-top:14px}
.record-view-section-heading{margin-bottom:11px;padding-bottom:10px;border-bottom:1px solid #e5edf2}
.record-view-section-heading h3{margin:0;color:var(--brand-dark);font-size:.92rem;line-height:1.3}
.record-view-section-heading p{margin:4px 0 0;color:var(--muted);font-size:.78rem;line-height:1.45}
.record-view-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 20px;
  margin:0;
}
.record-view-item{
  min-width:0;
  padding:8px 0 9px;
  border-bottom:1px solid #edf2f5;
}
.record-view-item.is-wide{grid-column:1/-1}
.record-view-item dt{
  margin:0 0 4px;
  color:var(--muted);
  font-size:.68rem;
  font-weight:820;
  letter-spacing:.045em;
  text-transform:uppercase;
}
.record-view-item dd{
  margin:0;
  color:var(--ink);
  font-size:.9rem;
  font-weight:720;
  line-height:1.45;
  overflow-wrap:anywhere;
  white-space:pre-line;
}
.record-view-actions{margin:0;padding:14px 26px 18px;border-top:1px solid var(--line);background:#fff}

.auto-number-preview{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 12px;
  border:1px dashed #b9d4e5;
  border-radius:12px;
  background:#f4faff;
  color:#315a78;
  font-size:.82rem;
  font-weight:800;
}

@media(max-width:760px){
  .record-actions-heading,.record-actions-cell{width:200px;min-width:200px}
  .record-action-grid{gap:6px}
  .record-action-button,.record-action-grid button,.record-action-grid a{font-size:.72rem;padding:8px 7px}
  .record-view-header{grid-template-columns:auto minmax(0,1fr);gap:13px;padding:20px 18px 17px}
  .record-view-heading{padding-right:0}
  .record-view-status{grid-column:1/-1;justify-self:start}
  .record-view-media{width:76px;height:88px;border-radius:12px}
  .record-view-meta>span{min-width:min(100%,140px);flex:1}
  .record-view-sections{max-height:calc(100dvh - 250px);padding:15px 15px 6px}
  .record-view-section{padding:14px}
  .record-view-grid{grid-template-columns:1fr}
  .record-view-item.is-wide{grid-column:auto}
  .record-view-actions{padding:12px 15px 15px}
  .record-view-actions .secondary-button{width:100%}
}
.record-action-grid>.record-action-item:last-child:nth-child(odd):not(:only-child){grid-column:1/-1}

/* Audit details use the same read-only record language without a staff photo. */
.audit-record-view-header{grid-template-columns:minmax(0,1fr) auto}
.audit-record-view-header .record-view-heading{padding-right:22px}
.audit-record-view .audit-json{margin:0;max-height:270px;border-radius:10px;font-size:.76rem;line-height:1.5}
@media(max-width:760px){
  .audit-record-view-header{grid-template-columns:minmax(0,1fr)}
  .audit-record-view-header .record-view-heading{padding-right:0}
}

/* Password-reset OTP flow. */
.otp-reset-card{width:min(100%,560px)}
.otp-destination{margin-bottom:6px}
.otp-code-input{text-align:center;font-size:1.55rem;font-weight:900;letter-spacing:.48em;padding-left:calc(12px + .48em);font-variant-numeric:tabular-nums}
.otp-code-input::placeholder{letter-spacing:.35em;color:#9eb0bf}
.otp-security-note{margin:4px 0 18px;padding:13px 14px;border:1px solid #cfe2ee;border-radius:13px;background:#f2f8fc;color:#49677d;font-size:.84rem;line-height:1.5}
.otp-security-note strong{color:var(--brand-deep)}
.password-requirements{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px;padding:13px 14px;border:1px solid var(--line);border-radius:13px;background:#f8fbfd;color:var(--muted);font-size:.8rem}
.password-requirements strong{grid-column:1/-1;color:var(--ink)}
.password-requirements span::before{content:'✓';margin-right:7px;color:#178157;font-weight:900}
.otp-resend-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:2px 0 20px;padding-top:17px;border-top:1px solid var(--line);color:var(--muted);font-size:.86rem}
.otp-resend-form{display:block!important;margin:0!important}
.otp-resend-button{min-width:165px;padding:10px 13px;font-size:.82rem}
.otp-resend-button:disabled{cursor:not-allowed;opacity:.65;transform:none}
@media(max-width:560px){.password-requirements{grid-template-columns:1fr}.otp-resend-row{align-items:stretch;flex-direction:column}.otp-resend-button{width:100%}.otp-code-input{font-size:1.35rem;letter-spacing:.34em}}

/* USB keyboard-wedge scanner guidance (connection detection is not implied). */
.scanner-usb-help{grid-column:1/-1;display:block;color:#526b7e;font-size:.82rem;line-height:1.55}

/* Guard and non-adviser accounts have no section assignment controls.
   The global label {display:flex} rule must not override the hidden attribute. */
[data-staff-section-field][hidden],
[data-staff-additional-sections][hidden],
[data-staff-edit-section-field][hidden],
[data-staff-edit-additional-sections][hidden],
[data-staff-account-help][hidden] { display:none!important; }
