/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a3a5c;
  --primary-dark: #122840;
  --primary-light: #e8f0f8;
  --success: #1a7a4a;
  --success-light: #e6f4ed;
  --danger: #b91c1c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--primary);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-md);
}
.header img { height: 44px; object-fit: contain; }
.header-title { font-size: 1.15rem; font-weight: 600; }
.header-subtitle { font-size: .82rem; opacity: .8; margin-top: 2px; }

/* Layout */
.container {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 16px 60px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  background: var(--primary-light);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 28px;
}
.card-header h2 { font-size: 1.15rem; color: var(--primary); font-weight: 700; }
.card-header p  { font-size: .875rem; color: var(--gray-600); margin-top: 4px; }
.card-body { padding: 28px; }

/* Anonimato badge */
.badge-anon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7d9be;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.badge-anon::before { content: "🔒"; }

/* Form */
.form-group { margin-bottom: 20px; }
label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
label .req { color: var(--danger); margin-left: 2px; }
select, textarea, input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--gray-900);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
select:focus, textarea:focus, input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}
textarea { resize: vertical; min-height: 140px; }
.form-hint {
  font-size: .78rem;
  color: var(--gray-400);
  margin-top: 5px;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}
.checkbox-group input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox-group label {
  font-size: .84rem;
  font-weight: 400;
  color: var(--gray-600);
  cursor: pointer;
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}
.btn-primary:hover  { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

/* Alerta de erro */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .875rem;
  margin-bottom: 20px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a7d9be; }

/* Página de confirmação */
.confirm-icon {
  width: 72px; height: 72px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 24px;
}
.protocolo-box {
  background: var(--gray-100);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}
.protocolo-box .protocolo-label { font-size: .78rem; color: var(--gray-600); margin-bottom: 6px; }
.protocolo-box .protocolo-num {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--primary);
  font-family: 'Courier New', monospace;
}
.info-list { list-style: none; padding: 0; }
.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .875rem;
  color: var(--gray-700);
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.info-list li:last-child { border: none; }
.info-list li::before { content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* Admin */
.admin-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { font-size: 1.1rem; font-weight: 700; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .stat-label { font-size: .78rem; color: var(--gray-600); margin-top: 4px; }

/* Tabela de denúncias */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 12px 16px; vertical-align: top; }

/* Status badges */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-pendente  { background: #fef3c7; color: #92400e; }
.status-em_analise { background: #dbeafe; color: #1e40af; }
.status-concluido { background: var(--success-light); color: var(--success); }
.status-arquivado { background: var(--gray-100); color: var(--gray-600); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--gray-400); line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 24px; }
.detail-row { margin-bottom: 16px; }
.detail-row .detail-label { font-size: .75rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.detail-row .detail-value { font-size: .9rem; color: var(--gray-900); }
.detail-row .detail-value.descricao {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  white-space: pre-wrap;
}
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

/* Login admin */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-icon { font-size: 2.5rem; margin-bottom: 12px; }
.login-card h2 { font-size: 1.2rem; color: var(--primary); font-weight: 700; margin-bottom: 6px; }
.login-card p { font-size: .85rem; color: var(--gray-600); margin-bottom: 28px; }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.spinner.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer {
  text-align: center;
  font-size: .78rem;
  color: var(--gray-400);
  margin-top: 40px;
  padding: 0 16px;
}

/* Responsivo */
@media (max-width: 480px) {
  .container { margin: 20px auto; }
  .card-body { padding: 20px; }
  .card-header { padding: 16px 20px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}
