/* LEV Compta — styles front
   Sous-étape A : liste des transactions (lecture seule) + formulaire mot de passe.
   Le bilan et le compte de P&P (étape 6) ajouteront leurs styles ici. */

.lev-compta { font-size: 14px; line-height: 1.5; }

/* Montants : alignement à droite, police tabulaire. */
.lev-compta .montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lev-compta .montant.negatif { color: #b91c1c; }

/* ── Liste des transactions ─────────────────────────────────────────── */
.levc-list { width: 100%; border-collapse: collapse; background: #fff; }
.levc-list th,
.levc-list td { padding: 7px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.levc-list thead th { background: #f3f4f6; font-weight: 600; border-bottom: 2px solid #d1d5db; }
.levc-list tbody tr:hover { background: #f9fafb; }
.levc-empty { color: #9ca3af; font-style: italic; }

.levc-row.levc-locked { background: #fafafa; color: #6b7280; }

.levc-statut { text-align: center; font-weight: 700; }
.levc-statut-pointe { color: #2563eb; }
.levc-statut-reconcilie { color: #16a34a; }
.levc-statut-cloture { color: #b45309; }
.levc-statut-libre { color: #9ca3af; }

/* ── Formulaire mot de passe (identité visuelle lev-activity) ────────── */
.levc-pw-wrap {
    max-width: 360px; margin: 40px auto; padding: 32px;
    background: linear-gradient(0deg, rgb(238,238,238) 0%, rgb(169,184,195) 50%, rgb(238,238,238) 100%);
    border: 1px solid #e5e7eb; border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08); font-family: sans-serif; box-sizing: border-box;
}
.levc-pw-head { text-align: center; margin-bottom: 24px; }
.levc-pw-lock { font-size: 40px; line-height: 1; }
.levc-pw-title { margin: 8px 0 4px !important; font-size: 20px; color: #1f2937; font-weight: 700; }
.levc-pw-subtitle { margin: 0 !important; color: #4b5260; font-size: 14px; line-height: 1.4; font-weight: 500; }
.levc-pw-error { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.levc-pw-form { margin: 0 !important; }

.levc-pw-field {
    display: flex !important; align-items: stretch !important; margin-bottom: 16px;
    border: 1px solid #d1d5db; border-radius: 8px; background: #fff; overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.levc-pw-field:focus-within { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.levc-pw-input {
    flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; margin: 0 !important;
    padding: 10px 14px !important; border: none !important; outline: none !important;
    background: transparent !important; box-shadow: none !important; font-size: 15px !important;
    line-height: 1.4 !important; color: #1f2937 !important; border-radius: 0 !important; box-sizing: border-box !important;
}
.levc-pw-toggle {
    flex: 0 0 44px !important; display: flex !important; align-items: center !important; justify-content: center !important;
    width: 44px !important; margin: 0 !important; padding: 0 !important; background: transparent !important;
    border: none !important; border-radius: 0 !important; box-shadow: none !important; cursor: pointer !important; color: #6b7280 !important;
}
.levc-pw-toggle:hover { color: #1f2937 !important; }
.levc-pw-eye { margin: 0 !important; flex-shrink: 0 !important; vertical-align: middle !important; }
.levc-pw-submit {
    display: flex !important; align-items: center !important; justify-content: center !important;
    width: 100% !important; margin: 0 !important; padding: 12px 16px !important; background: #4f46e5 !important;
    color: #fff !important; border: none !important; border-radius: 8px !important; box-shadow: none !important;
    font-size: 15px !important; font-weight: 600 !important; line-height: 1.2 !important; cursor: pointer !important;
}
.levc-pw-submit:hover { background: #4338ca !important; }

.levc-statut-click { cursor: pointer; }
.levc-statut-click:hover { background: #eff6ff; }
.levc-col-act { width: 34px; text-align: center; }
.levc-edit { cursor: pointer; text-decoration: none; }

/* ── Barre d'outils + tri + filtres ─────────────────────────────────── */
.levc-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.levc-search { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; min-width: 220px; }
.levc-toolbar-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Boutons « outil » — même identité visuelle que lev-activity (.leva-btn-tool) */
.levc-btn-tool {
    padding: 7px 14px; color: #fff; border: none; border-radius: 6px;
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
    text-decoration: none; display: inline-block; -webkit-tap-highlight-color: transparent;
}
.levc-btn-tool:hover { opacity: .88; }
.levc-btn-add  { background: #4f46e5; }
.levc-btn-edit { background: #0891b2; }
.levc-btn-grey { background: #6b7280; }
.levc-btn-nav  { background: #0f766e; }
.levc-sortable { cursor: pointer; user-select: none; }
.levc-sortable:hover { background: #eef2ff; }
.levc-arrow { font-size: 10px; color: #6b7280; margin-left: 2px; }
.levc-filter-row select { width: 100%; box-sizing: border-box; font-size: 12px; padding: 3px; }
.levc-list-foot { margin-top: 12px; display: flex; gap: 8px; }
.levc-level-badge {
    font-size: 12px; color: #6b7280; background: #f3f4f6;
    border: 1px solid #e5e7eb; border-radius: 999px; padding: 2px 10px;
}
.levc-elevate-form { margin: 4px 0 14px; }
.levc-elevate-form .levc-pw-wrap { margin: 8px auto 0; }

/* ── Panneau d'édition (overlay modal) ──────────────────────────────── */
.levc-panel-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 99999; padding: 40px 16px; overflow: auto;
}
.levc-panel {
    background: #fff; border-radius: 12px; padding: 20px;
    width: 100%; max-width: 440px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.levc-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin: -20px -20px 16px -20px; padding: 14px 20px 10px;
    border-bottom: 1px solid #f3f4f6;
}
.levc-panel-title { margin: 0; font-size: 18px; }
.levc-panel-close {
    background: none; border: none; font-size: 24px; cursor: pointer;
    color: #9ca3af; padding: 4px 8px; line-height: 1;
}
.levc-panel-close:hover { color: #374151; }

.levc-field { margin-bottom: 10px; }
.levc-label { display: block; font-size: 12px; font-weight: 600; color: #4b5563; margin-bottom: 4px; }
.levc-input {
    width: 100%; box-sizing: border-box; padding: 7px 9px;
    border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px;
    font-family: inherit; background: #fff;
}
.levc-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,.15); }

.levc-panel-msg { min-height: 18px; font-size: 13px; margin: 6px 0; }
.levc-panel-actions {
    margin-top: 20px; padding-top: 14px; border-top: 2px solid #e5e7eb;
    display: flex; flex-direction: column; gap: 8px;
}
/* Boutons pleine largeur — identité lev-activity (.lev-btn) */
.levc-btn {
    width: 100%; padding: 12px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.levc-btn-save   { background: #059669; color: #fff; }
.levc-btn-save:hover   { background: #047857; }
.levc-btn-delete { background: #ef4444; color: #fff; }
.levc-btn-delete:hover { background: #dc2626; }

/* ── Rapports : Bilan & P&P ──────────────────────────────────────────── */
.levc-rapport { max-width: 820px; }
.levc-rapport-head-row th { font-size: 13px; font-weight: 700; color: #6b7280; padding: 4px 8px; border-bottom: 2px solid #374151; }
.levc-rapport-head-row th.montant { text-align: right; width: 120px; }
.levc-rapport-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.levc-rapport-titre { margin: 0; font-size: 20px; }
.levc-print-btn {
    padding: 7px 14px; border: none; border-radius: 6px; background: #7c3aed;
    color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.levc-print-btn:hover { opacity: .88; }
.levc-datepick .levc-date-toggle { color: inherit; text-decoration: underline dotted; cursor: pointer; }
.levc-date-input { margin-left: 8px; }

.levc-rapport-table { width: 100%; border-collapse: collapse; }
.levc-rapport-table td { padding: 0px 8px; }
.levc-rapport-table td.montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 120px; }
.levc-rapport-table .montant.negatif { color: #b91c1c; }
.levc-rapport-table .levc-ecart { color: #6b7280; }
.levc-rapport-table .levc-ecart.negatif { color: #b91c1c; }
.levc-pct { font-size: 11px; color: #9ca3af; }

/* Titre de groupe (Actifs / Passifs / Recettes / Dépenses). */
.levc-r-groupheader td { font-size: 17px; font-weight: 800; color: #111827; padding-top: 16px; border-bottom: 2px solid #374151; }
/* Comptes : ligne discrète. */
.levc-r-compte td { color: #374151; border-bottom: 1px solid #f3f4f6; }
/* Textes intercalaires (titres) : gras, taille selon le niveau. */
.levc-r-texte td { font-weight: 700; color: #111827; padding-top: 10px; }
.levc-r-texte.levc-lvl-0 td { font-size: 15px; }
.levc-r-texte.levc-lvl-1 td { font-size: 14px; }
.levc-r-texte.levc-lvl-2 td { font-size: 13px; color: #374151; }
/* Sous-totaux. */
.levc-r-total td { font-weight: 600; color: #1f2937; border-top: 1px solid #e5e7eb; }
/* Total de groupe (Total des actifs…). */
.levc-r-grouptotal td { font-weight: 800; color: #111827; border-top: 2px solid #9ca3af; padding-top: 6px; }
/* Résultat de l'exercice (P&P). */
.levc-r-resultat td { font-weight: 800; border-top: 3px double #6b7280; padding-top: 8px; font-size: 15px; }

/* ── Impression ──────────────────────────────────────────────────────── */
@media print {
    .lev-compta .no-print { display: none !important; }
    .levc-date-print { display: inline !important; }

    /* Masquer le header et le footer du site à l'impression.
       Sélecteurs WordPress/thèmes courants — si ton thème utilise d'autres
       classes pour son en-tête/pied, indique-les et je les ajoute ici. */
    #wpadminbar,
    header, .site-header, #masthead, #site-header,
    footer, .site-footer, #colophon, #site-footer {
        display: none !important;
    }
}
