/* Gestão FAUEL — tema. As cores ficam todas aqui (verde do logo FAUEL). */
:root {
  --brand: #2e7d32;
  --brand-dark: #1b5e20;
  --brand-light: #e8f5e9;
  --brand-accent: #66bb6a;
  --topbar-bg: #2e7d32;
  --sidebar-bg: #1d3a20;
  --sidebar-bg-hover: rgba(255, 255, 255, .06);
  --sidebar-bg-active: rgba(102, 187, 106, .16);
  --sidebar-text: #c8d6c9;
  --sidebar-muted: #7f9a82;
  --app-bg: #f4f6f4;
  --borda: #e3e8e4;
  --topbar-h: 58px;

  --bs-primary: #2e7d32;
  --bs-primary-rgb: 46, 125, 50;
  --bs-link-color: #2e7d32;
  --bs-link-color-rgb: 46, 125, 50;
  --bs-link-hover-color: #1b5e20;
  --bs-link-hover-color-rgb: 27, 94, 32;
}

body {
  background: var(--app-bg);
  color: #1f2a21;
}

/* Bootstrap no tom da marca */
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: 46, 125, 50;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-focus-shadow-rgb: 46, 125, 50;
}
.text-primary { color: var(--brand) !important; }
.text-bg-primary, .bg-primary { background-color: var(--brand) !important; color: #fff !important; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus, .form-control:focus, .form-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 .2rem rgba(46, 125, 50, .18);
}
.card {
  border: 1px solid var(--borda);
  border-radius: .75rem;
  box-shadow: 0 1px 3px rgba(16, 40, 20, .05);
}
.card > .card-header {
  background: #fff;
  border-bottom: 1px solid var(--borda);
  padding: .9rem 1.1rem;
  border-radius: .75rem .75rem 0 0;
}
.card-titulo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  margin: 0;
  font-size: 1rem;
}
.card-titulo .bi { color: var(--brand); }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2e7d32 0%, #1d3a20 100%);
  padding: 1rem;
}
.login-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}
.login-logo { display: block; max-height: 64px; margin: 0 auto 1rem; }
.login-title { font-size: 1.4rem; font-weight: 700; text-align: center; }
.login-subtitle { color: #6b7a6d; text-align: center; margin-bottom: 1.5rem; font-size: .9rem; }
.login-footer { text-align: center; color: #9aa79b; font-size: .8rem; margin-top: 1.5rem; }

/* ---------- Estrutura: barra superior + menu lateral ---------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  color: #fff;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.app-topbar .marca {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}
.app-topbar .marca img {
  height: 36px;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
}
.app-topbar .btn-topo {
  color: #fff;
  border: 0;
  background: transparent;
  padding: .35rem .6rem;
  border-radius: .5rem;
}
.app-topbar .btn-topo:hover, .app-topbar .btn-topo[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }

.app-wrapper { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: .5rem 0 1rem;
}
.app-sidebar .nav-section-title {
  color: var(--sidebar-muted);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .08em;
  padding: 1rem 1.25rem .4rem;
}
.app-sidebar .nav-link {
  color: var(--sidebar-text);
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .93rem;
  border-left: 3px solid transparent;
}
.app-sidebar .nav-link:hover { background: var(--sidebar-bg-hover); color: #fff; }
.app-sidebar .nav-link.active {
  background: var(--sidebar-bg-active);
  color: #fff;
  border-left-color: var(--brand-accent);
  font-weight: 600;
}
.app-content { flex: 1; min-width: 0; }
.app-main { padding: 1.5rem 1.75rem 3rem; max-width: 1500px; }
.sb-overlay { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: var(--topbar-h);
    z-index: 1050;
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .app-sidebar.open { transform: translateX(0); }
  .sb-overlay.open {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1040;
  }
  .app-main { padding: 1rem; }
}

/* ---------- Cabeçalho das páginas ---------- */
.trilha { font-size: .9rem; margin-bottom: .25rem; }
.trilha a { text-decoration: none; }
.trilha .bi { margin-right: .25rem; }
.trilha .sep { color: #9aa79b; margin: 0 .4rem; }
.titulo-pagina {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
}
.titulo-pagina .bi { color: var(--brand); }
.subtitulo-pagina { color: #6b7a6d; margin-top: .2rem; }

/* ---------- Avatar com iniciais ---------- */
.avatar {
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-inativo { background: #9aa79b; }

/* ---------- Painel de telas (funcionário / perfil) ---------- */
.painel-telas .secao-area {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #eef2ef;
  border-top: 1px solid var(--borda);
  border-bottom: 1px solid var(--borda);
  padding: .55rem 1.1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
  font-weight: 600;
  color: #4b5a4e;
}
.painel-telas .secao-area:first-child { border-top: 0; }
.painel-telas .linha-tela {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.1rem;
  border-bottom: 1px solid #eef1ee;
}
.painel-telas .linha-tela:hover { background: #fafcfa; }
.painel-telas .linha-tela.tem-acesso { background: #f6fbf6; }
.painel-telas .icone-tela { color: #6b7a6d; width: 1.25rem; text-align: center; }
.painel-telas .nome-tela { font-weight: 500; }
.painel-telas .chave-tela { font-size: .75rem; color: #9aa79b; }
.painel-telas .controles { margin-left: auto; display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.painel-telas .form-check { margin: 0; min-height: 0; }
.selo-perfil {
  font-size: .72rem;
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid #c8e6c9;
  border-radius: 1rem;
  padding: .1rem .55rem;
  white-space: nowrap;
}
.selo-perfil.inativo { background: #f1f3f1; color: #8a968c; border-color: #e0e4e0; }

/* Lista de perfis (cartão da esquerda) */
.item-perfil {
  display: flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid var(--borda);
  border-radius: .5rem;
  padding: .6rem .8rem;
  margin-bottom: .5rem;
  cursor: pointer;
}
.item-perfil:hover { background: #fafcfa; }
.item-perfil.marcado { border-color: #a5d6a7; background: #f6fbf6; }
.item-perfil .form-check-input { margin: 0; flex-shrink: 0; }

/* Listas clicáveis */
.linha-clicavel { cursor: pointer; }
.min-w-0 { min-width: 0; }

/* ---------- Painel do funcionário (atalhos) ---------- */
.area-card .card-header { background: #fff; }
.area-card .list-group-item { border-left: 0; border-right: 0; }
.area-card .list-group-item:last-child { border-bottom: 0; }

/* ---------- Notificações ---------- */
.sino-contador {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--topbar-bg);
}
.menu-notificacoes { width: 340px; max-width: 92vw; overflow: hidden; }
.menu-notificacoes .dropdown-item { white-space: normal; }
.item-nao-lido { background: #f2f9f2; }
.icone-notificacao {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.icone-notificacao.pequeno { width: 30px; height: 30px; font-size: .9rem; }
.ponto-nao-lido {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  align-self: center;
}
.nav-pills .nav-link.active { background: var(--brand); }
.nav-pills .nav-link { color: var(--brand-dark); }
