.sidebar .nav-link.active { background-color: var(--cor-verde-papello)!important; color: white !important; }
        :root {
            --cor-verde-papello: #84A802;
            --cor-verde-medio: #96CA00;
            --cor-verde-claro: #C5DF56;
            --cor-verde-escuro: #5f7a01;
            --sidebar-bg: #1a1f26;
            --sidebar-bg-hover: #252b35;
            --sidebar-text: #c8cdd3;
            --sidebar-text-muted: #8b939c;
        }

        body {
            font-family: 'Montserrat', sans-serif !important;
        }

        .brand-link {
            background: linear-gradient(135deg, var(--cor-verde-papello), var(--cor-verde-medio)) !important;
        }

        .btn-verde {
            background-color: var(--cor-verde-papello);
            border-color: var(--cor-verde-papello);
            color: white;
        }

        .btn-verde:hover {
            background-color: var(--cor-verde-medio);
            border-color: var(--cor-verde-medio);
            color: white;
        }

        .form-container {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e9ecef;
            margin-bottom: 20px;
        }

        .search-dropdown {
            position: relative;
        }

        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ced4da;
            border-top: none;
            border-radius: 0 0 4px 4px;
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
        }

        .search-result-item {
            padding: 10px 15px;
            cursor: pointer;
            border-bottom: 1px solid #f8f9fa;
            transition: background-color 0.2s;
        }

        .search-result-item:hover {
            background-color: #e9ecef;
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .preview-calculo {
            background: #e7f3ff;
            border: 1px solid #b3d9ff;
            border-radius: 6px;
            padding: 15px;
            margin-top: 15px;
        }

        .badge-multiplo {
            background-color: var(--cor-verde-papello);
            color: white;
            font-size: 0.8rem;
        }

        .table-quantidades {
            font-size: 14px;
        }

        .table-quantidades th {
            background-color: #f8f9fa;
            font-weight: 600;
        }
        .grafico-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  background: #f9f9f9;
  border-radius: 8px 8px 0 0;
}

.grafico-titulo h4 {
  margin: 0;
}

.grafico-filtros {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grafico-filtros input {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.btn-filtrar, .btn-fechar-grafico {
  background: #007bff;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filtrar:hover {
  background: #0056b3;
}

.btn-fechar-grafico {
  background: #dc3545;
}

.btn-fechar-grafico:hover {
  background: #a71d2a;
}

/* ========== Menu lateral EMPO ========== */
.main-sidebar.sidebar-empo {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #14181d 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow-x: visible;
    overflow-y: hidden;
    width: 250px;
    transition: width 0.28s ease, margin-left 0.28s ease;
}

.sidebar-empo .sidebar-rail-toggle {
    position: absolute;
    top: 1.35rem;
    right: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(197, 223, 86, 0.45);
    background: #1e242c;
    color: var(--cor-verde-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
    padding: 0;
    font-size: 0.62rem;
}

.sidebar-empo .sidebar-rail-toggle:hover {
    background: var(--cor-verde-papello);
    border-color: var(--cor-verde-medio);
    color: #fff;
    transform: scale(1.1);
}

.sidebar-empo .sidebar-brand-row {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 1rem 0.85rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    min-width: 0;
    min-height: 72px;
}

.sidebar-empo .brand-link {
    background: transparent !important;
    border-bottom: none !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    text-align: left;
    overflow: hidden;
    min-width: 0;
    flex: 1;
    text-decoration: none !important;
}

.sidebar-empo .brand-link:hover {
    opacity: 0.95;
}

.sidebar-empo .brand-link:hover .brand-icon {
    transform: scale(1.04);
}

.btn-sidebar-toggle-top {
    font-size: 1rem;
    font-weight: 600;
    color: #495057 !important;
    border-radius: 8px;
    padding: 0.35rem 0.65rem !important;
}

.btn-sidebar-toggle-top:hover {
    background: rgba(132, 168, 2, 0.1);
    color: var(--cor-verde-escuro) !important;
}

.sidebar-empo .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cor-verde-papello), var(--cor-verde-medio));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(132, 168, 2, 0.35);
    transition: transform 0.2s ease;
}

.sidebar-empo .brand-text-wrap {
    line-height: 1.2;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-empo .brand-title {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-empo .brand-subtitle {
    display: block;
    color: var(--sidebar-text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-empo .sidebar {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
}

.sidebar-empo .sidebar > nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-empo .sidebar > nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-empo .sidebar > nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-empo .nav-sidebar {
    padding: 0.35rem 0.55rem 0.75rem;
    width: 100%;
    overflow-x: hidden;
}

.sidebar-empo .nav-header {
    color: var(--sidebar-text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.9rem 0.7rem 0.35rem;
    margin-top: 0.1rem;
}

.sidebar-empo .nav-header:first-child {
    margin-top: 0;
    padding-top: 0.5rem;
}

.sidebar-empo .nav-sidebar > .nav-item {
    margin-bottom: 3px;
    max-width: 100%;
}

.sidebar-empo .nav-sidebar .nav-link {
    color: var(--sidebar-text);
    border-radius: 10px;
    padding: 0.62rem 0.7rem;
    font-weight: 500;
    font-size: 0.87rem;
    transition: background 0.2s ease, color 0.2s ease, padding 0.2s ease;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-empo .nav-sidebar .nav-link p {
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s ease;
}

.sidebar-empo .nav-sidebar .nav-link .nav-icon {
    width: 1.3rem;
    flex-shrink: 0;
    text-align: center;
    margin-right: 0.6rem;
    font-size: 0.95rem;
    opacity: 0.92;
}

.sidebar-empo .nav-sidebar .nav-link:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
}

.sidebar-empo .nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(132, 168, 2, 0.28), rgba(150, 202, 0, 0.1)) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--cor-verde-papello);
}

.sidebar-empo .nav-sidebar .nav-link.active .nav-icon {
    color: var(--cor-verde-claro);
    opacity: 1;
}

.sidebar-empo .sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 0.6rem 0.65rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sidebar-empo .sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    min-width: 0;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.2s ease;
}

.sidebar-empo .sidebar-user:hover {
    background: rgba(220, 53, 69, 0.12);
    color: #fff;
}

.sidebar-empo .sidebar-user:hover .sidebar-user-role {
    color: #f5a8b0;
}

.sidebar-empo .sidebar-user-icon {
    margin-left: auto;
    color: var(--sidebar-text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-empo .sidebar-user:hover .sidebar-user-icon {
    opacity: 1;
    color: #f5a8b0;
}

.sidebar-empo .sidebar-user-info {
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.sidebar-empo .sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cor-verde-escuro), var(--cor-verde-papello));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.sidebar-empo .sidebar-user-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-empo .sidebar-user-role {
    color: var(--sidebar-text-muted);
    font-size: 0.67rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

/* Menu recolhido (mini) */
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo {
    overflow: hidden !important;
    width: 4.6rem !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .brand-text-wrap,
body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar-user-info,
body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar-user-icon {
    display: none !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-header {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-sidebar > .nav-item {
    margin-bottom: 2px;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar-brand-row {
    justify-content: center;
    padding: 0.85rem 0.35rem 0.65rem;
    min-height: 64px;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .brand-link {
    justify-content: center;
    flex: 0;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar > nav {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0 !important;
    overflow: hidden !important;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-sidebar {
    padding: 0.2rem 0.3rem 0.35rem;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-sidebar .nav-link {
    justify-content: center;
    padding: 0.55rem 0.35rem;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-sidebar .nav-link p {
    display: none;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-sidebar .nav-link .nav-icon {
    margin-right: 0;
    font-size: 1.05rem;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .nav-sidebar .nav-link.active {
    box-shadow: none;
    background: rgba(132, 168, 2, 0.22) !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar {
    overflow: hidden !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar-footer {
    flex-shrink: 0;
    padding: 0.35rem 0.35rem 0.5rem;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar-user {
    justify-content: center;
    padding: 0.4rem;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar-rail-toggle {
    right: -13px;
}

body.sidebar-mini.sidebar-collapse .sidebar-empo .sidebar > nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Transição suave do conteúdo principal */
body.sidebar-mini .content-wrapper,
body.sidebar-mini .main-footer {
    transition: margin-left 0.28s ease;
}

/* ========== Página de login ========== */
body.login-page-empo {
    min-height: 100vh;
    margin: 0;
    font-family: 'Montserrat', sans-serif !important;
    background: #0f1419;
    overflow-x: hidden;
}

.login-page-empo .login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-page-empo .login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(150, 202, 0, 0.25), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(132, 168, 2, 0.18), transparent 40%),
        linear-gradient(145deg, #1a2210 0%, #0f1419 55%, #0a0d12 100%);
    overflow: hidden;
}

.login-page-empo .login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
}

.login-page-empo .login-hero-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-page-empo .login-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(132, 168, 2, 0.15);
    border: 1px solid rgba(197, 223, 86, 0.25);
    color: var(--cor-verde-claro);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.login-page-empo .login-hero h1 {
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.login-page-empo .login-hero p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.login-page-empo .login-hero-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-page-empo .login-hero-features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
}

.login-page-empo .login-hero-features i {
    color: var(--cor-verde-claro);
    width: 1.1rem;
}

.login-page-empo .login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f4f6f9;
}

.login-page-empo .login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 2rem 2rem 1.75rem;
    box-shadow: 0 20px 50px rgba(15, 20, 25, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-page-empo .login-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--cor-verde-papello), var(--cor-verde-medio));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 20px rgba(132, 168, 2, 0.3);
}

.login-page-empo .login-card h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a1f26;
    margin-bottom: 0.35rem;
}

.login-page-empo .login-card .login-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-page-empo .login-field {
    margin-bottom: 1rem;
}

.login-page-empo .login-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-page-empo .login-input-wrap {
    position: relative;
}

.login-page-empo .login-input-wrap .login-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.login-page-empo .login-input-wrap .form-control {
    padding-left: 2.65rem;
    height: 48px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}

.login-page-empo .login-input-wrap.has-toggle .form-control {
    padding-right: 3rem;
}

.login-page-empo .login-input-wrap .form-control:focus {
    border-color: var(--cor-verde-papello);
    box-shadow: 0 0 0 3px rgba(132, 168, 2, 0.15);
    background: #fff;
}

.login-page-empo .login-toggle-password {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    padding: 0;
    z-index: 2;
}

.login-page-empo .login-toggle-password:hover,
.login-page-empo .login-toggle-password.is-active {
    color: var(--cor-verde-papello);
    background: rgba(132, 168, 2, 0.08);
}

.login-page-empo .login-toggle-password:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(132, 168, 2, 0.2);
}

.login-page-empo .btn-login-empo {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cor-verde-papello), var(--cor-verde-medio));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 20px rgba(132, 168, 2, 0.28);
}

.login-page-empo .btn-login-empo:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(132, 168, 2, 0.35);
    color: #fff;
}

.login-page-empo .alert-login {
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    border: none;
    background: #fde8ea;
    color: #842029;
}

.login-page-empo .login-footer-note {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: #adb5bd;
}

@media (max-width: 991px) {
    .login-page-empo .login-shell {
        grid-template-columns: 1fr;
    }

    .login-page-empo .login-hero {
        display: none;
    }

    .login-page-empo .login-panel {
        min-height: 100vh;
        background:
            radial-gradient(circle at top, rgba(132, 168, 2, 0.12), transparent 50%),
            #f4f6f9;
    }
}

/* Navbar superior */
.main-header.navbar {
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.main-header .btn-outline-success {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.main-header .nav-link {
    font-size: 0.9rem;
    color: #495057;
}
/* === Correção do menu recolhido (glitch do AdminLTE no hover) === */

/* 1. Impede o menu de "abrir sozinho" quando o mouse passa por cima */
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover {
  width: 4.6rem !important;
}

/* 2. Mantém os textos escondidos mesmo com o mouse em cima */
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover .brand-text-wrap,
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover .sidebar-user-info,
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover .sidebar-user-icon,
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover .nav-header,
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover .nav-sidebar .nav-link p {
  display: none !important;
}

/* 3. Mantém os ícones centralizados no hover (sem esticar) */
body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo:hover .nav-sidebar .nav-link {
  justify-content: center;
  padding: 0.55rem 0.35rem;
}
/* === Corrige o botão de recolher/expandir que fica cortado === */
.main-sidebar.sidebar-empo {
  overflow-x: visible !important;
}

body.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-empo {
  overflow-x: visible !important;
  overflow-y: hidden !important;
}

/* Garante que o botão apareça inteiro por cima de tudo */
.sidebar-empo .sidebar-rail-toggle {
  z-index: 1200 !important;
}