/* Estilo global */
body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8f9fa;
  color: #333;
}

/* Cartões principais */
.card {
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

/* Títulos */
h4, h5 {
  font-weight: 600;
  color: #222;
}

/* Inputs e labels (escopado aos componentes Bootstrap, sem afetar tudo genérico) */
form label {
  font-weight: 500;
  margin-bottom: 4px;
}

.form-control,
.form-select,
textarea.form-control {
  border-radius: 8px !important;
  border: 1px solid #ccc;
  padding: 8px 12px;
  width: 100%;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  outline: none;
}

/* Botões */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 8px 16px;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  transform: scale(1.02);
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5c636a;
  border-color: #565e64;
  transform: scale(1.02);
}

/* Form-check (checkbox LGPD) */
.form-check-input {
  margin-right: 8px;
}

/* ⚠️ IMPORTANTES: NÃO sobrescreva utilitários Bootstrap globalmente.
   Em vez de .border-bottom / .mb-3 / .mt-4, use classes custom abaixo. */

/* Separadores (use <div class="divider"></div>) */
.divider {
  border-bottom: 2px solid #e9ecef;
}

/* Espaços custom (use junto ou no lugar dos utilitários) */
.gap-mb { margin-bottom: 1.2rem; }
.gap-mt { margin-top: 1.5rem; }

/* Navbar personalizada */
.navbar {
  border-bottom: 3px solid #0a58ca;
}

.navbar-brand img {
  border-radius: 6px;
}

/* Footer */
footer {
  font-size: 0.9rem;
  color: #6c757d;
}

/* Efeito sutil de hover nos cards (se quiser) */
.hover-up { transition: transform .15s ease, box-shadow .15s ease; }
.hover-up:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); }

/* Efeito sutil ao passar o mouse nos cards do topo */
.hover-card { transition: transform .08s ease, box-shadow .08s ease; }
.hover-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08)!important; }

/* botões de ação compactos (lista protocolos) */
.list-group-item .btn-group .btn { padding: .15rem .4rem; }

/* Notícias (Portal) */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e8edf3;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.08);
  transition: transform .12s ease, box-shadow .12s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(2, 8, 23, 0.12);
}

.news-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #eef2f6;
}

.news-placeholder {
  background: linear-gradient(120deg, #e2e8f0, #f1f5f9);
}

.news-body {
  padding: 12px 14px 14px;
}

.news-title {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
}

.news-cta {
  font-size: 0.85rem;
  color: #0b4b7a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 991px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* Form sections */
.section-card.section-invalid {
  border-color: #f2b8b5;
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15);
}

/* Sidebar Secretaria */
.sidebar-card {
  position: sticky;
  top: 1rem;
  border-radius: 12px;
}

.layout-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 12px;
}

.layout-sidebar {
  display: none;
}

.layout-content {
  width: 100%;
}

.layout-secretaria .layout-shell {
  display: flex;
  gap: 1rem;
  max-width: none;
  padding: 0 12px;
}

.layout-secretaria .layout-sidebar {
  display: block;
  width: 260px;
}

.layout-secretaria .layout-content {
  flex: 1;
  min-width: 0;
}

.layout-secretaria .layout-inner {
  max-width: 100%;
}

/* Secretaria — visual moderno/expressivo */
.layout-secretaria {
  --sec-ink: #0f172a;
  --sec-muted: #64748b;
  --sec-card: #ffffff;
  --sec-border: #e2e8f0;
  --sec-accent: #0ea5e9;
  --sec-accent-2: #14b8a6;
  --sec-bg: #f4f7fb;
  font-family: "Sora", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--sec-bg);
  color: var(--sec-ink);
}

.layout-secretaria::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(20, 184, 166, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(14, 165, 233, 0.18), transparent 60%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
  pointer-events: none;
  z-index: 0;
}

.layout-secretaria > * {
  position: relative;
  z-index: 1;
}

.layout-secretaria .navbar {
  background: linear-gradient(90deg, #0f172a 0%, #0b4b7a 45%, #0ea5e9 100%);
  border-bottom: 0;
  position: relative;
  z-index: 2001;
}

.layout-secretaria .navbar .nav-link,
.layout-secretaria .navbar .navbar-brand {
  color: #e2f2ff !important;
}

.layout-secretaria .navbar .nav-link:hover {
  color: #ffffff !important;
}

.layout-secretaria .card {
  border: 1px solid var(--sec-border);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(2, 8, 23, 0.10);
}

.layout-secretaria .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(2, 8, 23, 0.14);
}

.layout-secretaria .sidebar-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--sec-border);
  border-radius: 16px;
}

.layout-secretaria .layout-sidebar {
  position: relative;
  z-index: 1;
}

.layout-secretaria .navbar .dropdown-menu {
  z-index: 2002;
}

.layout-secretaria .sidebar-nav .nav-link {
  color: var(--sec-ink);
  border-radius: 10px;
}

.layout-secretaria .sidebar-nav .nav-link:hover {
  background: rgba(14, 165, 233, 0.12);
  color: #0b4b7a;
}

.layout-secretaria .sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(20, 184, 166, 0.12));
  color: #0b4b7a;
  font-weight: 600;
}

.layout-secretaria .btn-toggle {
  color: var(--sec-ink);
}

.layout-secretaria .btn-toggle:hover {
  background: rgba(20, 184, 166, 0.12);
}

.layout-secretaria h4,
.layout-secretaria h5 {
  color: var(--sec-ink);
  letter-spacing: -0.3px;
  font-weight: 700;
}

.layout-secretaria h1,
.layout-secretaria h2,
.layout-secretaria h3 {
  letter-spacing: -0.6px;
  font-weight: 700;
}

.layout-secretaria .card .card-title,
.layout-secretaria .card .card-header {
  font-weight: 700;
}

.layout-secretaria .small,
.layout-secretaria .text-muted {
  color: var(--sec-muted) !important;
}

.layout-secretaria .table {
  background: var(--sec-card);
}

/* Botões e inputs (escopo Secretaria) */
.layout-secretaria .btn {
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(2, 8, 23, 0.08);
}

.layout-secretaria .btn-primary {
  background: linear-gradient(90deg, #0ea5e9, #14b8a6);
  border: 0;
}

.layout-secretaria .btn-primary:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.layout-secretaria .form-control,
.layout-secretaria .form-select,
.layout-secretaria textarea.form-control {
  border-radius: 12px !important;
  border: 1px solid var(--sec-border);
  background: #fbfdff;
}

.layout-secretaria .form-control:focus,
.layout-secretaria .form-select:focus,
.layout-secretaria textarea.form-control:focus {
  border-color: var(--sec-accent);
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.2);
}

.sidebar-nav .nav-link {
  color: #334155;
  border-radius: 8px;
  padding: .4rem .6rem;
}

.sidebar-nav .nav-link:hover {
  background: #eef2ff;
  color: #1e40af;
}

.btn-toggle {
  background: transparent;
  border: 0;
  font-weight: 600;
  border-radius: 8px;
  padding: .35rem .6rem;
  color: #0f172a;
}

.btn-toggle:hover {
  background: #f1f5f9;
}
