/* ==========================================================================
   SIGAD — MODERN DESIGN SYSTEM (Estilo Visual: novo-sistema-inscricoes)
   Tipografia Manrope · Top Navigation 2 Níveis · Paleta Slate + Índigo/Roxo
   ========================================================================== */

:root {
  /* Paleta principal (novo-sistema-inscricoes) */
  --ui-bg: #f1f5f9;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f8fafc;
  --ui-text: #0f172a;
  --ui-muted: #64748b;
  --ui-border: #e2e8f0;
  --ui-border-strong: #cbd5e1;
  --ui-primary: #6847e8;
  --ui-primary-dark: #5434d0;
  --ui-primary-soft: #f0edff;
  --ui-success: #15803d;
  --ui-danger: #be123c;
  --ui-warning: #b45309;
  --ui-info: #0284c7;
  --ui-radius: 12px;
  --ui-radius-sm: 8px;
  --ui-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.03);

  /* Mapeamento das variáveis legadas do SIGAD para consistência global */
  --navy: #0f172a;
  --navy2: #0f172a;
  --blue: #6847e8;
  --teal: #6847e8;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --bg: var(--ui-bg);
  --border: var(--ui-border);
  --text: var(--ui-text);
  --muted: var(--ui-muted);
  --white: #ffffff;
  --shadow: var(--ui-shadow);
}

html {
  background: var(--ui-bg);
}

body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--ui-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--ui-primary-dark);
}

button, input, select, textarea {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   SHELL PRINCIPAL & TOP NAVIGATION (2 FAIXAS)
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  margin-left: 0 !important;
  width: 100% !important;
  min-width: 0;
  flex: 1;
}

.content,
main.content {
  width: 100%;
  max-width: min(97vw, 1920px);
  margin: 0 auto;
  padding: 16px clamp(14px, 2vw, 28px) 44px;
}

@media (min-width: 2100px) {
  .top-admin-inner,
  .content,
  main.content {
    max-width: min(96vw, 2400px);
  }
}

.top-admin-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #ffffff;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

.top-admin-inner {
  max-width: min(97vw, 1920px);
  margin: 0 auto;
  padding: 0 clamp(14px, 2.2vw, 32px);
}

/* Faixa 1: Barra Escura Superior */
.top-admin-bar {
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-admin-bar .top-admin-inner {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-bottom: 6px;
}

.top-brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  flex-shrink: 0;
  padding: 0;
  border: 0;
}

.top-brand:hover {
  color: #ffffff;
}

.top-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: linear-gradient(135deg, #6847e8, #9378ff);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(104, 71, 232, 0.42);
  flex-shrink: 0;
  overflow: hidden;
}

.top-brand .brand-mark.has-logo {
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.top-brand .brand-copy {
  min-width: 0;
  overflow: hidden;
}

.top-brand .brand-copy strong {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.15;
  white-space: nowrap;
}

.top-brand .brand-copy small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

/* Tenant Switcher na Barra Escura */
.top-admin-bar .tenant-switcher > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  max-width: 250px;
  padding: 4px 10px 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.top-admin-bar .tenant-switcher > summary:hover,
.top-admin-bar .tenant-switcher[open] > summary {
  background: rgba(255, 255, 255, 0.14);
  border-color: #8b70ff;
}

.top-admin-bar .tenant-switcher-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  background: rgba(104, 71, 232, 0.35);
  color: #ede9fe;
  font-size: 10px;
  font-weight: 800;
}

.top-admin-bar .tenant-switcher > summary small {
  color: #94a3b8;
  font-size: 8.5px;
  font-weight: 700;
}

.top-admin-bar .tenant-switcher > summary strong {
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  max-width: 155px;
}

.top-admin-bar .tenant-switcher > summary > i {
  color: #94a3b8;
  font-size: 12px;
}

.tenant-switcher-menu {
  left: 0;
  right: auto;
  border: 1.5px solid var(--ui-border);
  border-radius: 12px;
  box-shadow: 0 18px 40px -8px rgba(15, 23, 42, 0.25);
  padding: 8px;
}

.tenant-switcher-heading strong {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--ui-text);
}

.tenant-switcher-option {
  border-radius: 8px;
  border-bottom: 0;
  margin-bottom: 2px;
}

.tenant-switcher-option.current {
  background: var(--ui-primary-soft);
}

.tenant-switcher-option > span {
  background: #ede9fe;
  color: var(--ui-primary);
  border-radius: 7px;
  font-weight: 800;
}

.tenant-switcher-option > i {
  color: var(--ui-primary);
  font-weight: 800;
}

.tenant-switcher-all {
  color: var(--ui-primary);
  font-weight: 700;
  border-top: 1px solid var(--ui-border);
  margin-top: 6px;
}

/* Utilitários à direita na Barra Escura */
.top-utility-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-admin-bar .global-search {
  position: relative;
  width: 240px;
  max-width: 240px;
  margin: 0;
  flex: 0 1 240px;
}

.top-admin-bar .global-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.top-admin-bar .global-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 500;
  outline: none;
  transition: all 0.15s ease;
}

.top-admin-bar .global-search input::placeholder {
  color: #94a3b8;
}

.top-admin-bar .global-search input:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: #8b70ff;
  box-shadow: 0 0 0 3px rgba(104, 71, 232, 0.28);
}

.top-quick-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.top-btn-link .material-icon {
  font-size: 16px;
}

.top-btn-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.top-btn-link.accent {
  background: rgba(104, 71, 232, 0.32);
  border-color: rgba(139, 112, 255, 0.48);
  color: #ddd6fe;
}

.top-btn-link.accent:hover {
  background: rgba(104, 71, 232, 0.52);
  color: #ffffff;
}

.top-notif-link {
  padding: 0 9px;
}

.top-user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.top-user-box .avatar,
.mobile-drawer-user .avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6847e8, #8b5cf6);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.top-user-meta {
  line-height: 1.15;
  min-width: 0;
}

.top-user-meta strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-user-meta small {
  display: block;
  font-size: 9.5px;
  color: #94a3b8;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-user-box form {
  margin: 0;
}

.top-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 31px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.top-logout-btn .material-icon {
  font-size: 15px;
}

.top-logout-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

/* Faixa 2: Barra Horizontal de Módulos */
.top-admin-nav-wrap {
  background: #ffffff;
  border-bottom: 1px solid var(--ui-border);
  width: 100%;
  position: relative;
  z-index: 50;
  overflow: visible;
}

.top-admin-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
}

.top-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 31px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  line-height: 1.2;
}

.top-nav-item .material-icon {
  font-size: 16px;
  color: #64748b;
  transition: color 0.15s ease;
}

.top-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.top-nav-item:hover .material-icon {
  color: var(--ui-primary);
}

.top-nav-item.active {
  background: linear-gradient(135deg, #6847e8, #7c3aed);
  color: #ffffff;
  border-color: #6847e8;
  box-shadow: 0 2px 8px rgba(104, 71, 232, 0.28);
}

.top-nav-item.active .material-icon {
  color: #ffffff;
}

.nav-badge-pill-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #be123c;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
}

.top-nav-item.active .nav-badge-pill-danger {
  background: #ffffff;
  color: #be123c;
}

/* Dropdowns na Barra Horizontal */
.top-nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown-chevron {
  font-size: 15px !important;
  margin-left: -2px;
  transition: transform 0.2s ease;
}

.top-nav-dropdown:hover .dropdown-chevron,
.top-nav-dropdown:focus-within .dropdown-chevron {
  transform: rotate(180deg);
}

.top-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 255px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.18), 0 6px 14px -3px rgba(15, 23, 42, 0.08);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.top-nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.top-nav-dropdown:hover .top-nav-dropdown-menu,
.top-nav-dropdown:focus-within .top-nav-dropdown-menu {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(4px);
}

.top-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: #334155;
  transition: all 0.15s ease;
}

.top-nav-dropdown-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.top-nav-dropdown-item.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-weight: 700;
  border-left: 3px solid var(--ui-primary);
}

.top-nav-dropdown-item .material-icon {
  font-size: 18px;
  color: #64748b;
  flex-shrink: 0;
}

.top-nav-dropdown-item.active .material-icon {
  color: var(--ui-primary);
}

.top-nav-dropdown-item-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
}

.top-nav-dropdown-item-title {
  font-size: 12px;
  font-weight: 700;
}

.top-nav-dropdown-item-desc {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
  margin-top: 1px;
}

/* ==========================================================================
   MOBILE DRAWER (OFF-CANVAS)
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(84vw, 310px);
  background: #0f172a;
  color: #f8fafc;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-110%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
  overflow: hidden;
}

.mobile-drawer.open {
  transform: translateX(0);
  box-shadow: 12px 0 35px rgba(0, 0, 0, 0.45);
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer-header {
  padding: 15px 16px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-drawer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.mobile-drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  font-size: 20px;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mobile-drawer-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.mobile-drawer-org-box {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.mobile-drawer-org-box small {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.mobile-drawer-org-box strong {
  display: block;
  font-size: 12.5px;
  color: #ffffff;
  margin-top: 2px;
}

.mobile-drawer-org-box span {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 1px;
}

.mobile-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-drawer-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 9px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.mobile-drawer-item .material-icon {
  font-size: 18px;
}

.mobile-drawer-item .nav-badge-pill-danger {
  margin-left: auto;
}

.mobile-drawer-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.mobile-drawer-item.active {
  background: linear-gradient(135deg, #6847e8, #7c3aed);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(104, 71, 232, 0.35);
}

.mobile-drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #090e17;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mobile-drawer-footer form {
  margin: 0;
}

.mobile-drawer-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 35px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  width: 100%;
  cursor: pointer;
}

.mobile-drawer-action-btn.accent {
  background: rgba(104, 71, 232, 0.25);
  border-color: rgba(139, 112, 255, 0.45);
  color: #ddd6fe;
}

.mobile-drawer-action-btn.danger {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.35);
  color: #f87171;
}

/* ==========================================================================
   FLOATING TOASTS (MENSAGENS DO SISTEMA)
   ========================================================================== */
.floating-toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: 92vw;
  width: 500px;
}

.floating-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  width: 100%;
  box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.25), 0 4px 12px rgba(15, 23, 42, 0.1);
  background: #064e3b;
  border: 1.5px solid #059669;
  color: #ffffff;
  opacity: 0;
  transform: translateY(-40px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
}

.floating-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.floating-toast.hide {
  opacity: 0;
  transform: translateY(-30px) scale(0.94);
}

.floating-toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.floating-toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}

.floating-toast-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.floating-toast-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.floating-toast.error,
.floating-toast.danger {
  background: #7f1d1d;
  border-color: #dc2626;
}
.floating-toast.error .floating-toast-icon,
.floating-toast.danger .floating-toast-icon {
  background: #ef4444;
}

.floating-toast.warning {
  background: #78350f;
  border-color: #d97706;
}
.floating-toast.warning .floating-toast-icon {
  background: #f59e0b;
}

.floating-toast.info {
  background: #1e3a8a;
  border-color: #2563eb;
}
.floating-toast.info .floating-toast-icon {
  background: #3b82f6;
}

/* ==========================================================================
   PAGE HEADING (CARD BRANCO COMPACTO NO TOPO DAS PÁGINAS)
   ========================================================================== */
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: var(--ui-shadow);
}

.page-heading h1 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--ui-text);
}

.page-heading p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--ui-muted);
  line-height: 1.4;
}

.page-heading .back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ui-muted);
}

.page-heading .back:hover {
  color: var(--ui-primary);
}

.heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   BOTÕES PADRONIZADOS (GRADIENTES & ALTO CONTRASTE)
   ========================================================================== */
.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.15s ease;
}

.btn:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn.primary,
.heading-actions .btn.primary,
.filter-bar .btn.primary,
.report-filter-actions .btn.primary {
  border-color: #5b35f2;
  background: linear-gradient(135deg, #6d4aff 0%, #5833ea 100%);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(109, 74, 255, 0.28);
}

.btn.primary:hover:not(:disabled),
.heading-actions .btn.primary:hover:not(:disabled),
.filter-bar .btn.primary:hover:not(:disabled),
.report-filter-actions .btn.primary:hover:not(:disabled) {
  border-color: #4a24dd;
  background: linear-gradient(135deg, #5b35f2 0%, #4a24dd 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(109, 74, 255, 0.4);
}

.btn.secondary {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.btn.secondary:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #0f172a;
}

.btn.success {
  border-color: #059669;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(16, 185, 129, 0.28);
}

.btn.success:hover:not(:disabled) {
  border-color: #047857;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
}

.btn.info {
  border-color: #0284c7;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(2, 132, 199, 0.28);
}

.btn.info:hover:not(:disabled) {
  border-color: #0369a1;
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: #ffffff;
}

.btn.warning {
  border-color: #d97706;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(217, 119, 6, 0.25);
}

.btn.danger {
  border-color: #dc2626;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(239, 68, 68, 0.25);
}

.btn.danger:hover:not(:disabled) {
  border-color: #b91c1c;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  border-color: #cbd5e1;
  color: #475569;
  box-shadow: none;
}

.btn.ghost:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn.compact {
  min-height: 27px;
  padding: 0 9px;
  font-size: 10.5px;
  border-radius: 6px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--ui-primary);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.row-action:hover {
  background: var(--ui-primary-soft);
  border-color: #b8a8ff;
  color: var(--ui-primary-dark);
}

/* ==========================================================================
   KPI / METRIC CARDS
   ========================================================================== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 82px;
  box-shadow: var(--ui-shadow);
  display: flex;
  align-items: center;
  gap: 13px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.metric-link:hover {
  transform: translateY(-2px);
  border-color: #c4b5fd;
  box-shadow: 0 8px 22px rgba(104, 71, 232, 0.1);
}

.metric-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  font-size: 19px;
  display: grid;
  place-items: center;
}

.metric-icon.blue { background: #ede9fe; color: #6847e8; }
.metric-icon.amber { background: #fef3c7; color: #b45309; }
.metric-icon.red { background: #fee2e2; color: #be123c; }
.metric-icon.teal { background: #dcfce7; color: #15803d; }
.metric-icon.violet { background: #ede9fe; color: #6847e8; }

.metric small {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ui-muted);
  text-transform: uppercase;
}

.metric strong {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ui-text);
  margin: 2px 0;
}

.metric span {
  font-size: 10.5px;
  color: var(--ui-muted);
  font-weight: 500;
}

.metric-link > i {
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
}

.metric-link:hover > i {
  color: var(--ui-primary);
  transform: translateX(2px);
}

/* Card KPI destaque (featured gradient) */
.metric.featured {
  background: linear-gradient(135deg, #5b3ce0, #7a5af8);
  border: 0;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(91, 60, 212, 0.24);
}

.metric.featured:hover {
  box-shadow: 0 10px 24px rgba(91, 60, 212, 0.34);
}

.metric.featured .metric-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.metric.featured small,
.metric.featured strong,
.metric.featured span,
.metric.featured > i {
  color: #ffffff;
}

.metric.featured small,
.metric.featured span {
  opacity: 0.88;
}

/* Report metrics */
.report-metric::before {
  background: var(--ui-primary);
}
.report-metric strong {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  color: var(--ui-text);
}

/* ==========================================================================
   CARDS, PAINÉIS E TABELAS
   ========================================================================== */
.card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

.card-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--ui-border);
}

.card-head h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ui-text);
  margin: 0;
}

.card-head p {
  font-size: 11px;
  color: var(--ui-muted);
  margin: 2px 0 0;
}

.card-head > a {
  font-size: 11px;
  font-weight: 700;
  color: var(--ui-primary);
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ui-border);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  color: #334155;
}

tbody tr:hover td {
  background: #f8fafc;
}

td strong {
  color: var(--ui-text);
  font-weight: 700;
}

td small {
  color: var(--ui-muted);
  font-size: 10.5px;
}

/* Badges / Status / Severity */
.status,
.severity,
.tenant-role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
}

.status-draft { background: #f1f5f9; color: #475569; }
.status-sent, .status-received, .status-analysis, .status-open, .status-review { background: #e0f2fe; color: #0369a1; }
.status-signed, .status-finished, .status-closed, .status-approved, .status-archived { background: #dcfce7; color: #15803d; }
.status-approval, .status-signature, .status-submitted, .status-loaned { background: #fef3c7; color: #b45309; }
.status-cancelled, .status-returned, .status-disposed { background: #fee2e2; color: #be123c; }
.status-transferred { background: #ede9fe; color: #6847e8; }

.severity-info, .severity-light { background: #e0f2fe; color: #0369a1; }
.severity-moderate { background: #fef3c7; color: #b45309; }
.severity-serious, .severity-urgent, .severity-critical { background: #fee2e2; color: #be123c; }

.priority-list a {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.priority-list a:hover {
  background: #f8fafc;
}

.priority-list a strong {
  color: var(--ui-text);
  font-weight: 700;
  font-size: 12.5px;
}

/* ==========================================================================
   FILTROS, FORMULÁRIOS E COMPONENTES DE CONFIGURAÇÃO
   ========================================================================== */
.filter-bar {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--ui-shadow);
}

.form-control {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 11px;
  background: #ffffff;
  color: var(--ui-text);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 3px rgba(104, 71, 232, 0.12);
}

.field label,
.side-card form label,
.mini-form label,
.filter-field label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.field small {
  color: var(--ui-muted);
  font-size: 10.5px;
}

.field > input.form-control[type="checkbox"]:checked,
.document-switch:has(input:checked) i {
  background: var(--ui-primary);
  border-color: var(--ui-primary-dark);
}

.state-toggle.is-on::before {
  background: #10b981;
}

.form-card {
  padding: 20px;
}

.form-actions {
  border-top: 1px solid var(--ui-border);
  padding-top: 16px;
  margin-top: 20px;
}

.side-card {
  border-radius: var(--ui-radius);
  padding: 16px;
}

.side-card h3,
.settings-section-heading h2,
.section-title-row h2,
.report-section-heading h2,
.report-filter-heading h2,
.document-form-section-head h2,
.membership-section-heading h2,
.critical-modal h2,
.report-filter-modal h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  color: var(--ui-text);
}

.settings-card,
.report-card,
.attendance-month-card {
  border-radius: var(--ui-radius);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
}

.settings-card:hover,
.report-card:hover,
.attendance-month-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 8px 22px rgba(104, 71, 232, 0.1);
}

.settings-card strong,
.report-card-copy strong,
.attendance-month-card strong,
.tenant-admin-copy strong,
.tenant-choice-copy strong {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  color: var(--ui-text);
}

.settings-icon,
.report-card-icon,
.attendance-month-card > .material-icon:first-child,
.document-form-section-head > .material-icon,
.membership-section-icon {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  border-radius: 9px;
}

.report-card-icon.teal { background: #dcfce7; color: #15803d; }
.report-card-icon.amber { background: #fef3c7; color: #b45309; }
.report-card-icon.red { background: #fee2e2; color: #be123c; }

.settings-card small,
.report-card-copy small {
  color: var(--ui-primary);
}

.active-filter {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

.active-filter.danger {
  background: #fee2e2;
  color: #be123c;
}

/* Alertas inline (ex.: erros de formulário) */
.alert {
  padding: 11px 14px;
  border-radius: 9px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
}

.alert.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* Timeline, Organograma, Notificações, Ajuda */
.timeline-item i {
  background: var(--ui-primary);
  border-color: #ede9fe;
}

.org-node {
  border-radius: 10px;
  border-color: var(--ui-border);
}

.org-node.root {
  border-left: 4px solid var(--ui-primary);
}

.org-node > span,
.catalog-avatar,
.membership-identity > span,
.tenant-choice-logo,
.tenant-admin-logo {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

.notification-list > a.unread {
  background: #f5f3ff;
  border-left: 3px solid var(--ui-primary);
}

.help-page-header {
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

.help-page-topics > strong {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
}

.help-page-chat form button {
  background: linear-gradient(135deg, #6d4aff 0%, #5833ea 100%);
}

.help-page-chat form button:hover {
  background: linear-gradient(135deg, #5b35f2 0%, #4a24dd 100%);
}

.help-message.user {
  background: var(--ui-primary-soft);
  color: #3b1d8e;
}

/* Modais */
.critical-modal,
.report-filter-modal {
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.35);
}

.critical-modal::backdrop,
.report-filter-modal::backdrop {
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.page-scroll-toggle {
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.page-scroll-toggle:hover {
  background: var(--ui-primary);
}

/* Rodapé discreto (estilo novo-sistema-inscricoes) */
.admin-signature-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: 32px;
  padding: 14px 4px 6px;
  border-top: 1px solid rgba(203, 213, 225, 0.65);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.admin-signature-footer:hover {
  opacity: 1;
}

.admin-footer-left,
.admin-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-signature-separator {
  color: #cbd5e1;
}

/* ==========================================================================
   PÁGINAS STANDALONE: SELEÇÃO DE ORGANIZAÇÃO & VALIDAÇÃO PÚBLICA
   ========================================================================== */
.tenant-select-page {
  background: radial-gradient(circle at 20% 25%, rgba(104, 71, 232, 0.28), transparent 45%), #0f172a;
}

.tenant-select-shell {
  background: #f8fafc;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tenant-select-heading .brand-mark {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6847e8, #9378ff);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(104, 71, 232, 0.35);
}

.tenant-select-heading h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ui-text);
}

.tenant-choice-card {
  border-radius: 12px;
  border-color: var(--ui-border);
  transition: all 0.16s ease;
}

.tenant-choice-card:hover {
  border-color: #c4b5fd;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(104, 71, 232, 0.1);
}

.validation-page {
  background: var(--ui-bg);
}

.validation-card {
  border-radius: 14px;
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
}

.validation-card .doc-seal {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6847e8, #9378ff);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  margin-bottom: 14px;
}

.validation-card h1,
.validation-signatures h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  color: var(--ui-text);
}

.validation-result {
  border-radius: 9px;
}

.validation-result.valid {
  background: #dcfce7;
  color: #15803d;
}

.validation-result.invalid {
  background: #fee2e2;
  color: #be123c;
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE (< 992px)
   ========================================================================== */
@media (max-width: 1100px) {
  .top-admin-bar .global-search {
    width: 180px;
    flex-basis: 180px;
  }
}

@media (max-width: 992px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .top-admin-nav-wrap {
    display: none;
  }

  .top-admin-bar .global-search,
  .top-quick-links .top-btn-link:not(.top-notif-link),
  .top-user-meta,
  .top-logout-btn span:last-child {
    display: none;
  }

  .top-user-box {
    padding-left: 6px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .content,
  main.content {
    padding: 14px 12px 32px;
  }

  .top-admin-bar .tenant-switcher > summary > span:nth-child(2),
  .top-admin-bar .tenant-switcher > summary > i {
    display: none;
  }

  .top-admin-bar .tenant-switcher > summary {
    min-width: 0;
    padding: 4px;
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .heading-actions {
    width: 100%;
  }

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

  .admin-signature-footer {
    flex-direction: column;
    text-align: center;
  }
}

@media print {
  .top-admin-header,
  .mobile-drawer,
  .mobile-drawer-overlay,
  .floating-toast-container,
  .admin-signature-footer,
  .page-scroll-toggle {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  main.content {
    max-width: none;
    padding: 0;
  }
}
