:root {
  --primary: #003366;
  --primary-light: #0a467b;
  --primary-dark: #002244;
  --accent: #d97706;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;

  /* Aliases do Padrão Oficial do Município de Bebedouro */
  --cor-primaria: #003366;
  --cor-secundaria: #002244;
  --cor-destaque: #d97706;
  --cor-fundo: #f8fafc;
  --cor-card: #ffffff;
  --cor-texto: #1e293b;
  --cor-texto-suave: #64748b;
  --cor-borda: #cbd5e1;
  --cor-borda-suave: #e2e8f0;
  --cor-sucesso: #15803d;
  --cor-perigo: #b91c1c;
  --cor-alerta: #b45309;
  --raio-borda: 6px;
  --sombra-suave: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* Top bar institucional */
.top-bar-prefeitura {
  background-color: var(--primary-dark);
  color: #e2e8f0;
  font-size: 13px;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-prefeitura a {
  color: #cbd5e1;
  text-decoration: none;
}

.top-bar-prefeitura a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Header principal - Padrão Oficial com Borda de Destaque */
.main-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 16px 24px;
  box-shadow: 0 4px 12px rgba(6, 50, 88, 0.15);
  border-bottom: 3px solid var(--accent);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: white;
}

.brand-logo {
  max-height: 58px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text p {
  font-size: 13px;
  opacity: 0.85;
}

.user-nav-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: right;
}

.user-badge .role-tag {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  margin-left: 6px;
}

.btn-logout {
  background: rgba(220, 38, 38, 0.9);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.btn-logout:hover {
  background: #b91c1c;
}

/* Botão Toggle de Modo Noturno */
.btn-theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Menu de navegacao */
.nav-tabs-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-tabs-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  padding: 0 24px;
  gap: 8px;
  overflow-x: auto;
}

.nav-tab-item {
  padding: 14px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab-item:hover {
  color: var(--primary);
  border-bottom-color: #94a3b8;
}

.nav-tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Container do conteudo */
.main-container {
  max-width: 1280px;
  margin: 28px auto;
  padding: 0 24px;
  width: 100%;
  flex: 1;
}

/* Cards */
.card-box {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Cards de Atalhos Rápidos da Página Inicial */
.card-atalho-item {
  display: flex !important;
  gap: 14px !important;
  align-items: center !important;
  padding: 16px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.card-atalho-item:hover {
  background: #f1f5f9 !important;
  border-color: var(--primary) !important;
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  text-decoration: none !important;
}

/* Desativação universal de movimentação de cards no hover */
.card,
.card-box,
.card-box:hover,
.card-atalho-item,
.card-atalho-item:hover,
.req-card,
.req-card:hover,
.req-dashboard-card,
.req-dashboard-card:hover,
.stamp-slot-card,
.stamp-slot-card:hover,
.stat-card,
.stat-card:hover,
[class*="card"]:hover {
  transform: none !important;
}

.card-atalho-item * {
  text-decoration: none !important;
}

.card-atalho-item .icon-action {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

/* Botoes */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  transition: 0.2s;
}

.btn-primary,
.btn-primario {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
.btn-primary:hover,
.btn-primario:hover {
  background: var(--primary-light) !important;
  color: #ffffff !important;
}

.btn-success,
.btn-sucesso {
  background: var(--success) !important;
  color: #ffffff !important;
}
.btn-success:hover,
.btn-sucesso:hover {
  background: #15803d !important;
}

.btn-danger,
.btn-perigo {
  background: var(--danger) !important;
  color: #ffffff !important;
}
.btn-danger:hover,
.btn-perigo:hover {
  background: #b91c1c !important;
}

.btn-secondary,
.btn-secundario,
.btn-gray {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.btn-secondary:hover,
.btn-secundario:hover,
.btn-gray:hover {
  background: #cbd5e1 !important;
  color: #1e293b !important;
}

.btn-destaque,
.btn-accent {
  background: var(--accent) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
.btn-destaque:hover,
.btn-accent:hover {
  background: #b45309 !important;
  color: #ffffff !important;
}

/* Formularios */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 50, 88, 0.15);
}

/* Tabelas */
.table-responsive {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.custom-table th {
  background: #f1f5f9;
  padding: 12px 14px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid var(--border);
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.badge-success, .badge-sucesso { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #bbf7d0 !important; }
.badge-danger, .badge-perigo, .badge-erro { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fecaca !important; }
.badge-warning, .badge-aviso, .badge-alerta { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.badge-info { background: #e0f2fe !important; color: #0369a1 !important; border: 1px solid #bae6fd !important; }
.badge-departamento {
  display: inline-block;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}

/* Paginacao */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.page-link {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: white;
}

.page-link:hover {
  background: #f1f5f9;
}

.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Modais */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 560px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
  overflow: visible;
  animation: modalIn 0.2s ease-out;
  position: relative;
  margin: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.modal-body {
  padding: 24px;
  position: relative;
}

.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Carimbo Preview Box */
.stamp-preview-box {
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 500px;
}

.stamp-preview-logo {
  max-width: 90px;
  max-height: 90px;
  object-fit: contain;
}

.stamp-preview-content {
  border-left: 2px solid #cbd5e1;
  padding-left: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: #334155;
}

.stamp-preview-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-size: 11px;
}

/* Rodape */
.main-footer {
  background: var(--primary-dark);
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  margin-top: auto;
  border-top: 3px solid var(--accent);
}

/* Combobox (Dropdown + Autocomplete) */
.combobox-wrapper {
  position: relative;
  width: 100%;
}

.combobox-input {
  padding-right: 32px !important;
  cursor: text;
}

.combobox-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted, #64748b);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.combobox-wrapper.open .combobox-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.08);
  z-index: 1060;
  display: none;
}

.combobox-dropdown.dropup {
  top: auto;
  bottom: calc(100% + 4px);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.18), 0 -4px 10px rgba(0, 0, 0, 0.08);
}

.combobox-item {
  padding: 9px 14px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background-color 0.15s ease;
}

.combobox-item:last-child {
  border-bottom: none;
}

.combobox-item:hover,
.combobox-item.active {
  background-color: #f1f5f9;
  color: var(--primary, #063258);
  font-weight: 600;
}

.combobox-item .item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox-item .item-sub {
  font-size: 11px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.combobox-empty {
  padding: 12px;
  font-size: 13px;
  color: #dc2626;
  text-align: center;
  background: #fef2f2;
}

/* ==========================================================================
   CONTROLE MODULAR DE EXIBIÇÃO DE ÍCONES (MENU, ATALHOS, GERAL)
   ========================================================================== */
.no-menu-icons .icon-menu {
  display: none !important;
}

.no-action-icons .icon-action,
.no-action-icons .req-card-icon {
  display: none !important;
}

.no-general-icons .icon-general {
  display: none !important;
}

/* ==========================================================================
   SUPORTE COMPLETO AO MODO ESCURO (DARK MODE) - PADRÃO OFICIAL BEBEDOURO
   ========================================================================== */

/* Redefinição Global de Variáveis no Modo Escuro */
body.dark-mode, html.dark-mode {
  --primary: #38bdf8 !important;
  --primary-light: #60a5fa !important;
  --primary-dark: #070c18 !important;
  --accent: #f59e0b !important;
  --bg: #0b1120 !important;
  --surface: #1e293b !important;
  --text: #f8fafc !important;
  --text-muted: #94a3b8 !important;
  --border: #334155 !important;

  --cor-primaria: #38bdf8 !important;
  --cor-secundaria: #93c5fd !important;
  --cor-destaque: #f59e0b !important;
  --cor-fundo: #0b1120 !important;
  --cor-card: #1e293b !important;
  --cor-texto: #f8fafc !important;
  --cor-texto-suave: #94a3b8 !important;
  --cor-borda: #334155 !important;
  --cor-borda-suave: #1e293b !important;

  background-color: #0b1120 !important;
  color: #f8fafc !important;
}

/* Top bar institucional no Dark Mode */
body.dark-mode .top-bar-prefeitura,
html.dark-mode .top-bar-prefeitura {
  background-color: #070c18 !important;
  border-bottom-color: #1e293b !important;
  color: #94a3b8 !important;
}

body.dark-mode .top-bar-prefeitura a,
html.dark-mode .top-bar-prefeitura a {
  color: #cbd5e1 !important;
}

body.dark-mode .top-bar-prefeitura a:hover,
html.dark-mode .top-bar-prefeitura a:hover {
  color: #38bdf8 !important;
}

/* Header principal no Dark Mode */
body.dark-mode .main-header,
html.dark-mode .main-header {
  background: #0f172a !important;
  border-bottom-color: #f59e0b !important;
}

body.dark-mode .btn-theme-toggle,
html.dark-mode .btn-theme-toggle {
  background: #334155 !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.dark-mode .btn-theme-toggle:hover,
html.dark-mode .btn-theme-toggle:hover {
  background: #475569 !important;
}

body.dark-mode .user-badge {
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: #334155 !important;
}

/* Abas de Navegação */
body.dark-mode .nav-tabs-bar {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

body.dark-mode .nav-tab-item {
  color: #94a3b8 !important;
}

body.dark-mode .nav-tab-item:hover {
  color: #38bdf8 !important;
  border-bottom-color: #38bdf8 !important;
}

body.dark-mode .nav-tab-item.active {
  color: #38bdf8 !important;
  border-bottom-color: #38bdf8 !important;
}

/* Cards e Caixas */
body.dark-mode .card-box,
body.dark-mode .card,
html.dark-mode .card-box,
html.dark-mode .card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .card-title,
body.dark-mode .card-box h2,
body.dark-mode .card-box h3,
body.dark-mode .card-box h4 {
  color: #38bdf8 !important;
}

body.dark-mode .card-box p {
  color: #94a3b8 !important;
}

/* Cards do Requerimento Dashboard */
body.dark-mode .req-dashboard-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .req-dashboard-card:hover {
  background: #273549 !important;
  border-color: #475569 !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
}

body.dark-mode .req-dashboard-card h3 {
  color: #38bdf8 !important;
}

body.dark-mode .req-dashboard-card p {
  color: #94a3b8 !important;
}

/* Modais */
body.dark-mode .modal-content {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.7) !important;
}

body.dark-mode .modal-header {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

body.dark-mode .modal-header h3 {
  color: #38bdf8 !important;
}

body.dark-mode .modal-footer {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}

/* Formulários, Inputs, Selects e Textareas */
body.dark-mode .form-control,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="datetime-local"],
body.dark-mode select,
body.dark-mode textarea {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-mode .form-control:focus,
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

body.dark-mode .form-label {
  color: #cbd5e1 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748b !important;
}

body.dark-mode input[readonly],
body.dark-mode textarea[readonly],
body.dark-mode select:disabled,
body.dark-mode input:disabled {
  background-color: #131d2e !important;
  color: #94a3b8 !important;
  border-color: #273549 !important;
  cursor: not-allowed !important;
}

/* Tabelas */
body.dark-mode .custom-table,
body.dark-mode .table,
body.dark-mode table {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .custom-table th,
body.dark-mode .table th,
body.dark-mode table th {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-bottom: 2px solid #334155 !important;
}

body.dark-mode .custom-table td,
body.dark-mode .table td,
body.dark-mode table td {
  background-color: #1e293b !important;
  border-bottom: 1px solid #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .custom-table tr:hover td,
body.dark-mode .table tr:hover td,
body.dark-mode table tr:hover td {
  background-color: #273549 !important;
}

/* Mini Calendário e Popups */
body.dark-mode #miniCalendarioPopup {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .cal-header {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .cal-nav-btn {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

body.dark-mode .cal-nav-btn:hover {
  background: #475569 !important;
}

body.dark-mode .cal-weekday {
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}

body.dark-mode .cal-day {
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-mode .cal-day:hover {
  background: #273549 !important;
  color: #38bdf8 !important;
}

body.dark-mode .cal-day-other {
  color: #475569 !important;
  background: transparent !important;
}

body.dark-mode .cal-day-today {
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

body.dark-mode .cal-day-selected {
  background: #0284c7 !important;
  color: #ffffff !important;
}

/* Visualizador / Preview Canvas */
body.dark-mode .preview-container {
  background: #0b1120 !important;
  border-color: #334155 !important;
}

/* Cards de Atalhos em Modo Escuro */
body.dark-mode .card-atalho-item {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .card-atalho-item:hover {
  background: #273549 !important;
  border-color: #38bdf8 !important;
}

/* Botões em Modo Escuro */
body.dark-mode .btn-secondary,
body.dark-mode .btn-secundario,
body.dark-mode .btn-gray {
  background-color: #334155 !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.dark-mode .btn-secondary:hover,
body.dark-mode .btn-secundario:hover,
body.dark-mode .btn-gray:hover {
  background-color: #475569 !important;
  color: #ffffff !important;
}

body.dark-mode .btn-primary,
body.dark-mode .btn-primario {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-primario:hover {
  background-color: #0369a1 !important;
}

body.dark-mode .btn-destaque,
body.dark-mode .btn-accent {
  background-color: #d97706 !important;
  color: #ffffff !important;
}
body.dark-mode .btn-destaque:hover,
body.dark-mode .btn-accent:hover {
  background-color: #b45309 !important;
}

/* Badges e Alertas em Modo Escuro */
body.dark-mode .badge-success,
body.dark-mode .badge-sucesso {
  background: #064e26 !important;
  color: #86efac !important;
  border: 1px solid #166534 !important;
}

body.dark-mode .badge-danger,
body.dark-mode .badge-perigo,
body.dark-mode .badge-erro {
  background: #450a0a !important;
  color: #fecaca !important;
  border: 1px solid #991b1b !important;
}

body.dark-mode .badge-warning,
body.dark-mode .badge-aviso,
body.dark-mode .badge-alerta {
  background: #451a03 !important;
  color: #fde68a !important;
  border: 1px solid #b45309 !important;
}

body.dark-mode .badge-info {
  background: #082f49 !important;
  color: #7dd3fc !important;
  border: 1px solid #0369a1 !important;
}

body.dark-mode .badge-departamento {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
}

/* Carimbo Preview Box */
body.dark-mode .stamp-preview-box {
  background: #1e293b !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

body.dark-mode .stamp-preview-content {
  border-left-color: #475569 !important;
  color: #cbd5e1 !important;
}

body.dark-mode .stamp-preview-title {
  color: #38bdf8 !important;
}

/* Combobox */
body.dark-mode .combobox-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .combobox-item {
  color: #f8fafc !important;
  border-bottom-color: #273549 !important;
}

body.dark-mode .combobox-item:hover,
body.dark-mode .combobox-item.active {
  background-color: #273549 !important;
  color: #38bdf8 !important;
}

body.dark-mode .combobox-item .item-sub {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

body.dark-mode .combobox-empty {
  background: #450a0a !important;
  color: #fecaca !important;
}

/* Rodapé */
body.dark-mode .main-footer {
  background-color: #070c18 !important;
  border-top-color: #f59e0b !important;
  color: #94a3b8 !important;
}

/* Paginação */
body.dark-mode .page-link {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-mode .page-link:hover {
  background: #273549 !important;
  color: #38bdf8 !important;
}

body.dark-mode .page-link.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   SOBREPOSIÇÃO UNIVERSAL DE ESTILOS INLINE EM MODO ESCURO
   Neutraliza containers, divs e blocos claros fixados via style="..."
   ========================================================================== */

/* Fundos Brancos e Neutros Claros */
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode [style*="background-color:#ffffff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"] {
  background: #1e293b !important;
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Fundos Cinza-Claros e Suaves (f8fafc / f1f5f9) */
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background-color: #f8fafc"],
body.dark-mode [style*="background-color:#f8fafc"],
body.dark-mode [style*="background-color: #f1f5f9"],
body.dark-mode [style*="background-color:#f1f5f9"] {
  background: #131d2e !important;
  background-color: #131d2e !important;
  color: #f8fafc !important;
}

/* Fundos Azuis Claros (eff6ff / e0f2fe / e2e8f0) */
body.dark-mode [style*="background: #eff6ff"],
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #e0f2fe"],
body.dark-mode [style*="background:#e0f2fe"] {
  background: #0f2744 !important;
  background-color: #0f2744 !important;
  color: #bae6fd !important;
  border-color: #0284c7 !important;
}

body.dark-mode [style*="background: #e2e8f0"],
body.dark-mode [style*="background:#e2e8f0"],
body.dark-mode [style*="background: #f1f5f9; color: #334155"] {
  background: #334155 !important;
  background-color: #334155 !important;
  color: #f8fafc !important;
}

/* Fundos Verdes Claros (f0fdf4 / dcfce7) */
body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"] {
  background: #064e26 !important;
  background-color: #064e26 !important;
  color: #bbf7d0 !important;
  border-color: #166534 !important;
}

/* Fundos Amarelos / Âmbar Claros (fffbeb / fef3c7) */
body.dark-mode [style*="background: #fffbeb"],
body.dark-mode [style*="background:#fffbeb"],
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background:#fef3c7"] {
  background: #451a03 !important;
  background-color: #451a03 !important;
  color: #fde68a !important;
  border-color: #b45309 !important;
}

/* Fundos Vermelhos Claros (fee2e2 / fef2f2 / fffcfc) */
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background: #fffcfc"],
body.dark-mode [style*="background:#fffcfc"] {
  background: #450a0a !important;
  background-color: #450a0a !important;
  color: #fecaca !important;
  border-color: #991b1b !important;
}

/* Sobrescrita Universal de Bordas Claras Inline */
body.dark-mode [style*="border: 1px solid var(--cor-borda-suave)"],
body.dark-mode [style*="border: 1px solid #e2e8f0"],
body.dark-mode [style*="border: 1px solid #cbd5e1"],
body.dark-mode [style*="border: 1px solid #bbf7d0"],
body.dark-mode [style*="border: 1px solid #fde68a"],
body.dark-mode [style*="border: 1px solid #fecaca"],
body.dark-mode [style*="border: 1px dashed var(--cor-borda)"],
body.dark-mode [style*="border-bottom: 1px solid var(--cor-borda-suave)"],
body.dark-mode [style*="border-bottom: 2px solid var(--cor-borda-suave)"],
body.dark-mode [style*="border-top: 1px solid var(--cor-borda-suave)"],
body.dark-mode [style*="border-bottom: 1px solid #f1f5f9"],
body.dark-mode [style*="border-bottom: 1px solid #e2e8f0"] {
  border-color: #334155 !important;
}

/* Sobrescrita de Cores de Textos Escuros Inline */
body.dark-mode [style*="color: var(--cor-secundaria)"],
body.dark-mode [style*="color: #002244"],
body.dark-mode [style*="color: #003366"],
body.dark-mode [style*="color: #063258"],
body.dark-mode [style*="color: var(--primary)"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color: #475569"],
body.dark-mode [style*="color: black"],
body.dark-mode [style*="color: #000"] {
  color: #f8fafc !important;
}

body.dark-mode [style*="color: var(--cor-texto)"],
body.dark-mode [style*="color: var(--text)"] {
  color: #f8fafc !important;
}

body.dark-mode [style*="color: var(--cor-texto-suave)"],
body.dark-mode [style*="color: var(--text-muted)"],
body.dark-mode [style*="color: #64748b"] {
  color: #94a3b8 !important;
}

body.dark-mode [style*="color: #0369a1"],
body.dark-mode [style*="color: #1e3a8a"] {
  color: #7dd3fc !important;
}

body.dark-mode [style*="color: #166534"],
body.dark-mode [style*="color: #15803d"] {
  color: #86efac !important;
}

body.dark-mode [style*="color: #92400e"],
body.dark-mode [style*="color: #b45309"] {
  color: #fde68a !important;
}

body.dark-mode [style*="color: #991b1b"],
body.dark-mode [style*="color: #b91c1c"],
body.dark-mode [style*="color: #dc2626"] {
  color: #fca5a5 !important;
}
