/* ============================================================
   SIGREI v5 - Estilos Globais
   ============================================================
   Arquivo CSS unificado. NÃO use estilos inline nas views.
   Todo CSS deve estar aqui ou em arquivos modulares.
   ============================================================ */

/* ============================================================
   1. VARIÁVEIS CSS (Design Tokens)
   ============================================================ */
:root {
    /* Cores Primárias — família "Musgo" (identidade SIGREI) */
    --primary: #375A3B;      /* musgo-700 — títulos, marca */
    --secondary: #4C8C93;    /* água-500 — links, foco, info */
    --dark: #24402A;         /* musgo-800 — sidebar, contraste máximo */
    --light: #EEF3EA;        /* musgo-50 — fundos suaves, tags */
    --accent: #47714C;       /* musgo-600 — ação primária */
    --accent-soft: #9DBE9C;  /* musgo-300 — hover/estados leves sobre fundo escuro */

    /* Cores de Apoio */
    --success: #47714C;      /* musgo-600 */
    --info: #4C8C93;         /* água-500 */
    --warning: #C9922E;      /* âmbar — atenção/pendência */
    --danger: #B5482F;       /* tijolo — alerta/perigo */
    --purple: #7C6A93;       /* ameixa suave — harmoniza com a paleta */
    --barro: #C97B4A;        /* terracota — acento pontual (uso moderado) */
    --barro-light: #F3E1D2;

    /* Tons claros — fundo de alerts/badges suaves, com par de texto/borda acessível */
    --success-light: #EEF3EA; --success-text: #375A3B; --success-border: #C3D9C0;
    --info-light: #DCEDEF;    --info-text: #255358;    --info-border: #B9DBDF;
    --warning-light: #FBEED9; --warning-text: #7A5A17; --warning-border: #EFD9A8;
    --danger-light: #F6DED8;  --danger-text: #7A2E1D;  --danger-border: #EFC2B4;

    /* Tons de Cinza — leve viés esverdeado em vez de cinza puro */
    --gray-100: #F4F5EF;
    --gray-200: #E7EAE0;
    --gray-300: #D7DCCE;
    --gray-400: #C2C9B6;
    --gray-500: #A3AC95;
    --gray-600: #7C8570;
    --gray-700: #5B634F;
    --gray-800: #3A4033;

    /* Layout */
    --sidebar-width: 260px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(36, 64, 42, 0.08);

    /* Retinta o Bootstrap na origem: .bg-primary, .text-primary, .border-primary,
       .bg-opacity-* e afins são todos montados pelo Bootstrap 5.3 em cima destas
       variáveis com rgba(var(--bs-primary-rgb), opacidade) — sobrescrever aqui
       (em vez de sobrescrever cada classe .bg-primary com !important) é o que
       mantém os círculos de ícone com "bg-opacity-10" funcionando de verdade. */
    --bs-primary: #47714C;      --bs-primary-rgb: 71, 113, 76;
    --bs-secondary: #5B634F;    --bs-secondary-rgb: 91, 99, 79;
    --bs-success: #47714C;      --bs-success-rgb: 71, 113, 76;
    --bs-info: #4C8C93;         --bs-info-rgb: 76, 140, 147;
    --bs-warning: #C9922E;      --bs-warning-rgb: 201, 146, 46;
    --bs-danger: #B5482F;       --bs-danger-rgb: 181, 72, 47;
    --bs-light: #EEF3EA;        --bs-light-rgb: 238, 243, 234;
    --bs-dark: #24402A;         --bs-dark-rgb: 36, 64, 42;
    --bs-body-color: #2A2F26;
    --bs-link-color: var(--secondary);
    --bs-link-color-rgb: 76, 140, 147;
    --bs-link-hover-color: var(--primary);
    --bs-focus-ring-color: rgba(71, 113, 76, .25);
}

/* ============================================================
   2. RESET E ESTILOS BASE
   ============================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-100);
    color: #333;
    overflow-x: hidden;
    font-size: 14px;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

/* Escala tipográfica única — as views usam h1/h2/h3/h4 misturados (às vezes
   com utilitário .h3, às vezes sem) para o mesmo papel visual ("título de
   página", "título de card"). Fixar o tamanho por nível, em vez de deixar
   cada view escolher a tag e herdar o valor padrão do Bootstrap, é o que
   garante que o mesmo papel sempre pareça do mesmo tamanho. */
h1, .h1 { font-size: 1.75rem; font-weight: 700; }
h2, .h2 { font-size: 1.5rem;  font-weight: 700; }
h3, .h3 { font-size: 1.3rem;  font-weight: 600; }
h4, .h4 { font-size: 1.15rem; font-weight: 600; }
h5, .h5 { font-size: 1rem;    font-weight: 600; }
h6, .h6 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6 {
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================================
   3. LAYOUT PRINCIPAL (Wrapper, Sidebar, Main)
   ============================================================ */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - versão unificada (substitui estilos inline do sidebar.php) */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sidebar-logo-container {
    width: 190px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.sidebar-brand:hover .sidebar-logo {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.sidebar-toggle {
    position: absolute;
    right: 10px;
    top: 10px;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-body .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-body .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--accent-soft);
}

.sidebar-body .nav-link.active {
    background: rgba(0,0,0,0.3);
    color: #fff;
    border-left-color: var(--accent);
}

.sidebar-body .nav-link i {
    width: 20px;
    text-align: center;
}

.nav-section {
    padding: 15px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

.text-light-50 {
    color: rgba(255,255,255,0.5);
}

/* Sidebar - versão antiga (painel.php) */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    color: #eee;
    padding: 15px 20px;
    display: block;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(0,0,0,0.3);
    color: white;
    border-left: 3px solid var(--accent);
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin 0.3s;
}

/* Header (topo, fora da sidebar) */
.header {
    border-bottom: 1px solid var(--gray-200);
}

.header h4 {
    color: var(--primary);
    font-weight: 600;
}

.header #dropdownMenuButton {
    border-color: var(--gray-300);
    color: var(--primary);
}

.header #dropdownMenuButton:hover,
.header #dropdownMenuButton:focus {
    background-color: var(--light);
    border-color: var(--accent);
    color: var(--accent);
}

.header .dropdown-item:hover,
.header .dropdown-item:focus {
    background-color: var(--light);
    color: var(--accent);
}

/* ============================================================
   4. PÁGINA DE LOGIN
   ============================================================ */
.vh-100 {
    min-height: 100vh;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-box {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 30px;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto 10px;
    display: block;
}

.login-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.footer-text {
    text-align: center;
    margin-top: 20px;
    color: var(--gray-600);
    font-size: 0.85rem;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
}

.forgot-password {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* ============================================================
   5. FORMULÁRIOS
   ============================================================ */
.form-control {
    padding: 12px;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(76, 140, 147, 0.2);
}

.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(76, 140, 147, 0.2);
}

/* Checkbox/switch marcado — o Bootstrap fixa #0d6efd (azul) direto no CSS
   compilado, não via variável, então precisa de override explícito aqui */
.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(76, 140, 147, 0.2);
}

.form-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-control-password {
    padding: 12px;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    font-size: 0.95rem;
    width: 100%;
}

.form-control-password:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(76, 140, 147, 0.2);
}

.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-600);
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--secondary);
}

/* ============================================================
   6. BOTÕES
   ============================================================ */
.btn-login {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    width: 100%;
    margin-top: 15px;
    color: white;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border: none;
}

.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, var(--danger), #8A3722);
    color: white;
}

.btn-outline-secondary { border-color: var(--gray-500); color: var(--gray-700); }
.btn-outline-secondary:hover { background-color: var(--gray-700); border-color: var(--gray-700); color: #fff; }

.btn-outline-success { border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background-color: var(--success); border-color: var(--success); color: #fff; }

.btn-outline-info { border-color: var(--info); color: var(--info); }
.btn-outline-info:hover { background-color: var(--info); border-color: var(--info); color: #fff; }

.btn-outline-warning { border-color: var(--warning); color: #A87423; }
.btn-outline-warning:hover { background-color: var(--warning); border-color: var(--warning); color: #3A2C0C; }

.btn-outline-dark { border-color: var(--dark); color: var(--dark); }
.btn-outline-dark:hover { background-color: var(--dark); border-color: var(--dark); color: #fff; }

/* Paginação — o Bootstrap fixa a página ativa em azul (#0d6efd) direto no
   CSS compilado, não via variável ligada a --bs-primary */
.pagination {
    --bs-pagination-active-bg: var(--accent);
    --bs-pagination-active-border-color: var(--accent);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(76, 140, 147, 0.2);
}

/* Reskin dos botões semânticos do Bootstrap (btn-secondary/success/info/warning/danger)
   para usar a paleta SIGREI em vez das cores de fábrica do Bootstrap */
.btn-secondary {
    background-color: var(--gray-700);
    border-color: var(--gray-700);
}
.btn-secondary:hover {
    background-color: var(--gray-800);
    border-color: var(--gray-800);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
}
.btn-success:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-info {
    background-color: var(--info);
    border-color: var(--info);
    color: #fff;
}
.btn-info:hover {
    background-color: #3A6D73;
    border-color: #3A6D73;
    color: #fff;
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #3A2C0C;
}
.btn-warning:hover {
    background-color: #A87423;
    border-color: #A87423;
    color: #fff;
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover {
    background-color: #8A3722;
    border-color: #8A3722;
}

.btn-action {
    min-width: 100px;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.btn-action i {
    font-size: 1.1rem;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-lg-enhanced {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 10px;
    font-weight: 500;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius) !important;
    padding: 0;
    margin: 0 4px;
}

.btn-icon:hover {
    transform: scale(1.08);
}

.btn-icon i {
    font-size: 15px;
}

.btn-amber {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #333 !important;
    transition: all 0.3s ease;
}

.btn-amber:hover {
    background-color: #A87423;
    border-color: #A87423;
    transform: translateY(-2px);
}

.btn-residuos-antigos {
    background-color: var(--gray-600);
    border-color: var(--gray-600);
    transition: all 0.3s ease;
}

.btn-residuos-antigos:hover {
    background-color: var(--gray-800);
    border-color: var(--gray-800);
    transform: translateY(-2px);
}

.btn-group .btn {
    margin-right: 8px;
    border-radius: var(--border-radius);
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.export-btn {
    min-width: 150px;
}

/* ============================================================
   7. CARDS
   ============================================================ */
.card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 24px;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Padrão neutro por definição: card-header simples (sem bg-* explícito) usa
   fundo claro + título escuro, para nunca colidir com bg-white/bg-light/sem-classe.
   Cabeçalhos que querem a cor de marca continuam pedindo isso explicitamente
   via "bg-primary text-white" etc — essas classes do Bootstrap têm mais
   especificidade (duas classes) e vencem esta regra normalmente. */
.card-header {
    background: var(--light);
    color: var(--primary);
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
}

.card-header i {
    color: inherit;
}

.config-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.history-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.activity-card {
    border-radius: 10px;
    border-left: 3px solid;
    transition: all 0.3s;
}

.activity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.filter-card {
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-login { border-left-color: var(--secondary); }
.card-registro { border-left-color: var(--accent); }
.card-auditoria { border-left-color: var(--warning); }
.card-perfil { border-left-color: var(--purple); }

.stat-card {
    border-left: 4px solid var(--accent);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.info-card {
    border-left: 4px solid var(--accent);
    transition: all 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* ============================================================
   8. TABELAS
   ============================================================ */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table-hover tbody tr {
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover {
    background-color: rgba(71, 113, 76, 0.06);
    transform: translateX(2px);
}

.table thead th {
    background-color: var(--gray-100);
    font-weight: 600;
    color: var(--primary);
}

/* ============================================================
   9. BADGES
   ============================================================ */
.badge {
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.badge-normal {
    background-color: rgb(207, 205, 200);
    border-color: rgb(53, 51, 46);
    color: #333 !important;
    transition: all 0.3s ease;
}

.badge-controlado {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #333 !important;
    transition: all 0.3s ease;
}

.badge-insert { background-color: var(--success); }
.badge-update { background-color: var(--warning); color: #212529; }
.badge-delete { background-color: var(--danger); }

/* Reskin dos utilitários de cor do Bootstrap (bg-*, text-*, border-*, alert-*)
   usados nas 45 views para status, badges e mensagens de feedback.
   Feito via variáveis --bs-*-rgb (não por !important direto) porque o
   Bootstrap 5.3 monta bg-primary/text-primary/bg-opacity-10 etc. em cima
   dessas variáveis com rgba() — sobrescrever a cor "sólida" direto quebra
   os círculos de ícone com bg-opacity-10 (ícone some por cima do próprio
   fundo). Isso é definido em :root, ver seção 1. */
.text-warning  { color: #A87423 !important; } /* ajuste de contraste — --bs-warning puro é claro demais como texto */
.bg-warning    { color: #3A2C0C !important; } /* badge/card-header com fundo âmbar precisam de texto escuro, não branco (contraste) */

.alert { border-width: 1px; border-style: solid; border-radius: var(--border-radius); }
.alert-success { background-color: var(--success-light); border-color: var(--success-border); color: var(--success-text); }
.alert-info     { background-color: var(--info-light); border-color: var(--info-border); color: var(--info-text); }
.alert-warning  { background-color: var(--warning-light); border-color: var(--warning-border); color: var(--warning-text); }
.alert-danger   { background-color: var(--danger-light); border-color: var(--danger-border); color: var(--danger-text); }
.alert .alert-link { font-weight: 600; text-decoration: underline; }

/* ============================================================
   10. TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 40px;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    z-index: 1;
}

.timeline-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
}

.timeline-item-login:before { background-color: var(--secondary); }
.timeline-item-registro:before { background-color: var(--accent); }
.timeline-item-auditoria:before { background-color: var(--warning); }
.timeline-item-perfil:before { background-color: var(--purple); }

/* ============================================================
   11. DETALHES (Detail Row)
   ============================================================ */
.detail-row {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    flex: 0 0 35%;
    font-weight: 600;
    color: #555;
}

.detail-value {
    flex: 1;
    color: #333;
}

/* ============================================================
   13. FILTROS
   ============================================================ */
.filtro-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.filtro-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.filtro-container .col-filtro {
    min-width: 120px;
    flex: 1 1 0;
    padding-right: 8px;
    padding-left: 8px;
}

.filtro-container .row {
    display: flex;
    flex-wrap: nowrap;
    margin-right: -8px;
    margin-left: -8px;
}

/* ============================================================
   14. BOTÃO VOLTAR AO TOPO
   ============================================================ */
.btn-topo {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-topo.visible {
    opacity: 1;
    transform: scale(1);
}

.btn-topo:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.btn-topo i {
    transition: transform 0.3s ease;
}

.btn-topo:hover i {
    transform: translateY(-3px);
}

/* ============================================================
   15. CALENDÁRIO
   ============================================================ */
#calendar {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    min-height: 400px;
}

.fc .fc-button {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border: none;
    color: white;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 500;
    text-transform: capitalize;
    transition: all 0.2s;
}

/* ============================================================
   16. INPUT GROUP
   ============================================================ */
.input-group-text {
    background-color: var(--gray-100);
    border-right: none;
}

.form-select, .form-control {
    border-left: none;
    padding-left: 5px;
}

/* ============================================================
   17. PROGRESS BARS
   ============================================================ */
.progress {
    height: 8px;
    background-color: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.progress-bar.bg-success { background-color: var(--success) !important; }
.progress-bar.bg-info { background-color: var(--info) !important; }
.progress-bar-75 { width: 75%; }
.progress-bar-60 { width: 60%; }

/* ============================================================
   18. PERFIL
   ============================================================ */
.profile-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    background-color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 48px;
    color: var(--gray-600);
}

/* ============================================================
   19. BACKGROUNDS
   ============================================================ */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--dark));
}

.bg-purple {
    background-color: var(--purple) !important;
    color: white !important;
}

.btn-purple {
    background-color: var(--purple) !important;
    color: white !important;
    border-color: var(--purple) !important;
}

.btn-purple:hover,
.btn-purple:focus,
.btn-purple:active {
    background-color: #5F4E73 !important;
    border-color: #5F4E73 !important;
    color: white !important;
}

.btn-purple:active:focus {
    box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.5) !important;
}

.border-purple {
    border-color: var(--purple) !important;
}

/* ============================================================
   20. DIFF / AUDITORIA
   ============================================================ */
.diff-old { background-color: #ffeef0; text-decoration: line-through; }
.diff-new { background-color: #e6ffed; }

/* ============================================================
   21. ÍCONES
   ============================================================ */
.icon-wrapper {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   22. CONTENT HEADER
   ============================================================ */
.content-header {
    background-color: white;
    padding: 20px;
    margin: -20px -20px 20px -20px;
    border-bottom: 1px solid #eee;
}

/* ============================================================
   23. PÁGINA DE IMPRESSÃO (imprimir.php)
   ============================================================ */
.print-container {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #000;
    background: #fff;
    padding: 15px;
}

.print-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.print-header h1 {
    font-size: 18px;
    margin-bottom: 5px;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 11px;
}

.print-table th {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-weight: bold;
}

.print-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.print-table td.label-cell,
td.label-col {
    width: 30%;
}

.print-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-size: 10px;
    color: #666;
}

.print-actions {
    text-align: right;
    margin-bottom: 10px;
}

.print-actions .btn-print {
    padding: 8px 16px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.print-actions .btn-print-close {
    padding: 8px 16px;
    background: #95a5a6;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

@media print {
    .print-container { padding: 0; }
    .no-print { display: none; }
}

/* ============================================================
   24. PÁGINA 404
   ============================================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon {
    font-size: 5rem;
}

/* ============================================================
   25. PÁGINAS DE AUTENTICAÇÃO (recuperar/redefinir senha)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    max-width: 500px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header img {
    max-height: 60px;
}

.auth-header h2 {
    margin-top: 0.5rem;
    font-weight: bold;
}

/* ============================================================
   26. RESPONSIVIDADE
   ============================================================ */
@media (max-width: 992px) {
    .filtro-container .row { flex-wrap: wrap; }
    .filtro-container .col-filtro { flex: 0 0 50%; padding-bottom: 15px; }
}

@media (max-width: 768px) {
    .filtro-container .col-md-3 { margin-bottom: 15px; }
    .filtro-container .col-filtro { flex: 0 0 100%; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar.active { margin-left: 0; }
    .main-content { margin-left: 0; }
    .main-content.active { margin-left: var(--sidebar-width); }
}

@media (max-width: 576px) {
    .login-box { padding: 25px 20px; }
    .logo { max-width: 150px; }
}

/* ============================================================
   27. DASHBOARD - Ícones, Gráficos e Utilitários
   ============================================================ */

/* Círculo para ícones grandes nos cards */
.icon-circle-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Alturas fixas para containers de gráficos */
.chart-container-300 {
    height: 300px;
}

.chart-container-200 {
    height: 200px;
}

/* Barra de progresso fina (para tabela de setores) */
.progress-thin {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

/* Truncamento de texto com largura fixa */
.text-truncate-150 {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.text-truncate-120 {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.text-truncate-100 {
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* Opacidade para Bootstrap bg-opacity (fallback) */
.bg-opacity-10 { --bs-bg-opacity: 0.1; }
.bg-opacity-25 { --bs-bg-opacity: 0.25; }

/* Cor laranja personalizada (Bootstrap não tem bg-orange nativamente) */
.bg-orange {
    background-color: var(--barro) !important;
}

/* ============================================================
   28. CORES PARA BARRAS DE PROGRESSO DO DASHBOARD
   ============================================================ */
/* Usadas no dashboard para as barras de setores com mais resíduos */
.progress-bar-verde    { background-color: var(--success) !important; }
.progress-bar-azul     { background-color: var(--info) !important; }
.progress-bar-primary  { background-color: var(--purple) !important; }
.progress-bar-amarelo  { background-color: var(--warning) !important; }
.progress-bar-laranja  { background-color: var(--barro) !important; }
.progress-bar-vermelho { background-color: var(--danger) !important; }
.progress-bar-cinza    { background-color: var(--gray-600) !important; }
