/* FishCare Flota — estilos */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap");

:root {
  --bg0: #050b14;
  --bg1: #0a1628;
  --panel: #0f1c30;
  --panel2: #132338;
  --line: #243a58;
  --navy: #1B365D;
  --orange: #E45E2A;
  --cyan: #00D4FF;
  --green: #2ECC71;
  --warn: #F4C430;
  --dim: #8aa0b8;
  --text: #eef4ff;
  --glow: rgba(228, 94, 42, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(228, 94, 42, 0.18), transparent 55%),
    radial-gradient(900px 500px at 95% 0%, rgba(0, 212, 255, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #07101c);
  background-attachment: fixed;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #7aecff; }

.mono { font-family: "JetBrains Mono", Consolas, monospace; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 14, 26, 0.88);
  backdrop-filter: blur(12px);
}
.logo-wrap {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px 10px 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 55%, #ffe8dc 140%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.12),
    0 12px 36px var(--glow),
    0 0 40px rgba(0, 212, 255, 0.08);
  animation: logoIn .7s ease-out;
}
.logo-wrap img { height: 58px; width: auto; display: block; }
@keyframes logoIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.brand h1 {
  margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff 0%, #ffd2bf 45%, var(--orange) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub { color: var(--dim); font-size: 0.88rem; margin-top: 2px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  background: rgba(46, 204, 113, 0.15); color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.top-meta { margin-left: auto; text-align: right; color: var(--dim); font-size: 0.85rem; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.top-meta strong { color: var(--text); }
.btn-logout {
  border: 1px solid var(--line); background: #243a58; color: var(--text);
  border-radius: 6px; padding: 4px 10px; font-size: .75rem; font-weight: 700; cursor: pointer;
}
.btn-logout:hover { border-color: var(--orange); color: #fff; }

main { max-width: 1380px; margin: 0 auto; padding: 22px 18px 40px; }

/* Fleet grid */
.hero-note {
  margin: 0 0 18px;
  color: var(--dim);
  font-size: 0.95rem;
}
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.truck-card {
  position: relative;
  border-radius: 18px;
  padding: 16px 16px 14px;
  background: linear-gradient(160deg, var(--panel) 0%, #0c1828 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.truck-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent, var(--orange));
}
.truck-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent, var(--orange)) 55%, var(--line));
  box-shadow: 0 16px 40px rgba(0,0,0,.35), 0 0 24px color-mix(in srgb, var(--accent, var(--orange)) 25%, transparent);
}
.truck-card .num {
  font-size: 2.4rem; font-weight: 800; line-height: 1;
  color: var(--accent, var(--orange));
  opacity: 0.95;
}
.truck-card .name { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.truck-card .pat { color: var(--dim); font-size: 0.82rem; margin-top: 2px; }
.status-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 10px rgba(244, 196, 48, .5);
}
.dot.on { background: var(--green); box-shadow: 0 0 12px rgba(46,204,113,.65); }
.metrics {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-top: 14px;
}
.metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 8px;
}
.metric .k { color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em; }
.metric .v { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 1.05rem; margin-top: 3px; }

footer {
  text-align: center; color: var(--dim); font-size: 0.8rem;
  padding: 8px 16px 28px;
}

/* Detail page */
.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--dim); font-weight: 600; margin-bottom: 10px;
}
.back:hover { color: var(--cyan); }
.detail-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.detail-head h2 {
  margin: 0; font-size: 1.8rem; font-weight: 800;
}
.detail-head .accent-bar {
  width: 56px; height: 4px; border-radius: 4px;
  background: var(--accent, var(--orange)); margin-top: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.kpi .k { color: var(--dim); font-size: 0.78rem; }
.kpi .v { font-family: "JetBrains Mono", monospace; font-size: 1.55rem; font-weight: 700; margin-top: 4px; }
.kpi-tk1 .k { color: #E53935; }
.kpi-tk1 .v { color: #E53935; }
.o2-cell .t { font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; }
.o2-cell .n { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 1.1rem; margin-top: 4px; }

.layout-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .layout-2 { grid-template-columns: 1fr; }
}

.panel {
  background: linear-gradient(165deg, var(--panel), #0c1726);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
select, .btn {
  appearance: none;
  background: #173050;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange), #c4471f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(228, 94, 42, 0.3);
}
.btn-ghost { background: transparent; }
.btn:hover { filter: brightness(1.08); }

.chart-wrap {
  position: relative;
  height: 340px;
  background: #08121f;
  border-radius: 12px;
  border: 1px solid #1a2c44;
  padding: 8px;
}

#map {
  height: 340px;
  border-radius: 12px;
  border: 1px solid #1a2c44;
  background: #08121f;
}
.map-note {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--dim);
}
.range-lbl {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--dim);
  font-weight: 600;
}
.range-lbl input {
  background: #173050;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.82rem;
}
.map-fallback {
  height: 340px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--dim); text-align: center; padding: 20px;
}
.map-pin {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent, var(--orange));
  box-shadow: 0 0 0 6px rgba(228,94,42,.25);
}
.scania-marker {
  background: transparent !important;
  border: none !important;
}
.scania-pin {
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.45));
  line-height: 0;
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.scania-pin .placa-tag {
  font: 700 10px/1.1 Consolas, "Courier New", monospace;
  letter-spacing: .04em;
  color: #1a2a3c;
  background: #fff;
  border: 1px solid #1a2a3c;
  border-radius: 3px;
  padding: 2px 5px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.scania-pin svg {
  display: block;
}
.truck-card .name .placa {
  margin-left: 6px;
  color: var(--accent, #E45E2A);
  font-weight: 700;
  font-size: .92em;
}

.o2-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 12px;
}
.o2-cell {
  text-align: center; padding: 10px 6px;
  background: rgba(0,0,0,.2); border-radius: 10px;
  border: 1px solid rgba(255,255,255,.05);
}
.o2-cell .t { font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; }
.o2-cell .n { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 1.1rem; margin-top: 4px; }
