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

.dr-row.is-focus { background: var(--info-bg); }

/* ---------------------------------------------------------------- the form */
.drf-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; }
.drf-sec[hidden], .drf-field[hidden], .drf-row[hidden] { display: none !important; }
.drf-legend { margin: 0; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.drf-row { display: flex; gap: 1rem; align-items: flex-start; }
.drf-row > .drf-field { flex: 1 1 0; min-width: 0; }
.drf-field { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.drf-field .acc-lbl { font-size: 0.92rem; font-weight: 600; line-height: 1.4; }
.drf-req { color: var(--stop); font-weight: 700; }
.drf-sec input[type="text"], .drf-sec input[type="tel"], .drf-sec input[type="date"], .drf-sec input[type="email"], .drf-sec select, .drf-sec textarea, .dr-sign input[type="text"], .dr-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);
}
.drf-sec textarea, .dr-sign textarea { min-height: 5rem; line-height: 1.5; resize: vertical; }
.drf-sec input[readonly] { background: var(--bg); color: var(--ink-soft); }
.drf-sec input:focus-visible, .drf-sec select:focus-visible, .drf-sec textarea:focus-visible, .dr-sign input:focus-visible, .dr-sign textarea:focus-visible { outline: 3px solid var(--info-line); outline-offset: 1px; }
/* Two calendar inputs, From and To (a blank To is a single day). */
.drf-yn, .drf-checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.drf-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.drf-yn .acc-check, .drf-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; }
.drf-yn .acc-check:has(input:checked), .drf-checks .acc-check:has(input:checked) { border-color: var(--primary); background: var(--info-bg); font-weight: 600; }
.drf-yn input, .drf-checks input, .drf-ack input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.drf-field--yesno select { max-width: 24rem; }
.drf-sec input.is-auto { background: var(--bg); color: var(--ink-soft); }
.drf-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; }
.drf-ack:has(input:checked) { background: var(--ok-bg); border-color: var(--ok-line); }
.drf-err { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--stop); }
.drf-err[hidden] { display: none; }
.drf-file { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }
.drf-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; }
.drf-drop:hover, .drf-drop.is-hover { border-color: var(--primary); background: var(--info-bg); }
.drf-file:focus-visible + .drf-drop { outline: 3px solid var(--info-line); outline-offset: 2px; }
.drf-drop-ic { font-size: 1.5rem; line-height: 1; font-weight: 700; }
.drf-drop small { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: var(--ink-soft); }
.drf-files { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.drf-files:empty { display: none; }
.drf-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; }
.drf-files li.is-pending { background: var(--bg); color: var(--ink-soft); }
.drf-files li.is-err { border-color: var(--stop-line); background: var(--stop-bg); color: #7d1f1f; }
.drf-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.drf-file-size { font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.drf-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 */
.dr-head--ok { --sev: var(--ok-line); }
.dr-head--warn { --sev: var(--warn-line); }
.dr-head--stop { --sev: var(--stop-line); }
.dr-head--archived { --sev: #b8bec4; }
.dr-step { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.dr-denial { margin: 0; }
.dr-chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; counter-reset: stchain; }
.dr-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); }
.dr-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; }
.dr-link.is-done::before { background: #1d5330; border-color: #1d5330; color: #fff; }
.dr-link.is-now { background: var(--warn-bg); border-color: var(--warn-line); }
.dr-link.is-now::before { border-color: #7a4b00; }
.dr-link__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; }
.dr-link__state { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.dr-sig { margin-top: 0.4rem; }
.dr-sig img { display: block; max-width: 100%; width: 16rem; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; }
.dr-chain--plain { counter-reset: stchain; }
.dr-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); }
.dr-chain--plain li::before { content: counter(stchain); position: absolute; left: 0.6rem; font-weight: 700; color: var(--ink-soft); }
.dr-sign .rm-pad { height: 200px; }
.dr-sign { display: flex; flex-direction: column; gap: 0.8rem; }
.dr-sign .drf-field { display: flex; flex-direction: column; gap: 0.35rem; }

/* ---------------------------------------------------------------- phone width */
@media (max-width: 640px) {
  .dr-table thead { display: none; }
  .dr-table, .dr-table tbody, .dr-table tr, .dr-table td { display: block; width: 100%; }
  .dr-table tr { margin: 0 0 0.6rem; padding: 0.5rem 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; }
  .dr-table td { padding: 0.25rem 0; border: 0; }
  .dr-table td[data-l]:not([data-l=""])::before { content: attr(data-l) ": "; font-weight: 700; color: var(--ink-soft); font-size: 0.75rem; }
  .dr-table td:empty { display: none; }
  .dr-actions .btn { flex: 1 1 6rem; justify-content: center; }
  .drf-row { flex-direction: column; align-items: stretch; gap: 0.9rem; }
  .drf-sec { padding: 0.9rem 0.9rem 1rem; border-radius: 0.6rem; }
  .drf-checks { grid-template-columns: 1fr; }
  .dr-sig img { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .drf-drop { transition: none; } }
@media print { .dr-actions, .dr-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. */
.dr-head .rp-facts { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
