*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f2f7;
  color: #1a1a2e;
  font-size: 14px;
}

/* ── Topbar ── */
.topbar {
  background: linear-gradient(135deg, #0d2444 0%, #1a4a8a 100%);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(13,36,68,.25);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.topbar-icon {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
}
.topbar-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.topbar-sub {
  color: rgba(255,255,255,.6);
  font-size: 11px;
}
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar-controls .form-select,
.topbar-controls .form-control {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 12px;
  height: 32px;
  border-radius: 6px;
  padding: 0 8px;
}
.topbar-controls .form-select:focus,
.topbar-controls .form-control:focus {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.4);
  box-shadow: none;
  color: #fff;
  outline: none;
}
.topbar-controls .form-select option { color: #1a1a2e; background: #fff; }
.topbar-controls input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .7; }
.topbar-controls .btn-refresh {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 12px;
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.topbar-controls .btn-refresh:hover { background: rgba(255,255,255,.25); }

/* ── Conteúdo ── */
.page-content {
  padding: 24px 28px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-align: left;
  width: 100%;
  border-left: 4px solid transparent;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.kpi-card.blue  { border-left-color: #1a4a8a; }
.kpi-card.green { border-left-color: #16a34a; }
.kpi-card.teal  { border-left-color: #0891b2; }

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.kpi-card.blue  .kpi-icon { background: #dbeafe; color: #1a4a8a; }
.kpi-card.green .kpi-icon { background: #dcfce7; color: #16a34a; }
.kpi-card.teal  .kpi-icon { background: #cffafe; color: #0891b2; }

.kpi-body { flex: 1; min-width: 0; }
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: #0d2444;
  letter-spacing: -.5px;
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

/* ── Info cards (presença + resumo + admin) ── */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  margin-bottom: 20px;
  align-items: start;
}
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.info-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-bottom: 6px;
}
.info-card-value {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

.btn-admin {
  background: #0d2444;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 20px;
  height: 100%;
  min-height: 68px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: background .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.btn-admin:hover { background: #1a3a6a; }
.btn-admin i { font-size: 18px; opacity: .85; }

/* ── Gráfico ── */
.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 20px;
}
.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.chart-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.chart-day-badge {
  font-size: 11px;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.chart-wrap { position: relative; height: 240px; }

/* ── Tabela ── */
.table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden;
  margin-bottom: 20px;
}
.table-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.table-filters {
  padding: 10px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #fafbfc;
}
.table-scroll { max-height: 58vh; overflow: auto; }
#tabelaDetalhe { margin: 0; font-size: 13px; }
#tabelaDetalhe thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  padding: 10px 14px;
  border-bottom: 2px solid #e2e8f0;
}
#tabelaDetalhe tbody td { padding: 9px 14px; border-bottom: 1px solid #f1f5f9; }
#tabelaDetalhe tbody tr:hover td { background: #f8fafc; }
#tabelaDetalhe tbody tr:last-child td { border-bottom: none; }

/* ── Modais ── */
.modal-header-navy {
  background: linear-gradient(135deg, #0d2444 0%, #1a4a8a 100%);
  color: #fff;
  padding: 14px 20px;
}
.modal-header-navy .btn-close { filter: brightness(0) invert(1); }

/* ── Badges na tabela ── */
.badge-sim { background: #dcfce7; color: #15803d; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.badge-nao { background: #fee2e2; color: #b91c1c; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }

/* ── Responsivo ── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .info-row { grid-template-columns: 1fr 1fr; }
  .btn-admin { grid-column: span 2; min-height: 50px; flex-direction: row; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 576px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .info-row { grid-template-columns: 1fr; }
  .btn-admin { grid-column: span 1; }
  .chart-wrap { height: 180px; }
  #tabelaDetalhe th:nth-child(3), #tabelaDetalhe td:nth-child(3) { display: none; }
  .topbar-title { font-size: 13px; }
}
