/* Letters, Pupil profiles and the Incident log inside the BBCA all-in-one app.
   The look is the "section colours" design in app.css; this only adds the app's own pieces. */
.side .brand-mark { background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.side .brand-mark img { display: block; width: 40px; height: 40px; border-radius: var(--r-lg); }
.hub-top-apps { display: none; }
@media (max-width: 900px) {
  .hub-top-apps { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: none; min-height: 40px; padding: 0 12px; border-radius: var(--r-full);
    background: var(--n-100); color: var(--n-800); font-weight: 650; font-size: var(--fs-label); text-decoration: none; }
  .hub-top-apps .ic { width: 16px; height: 16px; color: var(--n-500); }
}
/* Letter settings ▸ Letters due: every letter limit in one place (BBCA app 0.10.0) */
.form-card h3.due-h { margin: 28px 0 8px; }
.table.due-rules { width: 100%; }
.table.due-rules td:first-child { width: 40%; }

/* ===== 0.19.0: Letter settings, Class sections, Sections, Attendance letters, Edit pupil details, Incident types
   (the approved mockups, page 8). Cards side by side on a wide screen, one under the other on a phone. ===== */
.set-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.set-cols.rail { grid-template-columns: minmax(0, 1fr) 340px; }
.set-cols.list { grid-template-columns: 380px minmax(0, 1fr); }
.set-cols > .card, .set-cols > .stack > .card, .set-cols > div > .card { margin: 0; }
.set-cols > .stack { gap: 18px; }
.set-cols > * { min-width: 0; }
@media (max-width: 1100px) { .set-cols, .set-cols.rail, .set-cols.list { grid-template-columns: minmax(0, 1fr); } }
.set-intro { margin: 0 0 14px; }
.set-narrow { max-width: 320px; }

/* Letters due: one row per kind of letter */
.limit-h, .limit-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1.3fr); gap: 12px; align-items: center; }
.limit-h { font-size: var(--fs-overline); font-weight: 700; color: var(--n-500); text-transform: uppercase; letter-spacing: .06em; padding: 0 0 8px; }
.limit-row { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.limit-row > b { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--n-900); }
.limit-row .lim { display: flex; align-items: center; gap: 8px; }
.limit-row .lim input { width: 76px; text-align: center; }
.limit-row select { min-width: 0; }
.dotk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--k, var(--n-300)); }
.limit-none { margin: 4px 0 0; }
@media (max-width: 600px) {
  .limit-h { display: none; }
  .limit-row { grid-template-columns: minmax(0, 1fr) auto; }
  .limit-row select { grid-column: 1 / -1; }
}

/* small coloured labels */
.tagc { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-full); font-size: var(--fs-caption); font-weight: 650; background: var(--n-100); color: var(--n-800); white-space: nowrap; }
.tagc .ic { width: 13px; height: 13px; }
.tagc.ok { background: var(--success-50); color: var(--success-900); box-shadow: inset 0 0 0 1px var(--success-200); }
.tagc.bad { background: var(--error-50); color: var(--error-900); box-shadow: inset 0 0 0 1px var(--error-200); }
.tagc.wait { background: var(--warning-50); color: var(--warning-900); box-shadow: inset 0 0 0 1px var(--warning-200); }
.tagc.sec { background: var(--sec-50); color: var(--sec-ink); box-shadow: inset 0 0 0 1px var(--sec-200); }
.lock-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-caption); color: var(--n-500); font-weight: 600; }
.lock-tag .ic { width: 13px; height: 13px; }

/* Class sections: a plain table; only the section is chosen here */
.cls-table td.ord { color: var(--n-500); width: 64px; }
.cls-table .cls-staff { display: block; color: var(--n-500); font-size: var(--fs-caption); font-weight: 500; margin-top: 2px; }
.cls-table select { min-width: 180px; }
.cls-table input { min-width: 0; }
.cls-table input.input-xs { width: 64px; }
.card-foot.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Sections: the list beside the one being edited */
.sec-list { display: grid; gap: 10px; }
.sec-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-xl);
  background: var(--n-0); border: 1px solid var(--line); box-shadow: var(--e-1); color: var(--n-800); text-decoration: none; min-height: 64px; }
.sec-item:hover { border-color: var(--line-strong); text-decoration: none; color: var(--n-800); }
.sec-item.on { border-color: var(--sec-600); box-shadow: 0 0 0 3px var(--sec-50); }
.sec-item .dotk { width: 14px; height: 14px; grid-row: span 2; }
.sec-item b { color: var(--n-900); }
.sec-item small { grid-column: 2; color: var(--n-600); font-size: var(--fs-label); }
.sec-item .tagc { grid-row: span 2; }
.sec-help { margin: 0 0 12px; }

/* Attendance letters: the choose-and-write bar sits on the table */
.bulk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--sec-50); border-bottom: 1px solid var(--line-soft);
  border-radius: var(--r-xl) var(--r-xl) 0 0; flex-wrap: wrap; }
.bulk-head b { font-weight: 650; color: var(--n-900); }

/* Edit pupil details: fields the Register owns are shown but locked */
.locked-note { display: flex; align-items: flex-start; gap: 10px; }
.locked-note a { font-weight: 650; white-space: nowrap; }

/* Incident types: one row is edited at a time */
.it-table .it-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--n-900); }
.it-table tr.hidden-type td { opacity: .55; }
.it-table tr.editing td { background: var(--sec-50); }
.it-table .row-acts { white-space: nowrap; text-align: right; }
.it-table .row-acts form { display: inline; }
.it-edit { display: grid; grid-template-columns: 76px 64px minmax(150px, 2fr) minmax(170px, 2fr) auto minmax(110px, 1fr); gap: 10px 12px; align-items: end; }
.it-edit .check { min-height: 44px; }
.it-edit .acts { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 900px) { .it-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.info-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--n-50); border: 1px solid var(--line-soft); color: var(--n-700); font-size: var(--fs-label); line-height: 1.5; }
.info-note > .ic { flex: none; margin-top: 2px; color: var(--n-500); }
.info-note.warn { background: var(--warning-50); border-color: var(--warning-200); color: var(--warning-900); }
.info-note.warn > .ic { color: var(--warning-600); }
.top .top-t { min-width: 0; }
.top .top-t h1 { margin: 0; }
.top .top-sub { color: var(--n-500); font-size: var(--fs-label); font-weight: 500; margin-top: 2px; }
/* Attendance letters: the period and class, labelled, in one card */
.att-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.att-filters .custom-dates:not([hidden]) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 600px) { .att-filters { grid-template-columns: minmax(0, 1fr); } .att-filters .btn { width: 100%; justify-content: center; } }
.bulkbar.bulk-head { margin: 0; }
.form-actions.end { justify-content: flex-end; }
/* side by side only when there is room for three columns in each card */
@media (max-width: 1399px) { .set-cols.wide-only { grid-template-columns: minmax(0, 1fr); } }
/* the order of classes and incident types is for the big screen; on a phone the name heads each card */
.cls-table th.ord, .it-table th.ord { width: 64px; }
@media (max-width: 760px) { .cls-table td.ord, .it-table td.ord { display: none; } }

/* BBCA app (1.0.8, the owner's layout fixes): on a phone a page's title goes onto a second line instead of being cut short
   with … ("Awards and certi…") */
@media (max-width: 900px) {
  .top h1 { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: 1.125rem; line-height: 1.2; }
}
