/* =========================================================
   QSP Global Menu
   Menu hambúrguer global do sistema Qualidade Sem Papel
   ========================================================= */

.qsp-global-menu-root {
  font-family: Inter, Arial, sans-serif;
}

.qsp-global-menu-button {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 999999;
  width: 46px;
  height: 46px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  transition: all 0.2s ease;
}

.qsp-global-menu-button:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.qsp-global-menu-button svg {
  width: 24px;
  height: 24px;
}

.qsp-global-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 999997;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.qsp-global-menu-overlay.qsp-open {
  opacity: 1;
  pointer-events: auto;
}

.qsp-global-menu-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999998;
  width: 304px;
  max-width: 88vw;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 16px 0 40px rgba(15, 23, 42, 0.22);
  transform: translateX(-110%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.qsp-global-menu-sidebar.qsp-open {
  transform: translateX(0);
}

.qsp-global-menu-header {
  height: 74px;
  padding: 0 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  flex-shrink: 0;
}

.qsp-global-menu-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.qsp-global-menu-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qsp-global-menu-logo-box img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.qsp-global-menu-title {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.qsp-global-menu-subtitle {
  font-size: 12px;
  line-height: 1.1;
  color: #94a3b8;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qsp-global-menu-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qsp-global-menu-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.qsp-global-menu-close svg {
  width: 22px;
  height: 22px;
}

.qsp-global-menu-nav {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.qsp-global-menu-nav::-webkit-scrollbar {
  width: 7px;
}

.qsp-global-menu-nav::-webkit-scrollbar-track {
  background: #f8fafc;
}

.qsp-global-menu-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.qsp-global-menu-link,
.qsp-global-menu-section-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #475569;
  text-decoration: none;
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.qsp-global-menu-link:hover,
.qsp-global-menu-section-button:hover {
  background: #f8fafc;
  color: #0f172a;
}

.qsp-global-menu-link.qsp-active {
  background: #eef2ff;
  color: #4f46e5;
}

.qsp-global-menu-icon {
  width: 21px;
  height: 21px;
  color: #94a3b8;
  flex-shrink: 0;
}

.qsp-global-menu-link.qsp-active .qsp-global-menu-icon {
  color: #4f46e5;
}

.qsp-global-menu-chevron {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  margin-left: auto;
  transition: transform 0.18s ease;
}

.qsp-global-menu-section.qsp-open .qsp-global-menu-chevron {
  transform: rotate(180deg);
}

.qsp-global-menu-submenu {
  display: none;
  padding: 4px 0 8px 44px;
}

.qsp-global-menu-section.qsp-open .qsp-global-menu-submenu {
  display: block;
}

.qsp-global-menu-submenu a {
  display: block;
  text-decoration: none;
  color: #64748b;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.qsp-global-menu-submenu a:hover {
  background: #f8fafc;
  color: #0f172a;
}

.qsp-global-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 14px 0;
}

.qsp-global-menu-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 12px 8px;
}

.qsp-global-menu-footer {
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.qsp-global-menu-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px;
  background: #fff1f2;
  color: #be123c;
  font-size: 14px;
  font-weight: 800;
}

.qsp-global-menu-logout:hover {
  background: #ffe4e6;
}

@media (max-width: 768px) {
  .qsp-global-menu-button {
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
  }

  .qsp-global-menu-sidebar {
    width: 292px;
  }
}
.qsp-global-menu-root.qsp-menu-is-open .qsp-global-menu-button {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
}

.qsp-global-menu-header {
  justify-content: flex-end !important;
  padding: 0 18px !important;
}

.qsp-global-menu-close {
  margin-left: auto !important;
  margin-right: 0 !important;
}
#qspUniversalBackButton {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999996;
  height: 46px;
  padding: 0 22px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.2s ease;
}

#qspUniversalBackButton:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.qsp-global-menu-root.qsp-menu-is-open ~ #qspUniversalBackButton,
body:has(.qsp-global-menu-sidebar.qsp-open) #qspUniversalBackButton {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  #qspUniversalBackButton {
    top: 12px;
    right: 12px;
    height: 44px;
    padding: 0 16px;
    font-size: 13px;
  }
}
/* =========================================================
   QSP Dark Mode Global
   ========================================================= */

html.qsp-dark-mode,
body.qsp-dark-mode {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

body.qsp-dark-mode main,
body.qsp-dark-mode section,
body.qsp-dark-mode .container,
body.qsp-dark-mode .content,
body.qsp-dark-mode .page,
body.qsp-dark-mode .wrapper {
  color: #e5e7eb !important;
}

body.qsp-dark-mode header,
body.qsp-dark-mode .header,
body.qsp-dark-mode .glass-header,
body.qsp-dark-mode nav:not(.qsp-global-menu-nav) {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(51, 65, 85, 0.9) !important;
  color: #e5e7eb !important;
}

body.qsp-dark-mode .bg-white,
body.qsp-dark-mode .bg-slate-50,
body.qsp-dark-mode .bg-gray-50,
body.qsp-dark-mode .bg-gray-100,
body.qsp-dark-mode .card,
body.qsp-dark-mode .panel,
body.qsp-dark-mode .box,
body.qsp-dark-mode .rounded-xl,
body.qsp-dark-mode .rounded-2xl {
  background-color: #1e293b !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

body.qsp-dark-mode .text-slate-900,
body.qsp-dark-mode .text-slate-800,
body.qsp-dark-mode .text-slate-700,
body.qsp-dark-mode .text-gray-900,
body.qsp-dark-mode .text-gray-800,
body.qsp-dark-mode .text-gray-700,
body.qsp-dark-mode h1,
body.qsp-dark-mode h2,
body.qsp-dark-mode h3,
body.qsp-dark-mode h4,
body.qsp-dark-mode h5,
body.qsp-dark-mode h6 {
  color: #f8fafc !important;
}

body.qsp-dark-mode .text-slate-600,
body.qsp-dark-mode .text-slate-500,
body.qsp-dark-mode .text-gray-600,
body.qsp-dark-mode .text-gray-500,
body.qsp-dark-mode p,
body.qsp-dark-mode span,
body.qsp-dark-mode label {
  color: #cbd5e1 !important;
}

body.qsp-dark-mode table {
  background: #1e293b !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

body.qsp-dark-mode thead,
body.qsp-dark-mode th {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.qsp-dark-mode td {
  border-color: #334155 !important;
}

body.qsp-dark-mode input,
body.qsp-dark-mode textarea,
body.qsp-dark-mode select {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.qsp-dark-mode input::placeholder,
body.qsp-dark-mode textarea::placeholder {
  color: #94a3b8 !important;
}

body.qsp-dark-mode .border,
body.qsp-dark-mode .border-slate-100,
body.qsp-dark-mode .border-slate-200,
body.qsp-dark-mode .border-gray-100,
body.qsp-dark-mode .border-gray-200 {
  border-color: #334155 !important;
}

body.qsp-dark-mode .shadow,
body.qsp-dark-mode .shadow-sm,
body.qsp-dark-mode .shadow-md,
body.qsp-dark-mode .shadow-lg,
body.qsp-dark-mode .shadow-xl {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35) !important;
}

/* Menu global em dark mode */

body.qsp-dark-mode .qsp-global-menu-button,
body.qsp-dark-mode #qspUniversalBackButton {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.qsp-dark-mode .qsp-global-menu-sidebar,
body.qsp-dark-mode .qsp-global-menu-header,
body.qsp-dark-mode .qsp-global-menu-footer {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.qsp-dark-mode .qsp-global-menu-title {
  color: #f8fafc !important;
}

body.qsp-dark-mode .qsp-global-menu-link,
body.qsp-dark-mode .qsp-global-menu-section-button,
body.qsp-dark-mode .qsp-global-menu-submenu a {
  color: #cbd5e1 !important;
}

body.qsp-dark-mode .qsp-global-menu-link:hover,
body.qsp-dark-mode .qsp-global-menu-section-button:hover,
body.qsp-dark-mode .qsp-global-menu-submenu a:hover {
  background: #1e293b !important;
  color: #f8fafc !important;
}

body.qsp-dark-mode .qsp-global-menu-link.qsp-active {
  background: #312e81 !important;
  color: #ffffff !important;
}

.qsp-global-theme-toggle {
  width: 100%;
  height: 44px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.qsp-global-theme-toggle:hover {
  background: #f8fafc;
}

body.qsp-dark-mode .qsp-global-theme-toggle {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.qsp-dark-mode .qsp-global-theme-toggle:hover {
  background: #334155 !important;
}
/* =========================================================
   QSP - Limpeza visual dos cabeçalhos antigos
   Remove faixa branca/linha/sombra sem apagar botões da tela
   ========================================================= */

body header:not(.qsp-global-menu-header) {
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

body .glass-header {
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body header:not(.qsp-global-menu-header) + main,
body .glass-header + main {
  margin-top: 0 !important;
}
