:root {
  --blue: #1573B7;
  --blue-light: #2AA9E0;
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --green: #059669;
  --green-bg: #ECFDF5;
  --green-border: #A7F3D0;
  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --orange: #EA580C;
  --orange-bg: #FFF7ED;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; color: var(--gray-900); background: var(--gray-50); }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
select, input { font-family: inherit; }
.hidden { display: none !important; }
.eyebrow { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-500); }

/* ===== FADE IN ANIMATION ===== */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ===== LOGIN ===== */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: white;
}
.boot-loader.hidden { display: none; }
.boot-loader-logo { height: 28px; opacity: 0.9; }
.boot-loader-spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: boot-spin 0.7s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

.login-view {
  display: flex;
  min-height: 100vh;
}
.login-form-side {
  flex: 0 0 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: white;
}
.login-inner { width: 100%; max-width: 360px; }
.login-logo { height: 28px; margin-bottom: 40px; }
.login-header { margin-bottom: 32px; }
.login-header .eyebrow { margin-bottom: 8px; }
.login-header h1 { font-size: 2rem; font-weight: 700; line-height: 1.15; color: var(--gray-900); margin-top: 6px; }
.login-sub { color: var(--gray-500); font-size: 0.875rem; margin-top: 8px; line-height: 1.5; }
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-group label { font-size: 0.8125rem; font-weight: 500; color: var(--gray-700); }
.field-group input {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--gray-900);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.field-group input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21,115,183,0.12);
}
.field-group select, .field-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--gray-900);
  background: white;
  font-family: inherit;
}
.field-group select:focus, .field-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21,115,183,0.12);
}
.field-group label input[type="checkbox"] { margin-right: 6px; }
.form-error { color: var(--red); font-size: 0.8125rem; min-height: 18px; margin-bottom: 4px; }

/* ===== ADMIN PANEL ===== */
.admin-tab.hidden { display: none; }
.admin-form {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg, 12px);
  padding: 24px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: start;
}
.admin-form h3 { grid-column: 1 / -1; margin-bottom: 8px; font-size: 1rem; }
.admin-form .form-error { grid-column: 1 / -1; }
.admin-form button[type="submit"] { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
.admin-form .field-group:has(textarea) { grid-column: 1 / -1; }
.admin-tab .filter-bar { margin-top: 0; }
.admin-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50, #f9fafb);
}
.admin-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
}
.btn-table-action {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: white;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}
.btn-primary:hover { background: #1260A0; }
.btn-primary:active { transform: scale(0.99); }
.btn-loading { color: rgba(255,255,255,0.8); }
.lgpd-notice { font-size: 0.75rem; color: var(--gray-400); line-height: 1.6; margin-top: 32px; }
.lgpd-notice strong { color: var(--gray-500); }
.login-visual-side { flex: 1; position: relative; overflow: hidden; background: #0F172A; }
.login-visual-side video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.login-visual-side.login-visual-fallback {
  background: #F8FAFC url("Fundo-Login.png") center / 340px auto no-repeat;
}
.login-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 40px;
}
.login-caption { color: white; }
.login-caption strong { display: block; font-size: 1.25rem; font-weight: 700; }
.login-caption span { font-size: 0.875rem; opacity: 0.8; }

/* ===== APP SHELL ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.2s ease;
}
.sidebar {
  background: #0F172A;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-icon { width: 26px; height: 26px; flex-shrink: 0; }
.sidebar-brand-text { display: flex; flex-direction: column; gap: 1px; }
.sidebar-brand-name { font-size: 1rem; font-weight: 800; color: white; letter-spacing: 0.04em; line-height: 1; }
.sidebar-brand-sub { font-size: 0.6rem; color: #475569; text-transform: uppercase; letter-spacing: 0.1em; }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94A3B8;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: #CBD5E1; }
.nav-link.active { background: rgba(21,115,183,0.2); color: #60A5FA; }
.nav-badge {
  margin-left: auto;
  background: var(--amber);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-project-label { display: flex; flex-direction: column; gap: 2px; }
.sidebar-project-label span { font-size: 0.6875rem; color: #475569; text-transform: uppercase; letter-spacing: 0.06em; }
.sidebar-project-label strong { font-size: 0.8125rem; color: #94A3B8; }
.btn-sidebar-logout, .btn-sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.06);
  color: #64748B;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.btn-sidebar-logout svg, .btn-sidebar-collapse svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.2s; }
.btn-sidebar-logout:hover { background: rgba(220,38,38,0.15); color: #F87171; }
.btn-sidebar-collapse:hover { background: rgba(255,255,255,0.1); color: #CBD5E1; }

/* ----- Sidebar recolhida (somente ícones, desktop) ----- */
@media (min-width: 901px) {
  .app-shell.sidebar-collapsed { grid-template-columns: 76px 1fr; }
}
.app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 18px 8px; }
.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .sidebar-project-label { display: none; }
.app-shell.sidebar-collapsed .nav-link { justify-content: center; padding: 9px; }
.app-shell.sidebar-collapsed .sidebar-footer { align-items: center; }
.app-shell.sidebar-collapsed .btn-sidebar-logout,
.app-shell.sidebar-collapsed .btn-sidebar-collapse { justify-content: center; padding: 9px; width: 36px; }
.app-shell.sidebar-collapsed #sidebarCollapseBtn svg { transform: rotate(180deg); }
@media (max-width: 900px) {
  .btn-sidebar-collapse { display: none; }
}

/* ===== MAIN WRAP ===== */
.main-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  flex-shrink: 0;
}
.menu-btn {
  display: none;
  padding: 6px;
  border-radius: 7px;
  color: var(--gray-500);
  transition: background 0.15s;
}
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn:hover { background: var(--gray-100); }
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-icon { width: 28px; height: 28px; }
.topbar-eyebrow { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gray-400); }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
#adminClientSelector {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  background: white;
}
.user-pill {
  padding: 5px 12px;
  background: var(--gray-100);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-secondary {
  padding: 8px 14px;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 28px 48px;
  scroll-behavior: smooth;
  min-width: 0;
}
.page { animation: pageFade 0.25s ease; min-width: 0; max-width: 100%; }
@keyframes pageFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 32px 0 16px;
}
.section-header:first-child { margin-top: 0; }
.section-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); margin-top: 4px; }
.btn-link { font-size: 0.8125rem; font-weight: 500; color: var(--blue); background: none; transition: color 0.15s; padding-bottom: 2px; }
.btn-link:hover { color: #1260A0; }

/* ===== ATIVOS PLANEJADOS (sem data definida) ===== */
/* o section-header aqui é o :first-child do wrapper #plannedAssetsSection, então a regra
   genérica ".section-header:first-child { margin-top:0 }" zerava o espaço acima e colava no bloco anterior */
#plannedAssetsSection .section-header:first-child { margin-top: 32px; }
.planned-assets-sub { font-size: 0.8125rem; color: var(--gray-400); margin: -10px 0 16px; }
.planned-assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.planned-asset-more {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  color: var(--blue);
  border-style: solid;
  border-color: var(--blue-100, #DBEAFE);
  background: var(--blue-50, #EFF6FF);
}
.planned-asset-more:hover { background: var(--blue-100, #DBEAFE); border-color: var(--blue); transform: translateY(-1px); }
.planned-asset-more-count { font-size: 1.25rem; font-weight: 700; }
.planned-asset-more-label { font-size: 0.8125rem; font-weight: 600; }
.planned-asset-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  background: white;
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.planned-asset-card:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-1px); }
.planned-asset-card-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.planned-asset-badge {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.planned-asset-pin { color: var(--blue); display: flex; flex-shrink: 0; }
.planned-asset-pin svg { width: 14px; height: 14px; }
.planned-asset-card strong { font-size: 0.9375rem; color: var(--gray-900); }
.planned-asset-area { font-size: 0.75rem; color: var(--gray-400); }

/* ===== STATUS BANNER ===== */
.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 0.875rem;
  font-weight: 500;
}
.status-banner.green { background: var(--green-bg); border: 1px solid var(--green-border); color: #065F46; }
.status-banner.amber { background: var(--amber-bg); border: 1px solid var(--amber-border); color: #92400E; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== KPI GRID ===== */
.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 0;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 0;
}
.kpi-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-card:hover::before { opacity: 1; }
.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.kpi-dot {
  font-size: 0.5rem;
  color: var(--gray-300);
  line-height: 1;
  margin-bottom: 2px;
  display: block;
}
.kpi-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gray-900);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.kpi-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.kpi-card.kpi-alert .kpi-value { color: var(--amber); }
.kpi-card.kpi-alert { border-left: 3px solid var(--amber); }

/* ===== ALERT GRID ===== */
.alert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.alert-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  border-left: 3px solid var(--amber);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.alert-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.alert-card.crit-Alta { border-left-color: var(--red); }
.alert-card.crit-Media { border-left-color: var(--amber); }
.alert-card.crit-Baixa { border-left-color: var(--blue-light); }
.alert-card-top { display: flex; align-items: center; gap: 8px; }
.alert-card-area { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); }
.alert-card h3 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); line-height: 1.3; }
.alert-card-obs { font-size: 0.8125rem; color: var(--gray-500); line-height: 1.5; }
.alert-card-rec {
  display: flex;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--gray-700);
  background: var(--gray-50);
  padding: 8px 10px;
  border-radius: 7px;
  line-height: 1.4;
}
.alert-card-rec::before { content: '→'; color: var(--blue); font-weight: 600; flex-shrink: 0; }
.alert-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.btn-detail {
  padding: 6px 12px;
  background: var(--blue-50);
  color: var(--blue);
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-detail:hover { background: var(--blue-100); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge.Alta { background: var(--red-bg); color: var(--red); }
.badge.Media { background: var(--amber-bg); color: var(--amber); }
.badge.Baixa { background: var(--green-bg); color: var(--green); }
.badge.resultado-ok { background: var(--green-bg); color: var(--green); }
.badge.resultado-obs { background: var(--blue-50); color: var(--blue); }
.badge.resultado-anomalia { background: var(--red-bg); color: var(--red); }
.badge.resultado-parcial { background: var(--amber-bg); color: var(--amber); }

/* ===== AREA COVERAGE ===== */
.area-coverage-list { display: flex; flex-direction: column; gap: 10px; }
.area-coverage-item {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.area-name { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); min-width: 180px; }
.area-bar-wrap { flex: 1; }
.area-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.area-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.area-count { font-size: 0.8125rem; font-weight: 700; color: var(--gray-900); min-width: 60px; text-align: right; }
.area-count span { font-weight: 400; color: var(--gray-400); }

/* ===== TIMELINE ===== */
.timeline-bars {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  padding: 24px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
  box-shadow: var(--shadow);
}
.timeline-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.timeline-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.timeline-bar {
  width: 100%;
  background: var(--blue);
  border-radius: 5px 5px 0 0;
  height: 0;
  transition: height 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.timeline-bar:hover { background: #1260A0; }
.timeline-bar .bar-count {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-700);
  white-space: nowrap;
}
.timeline-date { font-size: 0.6875rem; font-weight: 600; color: var(--gray-400); text-align: center; margin-top: 4px; }
.timeline-item.peak .timeline-bar { background: var(--blue-light); }

/* ===== HIGHLIGHTS ===== */
.highlights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.highlight-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  padding: 20px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.highlight-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.highlight-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.highlight-icon svg { width: 20px; height: 20px; }
.highlight-card--green .highlight-icon { background: var(--green-bg); color: var(--green); }
.highlight-card--blue .highlight-icon { background: var(--blue-50); color: var(--blue); }
.highlight-card--amber .highlight-icon { background: var(--amber-bg); color: var(--amber); }
.highlight-body h3 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.highlight-asset { font-size: 0.75rem; color: var(--gray-400); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.highlight-body p { font-size: 0.8125rem; color: var(--gray-500); line-height: 1.55; }
.highlight-body strong { color: var(--gray-700); font-weight: 600; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin-top: 6px; }
.page-sub { font-size: 0.875rem; color: var(--gray-500); margin-top: 6px; }
.badge-count {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 8px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-bar input, .filter-bar select {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--gray-700);
  background: white;
  transition: border-color 0.2s;
}
.filter-bar input { flex: 1; min-width: 180px; }
.filter-bar select { min-width: 160px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--blue); }

/* ===== RECOMMENDATIONS LIST ===== */
.rec-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.rec-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  border-left: 3px solid var(--amber);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s;
}
.rec-card:hover { box-shadow: var(--shadow-md); }
.rec-card.crit-Alta { border-left-color: var(--red); }
.rec-card.crit-Media { border-left-color: var(--amber); }
.rec-card.crit-Baixa { border-left-color: var(--blue-light); }
.rec-card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.rec-card-meta { display: flex; align-items: center; gap: 8px; }
.rec-area-chip {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rec-card h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.rec-finding {
  font-size: 0.875rem;
  color: var(--gray-600, #4B5563);
  line-height: 1.55;
}
.rec-rec {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--gray-700);
  line-height: 1.5;
  display: flex;
  gap: 8px;
}
.rec-rec::before { content: '→'; color: var(--blue); font-weight: 700; flex-shrink: 0; }
.rec-card-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.rec-date { font-size: 0.75rem; color: var(--gray-400); }

/* ===== COLLAPSIBLE ===== */
.collapsible-section {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-top: 8px;
}
.collapsible-section summary {
  padding: 16px 20px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collapsible-section summary::-webkit-details-marker { display: none; }
.collapsible-section summary::after { content: '›'; font-size: 1.2rem; transition: transform 0.2s; }
.collapsible-section[open] summary::after { transform: rotate(90deg); }
.no-pending-list { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.no-pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--gray-50);
  color: var(--gray-600, #4B5563);
}
.no-pending-item strong { color: var(--gray-900); font-weight: 500; }

/* ===== TABLE ===== */
.table-wrap {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: auto;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--gray-100); }
th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
td strong { color: var(--gray-900); font-weight: 600; }
.td-asset strong { font-size: 0.9rem; }

/* ===== VIEW TOGGLE ===== */
.view-toggle { display: flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: 9px; }
.view-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: background 0.15s, color 0.15s;
}
.view-btn.active { background: white; color: var(--gray-900); box-shadow: var(--shadow); }

/* ===== COLETA CARDS ===== */
.coleta-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.coleta-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.coleta-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.coleta-card-thumb {
  height: 140px;
  overflow: hidden;
  background: var(--gray-100);
  flex-shrink: 0;
  position: relative;
}
.coleta-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.coleta-card:hover .coleta-card-thumb img { transform: scale(1.06); }
.coleta-card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}
.coleta-card-thumb-placeholder svg { width: 32px; height: 32px; color: var(--gray-400); opacity: 0.5; }
.coleta-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.coleta-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.coleta-card h3 { font-size: 0.9rem; font-weight: 700; color: var(--gray-900); line-height: 1.35; }
.coleta-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coleta-meta-row { font-size: 0.8rem; color: var(--gray-400); }
.coleta-meta-sep { color: var(--gray-200); }
.coleta-card-obs { font-size: 0.8rem; color: var(--gray-500); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.coleta-card-team { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.coleta-card-team-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); }
.coleta-card-team-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.team-pill { font-size: 0.75rem; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }
.team-pill--lead { background: var(--blue-50); color: var(--blue); font-weight: 600; }
.coleta-card-footer { padding: 10px 16px 14px; display: flex; justify-content: flex-end; border-top: 1px solid var(--gray-50); margin-top: auto; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.4; }
.empty-state p { font-size: 0.9375rem; color: var(--gray-500); }

/* ===== GALLERY ===== */
.area-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.pill {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-500);
  background: white;
  transition: all 0.15s;
}
.pill:hover { border-color: var(--blue); color: var(--blue); }
.pill.active { background: var(--blue); border-color: var(--blue); color: white; }

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.galeria-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-100);
  box-shadow: var(--shadow);
}
.galeria-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.galeria-item:hover img { transform: scale(1.07); }
.galeria-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}
.galeria-item:hover .galeria-item-overlay { opacity: 1; }
.galeria-item-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(21,115,183,0.08);
  opacity: 0;
  transition: opacity 0.25s;
}
.galeria-item:hover .galeria-item-overlay::before { opacity: 1; }
.galeria-item-label { color: white; position: relative; }
.galeria-item-label strong { display: block; font-size: 0.875rem; font-weight: 700; line-height: 1.3; }
.galeria-item-label span { font-size: 0.75rem; opacity: 0.75; margin-top: 2px; display: block; }
.galeria-item-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(4px);
}
.galeria-item:hover .galeria-item-zoom { opacity: 1; }
.galeria-item-zoom svg { width: 14px; height: 14px; color: white; }

/* ===== MODAL (usado pelo painel admin — formulários genéricos) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 16px 16px 0 0;
  padding: 6px;
  border-radius: 7px;
  color: var(--gray-400);
  transition: background 0.15s, color 0.15s;
  z-index: 1;
}
.modal-close svg { width: 18px; height: 18px; display: block; }
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-header .eyebrow { margin-bottom: 4px; }
.modal-title { font-size: 1.375rem; font-weight: 700; color: var(--gray-900); margin: 6px 0 10px; }

/* ===== DETALHE DO ATIVO (página, FDR cliente) ===== */
.asset-detail-body { display: flex; flex-direction: column; margin-top: 16px; }
.asset-detail-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
#assetDetailBack { margin-bottom: 12px; }

/* ----- Resumo da coleta (topo da página de ativo) ----- */
.summary-hero {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  padding: 20px 24px 24px;
}
.summary-hero-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.summary-hero-header .modal-section-label { margin-bottom: 0; }
.summary-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px 16px;
  margin-top: 16px;
}
.summary-fact { display: flex; align-items: center; gap: 12px; min-width: 0; }
.summary-fact-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--blue-50, #EFF6FF);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-fact-icon svg { width: 18px; height: 18px; }
.summary-fact-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary-fact-body span { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gray-400); }
.summary-fact-body strong { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- Vídeo + pontos de interesse lado a lado ----- */
.inspection-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }
.inspection-pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.video-panel { padding: 16px; }
.poi-panel { display: flex; flex-direction: column; }
.count-pill { display: inline-block; background: var(--gray-100); color: var(--gray-500); border-radius: 999px; padding: 1px 8px; font-size: 0.66rem; }

.annotation-row { border-left: 3px solid transparent; }
.annotation-row[data-priority="Alta"] { border-left-color: var(--red); }
.annotation-row[data-priority="Media"] { border-left-color: var(--amber); }
.annotation-row[data-priority="Baixa"] { border-left-color: var(--green); }

/* ----- Relatório técnico ----- */
.narrative-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ----- Evidências fotográficas (anexo opcional, recolhido) ----- */
.evidence-toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.evidence-toggle-left { display: flex; align-items: center; gap: 12px; }
.evidence-toggle-left svg { width: 18px; height: 18px; color: var(--gray-400); flex-shrink: 0; }
.evidence-toggle-title { font-size: 0.875rem; font-weight: 700; color: var(--gray-900); }
.evidence-toggle-sub { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.evidence-chevron { width: 16px; height: 16px; color: var(--gray-400); transition: transform 0.2s; flex-shrink: 0; }
.evidence-section.open .evidence-chevron { transform: rotate(180deg); }
.evidence-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.evidence-section.open .evidence-body { grid-template-rows: 1fr; }
.evidence-body-inner { overflow: hidden; }
.evidence-grid { grid-template-columns: repeat(7, 1fr); padding: 4px 20px 20px; margin-top: 0; }

.modal-section-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); margin-bottom: 10px; }
.modal-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.modal-info-grid--2col { grid-template-columns: repeat(2, 1fr); margin-bottom: 12px; }
.modal-info-item { display: flex; flex-direction: column; gap: 3px; }
.modal-info-item span { font-size: 0.75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.modal-info-item strong { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); }
.modal-text { font-size: 0.9rem; color: var(--gray-600, #4B5563); line-height: 1.65; }
.modal-relato {
  background: var(--gray-50);
  border-left: 3px solid var(--blue);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  color: var(--gray-600, #4B5563);
  line-height: 1.6;
  font-style: italic;
}
.modal-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.modal-photo {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  background: var(--gray-100);
  width: 100%;
}
.modal-photo:hover { transform: scale(1.03); opacity: 0.9; }
.no-media { font-size: 0.8125rem; color: var(--gray-400); font-style: italic; }
.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.result-chip.ok { background: var(--green-bg); color: var(--green); }
.result-chip.obs { background: var(--blue-50); color: var(--blue); }
.result-chip.anomalia { background: var(--red-bg); color: var(--red); }
.result-chip.parcial { background: var(--amber-bg); color: var(--amber); }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.9); }
.lightbox-inner { position: relative; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lightbox-img { max-width: 90vw; max-height: 75vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  padding: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  color: white;
  transition: background 0.15s;
  z-index: 1;
}
.lightbox-close svg { width: 22px; height: 22px; }
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  color: white;
  transition: background 0.15s;
  z-index: 1;
}
.lightbox-arrow svg { width: 24px; height: 24px; display: block; }
.lightbox-arrow:hover { background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-caption { text-align: center; color: white; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lightbox-caption strong { display: block; font-size: 0.9375rem; font-weight: 600; }
.lightbox-caption span { font-size: 0.8125rem; opacity: 0.7; }
.lightbox-open-asset {
  margin-top: 4px;
  padding: 7px 18px;
  background: var(--blue);
  color: white;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
.lightbox-open-asset:hover { background: #1260A0; transform: translateY(-1px); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: none; }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
  backdrop-filter: blur(1px);
}

/* ===== CHARTS GRID ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.chart-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}
.chart-wrap { width: 100%; }
.chart-wrap-donut { width: 100%; }
.chart-panel--half { /* stays in the 2-col grid naturally */ }
.chart-panel-header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-top: 4px; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap-donut { position: relative; height: 220px; }

/* Estado vazio do gráfico (parada ainda não iniciada) — evita o quadrado branco */
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}
.chart-empty svg { width: 26px; height: 26px; color: var(--gray-400); }
.chart-empty span { font-size: 0.8125rem; color: var(--gray-500); font-weight: 500; }
@media (max-width: 640px) {
  .chart-wrap { height: 180px; }
  .chart-wrap-donut { height: 200px; }
  .charts-grid { gap: 12px; }
  .chart-panel { padding: 16px; }
}

/* ===== AREA CHIP SMALL ===== */
.area-chip-sm {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===== KANBAN LEGEND ===== */
.kanban-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.kanban-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
}
.kanban-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== EXECUTION KANBAN ===== */
.exec-kanban-wrap {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.exec-kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
  align-items: start;
  min-width: 980px;
}
.exec-kanban-col {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 8px;
  min-height: 60px;
}
.exec-kanban-header {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1.5px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exec-kanban-day {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-900);
}
.exec-kanban-date {
  font-size: 0.6875rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.exec-kanban-count {
  background: var(--blue);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.exec-kanban-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.exec-kanban-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: 7px;
  padding: 7px 9px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: box-shadow 0.15s, transform 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.exec-kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.exec-kanban-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.exec-status-pill {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.exec-status-pill.done { background: var(--green-bg); color: var(--green); }
.exec-status-pill.pending { background: var(--amber-bg); color: var(--amber); }
.exec-status-pill.inprogress { background: rgba(21,115,183,0.12); color: var(--blue); }
.exec-kanban-area {
  font-size: 0.6875rem;
  font-weight: 600;
}
.exec-kanban-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.exec-kanban-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.exec-kanban-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}
.exec-kanban-card .badge {
  font-size: 0.6rem;
  padding: 1px 5px;
}

/* ===== DASHBOARD GALLERY ===== */
.dash-galeria-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.dash-galeria-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-100);
  position: relative;
}
.dash-galeria-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.dash-galeria-item:hover img { transform: scale(1.07); }
.dash-galeria-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.22s;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
.dash-galeria-item:hover .dash-galeria-item-overlay { opacity: 1; }
.dash-galeria-label { color: white; font-size: 0.7rem; font-weight: 600; line-height: 1.3; }

/* ===== AREAS DYNAMIC INPUT ===== */
.areas-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.area-row { display: flex; align-items: center; gap: 8px; }
.area-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gray-900);
  font-family: inherit;
  background: white;
}
.area-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,115,183,0.12); }
.btn-remove-area {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--red-bg);
  color: var(--red);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.btn-remove-area:hover { background: var(--red); color: white; }
.btn-add-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-add-area:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-50); }

/* ===== ATIVIDADES BOARD ===== */
.aa-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.aa-project-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.2s, transform 0.15s;
}
.aa-project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.aa-project-card-client {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
}
.aa-project-card-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.25;
}
.aa-project-card-period { font-size: 0.8125rem; color: var(--gray-500); }
.aa-project-card-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 4px;
}
.aa-project-card-open {
  margin-top: 10px;
  padding: 9px 0;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: all 0.15s;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}
.aa-project-card-open:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.aa-board-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  transition: all 0.15s;
  font-family: inherit;
  cursor: pointer;
  background: white;
}
.btn-back:hover { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-300); }

.aa-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.aa-board-col {
  flex: 1;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 200px;
}
.aa-board-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--gray-200);
}
.aa-board-col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
}
.aa-board-col-count {
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.aa-board-col-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }

.aa-activity-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.aa-activity-card:hover { box-shadow: var(--shadow-md); }
.aa-activity-card-code {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 4px;
}
.aa-activity-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.3;
}
.aa-activity-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.aa-activity-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.aa-activity-card-date { font-size: 0.75rem; color: var(--gray-400); }
.aa-activity-card-actions { display: flex; gap: 2px; }
.aa-empty-col {
  text-align: center;
  padding: 28px 16px;
  color: var(--gray-400);
  font-size: 0.875rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1280px) {
  .galeria-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .dash-galeria-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  .kpi-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .highlights-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .coleta-card-grid { grid-template-columns: repeat(2, 1fr); }
  .inspection-pair { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: var(--sidebar-w);
    z-index: 50;
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: flex; }
  .main-wrap { height: 100vh; }
  .alert-grid { grid-template-columns: 1fr; }
  .modal-info-grid { grid-template-columns: repeat(2, 1fr); }
  .galeria-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-galeria-grid { grid-template-columns: repeat(3, 1fr); }
  .highlights-grid { grid-template-columns: 1fr; }
  .kpi-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .aa-board { flex-direction: column; }
  .aa-board-header-left { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 640px) {
  .highlight-card { flex-direction: column; gap: 12px; padding: 16px; }
  .highlight-icon { width: 36px; height: 36px; }
  .status-banner { font-size: 0.8rem; }
  .section-header h2 { font-size: 1rem; }
  .login-view { flex-direction: column; }
  .login-form-side { flex: none; width: 100%; padding: 36px 24px; }
  .login-visual-side { height: 240px; flex: none; order: -1; }
  .content-area { padding: 16px 14px 48px; }
  .kpi-grid-6 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 18px 16px; }
  .kpi-value { font-size: 2rem; }
  .highlights-grid { grid-template-columns: 1fr; }
  .coleta-card-grid { grid-template-columns: 1fr; }
  .galeria-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-galeria-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .topbar-eyebrow { display: none; }
  .topbar-icon { display: none; }
  .user-pill { display: none; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .topbar-actions a, .topbar-actions button { flex: 1 1 auto; justify-content: center; }
  .modal-panel { border-radius: var(--radius); }
  .modal-info-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; gap: 8px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .filter-bar { gap: 8px; }
  .filter-bar input, .filter-bar select { min-width: 0; flex: 1 1 140px; }
  .view-toggle { align-self: flex-start; }
  .narrative-grid { grid-template-columns: 1fr; }
  .summary-hero { padding: 18px 16px 20px; }
  .summary-hero-actions { width: 100%; }
  .summary-hero-actions a, .summary-hero-actions button { flex: 1 1 auto; justify-content: center; }
  .summary-hero-grid { grid-template-columns: repeat(2, 1fr); }
  .evidence-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== VÍDEOS DA GALERIA ===== */
.galeria-video-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.galeria-video-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.galeria-video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.galeria-video-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--blue-50, #EFF6FF);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.galeria-video-card-icon svg { width: 18px; height: 18px; }
.galeria-video-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.galeria-video-card-body strong { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); }
.galeria-video-card-body span { font-size: 0.75rem; color: var(--gray-400); }

/* ===== MAPA ===== */
.map-status-pills { display: flex; gap: 6px; }
.map-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600, #4B5563);
  background: white;
  transition: all 0.15s;
}
.map-status-pill:hover { border-color: var(--gray-400); }
.map-status-pill.active { background: var(--gray-900); border-color: var(--gray-900); color: white; }
.map-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mapa-container {
  height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
  background: var(--gray-100);
}
/* O Leaflet usa z-index interno até 1000 (controles) pros seus painéis/popups/botões de zoom.
   Isso passava por cima do menu lateral, modais etc. (que usam z-index bem mais baixo, tipo 50-300).
   "isolation:isolate" tranca esses z-index dentro do próprio mapa, sem precisar renumerar o resto do site.
   Vale pra qualquer mapa Leaflet da aplicação (aba Mapa + seletores de localização do admin). */
.leaflet-container { isolation: isolate; }
.mapa-pin-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.mapa-popup { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.mapa-popup-status {
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 2px;
}
.mapa-popup strong { font-size: 0.875rem; color: var(--gray-900); }
.mapa-popup-area { font-size: 0.75rem; color: var(--gray-400); margin-bottom: 4px; }
.mapa-popup .btn-primary { width: 100%; text-align: center; justify-content: center; }
@media (max-width: 640px) {
  .mapa-container { height: 420px; }
}

/* ===== PLAYER DE VÍDEO ANOTADO (pontos de interesse) ===== */
.video-annotation-player { display: flex; flex-direction: column; gap: 10px; }
.video-filename-label { font-size: 0.75rem; color: var(--gray-400); }
.video-annotation-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-annotation-stage video { width: 100%; max-height: 420px; display: block; background: #000; }
.video-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  padding: 16px;
  pointer-events: none;
}
.video-loading-overlay.hidden { display: none; }

/* tela cheia: o player inteiro (vídeo + controles) ocupa a tela, vídeo centralizado e sem corte */
.video-annotation-player:fullscreen {
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  gap: 12px;
}
.video-annotation-player:fullscreen .video-annotation-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.video-annotation-player:fullscreen .video-annotation-stage video { width: auto; height: 100%; max-height: 100%; max-width: 100%; object-fit: contain; }
.video-annotation-player:fullscreen .video-filename-label { color: rgba(255,255,255,0.75); }
.video-loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: videoLoadingSpin 0.8s linear infinite;
}
@keyframes videoLoadingSpin { to { transform: rotate(360deg); } }

.video-annotation-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-icon-sm {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}
.btn-icon-sm:hover { border-color: var(--gray-400); background: var(--gray-50); }
.video-time-display { font-size: 0.75rem; color: var(--gray-500); font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-seek-wrap { position: relative; flex: 1 1 160px; min-width: 120px; }
.video-seek-wrap input[type="range"] { width: 100%; display: block; accent-color: var(--blue); }
.annotation-ticks-layer { position: absolute; left: 0; right: 0; top: -2px; height: 6px; pointer-events: none; }
.annotation-tick {
  position: absolute;
  top: 0;
  width: 3px;
  height: 6px;
  border-radius: 2px;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
}
.annotation-tick.Alta { background: var(--red); }
.annotation-tick.Media { background: var(--amber); }
.annotation-tick.Baixa { background: var(--green); }

.annotation-list { display: flex; flex-direction: column; gap: 6px; }
.poi-panel [id^="vidCapture-"]:not(:empty) { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--gray-100); }
.annotation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--gray-50);
  cursor: pointer;
  transition: background 0.15s;
}
.annotation-row:hover { background: var(--gray-100); }
.annotation-row-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.annotation-row-body strong { font-size: 0.8125rem; color: var(--gray-900); }
.annotation-row-body span { font-size: 0.7rem; color: var(--gray-400); }

/* Frame capturado + caixa desenhada (marcação de ponto de interesse) */
.capture-canvas-wrap {
  position: relative;
  max-width: 520px;
  margin: 4px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.capture-canvas-wrap img { width: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.capture-hint { font-size: 0.75rem; color: var(--gray-400); margin: 8px 0; text-align: center; }
.bbox-layer { position: absolute; inset: 0; }
.bbox { position: absolute; border: 2px solid var(--red); border-radius: 4px; box-sizing: border-box; }
.bbox.Alta { border-color: var(--red); }
.bbox.Media { border-color: var(--amber); }
.bbox.Baixa { border-color: var(--green); }
.bbox-label {
  position: absolute;
  top: -22px;
  left: -2px;
  background: var(--gray-900);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.action-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ===== APROVAÇÕES DE VÍDEO (admin) ===== */
.aprovacoes-list { display: flex; flex-direction: column; gap: 14px; }
.aprovacao-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.aprovacao-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aprovacao-ativo { font-size: 0.9375rem; font-weight: 700; color: var(--gray-900); }
.aprovacao-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.aprovacao-file {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 12px;
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-size: 0.8125rem; color: var(--gray-700);
}
.aprovacao-file svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--blue); }
.aprovacao-file span:nth-of-type(1) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aprovacao-size { font-size: 0.75rem; color: var(--gray-400); white-space: nowrap; }
.aprovacao-player:not(:empty) { margin-top: 12px; }
.aprovacao-envio { font-size: 0.75rem; color: var(--gray-500); margin-top: 10px; }
.aprovacao-motivo {
  font-size: 0.8125rem; color: var(--red); background: var(--red-bg);
  border-radius: var(--radius); padding: 8px 12px; margin-top: 8px;
}
.aprovacao-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .aprovacao-actions button { flex: 1 1 auto; }
}

/* ===== AGRUPAMENTO DE ATIVIDADES POR ATIVO (Dados Coletados) ===== */
/* Quando o mesmo código de ativo tem mais de uma atividade, elas aparecem juntas */
.coleta-group-header td { background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.coleta-group-count {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-50);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
}
.coleta-subrow td { background: var(--gray-50); border-top: none; }
.td-asset-sub { color: var(--gray-300); font-weight: 700; padding-left: 20px !important; }

.coleta-card-group .coleta-card-thumb-group {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coleta-group-count-big { font-size: 1.75rem; font-weight: 800; color: var(--gray-400); }
.coleta-group-entries { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; border-top: 1px solid var(--gray-100); padding-top: 10px; }
.coleta-group-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--gray-600, #4B5563);
}
.coleta-group-entry .btn-detail { flex-shrink: 0; }

/* Activity media workspace */
#pageAssetDetail { max-width: 1440px; margin-inline: auto; }
#pageAssetDetail > .page-header { margin-bottom: 0; }
#pageAssetDetail .asset-detail-body { margin-top: 10px; gap: 0; }
.activity-context { display: flex; gap: 8px 20px; flex-wrap: wrap; color: var(--gray-500); font-size: .8rem; margin-bottom: 26px; }
.activity-context span + span::before { content: '·'; margin-right: 20px; color: var(--gray-400); }
.activity-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--gray-200); margin-bottom: 26px; overflow-x: auto; }
.activity-tabs [role="tab"] { flex-shrink: 0; display: flex; align-items: center; gap: 9px; padding: 14px 18px; font-size: .875rem; font-weight: 600; color: var(--gray-500); border-bottom: 3px solid transparent; }
.activity-tabs [aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.activity-tabs [role="tab"]:hover { background: #edf4fa; }
.activity-tabs [role="tab"]:focus-visible, .activity-video-picker button:focus-visible, .activity-photo-open:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.activity-count { padding: 2px 7px; border-radius: 6px; background: #e9edf1; color: var(--gray-500); font-size: .7rem; }
.activity-tabs [aria-selected="true"] .activity-count { background: var(--blue-100); color: var(--blue); }
#assetDetailBody [hidden] { display: none !important; }
.activity-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.activity-section-heading h2 { font-size: 1.15rem; letter-spacing: -.025em; }
.activity-section-heading p { font-size: .82rem; color: var(--gray-500); line-height: 1.6; margin-top: 6px; }
.activity-video-picker { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.activity-video-picker button { display: flex; align-items: center; gap: 12px; flex: 0 0 250px; padding: 13px 16px; border: 1px solid var(--gray-200); border-radius: 10px; background: white; text-align: left; min-width: 0; }
.activity-video-picker button[aria-pressed="true"] { border-color: var(--blue); background: #eff7fd; box-shadow: inset 0 0 0 1px var(--blue); }
.activity-video-number { flex-shrink: 0; font-size: .85rem; font-weight: 700; color: var(--blue); }
.activity-video-picker button > span:last-child { min-width: 0; }
.activity-video-picker strong { display: block; font-size: .8rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.activity-video-picker small { display: block; font-size: .7rem; color: var(--gray-500); margin-top: 5px; }
#pageAssetDetail .inspection-pair { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
#pageAssetDetail .video-panel { min-width: 0; padding: 16px; }
#pageAssetDetail .video-annotation-stage video { max-height: 570px; aspect-ratio: 16/9; object-fit: contain; }
#pageAssetDetail .poi-panel { min-width: 0; max-height: 650px; overflow-y: auto; padding: 20px; }
#pageAssetDetail .video-filename-label { overflow-wrap: anywhere; }
.activity-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.activity-photo-card { border: 1px solid var(--gray-200); background: white; border-radius: 12px; overflow: hidden; }
.activity-photo-open { width: 100%; display: block; background: #e6edf2; overflow: hidden; }
.activity-photo-open img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .2s; }
.activity-photo-open:hover img { transform: scale(1.03); }
.activity-photo-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px; font-size: .75rem; }
.activity-photo-card figcaption span { font-weight: 600; }
.activity-photo-card a { color: var(--blue); text-decoration: none; }
.activity-photo-card a:hover { text-decoration: underline; }
.activity-empty { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 64px 24px; text-align: center; background: white; }
.activity-empty strong { font-size: 1rem; }
.activity-empty p { margin-top: 10px; font-size: .85rem; color: var(--gray-500); line-height: 1.6; }
#assetPointClouds { margin: 0; padding: 24px; }
#pageAssetDetail .summary-fact-body strong { white-space: normal; overflow-wrap: anywhere; }
#pageAssetDetail .modal-text, #pageAssetDetail .modal-relato { white-space: pre-line; }
@media (max-width: 1150px) {
  #pageAssetDetail .inspection-pair { grid-template-columns: minmax(0, 1fr); }
  #pageAssetDetail .poi-panel { max-height: none; }
}
@media (max-width: 700px) {
  .activity-tabs { gap: 0; margin-bottom: 20px; }
  .activity-tabs [role="tab"] { padding: 12px 10px; gap: 6px; font-size: .8rem; }
  .activity-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .activity-photo-card figcaption { flex-wrap: wrap; padding: 10px; }
  .activity-context { gap: 8px 12px; margin-bottom: 18px; }
  .activity-context span + span::before { margin-right: 12px; }
  #pageAssetDetail .narrative-grid { grid-template-columns: minmax(0, 1fr); }
  #assetPointClouds { padding: 16px; }
}
@media (max-width: 420px) {
  .activity-tabs [role="tab"] { padding-inline: 7px; font-size: .75rem; gap: 4px; }
  .activity-count { padding-inline: 5px; }
}
