/* ============================================================
   RONDAS FM - Fórum Montijo
   styles.css - Estilos globais partilhados
   ============================================================ */

/* --- Variáveis de cor --- */
:root {
  --laranja:        #E8451A;
  --laranja-escuro: #CC2200;
  --laranja-claro:  #fff9f7;
  --laranja-borda:  #fde8e2;
  --amarelo:        #F5A800;
  --escuro:         #2C2C2A;
  --texto:          #3C3C3C;
  --texto-secundario: #888;
  --texto-claro:    #aaa;
  --fundo:          #f4f4f4;
  --branco:         #ffffff;
  --borda:          #eee;
  --verde:          #1D9E75;
  --verde-claro:    #f0faf5;
  --verde-borda:    #9FE1CB;
  --azul:           #185FA5;
  --azul-claro:     #e8f0fd;
}

/* --- Reset base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  font-size: 16px;
  line-height: 1.5;
}

/* --- Tipografia --- */
h1 { font-size: 26px; font-weight: 500; }
h2 { font-size: 22px; font-weight: 500; }
h3 { font-size: 18px; font-weight: 500; }

/* --- Botões --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  height: 50px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn-primario  { background: var(--laranja); color: #fff; }
.btn-secundario { background: var(--branco); color: var(--laranja); border: 1px solid var(--laranja-borda); }
.btn-perigo    { background: #e24b4a; color: #fff; }
.btn-bloco     { width: 100%; justify-content: center; }
.btn-sm        { height: 32px; font-size: 12px; padding: 0 12px; border-radius: 8px; }

/* --- Inputs --- */
.input-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.input-group label { font-size: 13px; color: var(--texto-secundario); }
.input {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  padding: 0 12px 0 42px;
  font-size: 16px;
  color: var(--texto);
  background: var(--branco);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--laranja); }
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--texto-claro);
  pointer-events: none;
}

/* --- Cards --- */
.card {
  background: var(--branco);
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.card-titulo {
  font-size: 15px;
  font-weight: 500;
  color: var(--texto);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-titulo a {
  font-size: 11px;
  color: var(--laranja);
  font-weight: 400;
  text-decoration: none;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}
.badge-superadmin  { background: var(--laranja-borda); color: #993C1D; }
.badge-admin       { background: #faeeda; color: #633806; }
.badge-director    { background: var(--azul-claro); color: var(--azul); }
.badge-vigilante   { background: var(--fundo); color: #5F5E5A; }
.badge-ativo       { background: var(--verde-claro); color: #0F6E56; }
.badge-inativo     { background: var(--fundo); color: var(--texto-secundario); }
.badge-concluida   { background: var(--verde-claro); color: #0F6E56; }
.badge-em-curso    { background: #fef9e8; color: #633806; }
.badge-pendente    { background: var(--fundo); color: var(--texto-secundario); }
.badge-exterior    { background: var(--laranja-borda); color: #993C1D; }
.badge-interior    { background: var(--azul-claro); color: var(--azul); }

/* --- Sidebar (dashboard) --- */
.sidebar {
  width: 220px;
  background: var(--escuro);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
}
.sidebar-logo {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img { height: 28px; }
.sidebar-logo .sub { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 4px; }
.nav-secao { padding: 12px 0 6px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav-label {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  padding: 0 16px;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background 0.1s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); }
.nav-item.ativo { background: rgba(232,69,26,0.15); color: var(--laranja); border-left-color: var(--laranja); font-weight: 500; }
.nav-item i { font-size: 17px; flex-shrink: 0; }
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* --- Layout dashboard --- */
.dash-layout { display: flex; min-height: 100vh; background: #ECEEF2; }
.dash-main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; }
.dash-topbar {
  height: 50px;
  background: var(--branco);
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.dash-topbar-titulo { font-size: 14px; font-weight: 500; color: var(--texto); }
.dash-content { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* --- Stat cards --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: var(--branco); border-radius: 10px; padding: 14px; border: 1px solid #e0e0e0; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.stat-card .val { font-size: 24px; font-weight: 500; color: var(--texto); }
.stat-card .lbl { font-size: 11px; color: var(--texto-claro); margin-top: 2px; }
.stat-card .trend { font-size: 10px; margin-top: 6px; }
.stat-card.alerta .val { color: var(--laranja); }

/* --- Tabelas --- */
.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { text-align: left; padding: 8px 12px; font-size: 10px; font-weight: 500; color: var(--texto-secundario); border-bottom: 1px solid var(--borda); background: var(--fundo); }
.tabela td { padding: 10px 12px; border-bottom: 1px solid #f8f8f8; color: var(--texto); }
.tabela tr:last-child td { border-bottom: none; }
.tabela tr:hover td { background: #fafafa; }

/* --- App mobile (Capacitor) --- */
.app-screen {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--fundo);
  display: flex;
  flex-direction: column;
}
.app-header {
  background: var(--laranja);
  padding: 12px 16px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.app-header-titulo { font-size: 18px; font-weight: 500; color: #fff; }
.app-header-sub { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.app-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.app-footer { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* --- NFC ring --- */
@keyframes nfc-pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.nfc-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--laranja);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  margin: 0 auto;
}
.nfc-ring::before, .nfc-ring::after {
  content: '';
  position: absolute;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--laranja);
  animation: nfc-pulse 1.4s ease-out infinite;
}
.nfc-ring::after { animation-delay: 0.5s; }
.nfc-ring i { font-size: 28px; color: #fff; }

/* --- Utilitários --- */
.text-laranja { color: var(--laranja); }
.text-secundario { color: var(--texto-secundario); }
.text-claro { color: var(--texto-claro); }
.text-verde { color: var(--verde); }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
  