﻿:root {
  --approach-nav-bg: #072a52;
  --approach-nav-bg-2: #041b39;
  --approach-nav-solid: #06264a; /* cor única para topo + lateral */
  --approach-nav-active: #0b4e93;
  --approach-text-light: #eaf3ff;
}

html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
}

/* Correção para ocupar toda a largura disponível */
html,
body {
  width: 100%;
  overflow-x: hidden;
}

.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-body {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  position: relative;
  min-height: calc(100vh - 110px);
  background-image: url('/images/background.png'), url('/images/backgroud.png') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #0a3d70;
}

.page-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(3, 15, 34, 0.58), rgba(10, 61, 112, 0.42));
  pointer-events: none;
}

.page-content-wrap {
  position: relative;
  z-index: 1;
  padding: 1rem;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}

/* ======================
   LOGIN
   ====================== */
.login-page {
  min-height: 100vh;
  background-image: url('/images/login-duplas.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(0, 0, 0, 0.28), rgba(10, 61, 112, 0.52));
}

.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 3rem;
}

.login-panel-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-panel-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.login-logo {
  width: 320px;
  max-width: 92%;
  height: auto;
  object-fit: contain;
  display: block;
}

.login-form-label {
  color: #fff;
  font-weight: 600;
}

.login-fields-group {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
}

.login-panel-card .form-control {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
}

.login-panel-card .btn-primary {
  border-radius: 10px;
}

/* LOGIN - ajuste visual campo Senha */
.login-panel-card .input-group .form-control {
  background: #ffffff !important;
  border-right: 0;
}

.login-panel-card .input-group .form-control:focus {
  background: #ffffff !important;
  box-shadow: none;
}

.login-password-toggle {
  background: #ffffff !important;
  border: 1px solid #ced4da !important;
  border-left: 0 !important;
  color: #0d6efd !important;
}

.login-password-toggle:hover,
.login-password-toggle:focus,
.login-password-toggle:active {
  background: #ffffff !important;
  color: #0a58ca !important;
  box-shadow: none !important;
}

.login-password-toggle i {
  color: inherit;
}

@media (max-width: 991.98px) {
  .login-screen {
    padding: 1.25rem;
  }

  .login-panel-wrapper {
    max-width: 460px;
  }
}

/* ======================
   APP SHELL
   ====================== */
/* Sidebar esquerda */
.sidebar {
  flex: 0 0 250px;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--approach-nav-solid) !important;
  color: var(--approach-text-light);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-logo {
  width: 100%;
  max-width: 170px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Logo da sede (topo esquerdo) */
.sidebar-sede-logo {
  max-height: 67px; 
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.sidebar-nav {
  padding: 0.5rem 0.75rem;
}

/* menu dinâmico (MENmenu / PERpermissao) */
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-level-0 {
  margin-top: 0.25rem;
}

.sidebar-level-1,
.sidebar-level-2,
.sidebar-level-3 {
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-item {
  margin-bottom: 0.2rem;
}

.menu-node {
  width: 100%;
}

.menu-summary {
  cursor: pointer;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  list-style: none;
  user-select: none;
  color: var(--approach-text-light);
}

.menu-summary::-webkit-details-marker {
  display: none;
}

.menu-summary::after {
  content: "▸";
  float: right;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.menu-node[open] > .menu-summary::after {
  transform: rotate(90deg);
}

.menu-link {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--approach-text-light);
}

.menu-link:hover,
.menu-summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.menu-link.active {
  background: var(--approach-nav-active);
  color: #fff;
  font-weight: 600;
}

.menu-text-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-icon {
  width: 1rem;
  min-width: 1rem;
  text-align: center;
  color: #fff;
}

.menu-empty {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.9rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Logo do sistema (rodapé esquerdo) */
.sidebar-footer-logo {
  max-height: 55px; 
  width: auto;
  opacity: 0.92;
  object-fit: contain;
}

.app-shell.sidebar-collapsed .sidebar {
  flex: 0 0 110px;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  min-height: 52px;
  padding: 0.5rem;
}

.app-shell.sidebar-collapsed .sidebar-brand-logo {
  max-width: 78px;
}

.app-shell.sidebar-collapsed .menu-text {
  display: none;
}

.app-shell.sidebar-collapsed .menu-summary::after {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-level-1,
.app-shell.sidebar-collapsed .sidebar-level-2,
.app-shell.sidebar-collapsed .sidebar-level-3 {
  display: none;
}

.app-shell.sidebar-collapsed .menu-summary,
.app-shell.sidebar-collapsed .menu-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.55rem;
}

.app-shell.sidebar-collapsed .sidebar-sede-logo {
  max-height: 53px;
}

.app-shell.sidebar-collapsed .sidebar-footer-logo {
  max-height: 37px; /* +20% sobre 31px */
}

.topbar {
  position: relative;
  z-index: 2000;
  padding: 0.65rem 1rem;
  background: var(--approach-nav-solid) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar,
.topbar strong,
.topbar .btn,
.topbar .btn i,
.topbar .topbar-action-link {
  color: #fff !important;
}

.topbar .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.topbar .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.8);
}

.topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar-action-link {
  text-decoration: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.95;
}

.notification-dot {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #ff3b30;
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
}

.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar .dropdown {
  position: relative;
}

.topbar .dropdown-menu {
  z-index: 2100;
}

.dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
}

/* Barra secundária */
.topbar-secondary {
  background: var(--approach-nav-solid) !important;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-secondary .btn {
  border-radius: 8px;
}

/* Área principal com imagem de fundo */
.page-body {
  position: relative;
  flex: 1;
  min-height: calc(100vh - 110px);
  background-image: url('/images/background.png'), url('/images/backgroud.png') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #0a3d70;
}

.page-body-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(3, 15, 34, 0.58), rgba(10, 61, 112, 0.42));
}

.page-content-wrap {
  position: relative;
  z-index: 1;
  padding: 1rem;
}

.sidebar-sede-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
}

.sidebar-sede-nome {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 120px;
}

.app-shell.sidebar-collapsed .sidebar-sede-nome {
  display: none;
}

/* Labels do formulário de Sede com contraste no fundo escuro */
.sede-form .form-label,
.sede-form .form-check-label,
.sede-form .form-text {
  color: #ffffff;
}

/* Padrão visual CRUD: texto claro sobre fundo escuro */
.crud-page {
  color: #ffffff;
}

.crud-page .form-label,
.crud-page .form-check-label,
.crud-page .form-text,
.crud-page p,
.crud-page h1,
.crud-page h2,
.crud-page h3,
.crud-page h4,
.crud-page h5,
.crud-page h6 {
  color: #ffffff;
}

.crud-page .card {
  background: rgba(5, 26, 51, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.crud-page .table {
  color: #ffffff;
}

.crud-page .table > :not(caption) > * > * {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}

.crud-page .nav-tabs .nav-link {
  color: #dcecff;
}

.crud-page .nav-tabs .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Títulos padrão de páginas CRUD/listagem */
.page-title {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0;
}

.page-subtitle {
  color: rgba(255, 255, 255, 0.82);
}

/* Overlay de fundo */
.page-body-overlay {
  z-index: 0;
}

/* Conteúdo principal sem stacking context agressivo */
.page-content-wrap {
  position: relative;
  padding: 1rem;
  z-index: auto;
}

/* Modal sempre acima */
.modal {
  z-index: 3000 !important;
}

.modal-backdrop {
  z-index: 2990 !important;
}