/* RHS Bureau — Royal High School Nyom
   One design system. No stacked patches. */

:root {
  --navy: #0B1B4D;
  --navy-2: #16306F;
  --ink: #141A2E;
  --gold: #D9E5F2;
  --gold-2: #F3F7FC;
  --gold-deep: #60758F;
  --cream: #F4F7FB;
  --paper: #FBFDFF;
  --card: #FFFFFF;
  --line: #E2E9F2;
  --line-strong: #C9D5E4;
  --muted: #68778B;
  --soft: #F0F5FA;
  --fr: #1A3A8C;
  --en: #60758F;
  --ok: #1B7A4E;
  --ok-bg: #E8F6EF;
  --warn: #536B88;
  --warn-bg: #EAF0F7;
  --bad: #A33B32;
  --bad-bg: #FBECEA;
  --info: #1A3A8C;
  --info-bg: #EEF2FB;
  --shadow: 0 1px 0 rgba(20, 26, 46, .04), 0 14px 36px rgba(11, 27, 77, .06);
  --shadow-lg: 0 24px 60px rgba(11, 27, 77, .16);
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sidebar: 272px;
  --top: 72px;
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #F4F8FF;
  --cream: #070E22;
  --paper: #0B1530;
  --card: #111D3B;
  --line: #2B3B61;
  --line-strong: #405579;
  --muted: #BBC9DE;
  --soft: #172448;
  --gold: #E1EBF7;
  --gold-2: #F5F9FF;
  --gold-deep: #B7C9E0;
  --fr: #C6D9F4;
  --en: #C6D9F4;
  --ok: #72D9A9;
  --ok-bg: #123528;
  --warn: #C4D2E4;
  --warn-bg: #263A58;
  --bad: #F0A6A1;
  --bad-bg: #3C1E1C;
  --info: #C6D9F4;
  --info-bg: #1A2A55;
  --shadow: 0 12px 32px rgba(0, 0, 0, .32), 0 0 0 1px rgba(213, 229, 248, .025);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .48);
  color-scheme: dark;
}
[data-theme="dark"] a { color: #D4E3F6; }
[data-theme="dark"] .crumb h1,
[data-theme="dark"] .page-head h2,
[data-theme="dark"] .card h3,
[data-theme="dark"] .class-card h3,
[data-theme="dark"] .modal-head h2,
[data-theme="dark"] .drawer-head h2 {
  color: #F6FAFF;
  text-shadow: 0 0 20px rgba(198, 217, 244, .16);
}
[data-theme="dark"] .kpi .value { color: #F4F8FF; }
[data-theme="dark"] .nav-btn.on { color: #F4F8FF; }
[data-theme="dark"] .role-card.on {
  background: linear-gradient(145deg, #1B2B4D, #15213D);
  border-color: #9FB5D2;
}
[data-theme="dark"] .btn.ghost:hover {
  border-color: #8FA8C8;
  box-shadow: 0 0 0 3px rgba(192, 212, 239, .08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--sans);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 560; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--fr); }
::selection { background: #DCE8F5; color: #15213A; }

.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.02em; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

/* ---------- Login ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(420px, .95fr);
  background: var(--cream);
}
.login-hero {
  position: relative;
  overflow: hidden;
  color: #F6FAFF;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(219, 233, 249, .18), transparent 42%),
    radial-gradient(ellipse at 80% 90%, rgba(36, 78, 168, .35), transparent 46%),
    linear-gradient(165deg, #07122C 0%, #0B1B4D 52%, #10275F 100%);
  padding: 36px 44px 28px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.rings {
  position: absolute;
  inset: auto auto -18% -28%;
  width: 78vmin;
  height: 78vmin;
  border-radius: 50%;
  border: 1px solid rgba(226, 238, 252, .30);
  box-shadow:
    0 0 0 28px rgba(226, 238, 252, .055),
    0 0 0 64px rgba(226, 238, 252, .04),
    0 0 0 108px rgba(226, 238, 252, .025);
  pointer-events: none;
}
.login-kicker {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 650;
}
.login-brand {
  position: relative;
  margin: auto 0;
  max-width: 460px;
  padding: 12px 0 28px;
}
.crest-plate {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: #fff;
  padding: 7px;
  box-shadow: 0 0 0 1px rgba(238, 245, 253, .88), 0 0 0 10px rgba(226, 238, 252, .09), 0 18px 40px rgba(0, 0, 0, .28);
}
.crest-plate img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.login-brand h1 {
  margin-top: 22px;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  font-weight: 560;
  color: #fff;
  letter-spacing: -.03em;
}
.login-brand h1 span { display: block; color: var(--gold-2); font-size: .62em; font-style: italic; font-weight: 500; margin-top: 2px; }
.login-brand .motto {
  margin-top: 18px;
  color: #D5DCF0;
  font-size: 15px;
  max-width: 38ch;
}
.login-foot {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  color: #B7C3E4;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-foot b { color: #fff; font-weight: 650; letter-spacing: .12em; }
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 48px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), transparent 120px),
    var(--cream);
}
[data-theme="dark"] .login-panel { background: var(--cream); }
.login-panel-inner { width: min(100%, 520px); margin: 0 auto; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
[data-theme="dark"] .eyebrow { color: var(--gold-2); }
.login-panel h2 { font-size: 2rem; margin: 8px 0 6px; }
.lede { color: var(--muted); font-size: 14.5px; max-width: 62ch; }
.role-groups { margin-top: 22px; display: grid; gap: 14px; }
.role-group h3 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  min-height: 64px;
  color: var(--ink);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.role-card b { font-size: 14px; font-weight: 680; }
.role-card small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.role-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.role-card.on {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 8px 20px rgba(73, 99, 132, .10);
  background: linear-gradient(180deg, #fff, #F4F8FC);
}
[data-theme="dark"] .role-card.on { background: #1A2748; }
.login-form { margin-top: 16px; display: grid; gap: 10px; }
.cred-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-submit { width: 100%; min-height: 48px; margin-top: 4px; }
.login-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.err {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 650;
}

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background:
    linear-gradient(180deg, rgba(230, 239, 250, .10), transparent 180px),
    linear-gradient(180deg, #0C1A40, #08122E);
  color: #E7ECF8;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid rgba(219, 232, 248, .25);
  z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 14px; }
.brand img {
  width: 52px; height: 52px; border-radius: 50%; background: #fff; object-fit: contain;
  box-shadow: 0 0 0 1px rgba(232, 241, 251, .8), 0 8px 18px rgba(0,0,0,.25);
}
.brand-kicker { font-size: 10px; letter-spacing: .18em; color: var(--gold-2); font-weight: 750; }
.brand-name { font-family: var(--serif); font-size: 15px; line-height: 1.15; color: #fff; }
.brand-place { font-family: var(--serif); font-style: italic; color: var(--gold-2); font-size: 14px; }
.year-select, .side-select {
  width: 100%;
  margin: 0 0 8px;
  background: rgba(255,255,255,.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  min-height: 38px;
  padding: 0 10px;
}
.side-nav { overflow: auto; padding: 6px 2px 12px; flex: 1; }
.side-nav::-webkit-scrollbar { width: 8px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group p {
  margin: 0 8px 6px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(226, 238, 252, .78);
  font-weight: 750;
}
.nav-btn, .side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #C9D3EE;
  font-weight: 560;
  font-size: 14px;
  text-align: left;
}
.nav-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-btn.on {
  background: rgba(255,255,255,.08);
  color: #F2F7FD;
  box-shadow: inset 2px 0 0 #D8E6F5;
  font-weight: 700;
}
.nav-btn .badge, .pill .count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #D8E4F1;
  color: #1A1408;
  font-size: 11px;
  font-weight: 750;
  display: grid;
  place-items: center;
}
.who {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 750; font-size: 13px; color: #1A1408;
  background: linear-gradient(145deg, #F7FAFE, #BCCBDD);
  flex: none;
}
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.who b { display: block; color: #fff; font-size: 13.5px; line-height: 1.2; }
.who small { color: #B7C3E2; font-size: 12px; }
.who button {
  margin-left: auto;
  width: 34px; height: 34px; min-height: 0; padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: transparent;
  color: #fff;
}

.workspace { min-width: 0; display: flex; flex-direction: column; position: relative; }
.workspace::before {
  content: "";
  position: fixed;
  left: calc(50% + 136px);
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(72vw, 900px);
  aspect-ratio: 1;
  background: url("/assets/logo.jpg") center / contain no-repeat;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .workspace::before {
  opacity: 1;
  background-image: url("/assets/logo.jpg"), radial-gradient(circle, rgba(231, 241, 253, .84) 0%, rgba(221, 235, 251, .58) 48%, rgba(221, 235, 251, .12) 69%, transparent 78%);
  background-position: center, center;
  background-size: contain, 100% 100%;
  background-repeat: no-repeat, no-repeat;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--top);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 28px;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.crumb { min-width: 0; flex: 1; }
.crumb .eyebrow { margin-bottom: 2px; }
.crumb h1 { font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 12px;
}
.seg button {
  border: 0; background: transparent; color: var(--muted);
  min-height: 32px; padding: 0 10px; border-radius: 9px; font-weight: 650; font-size: 13px;
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,46,.08); }
.icon-btn {
  width: 40px; height: 40px; min-height: 0; padding: 0;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: grid; place-items: center; position: relative;
}
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--card);
}
.search-btn {
  display: flex; align-items: center; gap: 8px;
  min-width: 220px; height: 40px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-weight: 550;
}
.search-btn kbd {
  margin-left: auto; font-family: var(--sans); font-size: 11px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 5px; color: var(--muted);
}

.view { position: relative; z-index: 1; padding: 26px 28px 72px; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.7rem; }
.page-head .lede { margin-top: 6px; }

.archive-banner, .intro-banner {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--warn-bg); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-radius: 14px; padding: 10px 12px; margin-bottom: 16px; font-size: 14px;
}
.intro-banner { background: var(--info-bg); border-color: color-mix(in srgb, var(--fr) 25%, var(--line)); }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; }
.stack { display: grid; gap: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card h3 { font-size: 1.15rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 1.12rem; }
.card-head .eyebrow { margin-bottom: 0; }

.kpi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 13px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px;
  background: var(--gold);
}
.kpi.bad::before { background: var(--bad); }
.kpi.ok::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.kpi .value { font-family: var(--serif); font-size: 1.85rem; margin-top: 6px; line-height: 1; }
.kpi .sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.office {
  text-align: left;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  gap: 6px;
  min-height: 112px;
}
.office:hover { border-color: var(--gold); }
.office .ico { color: var(--gold-deep); }
[data-theme="dark"] .office .ico { color: var(--gold-2); }
.office b { font-size: 15px; }
.office span { color: var(--muted); font-size: 13px; }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; padding-top: 0; }
.task button.linkish { margin-left: auto; }
.dot-p { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--gold); }
.dot-p.bad { background: var(--bad); }
.dot-p.warn { background: var(--warn); }
.dot-p.ok { background: var(--ok); }

.pill, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  background: var(--soft); color: var(--ink); border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.fr, .pill.fr { color: var(--fr); background: var(--info-bg); border-color: transparent; }
.tag.en, .pill.en { color: var(--gold-deep); background: var(--soft); border-color: transparent; }
[data-theme="dark"] .tag.en, [data-theme="dark"] .pill.en { color: var(--gold-2); }
.tag.ok, .pill.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.tag.bad, .pill.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.tag.warn, .pill.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.mark {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: currentColor;
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1 1 220px; }
.field { display: grid; gap: 6px; }
.field > span, .lbl {
  font-size: 12px; font-weight: 730; color: var(--muted); letter-spacing: .02em;
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 80%, white);
  outline-offset: 1px;
  border-color: var(--gold-deep);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  font-weight: 680; font-size: 14px; letter-spacing: -.01em;
}
.btn:hover { background: var(--navy-2); }
.btn.gold { background: linear-gradient(135deg, #FAFCFF, #D6E2F0); border-color: #B8C8DC; color: #14213A; box-shadow: inset 0 1px 0 rgba(255,255,255,.82); }
.btn.gold:hover { background: linear-gradient(135deg, #FFFFFF, #E8F0F8); border-color: #A9BCD4; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.linkish, button.linkish {
  border: 0; background: transparent; color: var(--fr); font-weight: 700; padding: 0; min-height: 0;
}
[data-theme="dark"] button.linkish, [data-theme="dark"] .btn.linkish { color: var(--gold-2); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  font-weight: 750; background: var(--soft); position: sticky; top: 0;
}
tr:last-child td { border-bottom: 0; }
tbody tr.click:hover td { background: color-mix(in srgb, var(--gold) 10%, transparent); cursor: pointer; }
td.right, th.right { text-align: right; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 700; }
.person small { color: var(--muted); }

.bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; min-width: 72px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--navy), var(--gold)); }
.bar.bad i { background: var(--bad); }
.bar.warn i { background: var(--warn); }
.bar.ok i { background: var(--ok); }

.heat { font-variant-numeric: tabular-nums; font-weight: 730; font-size: 13px; }
.heat.low { color: var(--bad); }
.heat.mid { color: var(--warn); }
.heat.good { color: var(--ok); }
.heat.high { color: var(--gold-deep); }
[data-theme="dark"] .heat.high { color: var(--gold-2); }

/* class cards */
.sec-block { margin-top: 8px; }
.sec-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 18px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.class-card {
  text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; color: var(--ink); box-shadow: var(--shadow);
  display: grid; gap: 8px;
}
.class-card:hover { border-color: var(--gold); }
.class-card .top { display: flex; justify-content: space-between; align-items: center; }
.class-card h3 { font-size: 1.35rem; }
.class-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }

/* timetable */
.tt { width: 100%; border-collapse: separate; border-spacing: 0; }
.tt th, .tt td { border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.tt th { background: var(--soft); }
.tt td.today, .tt th.today { background: color-mix(in srgb, var(--gold) 16%, var(--card)); }
.tt .brk td { background: var(--soft); text-align: center; color: var(--muted); letter-spacing: .12em; font-size: 11px; text-transform: uppercase; font-weight: 750; }
.slot b { display: block; font-size: 13px; }
.slot small { color: var(--muted); }

/* bulletin paper */
.paper {
  background: #FCFDFF;
  color: #1A1408;
  border: 1px solid #DCE5EF;
  border-radius: 8px;
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-lg);
  max-width: 860px;
  margin: 0 auto;
}
[data-theme="dark"] .paper { background: #FBFDFF; }
.paper-head { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; align-items: center; border-bottom: 2px solid #0B1B4D; padding-bottom: 12px; }
.paper-head img { width: 78px; height: 78px; object-fit: contain; }
.paper-head h2 { font-size: 1.35rem; color: #0B1B4D; }
.paper-head .school-sub { letter-spacing: .14em; font-size: 11px; font-weight: 750; color: #60758F; text-transform: uppercase; }
.paper-title { text-align: center; margin: 16px 0 12px; }
.paper-title h3 { font-size: 1.25rem; letter-spacing: .04em; color: #0B1B4D; }
.meta-line { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 14px; margin-bottom: 12px; }
.paper table { color: #1A1408; }
.paper th { background: #EEF3F8; color: #50627A; }
.paper td, .paper th { border-bottom: 1px solid #DFE7F0; }
.sign-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 22px; font-size: 12.5px; color: #3E4A6B; }
.sign-row div { border-top: 1px solid #CBD7E5; padding-top: 8px; min-height: 64px; }
.avg-band {
  display: flex; justify-content: space-between; gap: 12px; align-items: end;
  margin-top: 12px; padding: 10px 12px; background: #EDF3F9; border-radius: 8px;
}
.avg-band strong { font-family: var(--serif); font-size: 1.8rem; color: #0B1B4D; }

/* drawer + modal + palette */
.backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 14, 32, .46);
  display: flex; justify-content: flex-end;
}
.backdrop.center { justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
.drawer {
  width: min(560px, 100%);
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slide .28s var(--ease);
}
.modal {
  width: min(560px, 100%);
  background: var(--paper);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  max-height: min(84dvh, 760px);
  overflow: auto;
  animation: pop .22s var(--ease);
}
.palette {
  width: min(680px, 100%);
  background: var(--paper);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .18s var(--ease);
}
@keyframes slide { from { transform: translateX(16px); opacity: .6; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.drawer-head, .modal-head {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 18px 18px 12px; border-bottom: 1px solid var(--line);
}
.drawer-body, .modal-body { padding: 16px 18px 22px; overflow: auto; }
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); overflow: auto; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  min-height: 40px; padding: 0 10px; font-weight: 700; font-size: 13.5px;
  border-bottom: 2px solid transparent; border-radius: 0;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--gold); }
.pal-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  min-height: 56px; padding: 0 18px; background: transparent; font-size: 16px;
}
.pal-input:focus { outline: none; }
.pal-list { max-height: 420px; overflow: auto; padding: 8px; }
.pal-item, .list-btn {
  width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink);
  border-radius: 12px; min-height: 46px; padding: 8px 10px;
  display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.pal-item:hover, .list-btn:hover, .pal-item.on { background: var(--soft); }
.pal-item small, .list-btn small { margin-left: auto; color: var(--muted); font-weight: 550; }
.pal-label { padding: 8px 10px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 750; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); font-size: 14px;
}
.split { display: grid; grid-template-columns: 280px 1fr; gap: 12px; min-height: 460px; }
.thread-list { display: grid; align-content: start; gap: 6px; }
.thread {
  text-align: left; width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: 14px; padding: 10px 12px; color: var(--ink);
}
.thread.on { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.thread b { display: block; }
.thread small { color: var(--muted); }

.chat { display: flex; flex-direction: column; gap: 10px; min-height: 280px; }
.bubble { max-width: 72ch; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; }
.bubble.user { margin-left: auto; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.bubble.aura { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: 99px; min-height: 34px; padding: 0 12px; font-size: 13px; font-weight: 650;
}
.chip:hover { border-color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 80; background: var(--navy); color: #fff;
  border-left: 3px solid var(--gold);
  padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-weight: 650; font-size: 14px; max-width: min(92vw, 480px);
}
.bottom-nav { display: none; }
.backdrop-side { position: fixed; inset: 0; background: rgba(8,14,32,.45); z-index: 25; }

.empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.form-grid { display: grid; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-row div { min-width: 90px; }
.stat-row b { display: block; font-family: var(--serif); font-size: 1.3rem; }
.stat-row span { color: var(--muted); font-size: 12px; }

.att-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.att-seg button {
  border: 0; background: transparent; color: var(--muted); min-height: 32px; padding: 0 8px; font-size: 12px; font-weight: 750;
}
.att-seg button.on.present { background: var(--ok); color: #fff; }
.att-seg button.on.late { background: var(--warn); color: #fff; }
.att-seg button.on.absent { background: var(--bad); color: #fff; }

.coef input { width: 72px; min-height: 36px; }

/* One chevron per dropdown. No SVG background on <select>: some Android browsers tile it. */
select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  padding-right: 42px;
  min-height: 46px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
select::-ms-expand { display: none; }
label.field:has(> select) { position: relative; }
label.field:has(> select)::after {
  content: ''; position: absolute; right: 17px; bottom: 19px;
  width: 9px; height: 9px;
  border-right: 2px solid #506A8C; border-bottom: 2px solid #506A8C;
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.sidebar label.field:has(> select)::after { border-color: #E8F1FF; }
select:hover:not(:disabled) { border-color: #829BBA; box-shadow: 0 3px 12px rgba(11,27,77,.07); }
select:focus-visible { outline: 2px solid #8AA9D3; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(50,91,153,.12); }
select:disabled { opacity: .56; cursor: not-allowed; }
select option { color: #172548; background: #fff; }
.year-select, .side-select {
  min-height: 46px;
  padding: 9px 44px 9px 14px;
  border-radius: 12px;
  border-color: rgba(220,234,251,.27);
  background-color: rgba(255,255,255,.10);
  background-image: none !important;
}
.year-select:hover, .side-select:hover { background-color: rgba(255,255,255,.16); border-color: rgba(220,234,251,.55); }
.year-select:focus-visible, .side-select:focus-visible { outline-color: #D7E7FA; }
[data-theme="dark"] select:not(.year-select):not(.side-select) { background-color: var(--paper); color: var(--ink); }

/* A real, role-aware navigation dropdown in the top bar. */
.quick-menu { position: relative; flex: none; }
.quick-menu > summary {
  list-style: none; display: flex; gap: 8px; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--card); color: var(--ink); font-size: 13px; font-weight: 700;
  cursor: pointer; user-select: none; transition: background .18s, border-color .18s;
}
.quick-menu > summary::-webkit-details-marker { display: none; }
.quick-menu > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 3px; transition: transform .18s; }
.quick-menu[open] > summary::after { transform: rotate(225deg) translate(-2px,-2px); }
.quick-menu > summary:hover, .quick-menu[open] > summary { background: var(--soft); border-color: var(--gold-deep); }
.quick-menu > summary:focus-visible { outline: 2px solid #8AA9D3; outline-offset: 2px; }
.quick-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(290px, calc(100vw - 24px));
  max-height: min(70vh, 530px); overflow-y: auto; z-index: 45;
  padding: 9px; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg);
}
.quick-menu-label { padding: 10px 10px 5px; color: var(--muted); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 800; }
.quick-menu-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; min-height: 40px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 13px; font-weight: 650; }
.quick-menu-item:hover, .quick-menu-item:focus-visible { background: var(--soft); outline: none; }
.quick-menu-item.on { color: var(--fr); background: var(--info-bg); }
.quick-menu-item span { flex: 1; }
@media (max-width: 1100px) { .quick-menu > summary .quick-menu-text { display: none; } }
@media (max-width: 600px) { .quick-menu { display: none; } }

/* Payment receipt: screen presentation and the actual printed document. */
.modal:has(.receipt) { width: min(720px, 100%); }
.receipt {
  --receipt-ink: #10234D;
  position: relative; overflow: hidden;
  background: #fff; color: #20304A;
  border: 1px solid #CFD9E7; border-radius: 18px;
  box-shadow: 0 12px 36px rgba(11,27,77,.10);
  font-size: 13.5px;
}
.receipt::before { content: ''; display: block; height: 6px; background: linear-gradient(90deg, #0B1B4D, #3D639C 65%, #BDD0E7); }
.receipt-inner { padding: 26px 32px 22px; }
.receipt-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid #DEE6F0; }
.receipt-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.receipt-brand img { width: 68px; height: 68px; object-fit: contain; flex: none; }
.receipt-kicker { color: #596E8B; font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: .15em; }
.receipt-brand h2 { color: var(--receipt-ink); font-size: clamp(1.15rem, 3vw, 1.48rem); margin: 3px 0 2px; }
.receipt-brand small { color: #667790; font-size: 12px; }
.receipt-stamp { padding: 7px 11px; border: 1px solid #C9D9E9; border-radius: 99px; background: #EFF5FB; color: #244674; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; white-space: nowrap; }
.receipt-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 22px 0 20px; }
.receipt-title .receipt-kicker { display: block; margin-bottom: 5px; }
.receipt-title h3 { font-size: clamp(1.55rem, 4vw, 2rem); color: var(--receipt-ink); letter-spacing: -.03em; }
.receipt-ref { text-align: right; color: #61728A; font-size: 12px; }
.receipt-ref b { display: block; color: var(--receipt-ink); font-family: var(--mono); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.receipt-amount { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid #CDDCF0; border-radius: 14px; background: #EFF5FC; }
.receipt-amount span { color: #445D7E; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.receipt-amount strong { color: #0B1B4D; font-family: var(--serif); font-size: clamp(1.55rem, 5vw, 2.25rem); line-height: 1.1; white-space: nowrap; }
.receipt-section-title { margin: 22px 0 10px; font: 800 10px var(--sans); letter-spacing: .13em; color: #61738D; text-transform: uppercase; }
.receipt-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; border-top: 1px solid #E2E9F2; }
.receipt-detail { display: grid; gap: 3px; align-content: start; padding: 11px 0; border-bottom: 1px solid #E2E9F2; min-width: 0; }
.receipt-detail span { color: #697A90; font-size: 11px; }
.receipt-detail b { color: #213453; font-weight: 700; overflow-wrap: anywhere; }
.receipt-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.receipt-summary div { padding: 12px 14px; border-radius: 11px; background: #F5F8FC; border: 1px solid #E2E9F2; }
.receipt-summary span { display: block; color: #61738D; font-size: 11px; margin-bottom: 4px; }
.receipt-summary b { color: var(--receipt-ink); font-size: 15px; }
.receipt-sign { display: flex; justify-content: flex-end; margin: 34px 0 18px; }
.receipt-sign div { min-width: 225px; padding-top: 10px; border-top: 1px solid #90A5C0; color: #526780; font-size: 11px; text-align: center; }
.receipt-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid #DEE6F0; padding-top: 12px; font-size: 10px; color: #657890; }
.receipt-foot strong { color: #3A5B87; letter-spacing: .08em; }
@media (max-width: 600px) {
  .receipt-inner { padding: 18px 17px; }
  .receipt-top { align-items: flex-start; }
  .receipt-brand img { width: 50px; height: 50px; }
  .receipt-stamp { font-size: 9px; padding: 6px 8px; }
  .receipt-title { flex-direction: column; gap: 8px; }
  .receipt-ref { text-align: left; }
  .receipt-amount { align-items: flex-start; flex-direction: column; gap: 5px; }
  .receipt-details { grid-template-columns: 1fr; }
  .receipt-summary { gap: 8px; }
  .receipt-summary b { font-size: 13px; }
}

hr.fade { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2, .split { grid-template-columns: 1fr; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { min-width: 40px; width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-105%);
    transition: transform .25s var(--ease); width: min(86vw, 320px);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 14px; }
  .view { padding: 16px 14px 96px; }
  .workspace::before { left: 50%; top: 50%; width: min(112vw, 560px); opacity: 1; }
  [data-theme="dark"] .workspace::before { opacity: 1; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 24;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottom-nav button {
    flex: 1; border: 0; background: transparent; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; font-weight: 730; min-height: 50px; border-radius: 10px;
  }
  .bottom-nav button.on { color: var(--navy); }
  [data-theme="dark"] .bottom-nav button.on { color: var(--gold-2); }
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: auto; padding: 22px 20px 18px; }
  .login-brand { margin: 12px 0; }
  .login-brand h1 { font-size: 2.1rem; }
  .crest-plate { width: 92px; height: 92px; }
  .rings { display: none; }
  .login-panel { padding: 22px 16px 32px; }
  .login-foot { display: none; }
  .cred-row, .role-grid, .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .paper { padding: 16px; }
  .paper-head { grid-template-columns: 56px 1fr; }
  .paper-head .hide-sm { display: none; }
  .toast { bottom: 78px; }
}
@page { size: A4; margin: 14mm; }
@media print {
  html, body { height: auto; background: #fff !important; }
  body * { visibility: hidden; }
  #print-root, #print-root * { visibility: visible; }
  .shell, .workspace { display: block !important; position: static !important; width: 100% !important; }
  .backdrop, .backdrop.center, .modal, .modal-body { position: static !important; display: block !important; width: 100% !important; max-height: none !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; animation: none !important; }
  #print-root { position: absolute; left: 0; top: 0; width: 100%; }
  .paper, .receipt { box-shadow: none; border-color: #C9D5E4; break-inside: avoid; }
  .receipt { border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .receipt-inner { padding: 24px 28px; }
  .receipt-details { grid-template-columns: 1fr 1fr; }
  .receipt-amount { flex-direction: row; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* Aura · visual prototype (no external service required). */
.aura-launch { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); padding: 5px; }
.aura-launch:hover { border-color: #879AD3; box-shadow: 0 2px 14px rgba(105,104,206,.22); }
.aura-launch:focus-visible { outline: 2px solid #8AA9D3; outline-offset: 2px; }
.aura-mark { display: block; flex: none; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(141,215,250,.55), 0 0 14px rgba(93,99,245,.4); }
.aura-mark.sm { width: 21px; height: 21px; }
.aura-mark.chat-mark { width: 29px; height: 29px; margin-top: 2px; }
.aura-hero { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,42%); min-height: 268px; border-radius: 22px; overflow: hidden; color: #fff; background: #050C23; box-shadow: 0 16px 38px rgba(9,17,48,.16); margin-bottom: 16px; }
.aura-hero-copy { position: relative; z-index: 1; padding: 35px 16px 32px 35px; align-self: center; }
.aura-hero-copy .eyebrow { color: #AAD9FF; }
.aura-hero h3 { color: #fff; font-size: clamp(1.7rem,3vw,2.3rem); margin: 8px 0 9px; }
.aura-hero p { max-width: 43ch; color: #CFD9F0; line-height: 1.6; font-size: 14px; }
.aura-hero-tag { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; padding: 6px 11px; border-radius: 99px; border: 1px solid rgba(171,209,251,.24); background: rgba(177,207,255,.09); color: #DCEAFF; font-size: 11px; font-weight: 700; }
.aura-hero-tag i { width: 6px; height: 6px; border-radius: 50%; background: #87DAFA; box-shadow: 0 0 8px #5EBDFF; }
.aura-visual { min-width: 0; position: relative; overflow: hidden; }
.aura-visual::before { content: ''; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg,#050C23 0%,rgba(5,12,35,.05) 37%,transparent 75%); }
.aura-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center 53%; }
.aura-chat-card { border-radius: 18px; }
.aura-conversation { max-height: min(45vh,490px); min-height: 170px; overflow: auto; padding: 4px 4px 8px; }
.aura-bubble-head { display: flex; align-items: flex-start; gap: 10px; }
.aura-bubble-head .bubble { flex: 1; white-space: pre-line; }
.aura-disclaimer { font-size: 12px; line-height: 1.6; }
@media (max-width: 680px) {
  .aura-hero { display: flex; flex-direction: column; }
  .aura-visual { order: -1; height: 190px; }
  .aura-visual::before { background: linear-gradient(0deg,#050C23 0%,transparent 40%); }
  .aura-hero-copy { padding: 0 22px 24px; align-self: stretch; }
  .aura-hero h3 { margin-top: 5px; }
  .aura-hero-tag { margin-top: 14px; }
}
@media (max-width: 400px) { .top-actions .seg, .top-actions .search-btn { display: none; } }


/* Compact chat composer: attach files and ask a question in the same message. */
.aura-chat-card { overflow: hidden; }
.aura-conversation { max-height: min(55vh,540px); }
.aura-message { display: flex; flex-direction: column; align-items: flex-end; }
.aura-message .bubble.user { max-width: min(84%,650px); }
.aura-sent-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 6px 0 10px; max-width: 90%; }
.aura-sent-files .aura-file-chip { background: var(--card); }
.aura-composer { border: 1px solid var(--line-strong); border-radius: 18px; padding: 10px; background: var(--paper); box-shadow: 0 3px 12px rgba(11,27,77,.05); transition: border-color .18s, box-shadow .18s; }
.aura-composer:focus-within, .aura-composer.is-dragging { border-color: #7596D1; box-shadow: 0 0 0 3px rgba(92,133,208,.10); }
.aura-composer.is-dragging { border-style: dashed; }
.aura-composer-files { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 2px 9px; }
.aura-file-chip { display: inline-flex; align-items: center; gap: 7px; max-width: min(100%,300px); min-height: 35px; padding: 4px 6px 4px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--soft); font-size: 12px; }
.aura-file-chip .ico { width: 15px; height: 15px; color: var(--fr); }
.aura-file-chip .aura-file-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 185px; }
.aura-file-chip small { color: var(--muted); flex: none; font-size: 10px; }
.aura-file-chip .aura-file-remove { border: none; border-radius: 7px; display: grid; place-items: center; width: 23px; height: 23px; flex: none; padding: 0; background: transparent; color: var(--muted); }
.aura-file-chip .aura-file-remove:hover { background: var(--line); color: var(--ink); }
.aura-file-chip .aura-file-open { display: flex; align-items: center; gap: 5px; max-width: 100%; border: none; background: none; color: inherit; padding: 0; text-align: left; font-size: inherit; }
.aura-file-chip button:focus-visible { outline: 2px solid #7398CE; outline-offset: 2px; }
.aura-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.aura-attach, .aura-send { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border-radius: 12px; }
.aura-attach { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); }
.aura-attach:hover { background: var(--soft); border-color: #8DA8D1; }
.aura-send { border: 1px solid #0B1B4D; background: #0B1B4D; color: white; }
.aura-send:hover { background: #16306F; }
.aura-attach:focus-visible, .aura-send:focus-visible { outline: 2px solid #7398CE; outline-offset: 2px; }
.aura-composer textarea { display: block; flex: 1; min-width: 0; width: 100%; min-height: 40px; max-height: 160px; resize: vertical; padding: 8px 4px; border: 0; border-radius: 0; background: transparent; line-height: 1.45; font-size: 14px; }
.aura-composer textarea:focus { border: 0; outline: 0; }
.aura-composer-hint { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; margin: 8px 2px 1px; color: var(--muted); font-size: 11px; }
.aura-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.aura-attachment-preview { display: grid; place-items: center; max-height: 65vh; overflow: auto; border-radius: 12px; background: #0C1631; }
.aura-attachment-preview img { display: block; max-width: 100%; max-height: 64vh; object-fit: contain; }
.aura-attachment-preview iframe { display: block; width: 100%; height: 58vh; border: 0; background: white; }
@media (max-width: 500px) { .aura-sent-files { max-width: 100%; } .aura-message .bubble.user { max-width: 95%; } .aura-composer { padding: 8px; } .aura-composer-hint span:last-child { display: none; } }
/* bulletin : modèle officiel */
.paper.rc { max-width: 1000px; padding: 16px 16px 12px; font-size: 12px; }
.rc-head { display: grid; grid-template-columns: 1fr 84px 1fr; gap: 10px; align-items: center; text-align: center; font-size: 10px; font-weight: 700; line-height: 1.4; text-transform: uppercase; }
.rc-head img { width: 84px; height: 84px; object-fit: contain; margin: 0 auto; }
.rc-motto { font-weight: 500; }
.rc-title { text-align: center; margin: 10px 0 8px; position: relative; }
.rc-title small { display: block; letter-spacing: .12em; font-weight: 700; font-size: 10.5px; }
.rc-title h3 { font-size: 1.45rem; letter-spacing: .02em; text-decoration: underline; text-underline-offset: 4px; color: #1A1408; }
.rc-year { font-size: 11px; margin-top: 2px; } .rc-year b { margin-left: 6px; }
.rc-id { display: grid; grid-template-columns: 88px 1.3fr 1fr; gap: 12px; margin-bottom: 8px; align-items: start; }
.rc-photo { width: 88px; height: 100px; border: 1px solid #8A94A3; background: #EEF3F8; display: grid; place-items: center; overflow: hidden; font-weight: 800; color: #50627A; font-size: 1.4rem; }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-info p { margin: 0 0 4px; line-height: 1.35; } .rc-info span { color: #50627A; } .rc-info b { margin: 0 8px 0 3px; }
.rc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.paper .rc-table, .paper .rc-mini { width: 100%; border-collapse: collapse; font-size: 11px; }
.paper .rc-table { min-width: 780px; }
.paper .rc-table th, .paper .rc-table td, .paper .rc-mini th, .paper .rc-mini td { border: 1px solid #8A94A3; padding: 3px 5px; text-align: center; }
.paper .rc-table th.l, .paper .rc-table td.l { text-align: left; }
.paper .rc-table thead th, .paper .rc-mini th { background: #E9EDF2; color: #1A1408; }
.paper .rc-table tr.rc-group td { background: #DDE2E8; font-weight: 700; text-align: left; }
.rc-group span { font-weight: 500; margin-left: 8px; }
.rc-foot { display: grid; grid-template-columns: 1.1fr 1.5fr 1fr; gap: 10px; margin-top: 10px; align-items: start; }
.paper .rc-total td { font-size: 13px; font-weight: 700; } .paper td.rc-avg { background: #E9EDF2; font-size: 15px; }
.rc-seqs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; } .rc-seqs span { border: 1px solid #8A94A3; padding: 3px 8px; } .rc-seqs b { margin-left: 6px; }
.rc-gen { border: 1px solid #8A94A3; text-align: center; padding: 6px; font-size: 11px; } .rc-gen div { background: #E9EDF2; padding: 3px; font-weight: 700; margin: -6px -6px 6px; } .rc-gen b { display: block; margin: 4px 0; font-size: 13px; }
.rc-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; min-height: 90px; text-align: center; font-size: 11px; }
.profile-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #C9A24B; background: #0B1B4D; color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; flex: none; }
@media (max-width: 640px) { .rc-foot, .rc-id { grid-template-columns: 1fr; } .rc-head { font-size: 8.5px; grid-template-columns: 1fr 56px 1fr; } .rc-head img { width: 56px; height: 56px; } }
@media print { .rc-scroll { overflow: visible; } .paper .rc-table { min-width: 0; } .paper.rc { padding: 8px; font-size: 10.5px; } }
@media (max-width: 600px) { .top-actions { gap: 6px; } .top-actions .seg { display: none; } .profile-btn { width: 36px; height: 36px; font-size: 12px; } }
