/* =============================================================================
   SisCAE — Sistema de Controle e Acompanhamento Eleitoral
   Folha de estilos modernizada — v2.0
   Paleta institucional: azul marinho, verde bandeira e dourado
   ========================================================================== */

:root {
  /* Paleta principal */
  --navy-950: #081527;
  --navy-900: #0c1d36;
  --navy-800: #12294b;
  --navy-700: #1a3a66;
  --navy-600: #234b82;

  --verde: #009c3b;
  --verde-escuro: #007a2e;
  --verde-claro: #e6f7ec;

  --dourado: #d4a017;
  --dourado-claro: #f8edd0;
  --dourado-vivo: #ffdf00;

  /* Cores funcionais */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --success-dark: #15803d;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --warning: #f59e0b;
  --warning-dark: #b45309;
  --info: #0ea5e9;
  --info-dark: #0284c7;

  /* Neutros */
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --border: #d7dce3;
  --border-light: #e8ebf0;
  --text: #1a2332;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(12, 29, 54, 0.06);
  --shadow: 0 2px 8px rgba(12, 29, 54, 0.08);
  --shadow-md: 0 4px 16px rgba(12, 29, 54, 0.12);
  --shadow-lg: 0 10px 30px rgba(12, 29, 54, 0.18);

  /* Raios e transições */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.18s ease;
}

/* =============================================================================
   RESET / BASE
   ========================================================================== */

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  color: var(--navy-900);
  overflow-wrap: anywhere;
}

/*
 * FOCO DOS CAMPOS: mantido o comportamento padrão do navegador,
 * apenas com um contorno azul sutil e discreto. NÃO alterar a cor de
 * fundo dos campos em foco.
 */
:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 1px;
}

/* =============================================================================
   HEADER / TOPBAR
   ========================================================================== */

header {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  background: var(--navy-900);
  color: #e8edf5;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 100;
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px clamp(12px, 3vw, 28px);
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, var(--navy-800) 100%);
  border-bottom: 3px solid var(--dourado);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 300px;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.topbar-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.topbar-title {
  min-width: 0;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.topbar-subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb1c9;
}

.topbar-campanha {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.02em;
  margin-top: 1px;
}

/* --- Seletor de campanha (admin) no header --- */
.topbar-campanha-form {
  display: inline-block;
  margin-top: 2px;
}

.topbar-campanha-select {
  font-size: 0.74rem;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 6px;
  padding: 2px 22px 2px 6px;
  cursor: pointer;
  outline: none;
  max-width: 340px;
  appearance: auto;
  -webkit-appearance: menulist;
}

.topbar-campanha-select:hover,
.topbar-campanha-select:focus {
  background: rgba(255,255,255,0.18);
  border-color: #fbbf24;
}

.topbar-campanha-select option {
  color: #1e293b;
  background: #fff;
  font-weight: 500;
}

/* Acessibilidade: rótulo oculto visualmente mas disponível para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  max-width: 100%;
  font-size: 0.88rem;
  color: #c7d2e2;
  overflow-wrap: anywhere;
  text-align: right;
}

.topbar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--dourado-vivo);
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid var(--dourado);
}

.topbar-user-name {
  font-weight: 600;
  color: #ffffff;
  display: block;
  line-height: 1.25;
}

.topbar-user-nivel {
  display: block;
  font-size: 0.74rem;
  color: #9fb1c9;
  text-transform: capitalize;
  line-height: 1.25;
}

/* =============================================================================
   NAVBAR + MENU DROPDOWN HIERÁRQUICO
   ========================================================================== */

.navbar {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, var(--navy-900) 0%, var(--navy-800) 100%);
  border-bottom: 1px solid var(--navy-700);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(12px, 3vw, 28px);
}

/* Botão hamburger — visível apenas no mobile */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #e8edf5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.nav-toggle:hover {
  background: var(--navy-700);
}

.nav-toggle .nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle .nav-toggle-bars span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--dourado-vivo);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.navbar-menu {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-menu > li {
  position: relative;
  min-width: 0;
}

.navbar-spacer {
  flex: 1 1 auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  color: #d5deeb;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.nav-link:hover {
  background: var(--navy-700);
  color: #ffffff;
}

.nav-link.active {
  color: #ffffff;
  font-weight: 700;
  border-bottom-color: var(--verde);
  background: rgba(0, 156, 59, 0.14);
}

.nav-link .nav-icon,
.nav-link i[data-lucide],
.nav-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--dourado-vivo);
}

.nav-link.active .nav-icon,
.nav-link.active i[data-lucide],
.nav-link.active svg {
  color: #37d071;
}

/* Setinha (caret) dos itens com dropdown */
.nav-caret {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
  opacity: 0.7;
}

/* --- Dropdown nível 1 --- */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--verde);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition),
    visibility var(--transition);
  z-index: 200;
}

.dropdown-menu li {
  position: relative;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.dropdown-link:hover {
  background: var(--verde-claro);
  color: var(--verde-escuro);
}

.dropdown-link.active {
  background: var(--verde-claro);
  color: var(--verde-escuro);
  font-weight: 700;
}

.dropdown-link .nav-icon,
.dropdown-link i[data-lucide],
.dropdown-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--dourado);
}

.dropdown-link:hover .nav-icon,
.dropdown-link:hover svg,
.dropdown-link.active .nav-icon,
.dropdown-link.active svg {
  color: var(--verde);
}

/* Caret dos submenus laterais (nível 2+) */
.dropdown-link .nav-caret {
  margin-left: auto;
  transform: rotate(-45deg);
}

/* --- Dropdown nível 2 (abre ao lado) --- */
.dropdown-menu .dropdown-menu {
  top: -7px;
  left: 100%;
  border-top: 3px solid var(--dourado);
  border-radius: var(--radius);
  transform: translateX(8px);
}

/* --- Abertura via hover (desktop) e via classe .open (mobile/JS) --- */
@media (hover: hover) and (min-width: 901px) {
  .navbar-menu li.has-dropdown:hover > .dropdown-menu,
  .navbar-menu li.has-dropdown:focus-within > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(0, 0);
  }

  .navbar-menu li.has-dropdown:hover > .nav-link,
  .navbar-menu li.has-dropdown:focus-within > .nav-link {
    background: var(--navy-700);
    color: #ffffff;
  }
}

.navbar-menu li.has-dropdown.open > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0);
}

.navbar-menu li.has-dropdown.open > .nav-link > .nav-caret,
.navbar-menu li.has-dropdown.open > .dropdown-link > .nav-caret {
  transform: rotate(-135deg) translateY(-2px);
}

/* =============================================================================
   MAIN / CONTAINER
   ========================================================================== */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1280px;
  margin: 22px auto 40px;
  padding: 0 clamp(12px, 3vw, 28px);
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-header h1,
.page-header h2 {
  margin: 0;
}

/* =============================================================================
   FOOTER
   ========================================================================== */

footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.footer-bar {
  background: var(--navy-950);
  color: #9fb1c9;
  border-top: 3px solid var(--verde);
  padding: 16px clamp(12px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #d5deeb;
}

.footer-brand svg,
.footer-brand i[data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--dourado-vivo);
}

.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  color: var(--dourado-vivo);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* =============================================================================
   CARDS
   ========================================================================== */

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 18px;
  max-width: 100%;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.card-header {
  margin: -18px -20px 16px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700;
  color: var(--navy-900);
}

.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-body {
  max-width: 100%;
}

/* =============================================================================
   DASHBOARD
   ========================================================================== */

.dashboard {
  padding: 0;
}

.dashboard h1 {
  margin: 0 0 4px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.dash-card {
  position: relative;
  background: var(--bg-card);
  color: var(--text);
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--navy-700);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dash-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  margin: 0 0 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.dash-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: var(--dourado-vivo);
  float: right;
  margin-left: 10px;
}

.dash-card-icon svg,
.dash-card-icon i[data-lucide] {
  width: 20px;
  height: 20px;
}

.dash-number {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--navy-900);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.dash-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-card.dash-positive {
  border-left-color: var(--verde);
}
.dash-card.dash-positive .dash-number {
  color: var(--verde-escuro);
}
.dash-card.dash-positive .dash-card-icon {
  background: var(--verde-claro);
  color: var(--verde);
}

.dash-card.dash-negative {
  border-left-color: var(--danger);
}
.dash-card.dash-negative .dash-number {
  color: var(--danger-dark);
}
.dash-card.dash-negative .dash-card-icon {
  background: #fee2e2;
  color: var(--danger);
}

.dash-card.dash-zero,
.dash-card.dash-gold {
  border-left-color: var(--dourado);
}
.dash-card.dash-gold .dash-card-icon,
.dash-card.dash-zero .dash-card-icon {
  background: var(--dourado-claro);
  color: var(--dourado);
}

.dash-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.dash-pill-warning {
  background: var(--dourado-claro);
  color: var(--warning-dark);
  border: 1px solid #f3d488;
}

.dash-pill-ok {
  background: var(--verde-claro);
  color: var(--verde-escuro);
  border: 1px solid #a7e6bf;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
}

.dash-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.dash-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.98rem;
  color: var(--navy-900);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
}

.dash-panel h3 svg,
.dash-panel h3 i[data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--verde);
}

/* Barras de progresso (planejamento no dashboard) */
.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--verde), var(--verde-escuro));
  transition: width 0.5s ease;
}

.progress-bar.progress-gold {
  background: linear-gradient(90deg, var(--dourado-vivo), var(--dourado));
}

.progress-bar.progress-danger {
  background: linear-gradient(90deg, #f87171, var(--danger));
}

/* Cards estatísticos genéricos */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-900);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.info-card-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-900);
}

.info-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =============================================================================
   TABELAS
   ========================================================================== */

.table-wrapper,
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background-color: var(--bg-card);
}

th,
td {
  border-bottom: 1px solid var(--border-light);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

th {
  background: var(--navy-900);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--dourado);
}

tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover td {
  background-color: var(--verde-claro);
}

tfoot td,
.total-row td {
  font-weight: 700;
  background: #f1f5f9;
  border-top: 2px solid var(--border);
}

/* Botões de ação em tabelas — SEMPRE empilhados verticalmente */
.table-actions,
.siscae-table-actions,
.td-acoes .acoes,
td .btn-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 96px;
}

.table-actions a,
.table-actions form,
.table-actions .btn,
.table-actions button,
.siscae-table-actions a,
.siscae-table-actions form,
.siscae-table-actions .btn,
.siscae-table-actions button {
  width: 100%;
  margin: 0;
}

.table-actions form {
  display: flex;
}

.table-actions form .btn,
.table-actions form button {
  flex: 1 1 auto;
}

/* Linha destacada por busca/navegação */
.linha-destacada-registro td {
  background-color: var(--dourado-claro) !important;
  border-left: 3px solid var(--dourado);
  font-weight: 600;
}

/* Protocolo — destaques de atraso */
.protocolo-atraso-moderado td {
  background-color: #fdf6dd;
}

.protocolo-atraso-grave td {
  background-color: #fdeaea;
}

.table-wrapper table tr.protocolo-atraso-moderado:hover td,
.table-wrapper table tr.protocolo-atraso-grave:hover td {
  filter: brightness(0.97);
}

/* =============================================================================
   FORMULÁRIOS
   ========================================================================== */

form {
  margin-top: 6px;
  max-width: 100%;
}

label,
.rotulo {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 6px;
}

.required::after,
label.required::after {
  content: " *";
  color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="file"],
select,
textarea,
.form-control,
.form-select {
  width: 100%;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background-color: #ffffff;
  transition: border-color var(--transition), box-shadow var(--transition);
}

/*
 * Foco: contorno azul sutil, padrão discreto. Sem mudança de cor de fundo.
 */
input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly] {
  background-color: #f1f5f9;
  color: var(--text-muted);
  cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--verde);
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  max-width: 100%;
  min-width: 0;
  background: #fbfcfe;
}

legend {
  padding: 0 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy-800);
}

.hint,
.muted-help,
.obs,
small.form-text {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
}

/* Grades de formulário fluidas */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px 16px;
}

.form-grid label {
  margin-bottom: 0;
}

.form-row,
.filtro-linha {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  margin-bottom: 4px;
}

.form-group,
.filtro-campo,
.campo {
  flex: 1 1 220px;
  min-width: 0;
  margin-bottom: 12px;
}

.campo-inteiro,
.form-group.col-12,
.col-12 {
  flex: 1 1 100%;
}

/* Colunas fluidas (compatibilidade com views existentes) */
.form-group.col-2,
.col-2 { flex: 1 1 calc(16.66% - 16px); min-width: 140px; }
.form-group.col-3,
.col-3 { flex: 1 1 calc(25% - 16px); min-width: 160px; }
.form-group.col-4,
.col-4 { flex: 1 1 calc(33.33% - 16px); min-width: 180px; }
.form-group.col-6,
.col-6 { flex: 1 1 calc(50% - 16px); min-width: 200px; }
.form-group.col-8,
.col-8 { flex: 1 1 calc(66.66% - 16px); min-width: 220px; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
}

.row > * {
  min-width: 0;
}

.form-actions,
.form-acoes,
.filtros-botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

/* =============================================================================
   BOTÕES
   ========================================================================== */

button,
.btn,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  background-color: var(--primary);
  color: #ffffff;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background var(--transition), box-shadow var(--transition),
    transform 0.08s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary,
.btn-outline-secondary {
  background-color: #64748b;
}
.btn-secondary:hover,
.btn-outline-secondary:hover {
  background-color: #475569;
}

.btn-success {
  background-color: var(--success);
}
.btn-success:hover {
  background-color: var(--success-dark);
}

.btn-danger,
.btn-remover {
  background-color: var(--danger);
}
.btn-danger:hover,
.btn-remover:hover {
  background-color: var(--danger-dark);
}

.btn-warning {
  background-color: var(--warning);
  color: #ffffff;
}
.btn-warning:hover {
  background-color: var(--warning-dark);
}

.btn-info {
  background-color: var(--info);
}
.btn-info:hover {
  background-color: var(--info-dark);
}

.btn-editar {
  background-color: var(--navy-700);
}
.btn-editar:hover {
  background-color: var(--navy-800);
}

.btn-gold {
  background-color: var(--dourado);
  color: #ffffff;
}
.btn-gold:hover {
  background-color: #b8890f;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: auto;
}

/* Compatibilidade com botões siscae-* */
.siscae-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background-color: var(--primary);
  color: #ffffff;
  text-decoration: none;
  transition: background var(--transition);
}
.siscae-btn:hover { background-color: var(--primary-dark); }
.siscae-btn-secondary { background-color: #64748b; }
.siscae-btn-secondary:hover { background-color: #475569; }
.siscae-btn-danger { background-color: var(--danger); }
.siscae-btn-danger:hover { background-color: var(--danger-dark); }
.siscae-btn-xs { padding: 4px 10px; font-size: 0.78rem; }

/* =============================================================================
   BADGES
   ========================================================================== */

.badge,
.siscae-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.badge-success,
.siscae-badge-ok,
.status-ok {
  background-color: var(--verde-claro);
  color: var(--verde-escuro);
  border: 1px solid #a7e6bf;
}

.badge-danger {
  background-color: #fee2e2;
  color: var(--danger-dark);
  border: 1px solid #fca5a5;
}

.badge-warning,
.siscae-badge-alerta {
  background-color: var(--dourado-claro);
  color: var(--warning-dark);
  border: 1px solid #f3d488;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.badge-secondary,
.bg-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border);
}

.badge-gold {
  background-color: var(--dourado-claro);
  color: #92400e;
  border: 1px solid var(--dourado);
}

.badge-saldo {
  background-color: var(--verde-claro);
  color: var(--verde-escuro);
  border: 1px solid #a7e6bf;
  font-weight: 700;
}

/* =============================================================================
   ALERTAS / MENSAGENS FLASH
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-left-width: 4px;
  box-shadow: var(--shadow-sm);
  animation: alert-in 0.25s ease;
}

@keyframes alert-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert svg,
.alert i[data-lucide] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.alert-success {
  background: var(--verde-claro);
  color: #14532d;
  border-color: #a7e6bf;
  border-left-color: var(--verde);
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
  border-left-color: var(--danger);
}

.alert-warning {
  background: var(--dourado-claro);
  color: #92400e;
  border-color: #f3d488;
  border-left-color: var(--dourado);
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
  border-left-color: var(--primary);
}

/* Caixas de ajuda/informação usadas nas views */
.info-box,
.contrato-info-box,
.cargo-info-box,
.contrato-ajuda,
.cargo-ajuda,
.distrato-ajuda,
.lote-ajuda {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--dourado);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* =============================================================================
   LOGIN
   ========================================================================== */

.login-container {
  max-width: 400px;
  margin: 8vh auto 40px;
  width: 100%;
}

.login-container .card {
  border-top: 4px solid var(--verde);
  box-shadow: var(--shadow-lg);
}

/* =============================================================================
   UTILITÁRIOS
   ========================================================================== */

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--verde-escuro); }
.text-danger { color: var(--danger-dark); }
.text-gold { color: var(--dourado); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.num.negativo { color: var(--danger-dark); font-weight: 700; }
.num.positivo { color: var(--verde-escuro); font-weight: 700; }
.valor.estouro { color: var(--danger-dark); font-weight: 800; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

.d-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 12px;
}

.back-link:hover {
  color: var(--primary);
}

/* Ícone de olho legado (mantido por compatibilidade) */
.icon-eye {
  display: inline-block;
  width: 16px;
  height: 10px;
  border-radius: 50%/60%;
  border: 2px solid currentColor;
  position: relative;
  margin-right: 4px;
}

.icon-eye::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
}

/* Cabeçalho de documentos/relatórios impressos */
.cabecalho {
  text-align: center;
  margin-bottom: 10px;
}

.cabecalho img.logo-prefeitura {
  height: 90px;
  width: auto;
}

/* =============================================================================
   RESPONSIVIDADE
   ========================================================================== */

/* ---- Tablet (≤ 900px): menu vira painel vertical com hamburger ---- */
@media (max-width: 900px) {
  .navbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .navbar-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 10px 12px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .navbar-menu.open {
    display: flex;
    animation: menu-in 0.2s ease;
  }

  @keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .navbar-spacer {
    display: none;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    border-bottom: none;
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
  }

  .nav-link.active {
    border-left-color: var(--verde);
    border-bottom: none;
  }

  .nav-link .nav-caret {
    margin-left: auto;
  }

  /* Dropdowns viram acordeões dentro do menu */
  .dropdown-menu,
  .dropdown-menu .dropdown-menu {
    position: static;
    min-width: 0;
    width: auto;
    max-width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--navy-700);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.05);
    margin: 2px 0 6px 14px;
    padding: 2px 0 2px 4px;
  }

  .navbar-menu li.has-dropdown.open > .dropdown-menu {
    display: block;
  }

  .dropdown-link {
    color: #d5deeb;
    white-space: normal;
  }

  .dropdown-link:hover,
  .dropdown-link.active {
    background: var(--navy-700);
    color: #ffffff;
  }

  .dropdown-link .nav-icon,
  .dropdown-link svg {
    color: var(--dourado-vivo);
  }

  .dropdown-link .nav-caret {
    transform: rotate(45deg);
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .form-group.col-2,
  .form-group.col-3,
  .form-group.col-4,
  .col-2, .col-3, .col-4 {
    flex: 1 1 calc(50% - 16px);
  }
}

/* ---- Mobile (≤ 640px) ---- */
@media (max-width: 640px) {
  main {
    padding-inline: 10px;
    margin-top: 14px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .topbar-campanha-select {
    max-width: 220px;
    font-size: 0.68rem;
  }

  .topbar-user {
    flex: 1 1 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .card {
    padding: 14px;
  }

  .card-header {
    margin: -14px -14px 12px;
    padding: 12px 14px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .dash-card {
    padding: 14px;
  }

  .dash-number {
    font-size: 1.3rem;
  }

  .d-flex.justify-between {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group,
  .filtro-campo,
  .campo,
  .form-group.col-2,
  .form-group.col-3,
  .form-group.col-4,
  .form-group.col-6,
  .form-group.col-8,
  .col-2, .col-3, .col-4, .col-6, .col-8 {
    flex: 1 1 100%;
    min-width: 0;
  }

  .form-actions .btn,
  .form-acoes .btn,
  .filtros-botoes .btn,
  .form-actions button,
  .form-acoes button {
    flex: 1 1 auto;
  }

  .footer-bar {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

/* ---- Mobile pequeno (≤ 420px) ---- */
@media (max-width: 420px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  button,
  input[type="submit"] {
    width: 100%;
  }

  .table-actions {
    min-width: 0;
  }
}

/* =============================================================================
   IMPRESSÃO
   ========================================================================== */

@media print {
  .no-print,
  .navbar,
  .nav-toggle,
  .topbar-user,
  footer,
  .footer-bar {
    display: none !important;
  }

  body {
    background-color: #ffffff;
    overflow: visible;
  }

  .topbar {
    background: #ffffff;
    color: #000000;
    border-bottom: 1px solid #000000;
  }

  .topbar-title,
  .topbar-subtitle,
  .topbar-campanha {
    color: #000000;
  }

  .topbar-campanha-form {
    display: none;
  }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
  }

  main {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cabecalho {
    margin-bottom: 6px;
  }

  .cabecalho img.logo-prefeitura {
    height: 80px;
  }
}

/* =========================================================================
   MÓDULO LOGÍSTICA (agenda de compromissos, painel operacional, equipes)
   Visual compacto — alinhado ao padrão de Pagamentos/Contratos.
   ========================================================================= */

/* --- Badges --- */
.lg-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  color: #fff;
  background: var(--text-light);
  vertical-align: middle;
}
.lg-badge-gray   { background: #6b7280; }
.lg-badge-blue   { background: var(--primary); }
.lg-badge-green  { background: var(--success); }
.lg-badge-red    { background: var(--danger); }
.lg-badge-orange { background: #f97316; }
.lg-badge-yellow { background: var(--warning); color: #1a2332; }
.lg-badge-teal   { background: #0d9488; }
.lg-cand-0 { background: #f97316; }
.lg-cand-1 { background: #3b82f6; }
.lg-cand-2 { background: #ec4899; }
.lg-cand-3 { background: #8b5cf6; }
.lg-cand-4 { background: #0d9488; }
.lg-cand-5 { background: var(--dourado); color: #1a2332; }

/* --- Indicadores --- */
.lg-ind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.lg-ind i, .lg-ind svg { width: 14px; height: 14px; }
.lg-ind-ok     { background: #dcfce7; color: #15803d; }
.lg-ind-warn   { background: #fef9c3; color: #a16207; }
.lg-ind-orange { background: #ffedd5; color: #c2410c; }
.lg-ico-xs { width: 12px; height: 12px; vertical-align: -2px; }

/* --- Listagem --- */
.lg-titulo { font-weight: 600; text-decoration: none; font-size: 13px; }
.lg-sub { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.lg-acoes, .lg-acoes-det, .lg-card-acoes, .lgp-acoes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.lg-acoes .btn, .lg-card-acoes .btn, .lgp-acoes .btn, .lg-acoes-det .btn, .btn-mapa {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 0;
  line-height: 1.3;
}
.lg-acoes .btn i, .lg-card-acoes .btn i, .lgp-acoes .btn i, .lg-acoes-det .btn i, .btn-mapa i,
.lg-acoes .btn svg, .lg-card-acoes .btn svg, .lgp-acoes .btn svg, .lg-acoes-det .btn svg, .btn-mapa svg {
  width: 13px; height: 13px;
}
#tabelaAgenda td { font-size: 13px; padding: 6px 8px; vertical-align: middle; }
.lg-resumo { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-size: 12px; }
.lg-filtros .form-row { align-items: flex-end; }

/* --- Botão de mapa --- */
.btn-mapa {
  background: #0d9488;
  color: #fff;
  border: 1px solid #0f766e;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.btn-mapa:hover { background: #0f766e; color: #fff; }

/* --- Seções / fieldsets / detalhes --- */
.lg-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg-card);
}
.lg-fieldset legend {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 6px;
  display: flex; align-items: center; gap: 5px;
}
.lg-fieldset legend i, .lg-fieldset legend svg { width: 14px; height: 14px; }
.lg-fieldset .text-muted { font-size: 12px; }
.lg-sec {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg-card);
}
.lg-sec h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 5px; }
.lg-sec h3 i, .lg-sec h3 svg { width: 15px; height: 15px; }
.lg-dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.lg-dl dt { font-weight: 600; color: var(--text-muted); }
.lg-dl dd { margin: 0; }
.lg-dl dd.lg-pre { white-space: pre-wrap; }
.lg-membros { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; }
.lg-membros li { padding: 3px 0; border-bottom: 1px dashed var(--border-light); }

/* --- Checklist --- */
.lg-checklist, .lg-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 5px;
}
.lg-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
}
.lg-check:hover { border-color: var(--primary); }
.lg-check input { width: 15px; height: 15px; accent-color: var(--success); cursor: pointer; }
.lg-check:has(input:checked) { background: var(--verde-claro); border-color: var(--success); }
.lg-item { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12.5px; }
.lg-item.ok { background: #f0fdf4; border-color: #86efac; }
.lg-participantes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 5px; }
.lg-dono { font-size: 10.5px; color: var(--text-muted); margin-left: auto; }

/* --- Cards mobile da agenda --- */
.lg-row-mobile { display: none; }
.lg-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--bg-card); font-size: 12.5px; }
.lg-card-head { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.lg-card-data { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.lg-card-data i, .lg-card-data svg { width: 12px; height: 12px; }
.lg-card-titulo { font-weight: 700; font-size: 13px; text-decoration: none; display: block; margin-top: 1px; }
.lg-card-linha { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lg-card-acoes { margin-top: 8px; }

/* --- Painel operacional --- */
.lgp-sep { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--border); text-transform: capitalize; }
.lgp-sep i, .lgp-sep svg { width: 14px; height: 14px; }
.lgp-card { border: 1px solid var(--border); border-left: 4px solid var(--warning); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 8px; background: var(--bg-card); font-size: 12.5px; }
.lgp-card.lgp-conferido { border-left-color: var(--success); background: #f7fef9; }
.lgp-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lgp-hora { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.lgp-hora i, .lgp-hora svg { width: 12px; height: 12px; }
.lgp-titulo { font-size: 13.5px; font-weight: 700; text-decoration: none; display: block; margin-top: 1px; }
.lgp-info { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.lgp-info i, .lgp-info svg, .lgp-equipe i, .lgp-equipe svg, .lgp-check i, .lgp-check svg, .lgp-conf i, .lgp-conf svg, .lgp-sem-log i, .lgp-sem-log svg, .lgp-gps i, .lgp-gps svg { width: 12px; height: 12px; vertical-align: -2px; }
.lgp-equipe { margin-top: 6px; }
.lgp-equipe ul { margin: 2px 0 0 16px; padding: 0; }
.lgp-check { margin-top: 6px; }
.lgp-itens { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.lgp-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid #fca5a5; background: #fff1f2; color: #991b1b; font-weight: 600; cursor: pointer; font-size: 12px; }
.lgp-toggle i, .lgp-toggle svg { width: 14px; height: 14px; }
.lgp-toggle.ok { border-color: #86efac; background: #dcfce7; color: #166534; }
.lgp-toggle.static { cursor: default; }
.lgp-toggle:disabled { opacity: 0.6; cursor: wait; }
.lgp-obs { margin-top: 6px; padding: 5px 8px; background: var(--bg); border-radius: var(--radius-sm); }
.lgp-sem-log { margin-top: 6px; padding: 5px 8px; background: #fef9c3; border-radius: var(--radius-sm); color: #854d0e; }
.lgp-conf { margin-top: 6px; color: var(--text-muted); }
.lgp-conferido .lgp-conf { color: #166534; }
.lgp-acoes { margin-top: 8px; }
.lgp-acoes [data-mapa-slot]:empty { display: none; }
.lgp-total { color: var(--text-muted); margin: 4px 0; font-size: 12.5px; }
.lgp-gps { font-size: 12px; }

/* --- Formulário --- */
.lg-gps-feedback { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm); background: #dcfce7; color: #166534; font-weight: 600; font-size: 12.5px; }
.lg-gps-feedback.erro { background: #fee2e2; color: #991b1b; }
.lg-gps-feedback i, .lg-gps-feedback svg { width: 14px; height: 14px; }
.lg-template-aviso { display: none; margin-top: 6px; font-size: 12.5px; padding: 8px 10px; }
.lg-sticky { display: flex; gap: 6px; }

/* --- Responsivo --- */
@media (max-width: 768px) {
  .lg-row-desktop, #tabelaAgenda thead { display: none; }
  .lg-row-mobile { display: table-row; }
  .lg-row-mobile > td { padding: 4px 0 !important; border: 0 !important; }
  #tabelaAgenda { border-collapse: separate; }
  .lg-filtros .form-group, .lgp-filtros .form-group, .form-row .form-group { flex: 1 1 100%; }
  .lg-filtros .form-actions .btn, .lgp-filtros .btn { width: 100%; }
  .lg-dl { grid-template-columns: 1fr; gap: 1px 0; }
  .lg-dl dt { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em; }
  .lg-checklist, .lg-check-grid { grid-template-columns: 1fr 1fr; }
  .lg-card-acoes .btn, .lgp-acoes .btn, .lg-acoes-det .btn { flex: 1; justify-content: center; }
  .lg-card-acoes .btn, .lgp-acoes .btn, .lg-acoes-det .btn, .lgp-toggle, .lg-check, .btn-mapa { min-height: 36px; }
  .lgp-toggle { flex: 1 1 45%; justify-content: center; }
  .lg-sticky { position: sticky; bottom: 0; background: var(--bg-card); margin: 0 -12px; padding: 8px 12px; border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0,0,0,0.08); z-index: 5; }
  .lg-sticky .btn { min-height: 36px; flex: 1; justify-content: center; }
  .lg-fieldset { padding: 8px 10px; }
}
@media print {
  .page-actions, .lg-acoes-det, .navbar, .sidebar, footer { display: none !important; }
  .lg-sec { break-inside: avoid; }
}
