/* Pages comptabilité — thème clair / sombre */

/* Variables locales */
html[data-theme="dark"] {
    --compta-border: rgba(148, 163, 184, 0.2);
    --compta-surface: #1e293b;
    --compta-surface-2: #334155;
    --compta-text: #f1f5f9;
    --compta-muted: #94a3b8;
}

html[data-theme="light"] {
    --compta-border: rgba(15, 23, 42, 0.12);
    --compta-surface: #ffffff;
    --compta-surface-2: #f8f9fa;
    --compta-text: rgba(15, 23, 42, 0.92);
    --compta-muted: rgba(15, 23, 42, 0.62);
}

/* Cartes page "Toute la comptabilité" */
.compta-card,
.compta-entreprise-block {
    background: var(--compta-surface) !important;
    border: 1px solid var(--compta-border) !important;
    color: var(--compta-text);
}

.compta-card-header,
.compta-entreprise-block > .d-flex:first-child {
    color: var(--compta-text) !important;
    background: var(--compta-surface-2) !important;
    border-bottom: 1px solid var(--compta-border) !important;
}

.compta-toolbar {
    background: var(--compta-surface-2) !important;
    border-bottom: 1px solid var(--compta-border) !important;
}

.compta-toolbar .form-control,
.compta-toolbar .form-select {
    background-color: var(--irs-input-bg, #fff) !important;
    color: var(--irs-text, #212529) !important;
    border: 1px solid var(--compta-border) !important;
    border-radius: 12px;
    min-width: 220px;
}

.compta-toolbar .form-select.w-auto,
.compta-toolbar .form-control.w-auto {
    min-width: 0;
    width: auto;
}

.compta-entreprise-block h5 a {
    color: var(--compta-text) !important;
}

.compta-entreprise-block h5 a:hover {
    color: var(--irs-accent, #3498db) !important;
}

/* Tableaux comptabilité */
.compta-table thead th {
    background: var(--compta-surface-2) !important;
    border-bottom: 1px solid var(--compta-border) !important;
    color: var(--compta-text) !important;
}

html[data-theme="light"] .compta-table tbody td {
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="dark"] .compta-table tbody td {
    border-top: 1px solid rgba(148, 163, 184, 0.12) !important;
}

.compta-table tbody tr:hover {
    background: var(--compta-surface-2) !important;
}

html[data-theme="light"] .compta-table thead.table-light th {
    background: #f8f9fa !important;
}

/* Cartes stats (all_comptabilite) */
.compta-stat-card.border-success {
    border-color: #198754 !important;
    border-width: 2px !important;
}

.compta-stat-card.border-danger {
    border-color: #dc3545 !important;
    border-width: 2px !important;
}

.compta-stat-card.border-primary {
    border-color: #0d6efd !important;
    border-width: 2px !important;
}

/* Relevé comptabilité — lignes colorées */
.compta-row-gains {
    background: rgba(25, 135, 84, 0.12) !important;
}

.compta-row-depenses {
    background: rgba(220, 53, 69, 0.12) !important;
}

.compta-row-benef {
    background: rgba(13, 110, 253, 0.12) !important;
}

.compta-row-impots {
    background: rgba(202, 138, 4, 0.15) !important;
}

html[data-theme="dark"] .compta-row-gains {
    background: rgba(22, 163, 74, 0.2) !important;
}

html[data-theme="dark"] .compta-row-depenses {
    background: rgba(220, 38, 38, 0.18) !important;
}

html[data-theme="dark"] .compta-row-benef {
    background: rgba(37, 99, 235, 0.18) !important;
}

html[data-theme="dark"] .compta-row-impots {
    background: rgba(180, 83, 9, 0.22) !important;
}

/* Barre d'actions — boutons colorés (comme onglets dashboard) */
.compta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.compta-actions .btn {
    font-weight: 600;
    border: 1px solid transparent;
}

.compta-actions .dropdown-menu {
    margin-top: 0.25rem;
}

@media (max-width: 576px) {
    .compta-toolbar .form-control,
    .compta-toolbar .form-select {
        min-width: 100%;
    }
}
