:root {
  --bg: #070a13;
  --bg-2: #0f172a;
  --panel: rgba(14, 22, 42, 0.78);
  --panel-2: rgba(15, 23, 42, 0.92);
  --stroke: rgba(255, 255, 255, 0.13);
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, 0.68);
  --muted-2: rgba(248, 250, 252, 0.48);
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #fb7185;
  --warning: #facc15;
  --orange: #fb923c;
  --violet: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.22), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.20), transparent 28%),
    linear-gradient(135deg, #060914 0%, #101729 48%, #07111f 100%);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  z-index: -3;
}

.page-aurora { position: fixed; inset: 0; overflow: hidden; z-index: -2; }
.orb {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.28;
  animation: floatOrb 15s ease-in-out infinite alternate;
}
.orb-1 { top: -130px; left: -120px; background: #38bdf8; }
.orb-2 { right: -160px; top: 180px; background: #a78bfa; animation-delay: 2s; }
.orb-3 { left: 35%; bottom: -260px; background: #22c55e; animation-delay: 5s; }

@keyframes floatOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(70px, 45px, 0) scale(1.16); }
}

.nav-glass {
  background: rgba(7, 10, 19, 0.68);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--stroke);
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 38px rgba(56, 189, 248, .35);
}
.nav-link { color: rgba(255,255,255,.72) !important; font-weight: 500; }
.nav-link:hover { color: #fff !important; }

.hero-section {
  position: relative;
  padding: 96px 0 88px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82);
  font-size: .86rem;
  font-weight: 600;
}
.text-white-70 { color: var(--muted); }
.text-white-60 { color: rgba(255,255,255,.60); }
.text-white-50 { color: rgba(255,255,255,.50); }
.text-accent { color: var(--accent); }
.btn-hero { border-radius: 999px; padding: 12px 20px; font-weight: 700; }
.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  box-shadow: 0 18px 42px rgba(14, 165, 233, .25);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-soft {
  color: #eaf7ff;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
}
.btn-soft:hover { color: #fff; background: rgba(255,255,255,.14); transform: translateY(-2px); }

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 999px;
  background: rgba(56, 189, 248, .10);
  color: rgba(255,255,255,.76);
  font-size: .84rem;
  word-break: break-word;
}

.hero-card {
  min-height: 440px;
  border: 1px solid var(--stroke);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.05)),
    radial-gradient(circle at 40% 28%, rgba(56, 189, 248, .22), transparent 34%);
  backdrop-filter: blur(28px);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  transform-style: preserve-3d;
  animation: cardPulse 4.5s ease-in-out infinite alternate;
}
@keyframes cardPulse {
  from { box-shadow: 0 24px 80px rgba(0,0,0,.35), 0 0 0 rgba(56,189,248,0); }
  to { box-shadow: 0 28px 96px rgba(0,0,0,.45), 0 0 65px rgba(56,189,248,.22); }
}
.radar-ring {
  position: relative;
  width: 250px;
  height: 250px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.radar-ring span {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(56, 189, 248, .45);
  border-radius: 999px;
  animation: radarPing 3s ease-out infinite;
}
.radar-ring span:nth-child(2) { animation-delay: 1s; }
.radar-ring span:nth-child(3) { animation-delay: 2s; }
.radar-ring i {
  font-size: 5.2rem;
  color: #e0fbff;
  text-shadow: 0 0 36px rgba(56,189,248,.8);
}
@keyframes radarPing {
  0% { transform: scale(.42); opacity: .95; }
  100% { transform: scale(1.18); opacity: 0; }
}
.hero-card-content { text-align: center; z-index: 2; }

.mt-n4 { margin-top: -36px; }
.glass-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(26px);
  box-shadow: var(--shadow);
  padding: 24px;
}
.query-panel { position: relative; z-index: 4; }
.form-label { color: rgba(255,255,255,.72); font-weight: 600; }
.form-control, .form-select {
  border: 1px solid rgba(255,255,255,.13);
  color: #fff;
  background-color: rgba(255,255,255,.07);
  border-radius: 16px;
}
.form-control:focus, .form-select:focus {
  color: #fff;
  background-color: rgba(255,255,255,.10);
  border-color: rgba(56,189,248,.75);
  box-shadow: 0 0 0 .25rem rgba(56,189,248,.18);
}
.form-control::placeholder { color: rgba(255,255,255,.40); }
.form-select option { color: #0f172a; }
.input-icon { position: relative; }
.input-icon > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.46);
  pointer-events: none;
}
.input-icon .form-control { padding-left: 46px; }

.section-title { margin-bottom: 20px; }
.section-title span {
  color: var(--accent);
  font-size: .83rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}
.section-title h2 {
  margin: 6px 0 6px;
  font-weight: 800;
}
.section-title p { color: var(--muted); max-width: 880px; margin: 0; }

.kpi-card {
  position: relative;
  min-height: 156px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 26px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
  transition: transform .25s ease, border-color .25s ease;
}
.kpi-card:hover { transform: translateY(-6px); border-color: rgba(56,189,248,.40); }
.kpi-card::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  right: -42px;
  top: -42px;
  border-radius: 999px;
  background: var(--kpi-color, rgba(56,189,248,.24));
  filter: blur(4px);
  opacity: .55;
}
.kpi-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 14px;
}
.kpi-number { font-size: 2.15rem; line-height: 1; font-weight: 800; }
.kpi-label { color: var(--muted); font-weight: 600; }

.chart-card canvas { max-height: 330px; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar-search { flex: 1 1 320px; }
.compact-select { max-width: 240px; }
.table-area { min-height: 120px; }
.table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
}
.table {
  --bs-table-bg: transparent;
  --bs-table-color: rgba(255,255,255,.88);
  --bs-table-border-color: rgba(255,255,255,.10);
  margin-bottom: 0;
  min-width: 1040px;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: rgba(255,255,255,.76);
  background: rgba(8, 13, 26, .96);
  backdrop-filter: blur(16px);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table tbody tr { transition: background .18s ease, transform .18s ease; }
.table tbody tr:hover { background: rgba(56,189,248,.08); }
.local-cell { max-width: 390px; min-width: 280px; }
.small-muted { color: var(--muted-2); font-size: .80rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}
.status-vigente { color: #d1fae5; background: rgba(34,197,94,.16); border: 1px solid rgba(34,197,94,.35); }
.status-vence_30 { color: #fef9c3; background: rgba(250,204,21,.14); border: 1px solid rgba(250,204,21,.35); }
.status-vencido { color: #ffe4e6; background: rgba(251,113,133,.16); border: 1px solid rgba(251,113,133,.42); }
.status-sem_validade { color: #fff7ed; background: rgba(251,146,60,.16); border: 1px solid rgba(251,146,60,.42); }
.status-reparado { color: #ede9fe; background: rgba(167,139,250,.16); border: 1px solid rgba(167,139,250,.38); }

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 7px 11px;
  text-decoration: none;
  color: #fff;
  background: rgba(255,255,255,.07);
  font-size: .82rem;
  transition: transform .2s ease, background .2s ease;
}
.action-btn:hover { color: #fff; transform: translateY(-2px); background: rgba(255,255,255,.14); }
.map-btn { background: linear-gradient(135deg, rgba(14,165,233,.92), rgba(34,197,94,.88)); border: 0; }

.empty-state {
  text-align: center;
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: 24px;
  padding: 42px 18px;
  color: var(--muted);
}
.empty-state i { font-size: 2.3rem; color: var(--accent); display: block; margin-bottom: 12px; }

.skeleton-card {
  min-height: 156px;
  border-radius: 26px;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.15), rgba(255,255,255,.06));
  background-size: 220% 100%;
  animation: shimmer 1.35s infinite;
  border: 1px solid rgba(255,255,255,.08);
}
@keyframes shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}

.modal-dark {
  border: 1px solid var(--stroke);
  border-radius: 30px;
  color: #fff;
  background: rgba(8, 13, 26, .96);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.detail-item {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.06);
}
.detail-item small { display: block; color: var(--muted-2); margin-bottom: 4px; }
.timeline {
  position: relative;
  margin: 22px 0 0;
  padding-left: 20px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}
.timeline-item {
  position: relative;
  padding: 0 0 16px 18px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(56,189,248,.14);
}
.toast-dark .toast-header { background: rgba(15,23,42,.96); color: #fff; border-bottom: 1px solid rgba(255,255,255,.10); }
.toast-dark .toast-body { background: rgba(8,13,26,.96); color: rgba(255,255,255,.78); }
.footer { border-top: 1px solid rgba(255,255,255,.08); background: rgba(7,10,19,.42); }

@media (max-width: 991px) {
  .hero-section { padding: 72px 0 70px; }
  .hero-card { min-height: 330px; }
  .radar-ring { width: 200px; height: 200px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .glass-card { padding: 18px; border-radius: 22px; }
  .source-pill { border-radius: 18px; }
  .toolbar { align-items: stretch; }
  .toolbar > * { width: 100%; }
  .compact-select { max-width: none; }
  .detail-grid { grid-template-columns: 1fr; }
}
