/* Pit Stops + Drivers — shared V5 tab layout */

.tab-panel-wrap {
  width: 100%;
  max-width: none;
}

.tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tab-header-row .hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim, #9aa0a8);
  max-width: 520px;
}

.car-pick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.car-pick-bar .pick-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim, #9aa0a8);
  margin-right: 4px;
}

.car-pick-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border, #2a3040);
  border-radius: 3px;
  background: var(--panel, #1a1d24);
  color: var(--text, #e8eaed);
  cursor: pointer;
}

.car-pick-btn.active {
  border-color: var(--cyan, #0a9e8e);
  background: rgba(10, 158, 142, 0.15);
  color: var(--cyan, #0a9e8e);
}

.form-card {
  background: var(--panel, #1a1d24);
  border: 1px solid var(--border, #2a3040);
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 10px;
}

.form-card-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim, #9aa0a8);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #2a3040);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 12px;
}

.form-cell label {
  display: block;
  font-size: 11px;
  color: var(--text-dim, #9aa0a8);
  margin-bottom: 3px;
}

.form-cell input,
.form-cell select,
.form-cell textarea {
  width: 100%;
}

.form-subhead {
  margin: 8px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan, #0a9e8e);
}

.temp-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.temp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.temp-cell span {
  font-size: 10px;
  color: var(--text-dim, #9aa0a8);
}

.temp-cell input {
  width: 64px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pit-log-wrap,
.drv-stint-wrap {
  overflow: auto;
  border: 1px solid var(--border, #2a3040);
  border-radius: 3px;
  flex: 1;
  min-height: 120px;
}

.pit-log-table,
.drv-stint-table,
.drv-call-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pit-log-table th,
.pit-log-table td,
.drv-stint-table th,
.drv-stint-table td,
.drv-call-table th,
.drv-call-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border, #2a3040);
  text-align: center;
  white-space: nowrap;
}

.pit-log-table th,
.drv-stint-table th,
.drv-call-table th {
  position: sticky;
  top: 0;
  background: var(--panel-elevated, #22262e);
  color: var(--text-dim, #9aa0a8);
  font-weight: 600;
  z-index: 1;
}

.pit-log-table td.notes-col,
.drv-stint-table td.notes-col {
  text-align: left;
  white-space: normal;
  min-width: 140px;
}

.pit-log-table tbody tr,
.drv-stint-table tbody tr {
  cursor: pointer;
}

.pit-log-table tbody tr:hover,
.drv-stint-table tbody tr:hover {
  background: rgba(10, 158, 142, 0.08);
}

.pit-log-table tbody tr.selected,
.drv-stint-table tbody tr.selected {
  background: rgba(10, 158, 142, 0.18);
}

.drv-call-table tbody tr.tyre-call {
  background: #1e3a5f;
  color: #e8edf4;
}

.drv-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 300px);
  gap: 12px;
  align-items: start;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  height: auto;
}

.drv-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drv-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Wet call — always first on Drivers */
.drv-wet-banner {
  background: var(--panel, #1a1d24);
  border: 1px solid var(--border, #2a3040);
  border-left: 4px solid var(--text-dim, #9aa0a8);
  padding: 12px 14px;
}

.drv-wet-banner.is-dry {
  border-left-color: #0a9e8e;
}

.drv-wet-banner.is-inter {
  border-left-color: #d4a017;
}

.drv-wet-banner.is-wet {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(30, 58, 95, 0.55) 0%, var(--panel, #1a1d24) 55%);
}

.drv-wet-banner.is-empty {
  border-left-color: var(--border-bright, #3a4254);
}

.drv-wet-banner-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.drv-wet-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #9aa0a8);
}

.drv-wet-call {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text, #e8eaed);
  letter-spacing: 0.01em;
}

.drv-wet-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.drv-wet-summary {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim, #9aa0a8);
  line-height: 1.45;
}

.drv-wet-table-wrap {
  max-height: 96px;
  margin-top: 0;
}

.drv-schedule-card .form-card-title--inline {
  margin: 0 0 4px;
  padding-bottom: 0;
  border-bottom: 0;
}

.drv-schedule-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drv-filter-inp {
  width: 140px;
  min-width: 100px;
}

.drv-meta-grid {
  margin-top: 10px;
}

.drv-stint-wrap--spaced {
  margin-top: 12px;
  max-height: min(42vh, 420px);
}

.drv-stint-table {
  font-size: 13px;
}

.drv-stint-table th.col-tyre,
.drv-stint-table td.col-tyre {
  min-width: 110px;
}

.drv-stint-table th.col-driver,
.drv-stint-table td.col-driver {
  text-align: left;
  font-weight: 600;
  min-width: 100px;
}

.drv-stint-table th.col-window,
.drv-stint-table td.col-window {
  font-family: var(--mono, monospace);
  letter-spacing: 0.02em;
}

.drv-stint-table td.col-num {
  color: var(--text-dim, #9aa0a8);
  font-family: var(--mono, monospace);
  width: 36px;
}

.drv-tyre-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border, #2a3040);
  background: var(--panel-alt, #12151c);
}

.drv-tyre-chip.tyre-wet {
  border-color: #3b82f6;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
}

.drv-tyre-chip.tyre-dry {
  border-color: rgba(10, 158, 142, 0.45);
  color: #5eead4;
  background: rgba(10, 158, 142, 0.1);
}

.drv-stint-table td.col-dur,
.drv-stint-table td.col-fuel,
.drv-tracker-table td:nth-child(2),
.drv-tracker-table td:nth-child(3) {
  font-family: var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

.drv-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drv-bottom-grid > .form-card {
  margin-bottom: 0;
}

.drv-summary-box {
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text, #e8eaed);
  white-space: pre-wrap;
  padding: 8px;
  border: 1px solid var(--border, #2a3040);
  border-radius: 3px;
  background: var(--bg, #12151a);
}

.drv-muted {
  font-size: 11px;
  color: var(--text-dim, #9aa0a8);
  margin-bottom: 8px;
  line-height: 1.4;
}

@media (max-width: 1000px) {
  .drv-layout { grid-template-columns: 1fr; }
  .drv-bottom-grid { grid-template-columns: 1fr; }
  .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3 { grid-template-columns: 1fr; }
}

/* Drivers tab modifiers (from shared utilities migration) */
.form-card--nested {
  margin-top: 10px;
  padding: 10px;
}

.form-card-title--tight {
  margin-bottom: 8px;
}

.drv-stint-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.drv-stint-hint {
  margin: 0;
  flex: 1 1 auto;
}

.drv-stint-wrap--short {
  margin-top: 10px;
  max-height: 80px;
}

.drv-inp-stint { max-width: 48px; }
.drv-inp-driver { max-width: 128px; }
.drv-inp-start,
.drv-inp-end,
.drv-inp-duration { max-width: 80px; }
.drv-inp-tyre_set { max-width: 112px; }
.drv-inp-fuel_in,
.drv-inp-fuel_out { max-width: 80px; }

/* Pit stop log — tyre set + pressures early in the row */
.pit-log-table th:nth-child(4),
.pit-log-table td.pit-tyre-cell {
  font-weight: 600;
  min-width: 7rem;
}

.pit-log-table th:nth-child(5),
.pit-log-table td.pit-pressures-cell {
  white-space: nowrap;
  font-family: var(--mono, monospace);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.pit-log-table tbody tr.pit-tyre-only {
  background: rgba(56, 120, 180, 0.12);
}

.pit-log-table tbody tr.pit-tyre-only:hover {
  background: rgba(56, 120, 180, 0.2);
}

.pit-log-table tbody tr.pit-tyre-only.selected {
  background: rgba(56, 120, 180, 0.28);
}

.pit-log-table tbody tr.pit-just-logged {
  outline: 2px solid #3d8fd1;
  animation: pit-flash 1.2s ease-out 2;
}

@keyframes pit-flash {
  from { background: rgba(61, 143, 209, 0.45); }
  to { background: rgba(56, 120, 180, 0.12); }
}

.pit-log-preview {
  margin: 8px 0 0;
  min-height: 1.2em;
  color: var(--accent, #3d8fd1);
}

/* Tank reading — the one measurement that anchors the fuel calc, so it gets a
   visible nudge rather than looking like just another optional box. The real
   24H log recorded it once in six stops. */
.pit-anchor-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fd4f5;
  background: #1a3a5c;
  border: 1px solid #4ea8de;
}

.pit-anchor-cell .input-ctl:placeholder-shown {
  border-color: #4ea8de;
}

/* What the calculator will conclude from what's typed, shown before submit
   rather than in a toast after it. */
.pit-fuel-consequence {
  margin: 8px 0 0;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.45;
  border-left: 3px solid var(--border-bright, #3a4254);
  background: var(--panel-alt, #12151c);
  color: var(--text-dim, #9aa0a8);
}

.pit-fuel-consequence.is-good {
  border-left-color: #2ea86a;
  color: #b8f0c8;
}

.pit-fuel-consequence.is-warn {
  border-left-color: #d4a017;
  color: #f0d9a0;
}
