/* =====================================================================
   SINAPSE — Estilos complementares
   Classes adicionais para fleet-card, sev-pill, toast, bar-row,
   feed-item, gen-link, ticker-item e ajustes finos.
   ===================================================================== */

/* ===================== FLEET CARDS (dashboard) ===================== */
.fleet-card {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 12px 12px 10px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
}
.fleet-card.in {
  opacity: 1;
  transform: translateY(0);
  animation: fadeUp 0.35s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fleet-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 3px;
  height: 100%;
  background: var(--running);
  opacity: 0.9;
}
.fleet-card.status-warning::before  { background: var(--warning); }
.fleet-card.status-critical::before { background: var(--critical); animation: pulseBar 1.2s ease-in-out infinite; }
.fleet-card.status-standby::before  { background: var(--text-3); opacity: 0.4; }
.fleet-card.status-running::before  { background: var(--running); }

@keyframes pulseBar {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 6px var(--critical); }
  50%      { opacity: 1;   box-shadow: 0 0 16px var(--critical); }
}

.fleet-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.fleet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fleet-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-1);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.fleet-hours {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--text-3);
}

.fleet-loc {
  font-size: 12.5px;
  color: var(--text-1);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fleet-city {
  font-size: 10.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.fleet-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.fm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.fm-label {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  font-weight: 600;
}
.fm-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-1);
  font-weight: 600;
}
.fm-value i {
  font-style: normal;
  font-size: 9px;
  color: var(--text-3);
  margin-left: 2px;
}
.fm-value.hot {
  color: var(--critical);
}

.fleet-load {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.fl-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.fl-fill {
  height: 100%;
  width: var(--w, 0);
  background: linear-gradient(90deg, var(--accent), #ffd866);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.fleet-card.status-warning  .fl-fill { background: var(--warning); }
.fleet-card.status-critical .fl-fill { background: var(--critical); }
.fleet-card.status-standby  .fl-fill { background: var(--text-3); opacity: 0.3; }
.fl-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-2);
  min-width: 32px;
  text-align: right;
}

.fleet-fuel {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ff-label { font-size: 12px; opacity: 0.7; }
.ff-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.ff-fill {
  height: 100%;
  width: var(--w, 0);
  background: var(--running);
  transition: width 0.6s ease;
}
.fuel-mid .ff-fill { background: var(--warning); }
.fuel-low .ff-fill { background: var(--critical); }
.ff-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
  min-width: 30px;
  text-align: right;
}
.fuel-low .ff-text { color: var(--critical); }
.fuel-mid .ff-text { color: var(--warning); }

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--running);
  box-shadow: 0 0 6px currentColor;
}
.status-dot.status-running  { background: var(--running);  color: var(--running);  animation: pulseDot 1.6s ease-in-out infinite; }
.status-dot.status-warning  { background: var(--warning);  color: var(--warning);  animation: pulseDot 1s ease-in-out infinite; }
.status-dot.status-critical { background: var(--critical); color: var(--critical); animation: pulseDot 0.6s ease-in-out infinite; }
.status-dot.status-standby  { background: var(--text-3);   color: transparent; }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

/* ===================== ALERT FEED (dashboard) ===================== */
#alert-feed.pulse { animation: flashPulse 0.5s ease; }
@keyframes flashPulse {
  0%   { background: rgba(255, 184, 0, 0.06); }
  100% { background: transparent; }
}
.feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.15s ease;
}
.feed-item:hover { background: var(--bg-2); }
.feed-item:last-child { border-bottom: none; }
.feed-bar {
  width: 3px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--info);
}
.feed-item.sev-critical .feed-bar { background: var(--critical); animation: pulseBar 1.2s ease-in-out infinite; }
.feed-item.sev-warning  .feed-bar { background: var(--warning); }
.feed-item.sev-info     .feed-bar { background: var(--info); opacity: 0.7; }
.feed-content { flex: 1; min-width: 0; }
.feed-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.feed-code {
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 600;
}
.feed-gen {
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 600;
}
.feed-time {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
}
.feed-desc {
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.35;
  margin-bottom: 2px;
}
.feed-loc {
  font-size: 10.5px;
  color: var(--text-3);
}

/* ===================== ALERT TABLE — pills e ações ===================== */
.sev-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 10px;
  border: 1px solid currentColor;
}
.sev-pill.sev-critical { color: var(--critical); background: rgba(255, 77, 94, 0.08); }
.sev-pill.sev-warning  { color: var(--warning);  background: rgba(255, 184, 0, 0.08); }
.sev-pill.sev-info     { color: var(--info, #5BA8FF); background: rgba(91, 168, 255, 0.08); }

.sev-tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.sev-tag.sev-critical { background: var(--critical); color: #fff; }
.sev-tag.sev-warning  { background: var(--warning);  color: #0E1117; }
.sev-tag.sev-info     { background: var(--info, #5BA8FF); color: #0E1117; }

.row-action {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-2);
  font-size: 12px;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 4px;
  transition: all 0.15s ease;
}
.row-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gen-link {
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px dotted transparent;
}
.gen-link:hover { border-bottom-color: var(--accent); }

.alert-row.sev-critical { background: rgba(255, 77, 94, 0.02); }
.alert-loc, .alert-desc {
  font-size: 12px;
  color: var(--text-2);
}
.alert-desc { color: var(--text-1); }

/* ===================== TOAST (estrutura nova com .toast-icon, .toast-body, .toast-close) ===================== */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 360px;
  padding: 12px 14px;
  padding-right: 30px;
  position: relative;
  overflow: hidden;
}
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--info);
  color: #0E1117;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast.toast-critical .toast-icon { background: var(--critical); color: #fff; }
.toast.toast-warning  .toast-icon { background: var(--warning);  color: #0E1117; }
.toast.toast-info     .toast-icon { background: var(--info, #5BA8FF); color: #0E1117; }

.toast.toast-critical::before { background: var(--critical); }
.toast.toast-warning::before  { background: var(--warning); }
.toast.toast-info::before     { background: var(--info, #5BA8FF); }

.toast-body { flex: 1; min-width: 0; }
.toast-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-2);
}
.toast-desc {
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.35;
}
.toast-time {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
}
.toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
}
.toast-close:hover { color: var(--text-1); }
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 0;
  height: 2px;
  background: var(--accent);
  animation: toastShrink 6.5s linear forwards;
  transform-origin: left;
}
.toast.toast-critical .toast-progress { background: var(--critical); animation-duration: 10s; }
.toast.toast-warning  .toast-progress { background: var(--warning); }

@keyframes toastShrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.toast.in  { animation: toastIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.toast.out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(40px); opacity: 0; }
}

/* ===================== BAR LIST (relatórios) ===================== */
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 70px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.bar-row:last-child { border-bottom: none; }

.bar-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-1);
}
.bar-units {
  font-size: 10px;
  color: var(--text-3);
}
.bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--c, var(--accent));
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-fill.go { width: var(--w); }

.bar-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

/* ===================== TICKER ITEM ===================== */
.ticker-track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
  animation: tickerScroll 90s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px;
  font-size: 11.5px;
  color: var(--text-2);
}
.ticker-item b { color: var(--accent); margin: 0 4px; font-weight: 600; }
.ticker-item.ticker-crit b,
.ticker-item.ticker-crit .ticker-icon { color: var(--critical); }
.ticker-item.ticker-warn b,
.ticker-item.ticker-warn .ticker-icon { color: var(--warning); }
.ticker-item.ticker-run  .ticker-icon { color: var(--running); }
.ticker-item.ticker-info .ticker-icon { color: var(--info, #5BA8FF); }

.ticker-icon {
  font-style: normal;
  font-size: 8px;
  opacity: 0.9;
}
.ticker-sep {
  color: var(--text-3);
  opacity: 0.3;
  margin: 0 4px;
}

/* ===================== ENGINE DIAGRAM ===================== */
.engine-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===================== STATUS PILLS extras ===================== */
.status-pill.status-aberto   { color: var(--critical); border-color: rgba(255, 77, 94, 0.3); }
.status-pill.status-ativo    { color: var(--running);  border-color: rgba(46, 230, 168, 0.3); }
.status-pill.status-fechado  { color: var(--text-3);   border-color: var(--border-soft); }

/* ===================== TWEAKS GERAIS ===================== */
.icon-btn.muted {
  color: var(--text-3);
  opacity: 0.5;
}
.icon-btn.muted::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 1.5px;
  background: var(--critical);
  transform: rotate(-45deg);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* ===================== SCROLLBAR fina (tema escuro) ===================== */
.alert-feed::-webkit-scrollbar,
.map-list::-webkit-scrollbar,
.fleet-grid::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.alert-feed::-webkit-scrollbar-thumb,
.map-list::-webkit-scrollbar-thumb,
.fleet-grid::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 4px;
}
.alert-feed::-webkit-scrollbar-thumb:hover,
.map-list::-webkit-scrollbar-thumb:hover,
.fleet-grid::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}
