/* ============================================================
 * Acessibilidade — adicionado em 2026-05-31 (Fase 3 A11y)
 * ============================================================ */

/* Foco visivel global (para elementos sem focus-visible especifico) */
:focus-visible {
  outline: 2px solid var(--primary, #394820);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link para teclado (oculto ate receber foco) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary, #394820);
  color: #fff;
  padding: 12px 18px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* Respeita preferencia do usuario por menos animacao */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visualmente oculto mas legivel por 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;
}

/* ============================================================
 * Layout intranet aplicado ao view-rh (Fase A redesign 2026-05-31)
 * As regras originais ficam escopadas em #view-intranet e
 * #view-ubs-intranet; replicamos aqui para o painel RH usar a mesma
 * grid sidebar + main.
 * ============================================================ */
#view-rh .intranet-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  position: relative;
}

#view-rh .intranet-sidebar {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e0e7d4);
  border-radius: var(--radius, 10px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  overflow: hidden;
  position: sticky;
  top: 12px;
}

#view-rh .intranet-main {
  min-width: 0;
}

/* Responsivo: em mobile, sidebar empilha em cima */
@media (max-width: 920px) {
  #view-rh .intranet-grid {
    grid-template-columns: 1fr;
  }
  #view-rh .intranet-sidebar {
    position: static;
  }
}

/* ============================================================
 * Refinamento Painel RH — Versão A (Polish)
 * Sombras 2 camadas, transições 200ms, focus rings consistentes,
 * sidebar com dots indicadores, hierarchy tipográfica trabalhada.
 * Sobrescreve o bloco anterior de Refinamento visual.
 * ============================================================ */

/* ---- Header refinado ---- */
#view-rh .intranet-header {
  background: linear-gradient(135deg, #323e1d 0%, #394820 55%, #4a5a2e 100%);
  position: relative;
  padding: 22px 26px;
  border-radius: 14px;
  margin-bottom: 22px;
  box-shadow:
    0 1px 2px rgba(40,49,23,0.10),
    0 8px 24px -8px rgba(40,49,23,0.25);
  overflow: hidden;
}
#view-rh .intranet-header::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 35%;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}
#view-rh .intranet-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
#view-rh .intranet-header-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset;
}
#view-rh .intranet-header-title {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}
#view-rh .intranet-header-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.78);
  margin-top: 3px;
  letter-spacing: 0.01em;
}
#view-rh .intranet-header-actions {
  position: relative;
  z-index: 1;
}
#view-rh .intranet-header .btn {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.18s ease, transform 0.18s ease;
}
#view-rh .intranet-header .btn:hover {
  background: rgba(255,255,255,0.24);
  transform: translateY(-1px);
}
#view-rh .intranet-header .btn-danger {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(220, 38, 38, 0.20);
}
#view-rh .intranet-header .btn-danger:hover {
  background: rgba(220, 38, 38, 1);
}

/* ---- Sidebar refinada com indicador de seção ---- */
#view-rh .intranet-sidebar {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 16px -10px rgba(15, 23, 42, 0.10);
  padding: 6px 0;
  overflow: visible;
}
#view-rh .intranet-sidebar-section {
  padding: 14px 16px 8px;
}
#view-rh .intranet-sidebar-section + .intranet-sidebar-section {
  border-top: 1px solid #ecf0e5;
  margin-top: 2px;
  padding-top: 16px;
}
#view-rh .intranet-sidebar-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #8d9977;
  margin-bottom: 8px;
  padding-left: 4px;
}

/* Menu items: dot indicator antes do ícone */
#view-rh .intranet-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 14px 9px 28px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  font-size: 0.89rem;
  font-weight: 500;
  color: #4d5243;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, padding 0.18s ease;
  margin-bottom: 2px;
}
#view-rh .intranet-menu-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c5d1b0;
  transition: background 0.18s ease, transform 0.18s ease;
}
#view-rh .intranet-menu-item:hover:not(:disabled) {
  background: #f6f7f3;
  color: #394820;
}
#view-rh .intranet-menu-item:hover:not(:disabled)::before {
  background: #394820;
}
#view-rh .intranet-menu-item.is-active {
  background: linear-gradient(90deg, rgba(56,70,34,0.10), rgba(56,70,34,0.04));
  color: #323e1d;
  font-weight: 600;
}
#view-rh .intranet-menu-item.is-active::before {
  background: #394820;
  transform: translateY(-50%) scale(1.4);
  box-shadow: 0 0 0 3px rgba(56,70,34,0.15);
}
#view-rh .intranet-menu-item:disabled {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}
#view-rh .intranet-menu-item > i,
#view-rh .intranet-menu-item > svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}
#view-rh .intranet-menu-item > span:not(.intranet-badge-soon):first-of-type {
  flex: 1;
}

#view-rh .intranet-badge-soon {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #fde68a;
}
#view-rh .intranet-menu-item.is-active .intranet-badge-soon {
  background: rgba(255,255,255,0.7);
}

/* ---- Cards principais ---- */
#view-rh .card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.03),
    0 4px 14px -8px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
#view-rh .card:hover {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 8px 24px -10px rgba(15, 23, 42, 0.12);
}
#view-rh .card h4 {
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.014em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 9px;
}
#view-rh .card h4 i,
#view-rh .card h4 svg {
  color: #394820;
}
#view-rh .card .small {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #5b6250;
}

/* ---- Stat cards (KPIs) refinados ---- */
.rh-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.rh-stat-card {
  --accent: #394820;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rh-stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}
.rh-stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 10px 22px -10px rgba(15, 23, 42, 0.18);
}
.rh-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5b6250;
}
.rh-stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #1f2937;
  font-feature-settings: 'tnum';
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ---- Item cards (cada solicitação) refinados ---- */
.rh-item-card {
  --accent: #8d9977;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.rh-item-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}
.rh-item-card:hover {
  transform: translateY(-1px);
  border-color: #d1d5db;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 22px -10px rgba(15, 23, 42, 0.14);
}
.rh-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.rh-item-head strong {
  font-size: 1.02rem;
  color: #1f2937;
  letter-spacing: -0.01em;
}

/* ---- Tabelas ---- */
#view-rh table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
#view-rh table thead {
  background: #f9fafb;
}
#view-rh table thead th {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 11px 12px;
}
#view-rh table tbody tr {
  transition: background 0.14s ease;
}
#view-rh table tbody tr:hover {
  background: #f6f7f3;
}
#view-rh table tbody td {
  padding: 12px;
  border-top: 1px solid #ecf0e5;
}

/* ---- Botões refinados ---- */
#view-rh .btn-sm {
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
#view-rh .btn-sm:hover {
  transform: translateY(-1px);
}
#view-rh .btn-sm:focus-visible {
  outline: 2px solid #394820;
  outline-offset: 2px;
}

/* ---- Inputs/selects refinados ---- */
#view-rh input[type="text"],
#view-rh input[type="month"],
#view-rh input[type="date"],
#view-rh input[type="file"],
#view-rh select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  background: #fff;
  color: #1f2937;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
#view-rh input:focus,
#view-rh select:focus {
  outline: none;
  border-color: #394820;
  box-shadow: 0 0 0 3px rgba(56,70,34,0.10);
}

/* ---- Card de importação em destaque sutil ---- */
#view-rh .intranet-main > .card:first-child {
  background: linear-gradient(180deg, #fafdf5 0%, #ffffff 100%);
  border-color: #ede9fe;
}

/* ---- Animação de fade-in dos painéis ---- */
#view-rh .card:not(.hidden) {
  animation: rhFadeIn 0.28s ease;
}
@keyframes rhFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* prefers-reduced-motion ja desabilita animacoes globalmente */

/* ============================================================
 * Chart cards para o dashboard rico do RH (Fase C2)
 * ============================================================ */
#view-rh .rh-chart-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.03),
    0 4px 12px -8px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.22s ease;
}
#view-rh .rh-chart-card:hover {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 18px -10px rgba(15, 23, 42, 0.10);
}
#view-rh .rh-chart-card h5 {
  font-size: 0.94rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px;
  letter-spacing: -0.012em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
#view-rh .rh-chart-card h5 .small {
  font-weight: 500;
  color: #8d9977;
  font-size: 0.78rem;
  letter-spacing: 0;
}

/* Tabs do contracheque */
#view-rh .rh-cc-tab.is-active {
  color: var(--primary, #394820) !important;
  border-bottom-color: var(--primary, #394820) !important;
}
#view-rh .rh-cc-tab:hover:not(.is-active) {
  color: #4d5243 !important;
}

/* ============================================================
 * Layout intranet aplicado ao view-servidor (Fase S-A 2026-05-31)
 * ============================================================ */
#view-servidor .intranet-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  position: relative;
}
#view-servidor .intranet-sidebar {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -10px rgba(15, 23, 42, 0.10);
  padding: 6px 0;
}
#view-servidor .intranet-main { min-width: 0; }

#view-servidor .intranet-header {
  background: linear-gradient(135deg, #323e1d 0%, #394820 55%, #4a5a2e 100%);
  position: relative; padding: 22px 26px; border-radius: 14px; margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(40,49,23,0.10), 0 8px 24px -8px rgba(40,49,23,0.25);
  overflow: hidden;
}
#view-servidor .intranet-header-logo {
  width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.20); display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
#view-servidor .intranet-header-title { font-size: 1.22rem; font-weight: 700; color: #fff; }
#view-servidor .intranet-header-sub { font-size: 0.82rem; color: rgba(255,255,255,0.78); margin-top: 3px; }
#view-servidor .intranet-header .btn {
  background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
}
#view-servidor .intranet-header .btn:hover { background: rgba(255,255,255,0.24); }
#view-servidor .intranet-header .btn-danger { background: rgba(220,38,38,0.85); border-color: rgba(220,38,38,0.20); }

#view-servidor .intranet-sidebar-section { padding: 14px 16px 8px; }
#view-servidor .intranet-sidebar-section + .intranet-sidebar-section {
  border-top: 1px solid #ecf0e5; margin-top: 2px; padding-top: 16px;
}
#view-servidor .intranet-sidebar-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase;
  color: #8d9977; margin-bottom: 8px; padding-left: 4px;
}

#view-servidor .intranet-menu-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 14px 9px 28px; border: 0; background: transparent; border-radius: 9px;
  font-size: 0.89rem; font-weight: 500; color: #4d5243; text-align: left; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease; margin-bottom: 2px;
}
#view-servidor .intranet-menu-item::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #c5d1b0; transition: background 0.18s, transform 0.18s;
}
#view-servidor .intranet-menu-item:hover:not(:disabled) { background: #f6f7f3; color: #394820; }
#view-servidor .intranet-menu-item:hover:not(:disabled)::before { background: #394820; }
#view-servidor .intranet-menu-item.is-active {
  background: linear-gradient(90deg, rgba(56,70,34,0.10), rgba(56,70,34,0.04));
  color: #323e1d; font-weight: 600;
}
#view-servidor .intranet-menu-item.is-active::before {
  background: #394820; transform: translateY(-50%) scale(1.4);
  box-shadow: 0 0 0 3px rgba(56,70,34,0.15);
}
#view-servidor .intranet-menu-item > i, #view-servidor .intranet-menu-item > svg {
  width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85;
}

#view-servidor .card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03), 0 4px 14px -8px rgba(15,23,42,0.06);
  transition: box-shadow 0.22s ease;
}
#view-servidor .card:hover { box-shadow: 0 1px 2px rgba(15,23,42,0.05), 0 8px 24px -10px rgba(15,23,42,0.12); }
#view-servidor .card h4 { color: #1f2937; font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }

/* Responsivo */
@media (max-width: 920px) {
  #view-servidor .intranet-grid { grid-template-columns: 1fr; }
  #view-servidor .intranet-sidebar { position: static; }
}

/* ============================================================
 * Widget de notificações (sino fixo no canto)
 * ============================================================ */
.app-notif-widget {
  position: fixed;
  bottom: 100px;
  right: 22px;
  z-index: 9990;
}
.app-notif-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #394820 0%, #4a5a2e 100%);
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px rgba(56,70,34,0.45),
              0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.app-notif-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -2px rgba(56,70,34,0.55),
              0 3px 6px rgba(0, 0, 0, 0.10);
}
.app-notif-toggle:focus-visible {
  outline: 3px solid rgba(56,70,34,0.45);
  outline-offset: 3px;
}
.app-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.app-notif-panel {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 30px);
  max-height: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px -10px rgba(15, 23, 42, 0.35),
              0 4px 12px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: appNotifIn 180ms ease;
}
@keyframes appNotifIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #ecf0e5;
  background: linear-gradient(180deg, #fafafa, #fff);
}
.app-notif-head strong {
  font-size: 0.92rem;
  color: #1f2937;
  letter-spacing: -0.01em;
}
.app-notif-head-actions {
  display: flex;
  gap: 4px;
}
.app-notif-link-btn {
  background: transparent;
  border: 0;
  color: #394820;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.app-notif-link-btn:hover {
  background: #f6f7f3;
}
.app-notif-link-btn-danger {
  color: #b91c1c;
}
.app-notif-link-btn-danger:hover {
  background: #fdeef0;
}

.app-notif-list {
  overflow-y: auto;
  max-height: 420px;
  padding: 6px;
}
.app-notif-empty {
  padding: 30px 16px;
  text-align: center;
  color: #8d9977;
  font-size: 0.86rem;
}
.app-notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease;
  margin-bottom: 2px;
}
.app-notif-item:hover {
  background: #f6f7f3;
}
.app-notif-item.is-unread {
  background: linear-gradient(90deg, rgba(56,70,34,0.04), transparent);
  position: relative;
}
.app-notif-item.is-unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #394820;
  transform: translateY(-50%);
}
.app-notif-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #f6f7f3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #394820;
}
.app-notif-icon i, .app-notif-icon svg {
  width: 16px;
  height: 16px;
}
.app-notif-body {
  flex: 1;
  min-width: 0;
}
.app-notif-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
}
.app-notif-msg {
  font-size: 0.78rem;
  color: #5b6250;
  margin-top: 2px;
  line-height: 1.4;
}
.app-notif-time {
  font-size: 0.7rem;
  color: #8d9977;
  margin-top: 4px;
  font-weight: 500;
}

@media (max-width: 640px) {
  .app-notif-widget { bottom: 14px; right: 14px; }
  .app-notif-panel { width: 320px; }
}

/* Esconde widget antigo task-notification — unificado em app-notif-widget */
.task-notification-widget { display: none !important; }

/* ============================================================
 * Modal de confirmação in-app + animação toast (2026-05-31)
 * ============================================================ */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: appModalFade 160ms ease;
}
.app-modal-backdrop.hidden { display: none; }
@keyframes appModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.app-modal-box {
  background: #fff;
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  padding: 22px 24px 20px;
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.3);
  animation: appModalPop 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes appModalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.app-modal-title {
  margin: 0 0 8px;
  font-size: 1.06rem;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.01em;
}
.app-modal-message {
  margin: 0 0 20px;
  font-size: 0.92rem;
  color: #4d5243;
  line-height: 1.5;
}
.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@keyframes appToastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
 * Polish visual da Recepção (2026-05-31)
 * Aplica padrão intranet apenas ao header + refina cards
 * ============================================================ */
#view-reception .intranet-header {
  background: linear-gradient(135deg, #323e1d 0%, #394820 55%, #4a5a2e 100%);
  position: relative;
  padding: 20px 26px;
  border-radius: 14px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(40,49,23,0.10), 0 8px 24px -8px rgba(40,49,23,0.25);
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
#view-reception .intranet-header::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 35%;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}
#view-reception .intranet-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
#view-reception .intranet-header-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
#view-reception .intranet-header-title {
  font-size: 1.22rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
#view-reception .intranet-header-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.78);
  margin-top: 3px;
}
#view-reception .intranet-header-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
#view-reception .intranet-header .btn {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  font-weight: 500;
}
#view-reception .intranet-header .btn:hover { background: rgba(255,255,255,0.24); transform: translateY(-1px); }
#view-reception .intranet-header .btn-danger {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(220, 38, 38, 0.20);
}
#view-reception .intranet-header .btn-danger:hover { background: rgba(220, 38, 38, 1); }

/* Cards principais */
#view-reception .card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 14px -8px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s ease;
}
#view-reception .card:hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -10px rgba(15, 23, 42, 0.12);
}
#view-reception .rec-search-card,
#view-reception .rec-summary-card { padding: 18px; }
#view-reception .rec-search-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Inputs e botões da recepção */
#view-reception input[type="text"],
#view-reception input[type="date"],
#view-reception input[type="tel"],
#view-reception input[type="email"],
#view-reception .rec-field,
#view-reception select,
#view-reception textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#view-reception input:focus,
#view-reception select:focus,
#view-reception textarea:focus {
  outline: none;
  border-color: #394820;
  box-shadow: 0 0 0 3px rgba(56,70,34,0.08);
}

/* Tabs da ficha (underline roxo padrão) */
#view-reception .rec-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 16px;
}
#view-reception .rec-tab {
  background: transparent;
  border: 0;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #5b6250;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
#view-reception .rec-tab:hover:not(.active) {
  color: #4d5243;
}
#view-reception .rec-tab.active {
  color: var(--primary, #394820);
  border-bottom-color: var(--primary, #394820);
}

/* Botão de ação rápida na sidebar — destaque sutil */
#view-reception .rec-sidebar .btn {
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#view-reception .rec-sidebar .btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* Estado vazio */
#view-reception #rec-empty-state {
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  border: 1px dashed #c5d1b0;
}

/* Mobile responsivo */
@media (max-width: 920px) {
  #view-reception .rec-layout { grid-template-columns: 1fr !important; }
}

/* ============================================================
 * Botões dentro de cards — polish (2026-05-31)
 * Escopo: qualquer .btn dentro de .card aplica refinamento.
 * Sem afetar btn em headers, modais, sidebars.
 * ============================================================ */
.card .btn,
.rh-item-card .btn,
.rh-chart-card .btn,
.rh-stat-card .btn {
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.86rem;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease,
              box-shadow 0.18s ease, border-color 0.18s ease;
}
.card .btn:hover:not(:disabled),
.rh-item-card .btn:hover:not(:disabled),
.rh-chart-card .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18),
              0 1px 2px rgba(15, 23, 42, 0.06);
}
.card .btn:active:not(:disabled),
.rh-item-card .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.card .btn:focus-visible {
  outline: 2px solid var(--primary, #394820);
  outline-offset: 2px;
}

/* Botão primário (CTA) dentro de cards: gradient sutil + brilho */
.card .btn-primary,
.rh-item-card .btn-primary {
  background: linear-gradient(180deg, #45532e 0%, #394820 100%);
  border-color: var(--primary-dark, #323e1d);
  color: #fff;
}
.card .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #526139 0%, #45532e 100%);
  box-shadow: 0 6px 16px -4px rgba(56,70,34,0.45),
              0 1px 3px rgba(56,70,34,0.30);
}

/* Botão de sucesso (aprovar, confirmar) */
.card .btn[style*="background:#10b981"],
.card .btn[style*="background:#1f8a5b"] {
  background: linear-gradient(180deg, #16a574 0%, #10b981 100%) !important;
  border-color: #047857 !important;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.18);
}
.card .btn[style*="background:#10b981"]:hover:not(:disabled),
.card .btn[style*="background:#1f8a5b"]:hover:not(:disabled) {
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.40),
              0 1px 3px rgba(16, 185, 129, 0.30) !important;
}

/* Botão danger dentro de cards */
.card .btn-danger,
.rh-item-card .btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #e0445a 100%);
  border-color: #b91c1c;
}
.card .btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 6px 16px -4px rgba(239, 68, 68, 0.40),
              0 1px 3px rgba(239, 68, 68, 0.25);
}

/* Botão neutro (cancelar, atualizar) — outline */
.card .btn:not(.btn-primary):not(.btn-danger):not(.btn-info):not(.btn-warning):not(.btn-accent):not(.btn-success) {
  background: #fff;
  color: #4d5243;
  border-color: #e5e7eb;
}
.card .btn:not(.btn-primary):not(.btn-danger):not(.btn-info):not(.btn-warning):not(.btn-accent):not(.btn-success):hover:not(:disabled) {
  background: #f6f7f3;
  color: var(--primary, #394820);
  border-color: #c7ccbd;
}

/* Ícones dentro de botões em cards: padroniza tamanho */
.card .btn > svg,
.card .btn > i,
.rh-item-card .btn > svg,
.rh-item-card .btn > i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Botão sm continua menor mas com mesma harmonia */
.card .btn-sm,
.rh-item-card .btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Disabled */
.card .btn:disabled,
.rh-item-card .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}


/* ============================================================
 * Layout intranet aplicado ao view-reception (Fase Layout 2026-05-31)
 * ============================================================ */
#view-reception .intranet-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  position: relative;
}
#view-reception .intranet-sidebar {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -10px rgba(15, 23, 42, 0.10);
  padding: 6px 0;
}
#view-reception .intranet-main { min-width: 0; }
#view-reception .intranet-sidebar-section { padding: 14px 16px 8px; }
#view-reception .intranet-sidebar-section + .intranet-sidebar-section {
  border-top: 1px solid #ecf0e5; margin-top: 2px; padding-top: 16px;
}
#view-reception .intranet-sidebar-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.10em;
  text-transform: uppercase; color: #8d9977; margin-bottom: 8px; padding-left: 4px;
}
#view-reception .intranet-menu-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 14px 9px 28px; border: 0; background: transparent;
  border-radius: 9px; font-size: 0.89rem; font-weight: 500; color: #4d5243;
  text-align: left; cursor: pointer; margin-bottom: 2px;
  transition: background 0.18s ease, color 0.18s ease;
}
#view-reception .intranet-menu-item::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #c5d1b0;
  transition: background 0.18s, transform 0.18s;
}
#view-reception .intranet-menu-item:hover:not(:disabled) {
  background: #f6f7f3; color: #394820;
}
#view-reception .intranet-menu-item:hover:not(:disabled)::before { background: #394820; }
#view-reception .intranet-menu-item:disabled { color: #9ca3af; cursor: not-allowed; opacity: 0.55; }
#view-reception .intranet-menu-item > i,
#view-reception .intranet-menu-item > svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

@media (max-width: 920px) {
  #view-reception .intranet-grid { grid-template-columns: 1fr; }
  #view-reception .intranet-sidebar { position: static; }
}

/* Pre-boot splash anti-flash */

html.auth-pending body::before{content:"";position:fixed;inset:0;background:#fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%236d1f6c' stroke-width='2' stroke-dasharray='40 20' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") no-repeat center;z-index:99999;animation:authSplashFade 220ms ease 250ms forwards;pointer-events:none;}
@keyframes authSplashFade{to{opacity:0;visibility:hidden}}
html.auth-pending .view-section.active body::before,body:has(.view-section.active)::before{display:none}

/* ============================================================
 * Polish cards Recepcao 2 (rec-content-card)
 * ============================================================ */
#view-reception .rec-content-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 14px -8px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s ease;
}
#view-reception .rec-content-card:hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -10px rgba(15, 23, 42, 0.12);
}

#view-reception .rec-card-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #ecf0e5;
  margin-bottom: 16px !important;
}
#view-reception .rec-card-head h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.014em;
  color: var(--primary, #394820);
}

/* Labels e campos da ficha */
#view-reception .rec-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #4d5243;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
#view-reception .rec-field {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #fff;
  color: #1f2937;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
#view-reception .rec-field:focus {
  outline: none;
  border-color: var(--primary, #394820);
  box-shadow: 0 0 0 3px rgba(56,70,34,0.10);
}
#view-reception .rec-field:disabled,
#view-reception .rec-field[readonly] {
  background: #f7f9f4;
  color: #4d5243;
  cursor: not-allowed;
}

/* Grade do formulário */
#view-reception .rec-form-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px 18px !important;
}
@media (max-width: 720px) {
  #view-reception .rec-form-grid { grid-template-columns: 1fr !important; }
}

/* Tabs refinados (sobrescreve .rec-tab antigo dentro do view-reception) */
#view-reception .rec-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 18px;
  background: transparent;
}
#view-reception .rec-tab {
  background: transparent;
  border: 0;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #5b6250;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}
#view-reception .rec-tab:hover:not(.active) {
  color: #4d5243;
  background: transparent;
}
#view-reception .rec-tab.active {
  color: var(--primary, #394820);
  border-bottom-color: var(--primary, #394820);
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

/* Conteúdo das tabs com fade-in */
#view-reception .rec-tab-content:not(.hidden) {
  animation: recTabFadeIn 0.22s ease;
}
@keyframes recTabFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Estado vazio com gradient sutil */
#view-reception #rec-empty-state {
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  border: 1px dashed #c5d1b0;
  border-radius: 14px;
}

/* Botões dentro do header da ficha (Editar/Salvar/Cancelar) */
#view-reception .rec-card-head .btn-sm {
  border-radius: 8px;
  font-weight: 600;
}


/* ============================================================
 * Layout intranet aplicado ao view-operator (2026-05-31)
 * ============================================================ */
#view-operator .intranet-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  position: relative;
}
#view-operator .intranet-sidebar {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -10px rgba(15, 23, 42, 0.10);
  padding: 6px 0;
}
#view-operator .intranet-main { min-width: 0; }
#view-operator .intranet-sidebar-section { padding: 14px 16px 8px; }
#view-operator .intranet-sidebar-section + .intranet-sidebar-section,
#view-operator .op-linked-depts-panel + .intranet-sidebar-section,
#view-operator .intranet-sidebar-section + .op-linked-depts-panel {
  border-top: 1px solid #ecf0e5; margin-top: 2px; padding-top: 16px;
}
#view-operator .intranet-sidebar-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.10em;
  text-transform: uppercase; color: #8d9977; margin-bottom: 8px; padding-left: 4px;
}
#view-operator .intranet-menu-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 14px 9px 28px; border: 0; background: transparent;
  border-radius: 9px; font-size: 0.89rem; font-weight: 500; color: #4d5243;
  text-align: left; cursor: pointer; margin-bottom: 2px;
  transition: background 0.18s ease, color 0.18s ease;
}
#view-operator .intranet-menu-item::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #c5d1b0;
  transition: background 0.18s, transform 0.18s;
}
#view-operator .intranet-menu-item:hover:not(:disabled) {
  background: #f6f7f3; color: #394820;
}
#view-operator .intranet-menu-item:hover:not(:disabled)::before { background: #394820; }
#view-operator .intranet-menu-item > i,
#view-operator .intranet-menu-item > svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

/* Panel de departamentos vinculados dentro da sidebar — limita altura */
#view-operator .op-linked-depts-body {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 6px;
}

@media (max-width: 920px) {
  #view-operator .intranet-grid { grid-template-columns: 1fr; }
  #view-operator .intranet-sidebar { position: static; }
}
