/* static/css/custom.css */

/* 1) Tipografia */
body {
  font-family: Arial, sans-serif;
  font-size: 14px;
  background-color: #fafafa;
  color: #333;
font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}


/* 2) Navbar */
.navbar {
  background-color: #fff !important;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.navbar-logo {
  height: 40px;
  width: auto;
}

/* 3) Botões principais */
.btn-primary {
  background-color: #5dade2;
  border-color: #5dade2;
  border-radius: 0.5rem;
}
.btn-primary:hover {
  background-color: #5499c7;
  border-color: #5499c7;
}

/* 4) Cards e containers */
.card, .table, .border, .p-3 {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* 5) DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}
table.dataTable thead th {
  border-bottom: 2px solid #e0e0e0;
}
table.dataTable tbody tr {
  background-color: #fff;
}
table.dataTable tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* 6) Toasts (toastr) */
.toast-success {
  background-color: #2ecc71 !important;
}

/* 7) Tela de login */
.login-wrapper {
  max-width: 420px;
  margin: 2rem auto;
}
.login-card {
  border-radius: 1rem;
  overflow: hidden;
}
/* entrada do card (aparece deslizando de baixo) */
.login-card {
  animation: login-in 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* logo oficial da escola, no topo do login (flutuação sutil) */
.login-logo {
  display: block;
  max-width: 220px;
  max-height: 130px;
  width: auto;
  height: auto;
  margin: 0 auto;
  animation: ba-float 3.5s ease-in-out infinite;
}
/* junta os ícones aos campos (input-group sem emenda visível) */
.login-card .input-group-text {
  border-color: #ced4da;
}
.login-card .form-control:focus {
  box-shadow: none;
  border-color: #5dade2;
}
/* mantém a borda de foco coerente ao redor do input-group inteiro */
.login-card .input-group:focus-within {
  border-radius: 0.5rem;
  box-shadow: 0 0 0 0.2rem rgba(93, 173, 226, 0.25);
}
.login-card .input-group:focus-within .input-group-text,
.login-card .input-group:focus-within .form-control {
  border-color: #5dade2;
}
#togglePassword {
  cursor: pointer;
}

/* 8) Animações compartilhadas (usadas pelo topo do login) */
@keyframes ba-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  .login-card,
  .login-logo { animation: none; }
}

/* 9) Dashboard ------------------------------------------------------------ */
.dash {
  /* tokens de tinta/paleta usados nos KPIs e painéis */
  --ink-1: #1a1a19;
  --ink-2: #52514e;
  --ink-muted: #898781;
  --panel-border: #e7e6df;
  --panel-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.04);
  max-width: 1200px;
  margin: 0 auto;
}

/* cabeçalho */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.dash-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink-1);
  margin: 0;
}
.dash-sub {
  color: var(--ink-muted);
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

/* grade de KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  box-shadow: var(--panel-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;   /* é um <a>: sem sublinhado, herda a cor da tinta */
  color: inherit;
}
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(16, 24, 40, 0.09);
}
/* faixa de cor à esquerda (acento semântico) */
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}
.kpi__icon {
  grid-row: 1 / span 2;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 1.15rem;
  color: var(--accent);
  background: var(--accent-soft);
}
.kpi__label {
  align-self: end;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.kpi__value {
  align-self: start;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-1);
}
.kpi__hint {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* acentos semânticos (paleta validada) */
.kpi--info     { --accent: #2a78d6; --accent-soft: #eaf2fc; }
.kpi--violet   { --accent: #4a3aa7; --accent-soft: #eeecf8; }
.kpi--aqua     { --accent: #1baf7a; --accent-soft: #e5f6ef; }
.kpi--good     { --accent: #0ca30c; --accent-soft: #e6f5e6; }
.kpi--critical { --accent: #d03b3b; --accent-soft: #fbebeb; }
.kpi--muted    { --accent: #898781; --accent-soft: #f0efec; }

/* painéis (gráficos) */
.dash-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-panel {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  box-shadow: var(--panel-shadow);
  padding: 1.25rem 1.35rem 1.4rem;
}
.dash-panel--wide { grid-column: span 2; }
.dash-panel--today {
  display: flex;
  flex-direction: column;
}
.dash-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.dash-panel__title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-1);
  margin: 0;
}
.dash-panel__badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2a78d6;
  background: #eaf2fc;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}
.chart-box { position: relative; height: 240px; }
.chart-box--lg { height: 280px; }

/* destaque "hoje" */
.today {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  padding: 0.5rem 0 1rem;
}
.today__value {
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  color: #2a78d6;
}
.today__label {
  font-size: 0.9rem;
  color: var(--ink-muted);
  max-width: 12rem;
}
.dash-empty {
  color: var(--ink-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
  margin: 0;
}

@media (max-width: 720px) {
  .dash-panel--wide { grid-column: auto; }
}

/* 10) Marca d'água do leitor de câmera (etiqueta) --------------------------
   Ícone de etiqueta sobreposto ao vídeo da câmera, apagado por padrão;
   "acende" verde por um instante a cada código lido com sucesso. */
.scanner-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  color: #adb5bd;
  opacity: 0.45;
  pointer-events: none;
  z-index: 5;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease, text-shadow 0.15s ease;
}
.scanner-watermark-ok {
  color: #28a745;
  opacity: 1;
  text-shadow: 0 0 22px rgba(40, 167, 69, 0.85);
  animation: scanner-watermark-pulse 0.55s ease-out;
}
@keyframes scanner-watermark-pulse {
  0%   { transform: translate(-50%, -50%) scale(0.85); }
  45%  { transform: translate(-50%, -50%) scale(1.35); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .scanner-watermark-ok { animation: none; }
}
