/* HaulFoundry UI Consistency, v1 — presentation only.
   Deliberately does not hide controls or change underlying application state. */
:root {
  --hfui-surface: #0c1c30;
  --hfui-surface-raised: #10263d;
  --hfui-line: rgba(115,173,224,.25);
  --hfui-line-strong: rgba(100,190,246,.46);
  --hfui-ink: #eef6ff;
  --hfui-muted: #a1b5cc;
  --hfui-radius: 13px;
  --hfui-space: 12px;
  --hfui-control-height: 40px;
}
/* Shared control geometry across every existing screen/editor. */
.view .btn, .modal .btn, .terminal-resource-actions .btn,
.hfsp-panel button, .hf-maint-review-board button {
  min-height:var(--hfui-control-height);
  border-radius:10px;
  padding:8px 12px;
  line-height:1.25;
  font-weight:700;
}
.view input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=hidden]),
.view select,.view textarea,
.modal input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=hidden]),
.modal select,.modal textarea {
  min-height:var(--hfui-control-height);
  border-radius:10px;
  border-color:var(--hfui-line);
  transition:border-color .15s ease,box-shadow .15s ease;
}
.view input:focus-visible,.view select:focus-visible,.view textarea:focus-visible,
.modal input:focus-visible,.modal select:focus-visible,.modal textarea:focus-visible,
button:focus-visible {
  outline:2px solid #66cdfa;
  outline-offset:2px;
}
/* Cards, sections, heading rhythm: predictable padding and alignment. */
.view>.card,.view .card,.modal .sheet,.terminal-list-card,
.terminal-resource,.coverage-run,.coverage-driver,.hf-maint-review-card,
.hfsp-panel,.hfsp-day {
  border-radius:var(--hfui-radius);
}
.view>.card { padding:clamp(13px,1.5vw,20px);margin-block:12px; }
.view .section {gap:12px;margin-block:17px 9px;flex-wrap:wrap;}
.view .section h2 {font-size:16px;line-height:1.3;letter-spacing:-.015em;}
.view .card h3,.modal .sheet h3 {letter-spacing:-.012em;line-height:1.3;}
.view .sub,.modal .sub {line-height:1.45;}
/* A consistent grid that never collapses labels or fields into zero-width columns. */
.view .form,.modal .form {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.view .form>*,.modal .form>* {min-width:0;}
.view label,.modal label {line-height:1.45;}
.modal .sheet {scrollbar-gutter:stable;}
.modal .actions {gap:10px;flex-wrap:wrap;margin-top:16px;}
.modal .actions>.btn {min-width:96px;}
/* Actions wrap rather than overflowing; preserving every existing action. */
.item-actions,.terminal-resource-actions,.hfsi-actions {
  gap:8px;flex-wrap:wrap;align-items:center;
}
.item-actions .btn {flex:1 1 112px;}
.terminal-resource-actions .btn {min-width:112px;}
/* Numerical badges and information blocks align visually throughout modules. */
.view .metric,.view .timeline-card,.view .readiness-card,
.view .terminal-resource,.view .coverage-run,.view .coverage-driver {
  border-radius:12px;
}
.view .metric {padding:14px;min-height:83px;}
.view .metric span {line-height:1.35;letter-spacing:.045em;}
/* Don't visually imply a destructive action is equal to the primary Save action. */
.btn.remove,.btn.danger,button[onclick*="deleteRun"],button[onclick*="removeDriver"] {
  border-color:rgba(244,127,148,.4);
}
/* Subtle clarity: empty/error messages remain visible; nothing is concealed. */
.terminal-note,.tiny,.view .sub {overflow-wrap:break-word;}
@media(max-width:700px){
  .view .form,.modal .form {gap:9px;}
  .view>.card {padding:13px;}
  .view .section {margin-block:12px 7px;}
  .modal .actions>.btn {flex:1 1 115px;}
  .item-actions .btn {flex:1 1 110px;}
}
@media(max-width:420px){
  .view .form,.modal .form {grid-template-columns:minmax(0,1fr);}
  .hfui-date-time-popover {width:min(340px,calc(100vw - 20px));}
}
/* Date and time helper: rendered in a portal without wrapping/moving app inputs. */
.hfui-date-time-popover {
  position:fixed;display:none;z-index:120000;
  width:min(340px,calc(100vw - 20px));
  background:#10263c;border:1px solid var(--hfui-line-strong);
  color:var(--hfui-ink);border-radius:14px;
  box-shadow:0 18px 48px rgba(0,0,0,.52);
  padding:12px;font:12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.hfui-date-time-popover[data-open="true"] {display:block;}
.hfui-dt-head {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;}
.hfui-dt-head strong {font-size:13px;letter-spacing:-.01em;}
.hfui-dt-help {color:var(--hfui-muted);font-size:11px;margin-bottom:9px;}
.hfui-dt-entry {display:flex;gap:7px;margin-bottom:9px;}
.hfui-dt-entry input {flex:1;min-width:0;min-height:39px!important;width:100%;
  padding:8px 10px;border:1px solid #365b7a;border-radius:9px;
  background:#091c2e;color:#edf6ff;font-size:14px;}
.hfui-date-time-popover button {
  min-height:35px;border-radius:9px;border:1px solid #365b7a;
  padding:6px 10px;background:#193550;color:#e8f4ff;
  font-size:12px;font-weight:750;white-space:nowrap;cursor:pointer;
}
.hfui-date-time-popover button:hover {background:#234967;border-color:#69bdea;}
.hfui-date-time-popover button:focus-visible,.hfui-date-time-popover input:focus-visible {outline:2px solid #69d2fc;outline-offset:2px;}
.hfui-date-time-popover button.hfui-dt-primary {background:#41b9f5;color:#062032;border-color:#64cbff;}
.hfui-date-time-popover button.hfui-dt-close {background:transparent;border-color:transparent;font-size:17px;min-height:27px;padding:1px 8px;}
.hfui-dt-shortcuts {display:flex;gap:7px;flex-wrap:wrap;}
.hfui-dt-error {font-size:11px;color:#ffafba;margin:0 0 7px;min-height:0;}
.hfui-dt-error:empty {display:none;}
@media(prefers-reduced-motion:reduce){.hfui-date-time-popover *, .view input,.modal input {transition:none!important;}}
/* Native pickers remain available and legible on dark backgrounds. */
input[type="date"],input[type="time"],input[type="datetime-local"] {color-scheme:dark;}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {cursor:pointer;opacity:.88;}
/* Repeated feature-specific grids and panels share the same baseline control spacing. */
.hfsp-panel input,.hfsp-panel select,.hfsp-panel button,
.hfsi-sheet input,.hfsi-sheet select,.hfsi-sheet button,
.fleet-profile-section input,.fleet-profile-section select,
.hf-maint-review-board input,.hf-maint-review-board select {
  border-radius:10px;
}
.hfsp-panel input[type="date"],.hfsp-panel input[type="time"],
.hfsi-sheet input[type="date"],.hfsi-sheet input[type="time"] {min-height:40px;}
