/* ====================================================================
   Fleet dashboard — standalone styles layered on app.css
   ====================================================================
   Three-section grid: KPI strip / body (list + detail) / live feed.
   Body grows to fill the viewport; only the inner panels scroll. */

body.d-fleet-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 1100px 700px at 50% -15%,
      rgba(140, 158, 255, 0.05) 0%, transparent 60%),
    var(--d-bg);
}

.d-fleet-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 28px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Header strip ──────────────────────────────────────────────── */
.d-fleet-header {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}
.d-fleet-title {
  font-size: 1.6rem;
  margin: 4px 0 0;
  background: linear-gradient(180deg, #f4f6fb 0%, #c8d0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.d-fleet-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}
.d-fleet-filters .d-input { max-width: 220px; }
.d-fleet-filters .d-input.small { font-size: 0.82rem; padding: 5px 8px; max-width: 180px; }

/* ── KPI strip ─────────────────────────────────────────────────── */
.d-fleet-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 960px) { .d-fleet-kpis { grid-template-columns: repeat(2, 1fr); } }

.d-fleet-kpi {
  background: linear-gradient(180deg,
      rgba(28, 36, 64, 0.7) 0%, rgba(17, 23, 42, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.30);
  border-radius: var(--d-radius);
  padding: 12px 16px;
}
.d-fleet-kpi-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.005em;
  background: linear-gradient(180deg, #f4f6fb 0%, #d4dbeb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}
.d-fleet-kpi-value.pos  { background: linear-gradient(180deg, #c6f5dd 0%, #6fdfb2 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.d-fleet-kpi-value.warn { background: linear-gradient(180deg, #ffe8b8 0%, #e9b964 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.d-fleet-kpi-value.crit { background: linear-gradient(180deg, #ffd1cf 0%, #e57878 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.d-fleet-kpi-value.mono { font-family: var(--font-mono); font-size: 1.3rem; }

/* ── Body: list + detail drawer ────────────────────────────────── */
.d-fleet-body {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
@media (max-width: 960px) { .d-fleet-body { grid-template-columns: 1fr; } }

.d-fleet-list-panel,
.d-fleet-detail {
  background: linear-gradient(180deg,
      rgba(28, 36, 64, 0.6) 0%, rgba(17, 23, 42, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--d-radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.d-fleet-list-head,
.d-fleet-feed-head,
.d-fleet-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.d-fleet-list { flex: 1; min-height: 0; overflow-y: auto; }

.d-fleet-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 160ms;
}
.d-fleet-row:hover    { background: rgba(140, 158, 255, 0.04); }
.d-fleet-row.selected {
  background: linear-gradient(90deg,
      rgba(140, 158, 255, 0.10) 0%, rgba(140, 158, 255, 0.02) 80%);
  border-left: 2px solid var(--d-iris);
  padding-left: 12px;
}
.d-fleet-row-label  { font-size: 0.92rem; font-weight: 500; }
.d-fleet-row-sub    { font-size: 0.74rem; color: var(--d-text-dim); margin-top: 1px; }
.d-fleet-row-right  { text-align: right; }

.d-fleet-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0);
}
.d-fleet-dot.status-live     { background: var(--d-pos); box-shadow: 0 0 0 3px rgba(111, 223, 178, 0.18); animation: d-pulse-live 2s ease-in-out infinite; }
.d-fleet-dot.status-recent   { background: var(--d-iris); }
.d-fleet-dot.status-stale    { background: var(--d-warn); }
.d-fleet-dot.status-offline  { background: var(--d-text-dim); }
.d-fleet-dot.status-unpaired { background: #b3915d; }
@keyframes d-pulse-live {
  0%, 100% { box-shadow: 0 0 0 3px rgba(111, 223, 178, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(111, 223, 178, 0.05); }
}

/* ── Detail panel ──────────────────────────────────────────────── */
.d-fleet-detail-empty {
  padding: 20px 24px;
  color: var(--d-text-mute);
}
#detail-content { padding: 14px 20px 18px; overflow-y: auto; min-height: 0; }

.d-fleet-detail-head {
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 12px;
}
.d-fleet-detail-head h2 {
  background: linear-gradient(180deg, #f4f6fb 0%, #c8d0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.d-fleet-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 720px) { .d-fleet-detail-grid { grid-template-columns: repeat(2, 1fr); } }

.d-fleet-stat {
  padding: 10px 14px;
  background: rgba(17, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.d-fleet-stat .mono {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-top: 2px;
  color: var(--d-text);
}

.d-fleet-pos {
  background: rgba(17, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.d-fleet-pos .d-mono { color: var(--d-text); margin-top: 4px; }

.d-fleet-section { margin-bottom: 16px; }

.d-fleet-alerts, .d-fleet-events { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.d-fleet-alert {
  padding: 10px 12px;
  background: rgba(17, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--d-warn);
  border-radius: 6px;
}
.d-fleet-alert.sev-crit { border-left-color: var(--d-crit); }
.d-fleet-alert.sev-info { border-left-color: var(--d-iris); }
.d-fleet-alert-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.d-fleet-alert-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* ── Live event feed ───────────────────────────────────────────── */
.d-fleet-feed {
  background: linear-gradient(180deg,
      rgba(28, 36, 64, 0.55) 0%, rgba(17, 23, 42, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--d-radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  max-height: 200px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.d-fleet-feed-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; }

.d-fleet-event-line, .d-fleet-event-line.sev-info {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.84rem;
}
.d-fleet-event-line:hover { background: rgba(140, 158, 255, 0.04); }
.d-fleet-event-summary { color: var(--d-text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Severity chips (shared with the alerts panel) ─────────────── */
.d-chip.sev-info { background: rgba(140, 158, 255, 0.12); color: var(--d-iris-hi); }
.d-chip.sev-warn { background: rgba(233, 185, 100, 0.14); color: var(--d-warn); }
.d-chip.sev-crit { background: rgba(229, 120, 120, 0.16); color: var(--d-crit); }
.d-chip.status-live     { background: rgba(111, 223, 178, 0.14); color: var(--d-pos); }
.d-chip.status-recent   { background: rgba(140, 158, 255, 0.14); color: var(--d-iris-hi); }
.d-chip.status-stale    { background: rgba(233, 185, 100, 0.14); color: var(--d-warn); }
.d-chip.status-offline  { background: rgba(95, 103, 126, 0.20);  color: var(--d-text-mute); }
.d-chip.status-unpaired { background: rgba(201, 169, 110, 0.16); color: var(--d-bronze-hi); }

.d-fleet-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--d-text-dim);
}
