/*
 * tema_verde.css — Arquivo único de sobrescrita do tema verde Antigravity
 * Carregado como <link> DEPOIS do Bootstrap, portanto vence TUDO.
 * Corrige variáveis Bootstrap --bs-*, contraste de fontes e scrollbar.
 */

/* ============================================================
   1. VARIÁVEIS DO BOOTSTRAP — sobrescritas pelo tema verde
   ============================================================ */
[data-theme='green'],
[data-theme='green'] * {
    --bs-body-bg: #091a1a;
    --bs-body-color: #e0f7f4;
    --bs-secondary-color: #80cbc4;
    --bs-tertiary-bg: rgba(255,255,255,0.04);
    --bs-secondary-bg: #142d2d;
    --bs-border-color: rgba(255,255,255,0.12);
    --bs-card-bg: #142d2d;
    --bs-card-border-color: rgba(255,255,255,0.12);

    /* Cor primária do tema = verde */
    --bs-primary: #39cf88;
    --bs-primary-rgb: 57, 207, 136;
    --bs-link-color: #39cf88;
    --bs-link-hover-color: #5de0a0;

    /* Subtle backgrounds */
    --bs-primary-bg-subtle: rgba(57,207,136,0.12);
    --bs-secondary-bg-subtle: rgba(255,255,255,0.07);
    --bs-info-bg-subtle: rgba(13,202,240,0.10);
    --bs-success-bg-subtle: rgba(0,255,136,0.10);
    --bs-warning-bg-subtle: rgba(255,193,7,0.12);
    --bs-danger-bg-subtle: rgba(220,53,69,0.12);

    /* Subtle text colors */
    --bs-primary-text-emphasis: #39cf88;
    --bs-secondary-text-emphasis: #80cbc4;
    --bs-info-text-emphasis: #67e8f9;
    --bs-success-text-emphasis: #6effc2;
    --bs-warning-text-emphasis: #ffd54f;
    --bs-danger-text-emphasis: #ff8a80;

    /* Table */
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,0.03);
    --bs-table-hover-bg: rgba(57,207,136,0.06);
    --bs-table-border-color: rgba(255,255,255,0.10);

    /* Form controls */
    --bs-input-bg: rgba(255,255,255,0.07);
    --bs-input-border-color: rgba(255,255,255,0.12);
    --bs-input-color: #e0f7f4;
    --bs-input-placeholder-color: #80cbc4;
}

/* ============================================================
   2. FUNDO E COR BASE
   ============================================================ */
[data-theme='green'] body {
    background-color: #091a1a !important;
    color: #e0f7f4 !important;
}
[data-theme='green'] html {
    /* Scrollbar do Firefox */
    scrollbar-color: rgba(57,207,136,0.75) #0d2020;
    scrollbar-width: auto;
    /* Forca o scrollbar a sempre aparecer */
    overflow-y: scroll;
}

/* ============================================================
   3. SCROLLBAR — Chrome/Edge
   ============================================================ */
html[data-theme='green']::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme='green']::-webkit-scrollbar-track { background: #0d2020; }
html[data-theme='green']::-webkit-scrollbar-thumb {
    background: rgba(57,207,136,0.75);
    border-radius: 5px;
    border: 2px solid #0d2020;
}
html[data-theme='green']::-webkit-scrollbar-thumb:hover {
    background: #5de0a0;
}
/* Scrollbar em elementos internos */
[data-theme='green'] aside::-webkit-scrollbar,
[data-theme='green'] .sidebar::-webkit-scrollbar,
[data-theme='green'] .table-responsive::-webkit-scrollbar,
[data-theme='green'] .overflow-auto::-webkit-scrollbar,
[data-theme='green'] .overflow-y-auto::-webkit-scrollbar { width: 5px; height: 5px; }
[data-theme='green'] aside::-webkit-scrollbar-track,
[data-theme='green'] .sidebar::-webkit-scrollbar-track,
[data-theme='green'] .table-responsive::-webkit-scrollbar-track { background: transparent; }
[data-theme='green'] aside::-webkit-scrollbar-thumb,
[data-theme='green'] .sidebar::-webkit-scrollbar-thumb,
[data-theme='green'] .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(57,207,136,0.35);
    border-radius: 3px;
}


/* ============================================================
   4. TEXTOS GERAIS
   ============================================================ */
[data-theme='green'] h1, [data-theme='green'] h2,
[data-theme='green'] h3, [data-theme='green'] h4,
[data-theme='green'] h5, [data-theme='green'] h6 { color: #e0f7f4 !important; }
[data-theme='green'] p, [data-theme='green'] span:not(.badge),
[data-theme='green'] label, [data-theme='green'] .form-label,
[data-theme='green'] li, [data-theme='green'] td,
[data-theme='green'] th, [data-theme='green'] div { color: #e0f7f4; }
[data-theme='green'] .text-muted,
[data-theme='green'] .text-secondary,
[data-theme='green'] small { color: #80cbc4 !important; }
[data-theme='green'] .text-dark,
[data-theme='green'] .text-black { color: #e0f7f4 !important; }
[data-theme='green'] strong, [data-theme='green'] b { color: #e0f7f4 !important; }

/* Classes Bootstrap de texto colorido — manter mas com contraste */
[data-theme='green'] .text-primary { color: #39cf88 !important; }
[data-theme='green'] .text-info { color: #67e8f9 !important; }
[data-theme='green'] .text-success { color: #6effc2 !important; }
[data-theme='green'] .text-warning { color: #ffd54f !important; }
[data-theme='green'] .text-danger { color: #ff8a80 !important; }

/* ============================================================
   5. CARDS
   ============================================================ */
[data-theme='green'] .card {
    background-color: #142d2d !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e0f7f4 !important;
}
[data-theme='green'] .card-header {
    background-color: transparent !important;
    border-color: rgba(255,255,255,0.10) !important;
}
[data-theme='green'] .bg-light,
[data-theme='green'] .bg-white,
[data-theme='green'] .bg-body {
    background-color: rgba(255,255,255,0.04) !important;
    color: #e0f7f4 !important;
}
[data-theme='green'] .bg-primary-subtle { background-color: rgba(57,207,136,0.12) !important; }
[data-theme='green'] .bg-info-subtle { background-color: rgba(13,202,240,0.10) !important; }
[data-theme='green'] .bg-success-subtle { background-color: rgba(0,255,136,0.10) !important; }
[data-theme='green'] .bg-warning-subtle { background-color: rgba(255,193,7,0.12) !important; }
[data-theme='green'] .bg-danger-subtle { background-color: rgba(220,53,69,0.12) !important; }
[data-theme='green'] .bg-secondary-subtle { background-color: rgba(255,255,255,0.07) !important; }
[data-theme='green'] .bg-light-subtle { background-color: rgba(255,255,255,0.05) !important; color: #e0f7f4 !important; }

/* ============================================================
   6. FORMULÁRIOS
   ============================================================ */
[data-theme='green'] .form-control,
[data-theme='green'] .form-select,
[data-theme='green'] .input-group-text,
[data-theme='green'] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not(.btn),
[data-theme='green'] select,
[data-theme='green'] textarea {
    background-color: rgba(255,255,255,0.08) !important;
    color: #e0f7f4 !important;
    border-color: rgba(255,255,255,0.15) !important;
}
[data-theme='green'] select option {
    background-color: #142d2d !important;
    color: #e0f7f4 !important;
}
[data-theme='green'] .form-control:focus,
[data-theme='green'] .form-select:focus {
    background-color: rgba(255,255,255,0.11) !important;
    color: #e0f7f4 !important;
    border-color: #39cf88 !important;
    box-shadow: 0 0 0 0.2rem rgba(57,207,136,0.2) !important;
}
[data-theme='green'] .form-control::placeholder,
[data-theme='green'] input::placeholder,
[data-theme='green'] textarea::placeholder {
    color: #80cbc4 !important;
    opacity: 0.8;
}
[data-theme='green'] .form-control[readonly] {
    background-color: rgba(255,255,255,0.03) !important;
    color: #80cbc4 !important;
}
[data-theme='green'] .input-group-text {
    background-color: rgba(255,255,255,0.05) !important;
    color: #80cbc4 !important;
    border-color: rgba(255,255,255,0.12) !important;
}

/* ============================================================
   7. TABELAS
   ============================================================ */
[data-theme='green'] .table,
[data-theme='green'] table { --bs-table-bg: transparent; }
[data-theme='green'] .table td,
[data-theme='green'] .table th,
[data-theme='green'] table td,
[data-theme='green'] table th {
    color: #e0f7f4 !important;
    border-color: rgba(255,255,255,0.10) !important;
}
[data-theme='green'] .table thead th,
[data-theme='green'] thead th {
    background-color: #162f2f !important;
    color: #80cbc4 !important;
    border-color: rgba(255,255,255,0.10) !important;
}
[data-theme='green'] .table tbody td,
[data-theme='green'] tbody td {
    background-color: transparent !important;
}
[data-theme='green'] .table-hover tbody tr:hover > td {
    background-color: rgba(57,207,136,0.06) !important;
}
[data-theme='green'] .table-light,
[data-theme='green'] .table-light td {
    background-color: rgba(255,255,255,0.04) !important;
    color: #e0f7f4 !important;
}
[data-theme='green'] .table-warning td {
    background-color: rgba(255,193,7,0.15) !important;
    color: #ffe082 !important;
}
[data-theme='green'] thead.bg-light th {
    background-color: rgba(255,255,255,0.05) !important;
    color: #80cbc4 !important;
}
/* thead sticky */
[data-theme='green'] thead.sticky-top,
[data-theme='green'] th.sticky-top {
    background-color: #142d2d !important;
    color: #80cbc4 !important;
}
/* Rodapé de tabelas (tfoot) - corrigindo contraste */
[data-theme='green'] tfoot td,
[data-theme='green'] tfoot th {
    background-color: #162f2f !important;
    color: #e0f7f4 !important;
    border-color: rgba(255,255,255,0.15) !important;
}

/* ============================================================
   8. BOTÕES
   ============================================================ */
/* Bootstrap primário adapta ao verde */
[data-theme='green'] .btn-primary {
    background-color: #39cf88 !important;
    border-color: #39cf88 !important;
    color: #000 !important;
}
[data-theme='green'] .btn-primary:hover {
    background-color: #2fb874 !important;
    border-color: #2fb874 !important;
}
/* Botões de outline */
[data-theme='green'] .btn-outline-secondary {
    color: #80cbc4 !important; border-color: rgba(255,255,255,0.2) !important;
}
[data-theme='green'] .btn-outline-secondary:hover {
    background-color: rgba(255,255,255,0.08) !important; color: #e0f7f4 !important;
}
[data-theme='green'] .btn-outline-primary {
    color: #39cf88 !important; border-color: #39cf88 !important;
}
[data-theme='green'] .btn-outline-primary:hover {
    background-color: rgba(57,207,136,0.15) !important; color: #39cf88 !important;
}
[data-theme='green'] .btn-outline-danger {
    color: #ff8a80 !important; border-color: #ff5252 !important;
}
[data-theme='green'] .btn-outline-danger:hover {
    background-color: rgba(220,53,69,0.15) !important; color: #ff8a80 !important;
}
[data-theme='green'] .btn-outline-success {
    color: #6effc2 !important; border-color: #00ff88 !important;
}
[data-theme='green'] .btn-outline-success:hover {
    background-color: rgba(0,255,136,0.15) !important; color: #6effc2 !important;
}
/* Botões genéricos sem classe Bootstrap (templates legados) */
[data-theme='green'] .btn:not([class*="btn-primary"]):not([class*="btn-danger"]):not([class*="btn-success"]):not([class*="btn-warning"]):not([class*="btn-info"]):not([class*="btn-outline"]) {
    background-color: rgba(255,255,255,0.07) !important;
    color: #e0f7f4 !important;
    border-color: rgba(255,255,255,0.2) !important;
}
[data-theme='green'] .btn-close { filter: invert(1) !important; }

/* ============================================================
   9. BADGES
   ============================================================ */
[data-theme='green'] .badge.bg-primary-subtle { background-color: rgba(57,207,136,0.15) !important; color: #39cf88 !important; }
[data-theme='green'] .badge.bg-info-subtle { background-color: rgba(13,202,240,0.12) !important; color: #67e8f9 !important; }
[data-theme='green'] .badge.bg-success-subtle { background-color: rgba(0,255,136,0.12) !important; color: #6effc2 !important; }
[data-theme='green'] .badge.bg-warning-subtle { background-color: rgba(255,193,7,0.15) !important; color: #ffd54f !important; }
[data-theme='green'] .badge.bg-danger-subtle { background-color: rgba(220,53,69,0.15) !important; color: #ff8a80 !important; }
[data-theme='green'] .badge.bg-secondary-subtle { background-color: rgba(255,255,255,0.1) !important; color: #80cbc4 !important; }
[data-theme='green'] .badge.bg-light { background-color: rgba(255,255,255,0.1) !important; color: #e0f7f4 !important; }
[data-theme='green'] .badge.text-dark { color: #e0f7f4 !important; }
[data-theme='green'] .badge.text-primary { color: #39cf88 !important; }
[data-theme='green'] .badge.text-info { color: #67e8f9 !important; }
[data-theme='green'] .badge.text-success { color: #6effc2 !important; }
[data-theme='green'] .badge.text-warning { color: #ffd54f !important; }
[data-theme='green'] .badge.text-danger { color: #ff8a80 !important; }

/* ============================================================
   10. ALERTAS
   ============================================================ */
[data-theme='green'] .alert { border-color: rgba(255,255,255,0.12) !important; }
[data-theme='green'] .alert-primary { background-color: rgba(57,207,136,0.12) !important; color: #a5f3cb !important; }
[data-theme='green'] .alert-info { background-color: rgba(13,202,240,0.1) !important; color: #67e8f9 !important; }
[data-theme='green'] .alert-warning { background-color: rgba(255,193,7,0.12) !important; color: #ffd54f !important; }
[data-theme='green'] .alert-danger { background-color: rgba(220,53,69,0.12) !important; color: #ff8a80 !important; }
[data-theme='green'] .alert-success { background-color: rgba(25,135,84,0.12) !important; color: #6effc2 !important; }

/* ============================================================
   11. MODAIS E DROPDOWNS
   ============================================================ */
[data-theme='green'] .modal-content {
    background-color: #142d2d !important;
    color: #e0f7f4 !important;
    border-color: rgba(255,255,255,0.12) !important;
}
[data-theme='green'] .modal-header, [data-theme='green'] .modal-footer {
    border-color: rgba(255,255,255,0.10) !important;
}
[data-theme='green'] .dropdown-menu {
    background-color: #142d2d !important;
    border-color: rgba(255,255,255,0.12) !important;
}
[data-theme='green'] .dropdown-item { color: #e0f7f4 !important; }
[data-theme='green'] .dropdown-item:hover { background-color: #1d3d3d !important; }

/* ============================================================
   12. NAVBAR E SIDEBAR
   ============================================================ */
[data-theme='green'] .top-navbar {
    background-color: #0e2424 !important;
    border-color: rgba(255,255,255,0.10) !important;
}
[data-theme='green'] .sidebar {
    background-color: #0e2424 !important;
    border-color: rgba(255,255,255,0.10) !important;
}
[data-theme='green'] .sidebar a, [data-theme='green'] .sidebar .btn-submenu {
    color: #e0f7f4;
}
[data-theme='green'] .sidebar a:hover, [data-theme='green'] .sidebar .btn-submenu:hover {
    background-color: #1d3d3d;
    color: #39cf88;
}

/* ============================================================
   13. SEPARADORES E BORDAS
   ============================================================ */
[data-theme='green'] hr { border-color: rgba(255,255,255,0.10) !important; }
[data-theme='green'] .border,
[data-theme='green'] .border-top, [data-theme='green'] .border-bottom,
[data-theme='green'] .border-start, [data-theme='green'] .border-end,
[data-theme='green'] .border-primary { border-color: rgba(255,255,255,0.12) !important; }
[data-theme='green'] .border-start.border-4.border-primary { border-color: #39cf88 !important; }
