/* =========================================================
   FORNO & BRASA - UNIVERSAL EXECUTIVE NAVIGATION SUITE
   Estética Corporativa, Sóbria e Premium (Padrão Enterprise SaaS)
   ========================================================= */

/* Botão de Acionamento Executivo (Integrado Nativo ou Flutuante Seguro) */
#fb-master-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 8px;
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
  height: 36px;
  box-sizing: border-box;
}

#fb-master-nav-trigger.in-header {
  position: static !important;
  margin: 0 !important;
}

#fb-master-nav-trigger.floating {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 999998;
}

#fb-master-nav-trigger:hover {
  background: #141c2c;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

#fb-master-nav-trigger .trigger-svg {
  width: 15px;
  height: 15px;
  stroke: #94a3b8;
  stroke-width: 2;
  transition: stroke 0.18s ease;
}

#fb-master-nav-trigger:hover .trigger-svg {
  stroke: #f1f5f9;
}

#fb-master-nav-trigger .trigger-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Modal Overlay do Hub Executivo */
#fb-master-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999999;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#fb-master-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
}

#fb-master-modal-box {
  background: #0a0e17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  width: 100%;
  max-width: 1100px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

#fb-master-modal-overlay.active #fb-master-modal-box {
  transform: scale(1);
}

/* Header do Modal */
.fb-master-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d121d;
  flex-shrink: 0 !important;
}

.fb-master-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-master-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  background: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.fb-master-title-wrap h2 {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-master-title-wrap p {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 1px;
}

.fb-master-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fb-master-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Subbar de Controles do Accordion */
.fb-master-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0 !important;
}

.fb-master-subbar-info {
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.fb-master-subbar-actions {
  display: flex;
  gap: 8px;
}

.fb-btn-acc-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fb-btn-acc-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Container de Categorias Accordion */
.fb-master-categories-wrap {
  padding: 16px 24px;
  background: #080b12;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 0%;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.fb-master-categories-wrap::-webkit-scrollbar {
  width: 8px;
}

.fb-master-categories-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.fb-master-categories-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.fb-master-categories-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.fb-cat-accordion-item {
  background: #0d121d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0 !important;
  min-height: max-content;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.fb-cat-accordion-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.fb-cat-accordion-item.open {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.fb-cat-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background-color 0.15s ease;
  user-select: none;
}

.fb-cat-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.fb-cat-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fb-cat-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cat-accent, #94a3b8);
  flex-shrink: 0;
}

.fb-cat-icon-box svg {
  width: 20px;
  height: 20px;
}

.fb-cat-text h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  margin: 0 0 2px 0;
}

.fb-cat-text p {
  font-size: 0.76rem;
  color: #64748b;
  margin: 0;
}

.fb-cat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-cat-active-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fb-cat-count {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.fb-cat-chevron {
  width: 18px;
  height: 18px;
  color: #64748b;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
  flex-shrink: 0;
}

.fb-cat-header:hover .fb-cat-chevron {
  color: #cbd5e1;
}

.fb-cat-accordion-item.open .fb-cat-chevron {
  transform: rotate(180deg);
  color: #f1f5f9;
}

/* Corpo do Accordion (Nativamente Fechado) */
.fb-cat-body {
  display: none !important;
  padding: 0 18px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.15);
}

.fb-cat-accordion-item.open .fb-cat-body {
  display: block !important;
}

.fb-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding-top: 16px;
}

.fb-module-card {
  background: #0f1420;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: all 0.16s ease;
  position: relative;
}

.fb-module-card:hover {
  background: #141c2c;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.fb-module-card.current {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.04);
}

.fb-mod-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fb-mod-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mod-accent, #94a3b8);
}

.fb-mod-icon-wrap svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.fb-mod-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.fb-mod-status.current-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.fb-mod-body h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.fb-mod-body p {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 14px;
}

.fb-mod-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.fb-module-card:hover .fb-mod-action {
  color: #f8fafc;
}

/* Footer do Modal */
.fb-master-foot {
  padding: 14px 24px;
  background: #0a0e17;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
}

.fb-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #94a3b8;
}

.fb-user-chip strong {
  color: #f1f5f9;
}

.fb-btn-home {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.fb-btn-home:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

.fb-btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.fb-btn-logout:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

@media (max-width: 640px) {
  #fb-master-nav-trigger {
    top: auto;
    bottom: 16px;
    right: 16px;
    padding: 7px 12px;
  }
  .fb-master-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

/* Pílula Global de Monitoramento de Rede (Offline / Online) */
#fb-global-net-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 999999;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #0d131f;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  padding: 8px 18px;
  border-radius: 30px;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fca5a5;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}

#fb-global-net-pill.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#fb-global-net-pill.online {
  border-color: rgba(16, 185, 129, 0.35);
  color: #86efac;
}

#fb-global-net-pill .net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

#fb-global-net-pill.online .net-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

#fb-global-net-pill .net-link {
  color: #cbd5e1;
  text-decoration: underline;
  margin-left: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
}

