/* ── Refuel Tracker — page-specific styles ─────────────────────────────── */

/* Override container to allow vertical scroll on this page */
.refuel-container {
  overflow-y: auto;
  height: auto;
  padding-top: 24px;
  padding-bottom: 24px;
  align-items: start;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.rf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 20px;
}
.rf-card:last-child { margin-bottom: 0; }

.fleet-count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
}
.fleet-count + .fleet-count::before {
  content: '·';
  margin-right: 6px;
  opacity: 0.4;
}

.rf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.rf-card-title {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: block;
}
.rf-card-header .rf-card-title { margin-bottom: 0; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.rf-field { margin-bottom: 12px; }
.rf-field:last-child { margin-bottom: 0; }

.rf-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-family: var(--mono);
}
.rf-optional { opacity: 0.5; }

.rf-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 7px 10px;
  border-radius: 3px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.12s;
  box-sizing: border-box;
}
.rf-input:focus { border-color: var(--accent); }
.rf-input::placeholder { color: var(--text-muted); }
.rf-input.input-error { border-color: var(--danger); animation: shake 0.3s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

.rf-num { font-family: var(--mono); }

.rf-fuel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.rf-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
  font-family: var(--mono);
}

/* ── Fuel label colors ───────────────────────────────────────────────────── */
.fuel-lbl-h { color: #38bdf8; }
.fuel-lbl-q { color: #a78bfa; }
.fuel-lbl-r { color: #fbbf24; }

/* ── Capacity bar ────────────────────────────────────────────────────────── */
.rf-cap-bar-wrap { margin-bottom: 14px; }

.rf-cap-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  margin-bottom: 6px;
}

.rf-cap-fill { height: 100%; transition: width 0.3s ease; }
.cap-h { background: #38bdf8; }
.cap-q { background: #a78bfa; }

.rf-cap-labels {
  display: flex;
  gap: 6px;
}

/* ── Fuel tags ───────────────────────────────────────────────────────────── */
.fuel-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 700;
}
.fuel-h { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.25); }
.fuel-q { background: rgba(167, 139, 250, 0.12); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.25); }
.fuel-r         { background: rgba(251,191,36,0.10);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }
.fuel-ambush     { background: rgba(244,63,94,0.12);  color: #f43f5e; border: 1px solid rgba(244,63,94,0.28); }
.fuel-ambush-ok  { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.28); }
.fuel-tag-custom { background: rgba(100,116,139,0.12); color: #94a3b8; border: 1px solid rgba(100,116,139,0.25); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.rf-btn-primary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: border-color 0.12s, color 0.12s;
}
.rf-btn-primary:hover { border-color: var(--accent); color: var(--accent); }

.rf-io-row { display: flex; gap: 6px; }
.rf-io-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.12s;
}
.rf-io-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Stats search ────────────────────────────────────────────────────────── */
.rf-search {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  width: 180px;
  transition: border-color 0.12s;
}
.rf-search:focus { border-color: var(--accent); }
.rf-search::placeholder { color: var(--text-muted); }

/* ── Stats table ─────────────────────────────────────────────────────────── */
.rf-table-wrap { overflow-x: auto; margin-bottom: 12px; }

.rf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rf-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.rf-table th:nth-child(2),
.rf-table th:nth-child(5),
.rf-table th:nth-child(6) { text-align: center; }

.th-sub {
  font-size: 8px;
  opacity: 0.6;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  display: block;
}

.rf-table tr:hover td { background: rgba(255,255,255,0.02); }

.rf-table td { padding: 7px 10px; border-bottom: 1px solid rgba(28,52,80,0.4); vertical-align: middle; }

.rf-td-ship { color: var(--text-bright); font-size: 12px; }
.rf-td-n    { text-align: center; }
.rf-td-fuel { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.rf-td-serve { text-align: center; }
.rf-td-age  { text-align: center; font-family: var(--mono); font-size: 11px; }

.rf-avg   { color: var(--text-bright); font-weight: 600; }
.rf-range { color: var(--text-muted); font-size: 11px; }
.rf-over  { color: var(--danger); font-weight: 600; }
.rf-muted { color: var(--text-muted); }
.rf-count { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

.rf-empty-cell {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--mono);
}

.rf-stale-tag {
  color: var(--warn);
  margin-left: 4px;
  font-size: 11px;
  cursor: help;
}

/* ── Serve badges ────────────────────────────────────────────────────────── */
.rf-serve {
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  white-space: nowrap;
}
.serve-always   { background: rgba(0,229,160,0.12);  color: var(--success); border: 1px solid rgba(0,229,160,0.25); }
.serve-usually  { background: rgba(245,158,11,0.12); color: var(--warn);    border: 1px solid rgba(245,158,11,0.25); }
.serve-unlikely { background: rgba(255,77,106,0.12); color: var(--danger);  border: 1px solid rgba(255,77,106,0.25); }
.serve-unknown  { background: rgba(90,122,150,0.12); color: var(--text-muted); border: 1px solid rgba(90,122,150,0.2); }

/* ── Legend ──────────────────────────────────────────────────────────────── */
.rf-legend {
  font-size: 10px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 2;
}

/* ── History ─────────────────────────────────────────────────────────────── */
.rf-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
  padding: 8px 0;
}

.hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(28,52,80,0.4);
  font-size: 12px;
}
.hist-row:last-child { border-bottom: none; }

.hist-ship  { flex: 1; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-fuels { display: flex; gap: 4px; flex-shrink: 0; }
.hist-date  { color: var(--text-muted); font-family: var(--mono); font-size: 10px; flex-shrink: 0; }
.hist-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 3px;
  opacity: 0;
  transition: color 0.1s, opacity 0.1s;
  flex-shrink: 0;
  line-height: 1;
}
.hist-row:hover .hist-action-btn { opacity: 1; }
.hist-edit-btn:hover   { color: var(--accent); }
.hist-del-btn:hover    { color: var(--danger); }

/* Edit row */
.hist-row-edit {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
.hist-row-edit .hist-action-btn { opacity: 1; }

.hist-edit-ship {
  width: 100%;
  height: 26px;
  font-size: 12px;
  padding: 0 6px;
  box-sizing: border-box;
}
.hist-edit-row2 {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}
.hist-edit-right {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
}
.hist-edit-num {
  width: 52px;
  height: 26px;
  font-size: 12px;
  padding: 0 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.hist-edit-reward {
  width: 68px;
  height: 26px;
  font-size: 12px;
  padding: 0 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.hist-save-btn { color: var(--success) !important; opacity: 1 !important; }
.hist-cancel-btn { color: var(--text-muted) !important; opacity: 1 !important; }
.hist-save-btn:hover   { color: var(--success) !important; }
.hist-cancel-btn:hover { color: var(--danger)  !important; }

/* ── Ambush toggles ──────────────────────────────────────────────────────── */
.ambush-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.ambush-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.ambush-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

/* ── Log insight ─────────────────────────────────────────────────────────── */
.log-insight {
  margin-top: 6px;
  min-height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.insight-label { color: var(--text-muted); font-family: var(--mono); }

/* ── Textarea ────────────────────────────────────────────────────────────── */
.rf-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--mono);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.12s;
}
.rf-textarea:focus { border-color: var(--accent); }

/* ── Pod configurator ────────────────────────────────────────────────────── */
.pod-config-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0 6px;
}
.pod-config-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.pod-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(28,52,80,0.4);
}
.pod-row:last-child { border-bottom: none; }

.pod-index {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
  width: 38px;
  flex-shrink: 0;
}
.pod-toggle {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.pod-fuel-btn {
  height: 22px;
  padding: 0 9px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.pod-fuel-btn:hover { border-color: var(--accent); color: var(--accent); }

.pod-hf-on {
  background: rgba(56,189,248,0.15);
  color: #38bdf8;
  border-color: rgba(56,189,248,0.4);
}
.pod-qf-on {
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  border-color: rgba(167,139,250,0.4);
}

/* Ops-log pod info (read-only span) */
.pod-type-info {
  flex: 1;
  font-size: 11px;
  color: var(--text);
  font-family: var(--mono);
}

/* Pod type label — base button style (planner) */
.pod-type-label {
  flex: 1;
  font-size: 11px;
  font-family: var(--mono);
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: default;
  color: var(--text);
}

/* Swappable pod type button */
.pod-type-swap {
  color: var(--text);
  cursor: pointer;
}
.pod-type-swap:hover { color: var(--accent); }

/* Pod selector — inline picker that opens below a pod row */
.pod-row-wrap { display: flex; flex-direction: column; }

.pod-selector {
  margin: 2px 0 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.pod-selector-note {
  padding: 6px 10px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--warn);
  background: rgba(245,158,11,0.06);
  border-bottom: 1px solid rgba(245,158,11,0.18);
  line-height: 1.5;
}

.pod-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(28,52,80,0.4);
  transition: background 0.1s;
}
.pod-option:last-child { border-bottom: none; }
.pod-option:hover { background: rgba(0,212,255,0.06); }

.pod-opt-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
  min-width: 64px;
}
.pod-opt-mfr {
  flex: 1;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
}
.pod-opt-cap {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Config ship info ────────────────────────────────────────────────────── */
.cfg-ship-info {
  margin-top: 6px;
  min-height: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ship-info-pill {
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(0,212,255,0.08);
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.18);
}

.ship-info-note {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
  width: 100%;
  margin-top: 2px;
}

/* Autocomplete sub-text inside dropdowns */
.dd-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--mono);
  letter-spacing: 0;
  text-transform: none;
  margin-top: 1px;
}

/* ── Patch version badge ─────────────────────────────────────────────────── */
.patch-badge {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
}

/* ── Disabled dropdown option (coming soon ships) ───────────────────────── */
.comm-option-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Serviceable Ships — group headers ──────────────────────────────────── */
.serve-group-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0 4px;
  margin-top: 12px;
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.serve-group-hdr:first-child { margin-top: 0; }

.serve-ghdr-always  { color: var(--success); border-bottom-color: rgba(0,229,160,0.2); }
.serve-ghdr-usually { color: var(--warn);    border-bottom-color: rgba(245,158,11,0.2); }
.serve-ghdr-unlikely { color: var(--danger); border-bottom-color: rgba(255,77,106,0.2); }
.serve-ghdr-unknown  { color: var(--text-muted); }

.serve-ghdr-count {
  font-weight: 400;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
}

/* ── Serviceable Ships — rows ───────────────────────────────────────────── */
.serve-row {
  display: flex;
  align-items: center;
  padding: 5px 0;
  gap: 8px;
  border-bottom: 1px solid rgba(28,52,80,0.35);
  font-size: 12px;
}
.serve-row:last-child { border-bottom: none; }

.serve-ship-name {
  flex: 1;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-fuel {
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}
.sfv-ok   { color: var(--success); font-weight: 600; }
.sfv-over { color: var(--danger);  font-weight: 600; }
.sfv-sep  { color: var(--text-muted); opacity: 0.35; }
.sfv-unit   { font-size: 10px; }
.sfv-unit-h { color: #38bdf8; }
.sfv-unit-q { color: #a78bfa; }
.sfv-dot  { color: var(--text-muted); opacity: 0.35; margin: 0 2px; }
.sfv-est  { color: var(--text-muted); font-size: 10px; margin-right: 1px; }

.sample-n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 14px;
  text-align: right;
}
.sample-n-est { color: var(--warn); }

/* ── Efficiency counter ─────────────────────────────────────────────────── */
.serve-efficiency {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--mono);
  flex-shrink: 0;
}
#serve-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
  line-height: 1;
}
.serve-eff-of {
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .refuel-container { grid-template-columns: 1fr; }
  .rf-search { width: 140px; }
  .rf-table th:nth-child(6),
  .rf-table td:nth-child(6) { display: none; }
}
