/*
 * student-travel.css — the Student Travel Request pages (v0.53.0, Flagler edition), over app.css, rm.css, accident.css and fleet.css
 * (the sub-navigation, the cards, the admin tabs and the request page's sections are the Accident / Injury Report's; the status pill is
 * White Fleet's). NO TENANT COLOUR OR NAME IS WRITTEN HERE. [I20] Brand colours come from the custom properties app.css sets from
 * /api/config. Green is approved, amber is waiting, red is denied, grey is archived; colour is never the only signal: every pill says
 * what it means in words.
 */

/* ---------------------------------------------------------------- the dashboard */
.st-tabs { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.st-sub { font-size: 0.8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.st-id { font-size: 0.74rem; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.st-table { width: 100%; border-collapse: collapse; }
.st-table th { text-align: left; white-space: nowrap; }
.st-sorthead { appearance: none; background: transparent; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.st-sorthead:hover { text-decoration: underline; }
.st-sorthead:focus-visible { outline: 3px solid var(--info-line); outline-offset: 2px; }
.st-table td { vertical-align: top; }
.st-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.st-actions .btn { min-height: 2.5rem; display: inline-flex; align-items: center; text-decoration: none; }

.st-cards { display: grid; gap: 0.75rem; }
.st-card { background: var(--card); border: 1px solid var(--line); border-left: 0.4rem solid var(--line); border-radius: 0.75rem; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.65rem; }
.st-card--ok { border-left-color: var(--ok-line); }
.st-card--warn { border-left-color: var(--warn-line); }
.st-card--stop { border-left-color: var(--stop-line); }
.st-card--archived { border-left-color: #b8bec4; background: var(--bg); }
.st-card__top { display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr) auto; gap: 0.5rem 1rem; align-items: start; }
.st-date__main { font-weight: 700; font-variant-numeric: tabular-nums; }
.st-date__sub, .st-date__none { font-size: 0.8rem; color: var(--ink-soft); }
.st-name { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.st-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }
.st-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.4rem 1rem; }
.st-meta > div { display: flex; flex-direction: column; min-width: 0; }
.st-lbl { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.st-val { overflow-wrap: anywhere; }
.st-val.is-empty { color: var(--ink-soft); font-style: italic; }
.st-foot { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: space-between; align-items: center; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.st-slip { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.3rem 0.65rem; border: 1px solid #b8bec4; border-radius: 0.5rem; background: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.st-slip input { width: 1.2rem; height: 1.2rem; }
.st-slip.is-on { background: var(--ok-bg); border-color: var(--ok-line); color: #1d5330; }
.st-slip.is-readonly { cursor: default; background: var(--bg); }
.st-slip.is-saving { opacity: 0.6; }
.st-slip__by { font-weight: 400; font-size: 0.78rem; color: var(--ink-soft); }
.st-slip:focus-within { outline: 3px solid var(--info-line); outline-offset: 2px; }

/* ---------------------------------------------------------------- the form */
.stf-sec { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.stf-sec[hidden], .stf-field[hidden], .stf-row[hidden] { display: none !important; }
.stf-legend { margin: 0; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.stf-row { display: flex; gap: 1rem; align-items: flex-start; }
.stf-row > .stf-field { flex: 1 1 0; min-width: 0; }
.stf-field { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.stf-field .acc-lbl { font-size: 0.92rem; font-weight: 600; line-height: 1.4; }
.stf-req { color: var(--stop); font-weight: 700; }
.stf-sec input[type="text"], .stf-sec input[type="tel"], .stf-sec input[type="date"], .stf-sec input[type="email"], .stf-sec select, .stf-sec textarea, .st-sign input[type="text"], .st-sign textarea {
  width: 100%; min-height: 2.75rem; padding: 0.55rem 0.75rem; font: inherit; font-size: 1rem; border-radius: 0.5rem; border: 1px solid #b8bec4; background: #fff; color: var(--ink);
}
.stf-sec textarea, .st-sign textarea { min-height: 5rem; line-height: 1.5; resize: vertical; }
.stf-sec input[readonly] { background: var(--bg); color: var(--ink-soft); }
.stf-sec input:focus-visible, .stf-sec select:focus-visible, .stf-sec textarea:focus-visible, .st-sign input:focus-visible, .st-sign textarea:focus-visible { outline: 3px solid var(--info-line); outline-offset: 1px; }
.stf-time { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stf-sec .stf-time select { width: auto; min-width: 4.75rem; flex: 1 1 4.75rem; }
.stf-yn { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stf-yn .acc-check, .stf-checks .acc-check { margin: 0; min-height: 2.75rem; padding: 0.4rem 0.75rem; border: 1.5px solid #b8bec4; border-radius: 0.6rem; background: #fff; font-size: 0.95rem; }
.stf-yn .acc-check:has(input:checked), .stf-checks .acc-check:has(input:checked) { border-color: var(--primary); background: var(--info-bg); font-weight: 600; }
.stf-yn input, .stf-checks input, .stf-ack input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.stf-checks { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.stf-dates { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.stf-ack { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0; padding: 0.9rem 1rem; border: 1.5px solid #b8bec4; border-radius: 0.6rem; background: var(--bg); font-size: 0.92rem; line-height: 1.5; }
.stf-ack:has(input:checked) { background: var(--ok-bg); border-color: var(--ok-line); }
.stf-err { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--stop); }
.stf-err[hidden] { display: none; }
.stf-file { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }
.stf-drop { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.1rem; border: 2px dashed #b8bec4; border-radius: 0.75rem; background: var(--bg); cursor: pointer; }
.stf-drop:hover, .stf-drop.is-hover { border-color: var(--primary); background: var(--info-bg); }
.stf-file:focus-visible + .stf-drop { outline: 3px solid var(--info-line); outline-offset: 2px; }
.stf-drop-ic { font-size: 1.5rem; line-height: 1; font-weight: 700; }
.stf-drop small { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: var(--ink-soft); }
.stf-files { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.stf-files:empty { display: none; }
.stf-files li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; font-size: 0.85rem; }
.stf-files li.is-pending { background: var(--bg); color: var(--ink-soft); }
.stf-files li.is-err { border-color: var(--stop-line); background: var(--stop-bg); color: #7d1f1f; }
.stf-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.stf-file-size { font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.stf-file-rm { flex: 0 0 auto; padding: 0.2rem 0.65rem; min-height: 2rem; background: #fff; border: 1px solid #b8bec4; border-radius: 0.4rem; font: inherit; font-size: 0.78rem; cursor: pointer; }

/* ---------------------------------------------------------------- one request */
.st-head--ok { --sev: var(--ok-line); }
.st-head--warn { --sev: var(--warn-line); }
.st-head--stop { --sev: var(--stop-line); }
.st-head--archived { --sev: #b8bec4; }
.st-step { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.st-denial { margin: 0; }
.st-chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; counter-reset: stchain; }
.st-link { position: relative; counter-increment: stchain; padding: 0.6rem 0.8rem 0.6rem 2.6rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--bg); }
.st-link::before { content: counter(stchain); position: absolute; left: 0.7rem; top: 0.6rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; background: #fff; border: 2px solid #b8bec4; }
.st-link.is-done::before { background: #1d5330; border-color: #1d5330; color: #fff; }
.st-link.is-now { background: var(--warn-bg); border-color: var(--warn-line); }
.st-link.is-now::before { border-color: #7a4b00; }
.st-link__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; }
.st-link__state { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.st-sig { margin-top: 0.4rem; }
.st-sig img { display: block; max-width: 100%; width: 16rem; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; }
.st-chain--plain { counter-reset: stchain; }
.st-chain--plain li { counter-increment: stchain; padding: 0.35rem 0.6rem 0.35rem 2.2rem; position: relative; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--bg); }
.st-chain--plain li::before { content: counter(stchain); position: absolute; left: 0.6rem; font-weight: 700; color: var(--ink-soft); }
.st-sign .rm-pad { height: 200px; }
.st-sign { display: flex; flex-direction: column; gap: 0.8rem; }
.st-sign .stf-field { display: flex; flex-direction: column; gap: 0.35rem; }

/* ---------------------------------------------------------------- phone width */
@media (max-width: 640px) {
  .st-table thead { display: none; }
  .st-table, .st-table tbody, .st-table tr, .st-table td { display: block; width: 100%; }
  .st-table tr { margin: 0 0 0.6rem; padding: 0.5rem 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; }
  .st-table td { padding: 0.25rem 0; border: 0; }
  .st-table td[data-l]:not([data-l=""])::before { content: attr(data-l) ": "; font-weight: 700; color: var(--ink-soft); font-size: 0.75rem; }
  .st-table td:empty { display: none; }
  .st-actions .btn { flex: 1 1 6rem; justify-content: center; }
  .st-card__top { grid-template-columns: 1fr; }
  .st-badges { justify-content: flex-start; }
  .st-foot { flex-direction: column; align-items: stretch; }
  .st-slip { justify-content: flex-start; }
  .stf-row { flex-direction: column; align-items: stretch; gap: 0.9rem; }
  .stf-sec { padding: 0.9rem 0.9rem 1rem; border-radius: 0.6rem; }
  .stf-checks { grid-template-columns: 1fr; }
  .stf-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-sig img { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .st-slip, .stf-drop { transition: none; } }
@media print { .st-actions, .st-sign { display: none !important; } }
.acc-ui-body input[type="email"], .acc-ui-body input[type="text"] { width: 100%; min-height: 2.75rem; padding: 0.5rem 0.65rem; font: inherit; border: 1px solid #b8bec4; border-radius: 0.5rem; }

/* The header's facts: a wider minimum so an address ("Waiting on") is not split mid-word at desktop width. */
.st-head .rp-facts { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
