/* UPSC interview preparation pages — shared by interview_mgmt and msp_interview (offline booking):
   admission + registration form, session list, slot booking, staff slot lists and student-list dialogs.
   Colours only through var(--vr-…) so dark mode works. Tables use the shared vr-core §15 helpers. */

/* Breadcrumb */
.iv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; font-size: calc(13px * var(--vr-fs, 1)); color: var(--vr-muted); }
.iv-crumbs a { color: var(--vr-muted); text-decoration: none; }
.iv-crumbs a:hover { color: var(--vr-accent-ink); text-decoration: underline; }
.iv-crumbs [aria-current="page"] { color: var(--vr-ink-2); font-weight: 600; }

/* Notices (icon + text) */
.iv-notes { gap: 14px; }
.iv-note { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; border-radius: 14px; font-size: calc(13px * var(--vr-fs, 1)); line-height: 1.55; box-sizing: border-box; }
.iv-note > .vr-ico { flex: none; margin-top: 1px; }
.iv-note > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.iv-note p { margin: 0; }
.iv-note ul { margin: 2px 0 0; padding-left: 18px; }
.iv-note a { color: inherit; }
.iv-note .vr-btn { align-self: flex-start; margin: 4px 0; }
.iv-note--warn { background: var(--vr-warn-soft); color: var(--vr-warn); }
.iv-note--info { background: var(--vr-info-soft); color: var(--vr-info); }
.iv-note--good { background: var(--vr-good-soft); color: var(--vr-good); }
.iv-note--bad { background: var(--vr-bad-soft); color: var(--vr-bad); }
.iv-note--soft { background: var(--vr-card-2); color: var(--vr-ink-2); }
.iv-req { color: var(--vr-bad); font-weight: 700; }
.iv-hint { margin-top: -2px; font-size: calc(12px * var(--vr-fs, 1)); color: var(--vr-muted); }
.iv-locked { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--vr-fs, 1)); font-weight: 600; color: var(--vr-muted); }

/* "Admissions will start shortly" / login prompt */
.iv-wait { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 18px; }
.iv-wait > div { flex: 1 1 260px; min-width: 0; }
.iv-wait__icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--vr-accent-soft); color: var(--vr-accent-ink); }
.iv-wait__login { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; flex: 0 1 auto !important; }
.iv-wait__login .vr-sub { margin: 0; }

/* Session list: booking cell + "your bookings" list (msp_interview) */
.iv-booked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.iv-booked .vr-ico { color: var(--vr-good); vertical-align: -2px; }
.iv-booking { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.iv-booking .vr-cell strong .vr-ico { color: var(--vr-good); vertical-align: -2px; }

/* Booked slot summary */
.iv-conditions { font-size: calc(13px * var(--vr-fs, 1)); color: var(--vr-ink-2); }
.iv-conditions ul { margin: 4px 0 0; padding-left: 18px; }

/* Days with slots */
.iv-days { gap: 16px; }
.iv-days__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.iv-days__head .vr-h2, .iv-days__head .vr-sub { margin: 0; }
.iv-day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.iv-day { gap: 12px; }
.iv-day__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.iv-day__head .vr-h3 { flex: 1 1 auto; min-width: 0; }
.iv-day__icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--vr-accent-soft); color: var(--vr-accent-ink); }
.iv-day__list { min-height: 36px; padding: 6px 14px; }
.iv-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: calc(12px * var(--vr-fs, 1)); color: var(--vr-muted); }
.iv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.iv-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.iv-dot--open { background: var(--vr-good); }
.iv-dot--mine { background: var(--vr-info); }
.iv-dot--full { background: var(--vr-bad); }

/* Student slot picker: one chip per time; each bookable chip is its own form (display: contents keeps
   the chips in one wrapping row; a booking error spans the row above the chips, as before). */
.iv-slots { display: flex; flex-wrap: wrap; gap: 10px; }
.iv-slots > form { display: contents; }
.iv-slots .vr-alert { flex: 1 0 100%; order: -1; }
.iv-slot { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; box-sizing: border-box; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--vr-line-2); background: var(--vr-card); color: var(--vr-ink); font: inherit; font-size: calc(14px * var(--vr-fs, 1)); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.iv-slot small { font-size: calc(12px * var(--vr-fs, 1)); font-weight: 600; }
.iv-slot--open { cursor: pointer; border-color: var(--vr-good); color: var(--vr-good); background: var(--vr-good-soft); }
.iv-slot--open:hover { filter: brightness(.97); }
.iv-slot--open:focus-visible { outline: 2px solid var(--vr-accent); outline-offset: 2px; }
.iv-slot--open[disabled] { cursor: progress; opacity: .7; }
.iv-slot--mine { border-color: transparent; background: var(--vr-info-soft); color: var(--vr-info); }
.iv-slot--full { border-color: transparent; background: var(--vr-bad-soft); color: var(--vr-bad); cursor: not-allowed; }

/* Staff slot tables (msp_interview staff_slot_list) */
.iv-slots-table td { vertical-align: middle; }
.iv-slots-table .vr-meter { min-width: 150px; }
.iv-slots-table .vr-cell .vr-chip { margin-left: 4px; vertical-align: 1px; }

/* Staff "Download list" (CSV): From / To dates + button, on the admission page card head and the slot board */
.iv-dl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.iv-dl--bar { padding: 12px 14px; border-radius: 14px; background: var(--vr-card-2); border: 1px solid var(--vr-line); }
.iv-dl__title { flex-basis: 100%; font-size: calc(13px * var(--vr-fs, 1)); font-weight: 700; color: var(--vr-ink-2); }
.iv-dl__field { display: flex; flex-direction: column; gap: 3px; font-size: calc(12px * var(--vr-fs, 1)); color: var(--vr-muted); }
.iv-dl__field .vr-input { height: 40px; width: auto; min-width: 150px; padding: 0 10px; border-radius: 10px; font-size: calc(14px * var(--vr-fs, 1)); }
.iv-dl .vr-btn { min-height: 40px; }
.iv-dl__hint { flex-basis: 100%; font-size: calc(12px * var(--vr-fs, 1)); }
@media (max-width: 760px) {
  .iv-dl { width: 100%; }
  .iv-dl__field { flex: 1 1 130px; }
  .iv-dl__field .vr-input { width: 100%; min-width: 0; }
  .iv-dl .vr-btn { flex: 1 1 100%; justify-content: center; }
}

/* Staff slot board (as before the redesign): one row per date, every slot a button; a slot opens its
   students in the shared dialog, so full slots stay clickable for staff. */
.iv-board { gap: 14px; }
.iv-board__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.iv-board__head .vr-sub { margin: 0; }
.iv-board__rows { display: flex; flex-direction: column; border: 1px solid var(--vr-line); border-radius: 14px; overflow: hidden; }
.iv-board__row { display: grid; grid-template-columns: minmax(200px, 240px) 1fr; gap: 12px 20px; align-items: center; padding: 14px 16px; }
.iv-board__row + .iv-board__row { border-top: 1px solid var(--vr-line); }
.iv-board__row:nth-child(even) { background: var(--vr-card-2); }
.iv-board__row--today { box-shadow: inset 4px 0 0 var(--vr-accent); }
.iv-board__row--past .iv-board__date .vr-h3 { color: var(--vr-muted); }
.iv-board__date { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.iv-board__date .vr-h3 { margin: 0; }
.iv-board__date small { font-size: calc(12px * var(--vr-fs, 1)); }
.iv-board__list { margin-top: 4px; min-height: 32px; padding: 4px 12px; font-size: calc(13px * var(--vr-fs, 1)); }
.iv-slots .iv-slot--staff { min-height: 38px; padding: 6px 12px; }
button.iv-slot--staff { cursor: pointer; }
button.iv-slot--staff:hover { filter: brightness(.95); }
button.iv-slot--staff:focus-visible { outline: 2px solid var(--vr-accent); outline-offset: 2px; }
.iv-slot--staff.iv-slot--full { border-color: var(--vr-bad); }
@media (max-width: 760px) {
  .iv-board__row { grid-template-columns: 1fr; padding: 12px; }
  .iv-board__date { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .iv-board__date small { flex-basis: 100%; order: 2; }
  .iv-board__list { margin: 0 0 0 auto; }
  /* three compact buttons per row: time on top, seats booked under it */
  .iv-board .iv-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .iv-slots .iv-slot--staff { flex-direction: column; justify-content: center; gap: 0; min-height: 48px; padding: 6px 4px; font-size: calc(13px * var(--vr-fs, 1)); line-height: 1.25; }
  .iv-slot--staff small { font-size: calc(11px * var(--vr-fs, 1)); }
}

/* Registration form: upload widget (same server contract as script.js's single file upload) */
.iv-upload__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.iv-upload__list:empty { display: none; }
.iv-upload__file { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--vr-card-2); border: 1px solid var(--vr-line); font-size: calc(13px * var(--vr-fs, 1)); min-width: 0; }
.iv-upload__file > .vr-ico { flex: none; color: var(--vr-accent-ink); }
.iv-upload__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.iv-upload__size { flex: none; color: var(--vr-muted); }
.iv-upload__bar { flex: 1 1 60px; min-width: 40px; height: 6px; border-radius: 999px; background: var(--vr-ghost-a); overflow: hidden; }
.iv-upload__bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--vr-accent); transition: width .2s; }
.iv-upload__status { flex: none; font-size: calc(12px * var(--vr-fs, 1)); font-weight: 700; color: var(--vr-muted); }
.iv-upload__file.is-done .iv-upload__bar > span { background: var(--vr-good); }
.iv-upload__file.is-done .iv-upload__status { color: var(--vr-good); }
.iv-upload__file.is-error { border-color: var(--vr-bad); }
.iv-upload__file.is-error .iv-upload__status { color: var(--vr-bad); white-space: normal; }
.iv-upload__pick { align-self: flex-start; position: relative; }
.iv-upload__pick:focus-within { outline: 2px solid var(--vr-accent); outline-offset: 2px; }
.iv-upload__pick[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .iv-upload__bar > span { transition: none; } }

/* Student-list dialogs open with data-vr-modal-size="lg" (vr-core) */
.iv-modal-table .vr-dtable { min-width: 0; }

/* Phones: stacked table rows are narrow cards — long e-mails wrap inside them (e2e e4). */
@media (max-width: 760px) {
  .vr-dtable--stack td { overflow-wrap: anywhere; }
}
