/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
  --moriah-topbar:       #0c1e3d;
  --moriah-blue-dark:    #0c4480;
  --moriah-blue:         #185FA5;
  --moriah-blue-medium:  #378ADD;
  --moriah-blue-light:   #85B7EB;
  --moriah-blue-pale:    #E6F1FB;
  --moriah-content-bg:   #f0f2f5;
  --moriah-badge:        #E24B4A;
  --moriah-font:         'Source Sans 3', sans-serif;
  --topbar-height:       80px;
  --tabs-height:         38px;
  --sidebar-width:       200px;

  --mud-appbar-height:   118px; /* topbar(80px) + tabs(38px) — referência, sobrescrito pelo MudBlazor JS */
}

/* ===== FONTE GLOBAL ===== */
*, body {
  font-family: var(--moriah-font) !important;
}

/* ===== TOPBAR ===== */
.moriah-topbar {
  background-color: var(--moriah-topbar) !important;
  height: var(--topbar-height) !important;
  box-shadow: none !important;
}

/* Centraliza verticalmente todos os itens do topbar */
.moriah-topbar .mud-toolbar {
  height: 100% !important;
  align-items: center !important;
}

.topbar-brand {
  color: white !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap !important;
  margin-right: 4px !important;
}

.segment-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  padding: 6px 14px;
  cursor: pointer;
  margin-left: 12px;
  transition: background 0.15s;
}

.segment-btn:hover {
  background: rgba(255,255,255,0.14);
}

/* ===== MENUS DROPDOWN (MudMenu — todos no app) ===== */
/* Classe real do item: .mud-menu-item / texto: .mud-menu-item-text */
.mud-menu-list {
  display: flex !important;
  flex-direction: column !important;
  padding: 4px 0 !important;
  overflow: hidden !important;
  min-width: 160px !important;
}

.mud-menu-item {
  border-radius: 6px !important;
  padding: 6px 10px !important;
  margin: 1px 4px !important;
  color: #374151 !important;
  background: transparent !important;
}

.mud-menu-item-text {
  font-size: 13px !important;
  line-height: 1.4 !important;
  color: inherit !important;
}

.mud-menu-item:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

/* Rótulo interno dos botões de contexto (Ambiente: / Módulo:) */
.segment-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-right: 4px;
}

/* Variação do seletor de Ambiente — mesmo formato do segment-btn mas tom azul distinto */
.segment-btn--ambiente {
  border-color: rgba(56, 138, 221, 0.5);
  background: rgba(56, 138, 221, 0.12);
}

.segment-btn--ambiente:hover {
  background: rgba(56, 138, 221, 0.22);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.topbar-avatar:hover {
  background: rgba(255,255,255,0.22);
}

/* ===== TABS DE MÓDULOS (div fixa abaixo do AppBar) ===== */
.modulos-tabs-bar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  z-index: 1200; /* acima do MudDrawer (~1000) e MudAppBar (~1100) */
  background: var(--moriah-topbar);
  height: var(--tabs-height);
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 20px;
}

.modulo-tab {
  position: relative;
  padding: 7px 20px 9px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  background: rgba(255,255,255,0.07);
  border-radius: 8px 8px 0 0;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-bottom: none;
  white-space: nowrap;
  transition: all 0.15s;
  user-select: none;
  line-height: 1;
}

.modulo-tab:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.13);
}

.modulo-tab.active {
  background: var(--moriah-content-bg);
  color: var(--moriah-topbar);
  font-weight: 600;
  border-color: transparent;
  padding-bottom: 11px;
  margin-bottom: -1px;
  z-index: 5;
}

.modulo-tab--disabled {
  color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
  cursor: not-allowed;
  pointer-events: none;
}

.modulo-tab--disabled:hover {
  color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.03);
}

/* ===== BADGE DA TAB ===== */
.tab-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  background: var(--moriah-badge);
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--moriah-topbar);
  z-index: 6;
}

.tab-badge.active {
  border-color: var(--moriah-content-bg);
}

/* ===== SIDEBAR ===== */
.moriah-sidebar {
  width: var(--sidebar-width) !important;
  top: calc(var(--topbar-height) + var(--tabs-height)) !important;
  border-right: 0.5px solid rgba(0,0,0,0.08) !important;
  box-shadow: none !important;
}

.moriah-sidebar .mud-drawer-header {
  display: none !important;
}

/*
 * Corrige o gap à esquerda:
 * MudBlazor usa --mud-drawer-width-left para calcular o margin-left do MudMainContent.
 * Por padrão é 240px, mas nosso sidebar é 200px — 40px de gap indesejado.
 */
.mud-layout {
  --mud-drawer-width-left: var(--sidebar-width) !important;
}

.moriah-sidebar .mud-drawer-content {
  padding: 10px 8px !important;
  overflow-y: auto !important;
}

.sidebar-section-title {
  display: block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #6b7280 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  margin: 4px 0 8px 4px !important;
  line-height: 1.2 !important;
}

/* ===== NAV ITEMS ===== */
a.nav-item,
.nav-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 7px 10px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  color: #374151 !important;
  cursor: pointer !important;
  margin-bottom: 2px !important;
  border: none !important;
  text-decoration: none !important;
  transition: background 0.12s !important;
  background: transparent !important;
}

a.nav-item:hover,
.nav-item:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
  text-decoration: none !important;
}

a.nav-item-active,
.nav-item-active,
a.nav-item.active,
.nav-item.active {
  background: var(--moriah-blue-pale) !important;
  color: var(--moriah-blue) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

/* ===== BADGE DO NAV ===== */
.nav-badge {
  background: var(--moriah-badge);
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

/* ===== GRUPO DO NAV (divisor de seção no sidebar) ===== */
.nav-group-label {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #9ca3af !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  padding: 12px 10px 4px !important;
  line-height: 1 !important;
  margin-top: 2px !important;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
/*
 * MudBlazor JS mede o AppBar (56px) e sobrescreve --mud-appbar-height: 56px via inline style
 * no .mud-layout, ignorando nosso :root de 94px.
 * Resultado: padding-top do MudMainContent fica 56px → conteúdo atrás das tabs.
 * Fix: forçamos padding-top = topbar(56px) + tabs(38px) = 94px com !important.
 */
.mud-main-content {
  padding-top: calc(var(--topbar-height) + var(--tabs-height)) !important;
}

.moriah-content {
  background: var(--moriah-content-bg) !important;
  height: 100vh !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Área do @Body — cresce e rola; footer sempre visível abaixo */
.content-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* ===== FOOTER ===== */
.moriah-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin-top: auto;
  border-top: 0.5px solid rgba(0,0,0,0.08);
  background: #ffffff;
  font-size: 11px;
  color: #9ca3af;
}

.footer-copy {
  font-weight: 400;
}

.footer-versions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-version {
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.footer-separator {
  color: #d1d5db;
  font-size: 12px;
}

/* ===== BOTÃO PRIMÁRIO ===== */
.mud-button-filled-primary {
  background-color: var(--moriah-blue) !important;
  text-transform: none !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}

.mud-button-filled-primary:hover {
  background-color: var(--moriah-blue-dark) !important;
}

/* ===== STATUS PILLS ===== */
.status-pendente  { background: #FAEEDA !important; color: #854F0B !important; }
.status-enviado   { background: #EAF3DE !important; color: #3B6D11 !important; }
.status-aprovado  { background: #EAF3DE !important; color: #3B6D11 !important; }
.status-declinado { background: #FCEBEB !important; color: #A32D2D !important; }
.status-cancelado { background: #F1EFE8 !important; color: #5F5E5A !important; }

.status-pill {
  font-size: 10px !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  font-weight: 500 !important;
  display: inline-block !important;
}

/* ===== TABELAS ===== */
.moriah-table-header {
  background: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  padding: 10px 16px;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}

.moriah-table-row {
  padding: 11px 16px;
  border-bottom: 0.5px solid rgba(0,0,0,0.05);
  font-size: 12px;
}

.moriah-table-row:hover {
  background: #f9fafb;
}

/* ===== MUD TABS COMPLETE REGISTRATION ===== */
.tabs-fill .mud-tabs-toolbar,
.tabs-fill .mud-tabs-toolbar-wrapper,
.tabs-fill .mud-tabs-tabbar {
  width: 100% !important;
}

.tabs-fill .mud-tabs-tabbar {
  display: flex !important;
  overflow: hidden !important;
}

.tabs-fill .mud-tabs-tabbar .mud-tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  justify-content: center !important;
}

.tabs-fill .mud-tabs-tabbar .mud-tab .mud-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .modulos-tabs-bar { overflow-x: auto; }
  .moriah-sidebar { display: none !important; }
}

/* ===== LOADER DE INICIALIZAÇÃO ===== */
.moriah-loader {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(24, 95, 165, 0.18) 0%, transparent 65%),
    linear-gradient(160deg, rgba(12, 30, 61, 0.97) 0%, rgba(10, 24, 50, 0.95) 55%, rgba(12, 52, 110, 0.93) 100%);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.moriah-loader__bg-m {
  position: absolute;
  top: -10vh;
  right: -4%;
  height: 120vh;
  width: auto;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

.moriah-loader__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.moriah-loader__tagline {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  letter-spacing: 0.6px;
}

.moriah-loader__frase {
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-align: center;
  max-width: 300px;
  min-height: 22px;
  animation: moriah-frase-in 0.6s ease-out;
}

@keyframes moriah-frase-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.moriah-loader__dots {
  display: flex;
  gap: 10px;
}

.moriah-loader__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--moriah-blue-light);
  animation: moriah-dot-pulse 1.4s infinite ease-in-out;
}

.moriah-loader__dots span:nth-child(2) { animation-delay: 0.22s; }
.moriah-loader__dots span:nth-child(3) { animation-delay: 0.44s; }

@keyframes moriah-dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
  40%           { opacity: 1;    transform: scale(1);    }
}
