/* Visual refresh (2026-11-25), Masters + Admin pages. Loaded after site.css by the layout. Tokens only (src/Ui/wwwroot/css/ui.css +
   ui-refresh.css), no hex. Scope every rule to this group's pages (a wrapper class), never restyle shared pieces here. */

/* =====================================================================================================================
   .rf-masters = every page of the group. .rf-md = the master pattern (Pages/Masters): a form card ("New ..." / "Edit ...")
   and the saved list with Open buttons. .rf-md--side puts the form beside the list on wide screens (short forms);
   .rf-md--stack keeps a long form above the list.
   ===================================================================================================================== */
.rf-masters { max-width: 1320px; }

/* ---------- radio / tick lists of the old pages: chips instead of loose dots ---------- */
.rf-masters .fc-radios { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.rf-masters .fc-radios > legend { float: none; width: 100%; padding: 0; margin: 0 0 4px; font-size: var(--fs-12); }
.rf-masters .fc-radios > .form-check-inline { display: inline-flex; align-items: center; gap: 7px; margin: 0; min-height: 34px; padding: 0 12px 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--panel); color: var(--ink-2); font-size: var(--fs-13);
  cursor: pointer; transition: background-color var(--d-2), border-color var(--d-2), color var(--d-2); }
.rf-masters .fc-radios > .form-check-inline:hover { background: var(--hover); }
.rf-masters .fc-radios > .form-check-inline .form-check-input { float: none; margin: 0; flex: none; accent-color: var(--brand); }
.rf-masters .fc-radios > .form-check-inline:has(:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.rf-masters .fc-radios > .form-check-inline:has(:disabled) { opacity: .6; cursor: default; }
.rf-masters .fc-radios > .form-check-inline:has(:focus-visible) { outline: 2px solid var(--brand-ring); outline-offset: 1px; }
.rf-masters .fc-field--check .form-check { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; padding: 0; }
.rf-masters .fc-field--check .form-check-input { float: none; margin: 0; }

/* ---------- the form card ---------- */
.rf-md-form { border-top: 4px solid var(--brand); }
.rf-md-form .report-head { margin-bottom: 2px; }
.rf-md-form.is-editing { border-top-color: var(--saffron-ink); background: linear-gradient(180deg, var(--ember-soft), var(--panel) 140px); }
.rf-md-hint { margin: 6px 0 16px; font-size: var(--fs-13); color: var(--ink-2); max-width: 80ch; }
.rf-md .bus-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; align-items: start; margin-top: 0; }
.rf-md .bus-form > * { min-width: 0; }
.rf-md .bus-form + .bus-form { margin-top: 14px; }
.rf-md-form .form-control, .rf-md-form .form-select { min-height: 40px; }
.rf-md-form .fc-actions, .rf-md-extra .fc-actions { align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.rf-md-form .fc-actions .btn-outline-danger { margin-left: auto; }
.rf-md-form .fc-actions .btn-primary { min-width: 7.5em; }
.rf-md-note { margin: 12px 0 0; font-size: var(--fs-13); color: var(--ink-2); }
.rf-md-form .sub-title { margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.rf-md-form .report-head + .rf-md-hint + .sub-title { margin-top: 0; padding-top: 0; border-top: 0; }
@media (min-width: 900px) { .rf-md .bus-form > .rf-md-wide { grid-column: span 2; } }
/* tick lists (sessions, users, branches): one full row each, chips flow */
.rf-md .bus-form.rf-md-ticks { grid-template-columns: 1fr; }
.rf-md-ticks .fc-radios { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
/* a find box above the form (Teacher class allotment) */
.rf-md-find { background: var(--sunken); }
.rf-md-find .fc-actions { margin-top: 12px; }
/* two small switch cards side by side (Control status) */
.rf-cs-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 16px; align-items: start; }
.rf-md-tools { margin-left: auto; }

/* ---------- the list ---------- */
.rf-md-list .report-head { gap: 8px 10px; }
.rf-md-list .report-head > .section-note { margin-left: auto; }
.rf-md-list .report-table-wrap { margin-top: 4px; }
.rf-md-list .report-table tbody tr:last-child > td { border-bottom: 0; }
/* the grid's visually-hidden caption still adds 1px to the table in Chrome, so every short list got a scroll bar */
.rf-masters .report-table > caption.visually-hidden { position: fixed !important; }
.rf-md-list .report-table td { vertical-align: middle; white-space: normal; overflow-wrap: break-word; }
.rf-md-list td[data-l="Address"] { min-width: 14em; }
/* Open column (always first on these lists) and S.No (always second) stay narrow; ids are quiet */
.rf-md-list .report-table:has(button[value^="select:"]) th:first-child, .rf-md-list .report-table:has(button[value^="select:"]) td:first-child { width: 1%; white-space: nowrap; padding-right: 4px; }
.rf-md-list .report-table:has(td[data-l="SNo"]) th:nth-child(2), .rf-md-list td[data-l="SNo"] { width: 1%; text-align: right; padding-right: 16px; }
.rf-md-list td[data-l="SNo"], .rf-md-list td[data-l="Id"], .rf-md-list td[data-l$=" Id"] { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: var(--fs-13); }
/* the first real column (the name) reads first */
.rf-md-list .report-table:has(td[data-l="SNo"]) td:nth-child(3) { font-weight: 600; color: var(--ink); }
.rf-md-list button[value^="select:"] { min-height: 30px; --bs-btn-padding-x: 12px; --bs-btn-font-size: var(--fs-12); }
/* sortable headings (Cities): a header word, not a red link */
.rf-md-list thead th .btn-link { min-height: 0; padding: 0; border: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: none; }
.rf-md-list thead th .btn-link::after { content: "\2195"; margin-left: 4px; opacity: .55; }
.rf-md-list thead th .btn-link:hover { color: var(--brand-text); }
/* the row that is open in the form */
.rf-md-list .report-table tbody tr.fc-row--sel > td { background: color-mix(in srgb, var(--brand) 11%, var(--panel)); color: var(--ink); font-weight: 600; }
.rf-md-list .report-table tbody tr.fc-row--sel > td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
.rf-md-list tr.fc-row--sel button[value^="select:"] { background-image: var(--grad-btn); border-color: transparent; color: var(--brand-fg); }
/* pages of a long list */
.rf-masters .fc-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rf-masters .fc-pager .btn { min-width: 38px; justify-content: center; }
.rf-md-list .empty { padding: 28px 16px 20px; }

/* ---------- side layout: the form stays in view beside the list ---------- */
@media (min-width: 1100px) {
  .rf-md--side .fc-form { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 0 20px; align-items: start; }
  .rf-md--side .rf-md-side { position: sticky; top: 80px; }
  .rf-md--side .rf-md-side .bus-form { grid-template-columns: 1fr; }
  .rf-md--side .rf-md-list { min-height: 100%; }
}

@media (max-width: 720px) {
  .rf-md .bus-form { grid-template-columns: 1fr; }
  .rf-md-form .fc-actions .btn-outline-danger { margin-left: 0; }
}

/* =====================================================================================================================
   Admin pages
   ===================================================================================================================== */

/* ---------- Change session (.rf-ss): where you work now, in the old header colours, beside three numbered steps ---------- */
.rf-ss { max-width: 1080px; }
.rf-ss-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.rf-ss-now { padding: 22px 22px 24px; border-radius: var(--r-xl); background: var(--grad-brand); color: var(--brand-fg); box-shadow: var(--card-shadow); border-bottom: 4px solid var(--saffron); }
.rf-ss-now h2 { margin: 16px 0 6px; font: 700 var(--fs-11)/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: inherit; opacity: .85; }
.rf-ss-now b { display: block; font: 800 var(--fs-28)/1.15 var(--font-display); letter-spacing: -.01em; }
.rf-ss-now p { margin: 8px 0 0; font-size: var(--fs-14); opacity: .92; }
.rf-ss-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--brand-fg) 18%, transparent); }
.rf-ss-ic .ic { width: 22px; height: 22px; }
.rf-ss-change { border-top: 4px solid var(--brand); }
.rf-ss-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 20px; align-items: end; }
.rf-ss-row + .rf-ss-row { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.rf-ss-step { display: flex; gap: 12px; align-items: flex-end; min-width: 0; }
.rf-ss-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 5px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font: 800 var(--fs-13)/1 var(--font-display); }
.rf-ss-field { flex: 1; min-width: 0; }
.rf-ss-go .btn { min-height: 40px; min-width: 9em; }
.rf-ss-note { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 0; font-size: var(--fs-13); color: var(--ink-2); }
.rf-ss-note .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--info); }
.rf-ss-change .empty { padding: 24px 12px 8px; }
@media (max-width: 900px) { .rf-ss-grid { grid-template-columns: 1fr; } }

/* ---------- Approvals (.rf-ap): the request and the decision on the left, the refund finder beside them ---------- */
@media (min-width: 1100px) {
  .rf-ap .fc-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 20px; align-items: start; }
  .rf-ap .fc-form > section { grid-column: 1; }
  .rf-ap .fc-form > .rf-ap-find { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 80px; }
}
.rf-ap-find { background: var(--sunken); }
.rf-ap-find .fc-actions { margin-top: 12px; }
.rf-ap .empty { padding: 20px 12px 8px; }
.rf-ap-kvs { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--saffron-ink); border-radius: var(--r-lg); background: var(--sunken); }
.rf-ap-decide textarea.form-control { min-height: 84px; }

/* ---------- Send an SMS / Student login permission (.rf-sms): who on the left, the message (or permission) card stays
   in view on the right while ticking students in the list ---------- */
@media (min-width: 1100px) {
  .rf-sms .fc-form { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 20px; align-items: start; }
  .rf-sms .fc-form > .rf-sms-who, .rf-sms .fc-form > .rf-sms-list { grid-column: 1; }
  .rf-sms .fc-form > .rf-sms-msg { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 80px; }
  .rf-sms .rf-sms-msg .bus-form { grid-template-columns: 1fr; }
}
.rf-sms .bus-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 16px; align-items: end; margin-top: 0; }
.rf-sms .bus-form > * { min-width: 0; }
.rf-sms .bus-form + .bus-form { margin-top: 14px; }
.rf-sms .bus-form > .fc-radios { grid-column: 1 / -1; }
.rf-sms-one { padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.rf-sms-msg textarea.form-control { min-height: 120px; }
.rf-sms-msg .fc-actions .btn { min-width: 9em; }
.rf-sms-list .report-head { gap: 8px 10px; }
.rf-sms-list td .form-check-input { width: 18px; height: 18px; margin: 0; }

/* ---------- Fee link SMS (.rf-fsms): the SMS shown as it reads on a phone ---------- */
.rf-fsms-preview { display: grid; gap: 6px; margin-top: 16px; }
.rf-fsms-bubble { justify-self: start; max-width: 560px; margin: 0; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--sunken); border: 1px solid var(--line); font-size: var(--fs-13); color: var(--ink); overflow-wrap: anywhere; }
.rf-fsms-list .rt-head { position: sticky; top: 64px; z-index: 3; margin: -6px -8px 8px; padding: 6px 8px; background: var(--panel); border-radius: var(--r-md); }
.rf-fsms .report-table td:first-child, .rf-fsms .report-table th:first-child { width: 1%; }

/* ---------- User rights (.rf-rights): each menu a card; ticked menu = maroon heading, its pages light up; pages under an
   unticked menu are dimmed (they are not saved) ---------- */
.rf-rights-pick .filterbar__grow { flex: 1 1 28em; max-width: 640px; }
.rf-rights-when { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.rf-rights-pages .rt-head { position: sticky; top: 64px; z-index: 3; margin: -8px -10px 8px; padding: 8px 10px; background: var(--panel); border-radius: var(--r-md); }
.rf-rights .hr-classes { gap: 14px; }
.rf-rights .hr-branch { gap: 8px; padding: 12px 14px 14px; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--r-lg); background: var(--sunken); }
.rf-rights .hr-branch:first-of-type { padding-top: 12px; border-top: 3px solid var(--line-strong); }
.rf-rights .hr-branch:has(> .hr-branch__name input:checked) { border-top-color: var(--brand); background: var(--panel); }
.rf-rights .hr-branch__name.hr-tick { min-height: 30px; font: 700 var(--fs-14)/1.25 var(--font-display); color: var(--ink-2); }
.rf-rights .hr-branch__name.hr-tick:has(input:checked) { color: var(--head-ink); }
.rf-rights .hr-branch:not(:has(> .hr-branch__name input:checked)) > .hr-subjects { opacity: .62; }
.rf-rights .hr-subjects .hr-tick { min-height: 30px; border-radius: var(--r-full); padding: 2px 12px 2px 9px; }
.rf-rights .hr-subjects .hr-tick:has(input:checked) { font-weight: 600; }
.rf-rights .hr-tick:has(input:focus-visible) { outline: 2px solid var(--brand-ring); outline-offset: 1px; }
.rf-rights-pages .rt-head h2, .rf-fsms-list .rt-head h2 { font: 800 var(--fs-18)/1.25 var(--font-display); color: var(--ink); padding-left: 12px; border-left: 4px solid var(--saffron-ink); }
.rf-rights-pages .rt-head h2 .section-note, .rf-fsms-list .rt-head h2 .section-note { margin-left: 6px; font: 400 var(--fs-12) var(--font-ui); color: var(--ink-3); }
@media (max-width: 720px) { .rf-rights-pages .rt-head, .rf-fsms-list .rt-head { position: static; } }
