/* Payroll, expenses, subjects and assignments. Loaded after style.css. */
/* ---------- Payroll and expenses ---------- */
.pay-items select, .pay-items input { min-width: 0; }
.pay-summary { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 14px; margin-top: 12px; background: var(--brand-soft); border-radius: 8px; font-size: 14px; }
.pay-summary b { margin-left: 4px; }
details.adjust summary { list-style: none; cursor: pointer; }
details.adjust summary::-webkit-details-marker { display: none; }
details.adjust[open] { min-width: 260px; }
details.adjust form { margin-top: 8px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.bar { grid-column: 1 / -1; display: block; height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.bar-1 { width: 5%; }
.bar-2 { width: 10%; }
.bar-3 { width: 15%; }
.bar-4 { width: 20%; }
.bar-5 { width: 25%; }
.bar-6 { width: 30%; }
.bar-7 { width: 35%; }
.bar-8 { width: 40%; }
.bar-9 { width: 45%; }
.bar-10 { width: 50%; }
.bar-11 { width: 55%; }
.bar-12 { width: 60%; }
.bar-13 { width: 65%; }
.bar-14 { width: 70%; }
.bar-15 { width: 75%; }
.bar-16 { width: 80%; }
.bar-17 { width: 85%; }
.bar-18 { width: 90%; }
.bar-19 { width: 95%; }
.bar-20 { width: 100%; }
.payslip { max-width: 760px; margin-left: auto; margin-right: auto; }
.payslip table { width: 100%; }
@media print { .payslip { box-shadow: none; border: 0; max-width: none; } }

/* ---------- Subjects and assignments ---------- */
.chips { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; background: var(--line-2); border-radius: 999px; font-size: 13px; }
.chips form { display: inline; margin: 0; }
.chips button { padding: 0 6px; font-size: 16px; line-height: 1; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin: 8px 0 12px; }
.prose p { margin: 0 0 .75em; white-space: pre-wrap; }
.prose p:last-child { margin-bottom: 0; }
.answer { white-space: pre-wrap; font-size: 14px; background: var(--bg); border-left: 3px solid var(--brand); padding: 8px 12px; border-radius: 4px; margin: 4px 0 6px; max-height: 260px; overflow: auto; }
.grade { min-width: 180px; }
.grade textarea { font-size: 13px; }
.graded { margin-top: 12px; padding: 12px 14px; background: var(--good-soft); border-radius: 8px; }
.graded p { margin: 6px 0 0; white-space: pre-wrap; }
@media (min-width: 900px) { .nav-inner { flex-wrap: wrap; } .nav a { padding: 10px 9px; } }
.strong-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.strong-link:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Shared bits ---------- */
.scroll-x { overflow-x: auto; }
.pre { white-space: pre-wrap; }
.span-all { grid-column: 1 / -1; }
.actions.pad { padding-left: 16px; padding-right: 16px; }
.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: #f2c14e; color: #3b2a00; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.with-photo { display: flex; gap: 14px; align-items: center; }
.student-photo { width: 66px; height: 88px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--line-2); flex: none; }
.student-photo.none { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; color: var(--ink-3); }

/* ---------- Results entry ---------- */
.table input.score { width: 72px; text-align: right; min-height: 36px; padding: 4px 8px; }
.broadsheet td { white-space: nowrap; }
.broadsheet th { white-space: normal; vertical-align: bottom; min-width: 64px; }
fieldset.trait { border: 0; padding: 6px 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; border-bottom: 1px solid var(--line-2); }
fieldset.trait legend { float: left; width: 150px; padding: 0; font-weight: 600; font-size: 14px; }
fieldset.trait label { display: inline-flex; gap: 4px; align-items: center; font-size: 14px; min-height: 32px; }

/* ---------- Inbox ---------- */
.threads { list-style: none; margin: 0; padding: 0; }
.threads li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.threads li a:hover { background: var(--bg); }
.threads li.unread a { background: #fffaf0; }
.threads .th-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.threads .th-top .muted { margin-left: auto; }
.threads .th-last { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-width: 78%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; align-self: flex-start; }
.msg-bubble.me { align-self: flex-end; background: var(--brand-soft); border-color: #c5e2d4; }
.msg-bubble p { margin: 4px 0 0; white-space: pre-wrap; }
@media (max-width: 640px) { .msg-bubble { max-width: 94%; } }

/* ---------- Report card (A4, from the school's report card design) ---------- */
.rc { --accent: #1f3a68; width: 794px; max-width: 100%; min-height: 1123px; margin: 0 auto 24px; box-sizing: border-box; padding: 40px; background: #fff; color: #1a1f2b;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 12px; line-height: 1.35; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.rc-navy { --accent: #1f3a68; } .rc-maroon { --accent: #7a1f2b; } .rc-green { --accent: #1d5c3a; } .rc-purple { --accent: #4b2a6b; }
.rc h1, .rc h2 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; }
.rc-head { display: grid; grid-template-columns: 80px minmax(0, 1fr) 80px; gap: 16px; align-items: center; }
.rc-logo { width: 80px; height: 80px; border-radius: 50%; border: 1.5px dashed var(--accent); display: flex; align-items: center; justify-content: center; text-align: center; color: #4f5868; overflow: hidden; }
.rc-logo img { width: 100%; height: 100%; object-fit: contain; }
.rc-logo:has(img) { border: 0; border-radius: 0; }
.rc-photo { width: 80px; height: 92px; border: 1.5px dashed #9aa3b2; display: flex; align-items: center; justify-content: center; text-align: center; color: #4f5868; overflow: hidden; }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-photo:has(img) { border: 1px solid #c9cfd9; }
.rc-school { text-align: center; display: flex; flex-direction: column; gap: 3px; }
.rc-school h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--accent); letter-spacing: .01em; }
.rc-motto { font-style: italic; color: #4f5868; }
.rc-band { background: var(--accent); color: #fff; border-radius: 4px; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; }
.rc-band b { font-family: "Source Serif 4", Georgia, serif; font-size: 16px; letter-spacing: .04em; }
.rc-band span { font-size: 13px; font-weight: 500; }
.rc-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #c9cfd9; border-left: 1px solid #c9cfd9; border-radius: 4px; overflow: hidden; }
.rc-info div { padding: 6px 10px; border-right: 1px solid #c9cfd9; border-bottom: 1px solid #c9cfd9; display: flex; flex-direction: column; }
.rc-info span, .rc-summary span, .rc-foot span { color: #4f5868; font-size: 12px; }
.rc-info b { font-size: 14px; font-weight: 600; margin-top: 1px; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rc-table th { background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 4px 6px; font-weight: 600; text-align: center; }
.rc-table th small { font-weight: 400; font-size: 12px; }
.rc-table td { border: 1px solid #c9cfd9; padding: 0 6px; height: 22px; text-align: center; }
.rc-table tbody tr:nth-child(even) { background: #f4f6f9; }
.rc-table .l { text-align: left; }
.rc-table .sub { font-weight: 500; }
.rc-table .b { font-weight: 700; }
.rc-table .g { font-weight: 600; }
.rc-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rc-summary div { border: 1px solid #c9cfd9; border-radius: 4px; padding: 6px 10px; display: flex; flex-direction: column; }
.rc-summary b { font-size: 18px; font-weight: 700; margin-top: 1px; }
.rc-summary small { font-size: 12px; font-weight: 500; color: #4f5868; }
.rc-annual { font-size: 11px; }
.rc-annual th, .rc-annual td { padding: 0 3px; }
.rc-year { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); }
.rc-year b { font-size: 16px; }
.rc-promo b { font-size: 14px; }
.rc-promo-promoted b { color: #1e6b3c; } .rc-promo-trial b { color: #8a5a00; } .rc-promo-repeat b { color: #a12a2a; }
.rc-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rc-box { display: flex; flex-direction: column; gap: 3px; border: 1px solid #c9cfd9; border-radius: 4px; padding: 8px 10px; }
.rc-box h2, .rc-c h2 { margin: 0 0 4px; font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.rc-trait { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 16px); gap: 4px; align-items: center; min-height: 19px; }
.rc-trait i { display: block; height: 14px; border: 1px solid #9aa3b2; }
.rc-trait i.on { background: var(--accent); border-color: var(--accent); }
.rc-trait-head { color: #4f5868; font-weight: 600; text-align: center; min-height: 16px; }
.rc-trait-head span:first-child { text-align: left; }
.rc-legend { margin-top: auto; color: #4f5868; }
.rc-key { display: grid; grid-template-columns: 30px 64px minmax(0, 1fr); min-height: 15px; align-items: center; }
.rc-comment { border: 1px solid #c9cfd9; border-radius: 4px; padding: 7px 10px; display: flex; flex-direction: column; gap: 6px; }
.rc-c { display: flex; gap: 8px; align-items: baseline; }
.rc-c h2 { margin: 0; white-space: nowrap; }
.rc-c p { margin: 0; font-size: 13px; font-style: italic; min-height: 17px; white-space: pre-wrap; }
.rc-sign { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .6fr); gap: 16px; color: #4f5868; margin-top: 14px; }
.rc-sign span { border-top: 1px solid #9aa3b2; padding-top: 2px; }
.rc-sign.has-sig { margin-top: 40px; }
.rc-sig { position: relative; }
.rc-sig img { position: absolute; left: 0; bottom: 100%; height: 40px; max-width: 100%; object-fit: contain; object-position: left bottom; }
.sig-preview { display: inline-block; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; background: #fff; }
.sig-preview img { display: block; height: 60px; max-width: 320px; object-fit: contain; }
.rc-foot { margin-top: auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: stretch; }
.rc-foot .rc-total { background: none; border: 1.5px solid var(--accent); }
.rc-foot .rc-total b { color: var(--accent); }
.rc-foot div { background: #f4f6f9; border-radius: 4px; padding: 6px 10px; display: flex; flex-direction: column; }
.rc-foot b { font-size: 14px; font-weight: 700; }
.rc-foot .rc-stamp { background: none; border: 1.5px dashed #9aa3b2; align-items: center; justify-content: center; color: #4f5868; min-height: 46px; }
@media screen and (max-width: 820px) {
  .rc { padding: 16px; min-height: 0; }
  .rc-head { grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 8px; }
  .rc-logo { width: 56px; height: 56px; } .rc-photo { width: 56px; height: 66px; }
  .rc-school h1 { font-size: 19px; }
  .rc-band { flex-direction: column; align-items: flex-start; padding: 6px 12px; }
  .rc-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-three, .rc-foot { grid-template-columns: 1fr; }
  .rc-foot { grid-auto-flow: row; }
  .rc-table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media print {
  @page { size: A4; margin: 8mm; }
  .rc { width: 194mm; min-height: 280mm; padding: 6mm; max-width: none; margin: 0; border: 0; box-shadow: none; page-break-after: always; break-after: page;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rc:last-of-type { page-break-after: auto; break-after: auto; }
}
