/*
 * Thème CORIS COMPTA (repris de CORIS STOCK) pour l'administration Filament.
 * Les couleurs viennent des variables --tx-* définies dans
 * resources/views/filament/theme/variables.blade.php (couleur choisie dans Administration → Paramètres).
 */

/* ---------- Fond général ---------- */
.fi-body { background: var(--tx-fond) !important; }
.dark .fi-body { background: #0b1120 !important; }

/* ---------- Barre du haut ---------- */
.fi-topbar {
    background: var(--tx-barre) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
    border-bottom: none !important;
    color: #fff;
}
.fi-topbar .fi-icon-btn,
.fi-topbar .fi-topbar-open-sidebar-btn,
.fi-topbar .fi-topbar-close-sidebar-btn,
.fi-topbar .fi-topbar-open-collapse-sidebar-btn,
.fi-topbar .fi-topbar-close-collapse-sidebar-btn { color: rgba(255, 255, 255, .9) !important; }
.fi-topbar .fi-icon-btn:hover { background: rgba(255, 255, 255, .15) !important; }
.fi-topbar .fi-global-search-field .fi-input-wrp {
    background: rgba(255, 255, 255, .96) !important;
    border-radius: .65rem;
    box-shadow: none;
}
.fi-topbar .fi-user-menu-trigger .fi-user-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

/* Logo */
.tx-logo { display: flex; align-items: center; gap: .65rem; color: #fff; line-height: 1.05; }
.tx-logo-icone {
    width: 2.35rem; height: 2.35rem; border-radius: .7rem; display: grid; place-items: center;
    background: var(--tx-logo-fond); box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.tx-logo-icone svg { width: 1.35rem; height: 1.35rem; color: var(--tx-logo-icone); }
.tx-logo-nom { font-weight: 800; font-size: 1.3rem; letter-spacing: .06em; }
.tx-logo-sous { font-size: .68rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }

/* ---------- Menu latéral ---------- */
.fi-sidebar {
    background: var(--tx-menu) !important;
    box-shadow: 2px 0 14px rgba(0, 0, 0, .12);
}
.fi-sidebar-nav { scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.fi-sidebar .fi-sidebar-group-label { color: var(--tx-menu-titre) !important; text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; font-weight: 700; }
.fi-sidebar .fi-sidebar-group-btn .fi-icon,
.fi-sidebar .fi-sidebar-group-collapse-btn { color: rgba(255, 255, 255, .45) !important; }
.fi-sidebar .fi-sidebar-group-btn .fi-sidebar-group-icon { color: var(--tx-menu-titre) !important; }

.fi-sidebar .fi-sidebar-item-btn { border-radius: .6rem; transition: background .15s, transform .15s; }
.fi-sidebar .fi-sidebar-item-label { color: rgba(255, 255, 255, .86) !important; font-weight: 500; }
.fi-sidebar .fi-sidebar-item-icon { color: rgba(255, 255, 255, .6) !important; }
.fi-sidebar .fi-sidebar-item-btn:hover { background: rgba(255, 255, 255, .08) !important; }
.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-label { color: #fff !important; }

.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--tx-actif) !important;
    box-shadow: 0 4px 14px var(--tx-actif-ombre);
}
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon { color: #fff !important; font-weight: 600; }

/* Pastilles (compteurs) dans le menu */
.fi-sidebar .fi-badge { box-shadow: none; }

/* Pied du menu */
.tx-pied-menu {
    margin: .75rem 1rem 1rem; padding: .85rem 1rem; border-radius: .8rem;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .75); font-size: .78rem; line-height: 1.4;
}
.tx-pied-menu strong { color: #fff; display: block; font-size: .85rem; }
.tx-pied-menu .trait { width: 2rem; height: 3px; border-radius: 3px; background: var(--tx-accent); margin-top: .5rem; }

/* ---------- Titres de page ---------- */
.fi-header-heading { color: var(--tx-titre); letter-spacing: -.01em; }
.dark .fi-header-heading { color: #fff; }

/* ---------- Cartes, sections, tableaux ---------- */
.fi-section:not(.fi-section-not-contained),
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart .fi-section,
.fi-in-repeatable-table,
.fi-fo-repeater-item {
    border-radius: 1rem !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .05) !important;
}
.fi-ta-header-cell { background: var(--tx-entete-tableau) !important; }
.fi-ta-header-cell, .fi-ta-header-cell * { color: var(--tx-titre) !important; }
.dark .fi-ta-header-cell { background: rgba(255, 255, 255, .04) !important; }
.dark .fi-ta-header-cell, .dark .fi-ta-header-cell * { color: #e5e7eb !important; }
.fi-ta-row:hover > td { background: var(--tx-survol) !important; }
.dark .fi-ta-row:hover > td { background: rgba(255, 255, 255, .03) !important; }

/* ---------- Indicateurs du tableau de bord ---------- */
.fi-wi-stats-overview-stat { position: relative; overflow: hidden; border-top: 4px solid var(--tx-stat, var(--tx-accent)) !important; }
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label-ctn > .fi-icon {
    width: 2.6rem; height: 2.6rem; padding: .55rem; border-radius: .75rem;
    color: #fff; background: var(--tx-stat, var(--tx-accent));
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label { font-weight: 600; }
.fi-wi-stats-overview-stat-value { letter-spacing: -.02em; font-size: 1.35rem !important; white-space: nowrap; }
.fi-wi-stats-overview-stat-description { white-space: normal; line-height: 1.35; }
.fi-wi-stats-overview-stat-description > span { min-width: 0; }
.tx-stat-orange { --tx-stat: var(--tx-c500); }
.tx-stat-vert   { --tx-stat: #16a34a; }
.tx-stat-bleu   { --tx-stat: #2563eb; }
.tx-stat-violet { --tx-stat: #9333ea; }
.tx-stat-rouge  { --tx-stat: #dc2626; }
.tx-stat-or     { --tx-stat: #d97706; }
.tx-stat-cyan   { --tx-stat: #0891b2; }

/* ---------- Raccourcis du tableau de bord ---------- */
.tx-raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .85rem; }
.tx-raccourci {
    display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-radius: .9rem;
    color: #fff !important; font-weight: 700; text-decoration: none; font-size: .9rem; white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12); transition: transform .15s, box-shadow .15s;
}
.tx-raccourci:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .16); }
.tx-raccourci svg { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.tx-r-vert   { background: linear-gradient(135deg, #16a34a, #22c55e); }
.tx-r-bleu   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.tx-r-violet { background: linear-gradient(135deg, #7e22ce, #a855f7); }
.tx-r-orange { background: linear-gradient(135deg, var(--tx-c600), var(--tx-accent-x)); }
.tx-r-cyan   { background: linear-gradient(135deg, #0e7490, #14b8a6); }
.tx-r-rose   { background: linear-gradient(135deg, #be123c, #f43f5e); }

/* ---------- Écran de connexion ---------- */
.fi-simple-layout { background: var(--tx-connexion) !important; }
.fi-simple-main { border-radius: 1.1rem !important; box-shadow: 0 20px 50px rgba(0, 0, 0, .25) !important; }
.fi-simple-header .tx-logo { color: var(--tx-titre); }
.dark .fi-simple-header .tx-logo { color: #fff; }

/* ---------- CORIS COMPTA : grilles (saisie des notes, emploi du temps) ---------- */
.tx-grille { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.tx-grille th { background: var(--tx-entete-tableau); color: var(--tx-titre); font-weight: 700; text-align: left; padding: .55rem .7rem; border-bottom: 1px solid rgba(15, 23, 42, .08); white-space: nowrap; }
.tx-grille td { padding: .45rem .7rem; border-bottom: 1px solid rgba(15, 23, 42, .06); vertical-align: middle; }
.tx-grille tr:hover td { background: var(--tx-survol); }
.tx-grille .d { text-align: right; white-space: nowrap; }
.tx-grille .c { text-align: center; }
.tx-grille input[type=number], .tx-grille input[type=text] {
    width: 6.5rem; padding: .35rem .5rem; border-radius: .5rem; border: 1px solid #d1d5db; background: #fff; text-align: right; font-size: .9rem;
}
.tx-grille input:focus { outline: 2px solid var(--tx-c400); border-color: transparent; }
.dark .tx-grille th { background: rgba(255, 255, 255, .04); color: #e5e7eb; }
.dark .tx-grille td { border-color: rgba(255, 255, 255, .06); }
.dark .tx-grille input { background: #111827; border-color: #374151; color: #fff; }
.tx-carte { background: #fff; border-radius: 1rem; box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .05); overflow: visible; } /* visible : sinon les listes déroulantes du formulaire sont coupées */
.dark .tx-carte { background: #111827; }
.tx-pastille { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.tx-ok { background: #dcfce7; color: #166534; }
.tx-ko { background: #fee2e2; color: #991b1b; }
.tx-neutre { background: #f3f4f6; color: #374151; }

.tx-edt { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.tx-edt th { background: var(--tx-entete-tableau); color: var(--tx-titre); padding: .5rem; border-radius: .5rem; font-size: .85rem; }
.tx-edt td { vertical-align: top; padding: 0; }
.tx-edt .heure { width: 4.5rem; font-size: .75rem; color: #6b7280; text-align: right; padding-right: .4rem; }
.tx-seance { border-radius: .6rem; padding: .45rem .55rem; color: #fff; font-size: .78rem; line-height: 1.3; margin-bottom: 4px;
    background: linear-gradient(135deg, var(--tx-c600), var(--tx-accent-x)); box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.tx-seance.td { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.tx-seance.tp { background: linear-gradient(135deg, #0e7490, #14b8a6); }
.tx-seance strong { display: block; font-size: .82rem; }
.tx-annule > td { opacity: .55; text-decoration: line-through; }

/* ---------- CORIS COMPTA : trésorerie (cartes des caisses et banques) ---------- */
.tx-comptes { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.tx-compte { position: relative; padding: 1.1rem 1.2rem; border-radius: 1rem; color: #fff; overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.tx-compte.caisse { background: linear-gradient(135deg, #15803d, #22c55e); }
.tx-compte.banque { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.tx-compte.mobile_money { background: linear-gradient(135deg, var(--tx-c700), var(--tx-accent-x)); }
.tx-compte .nom { font-weight: 700; font-size: .95rem; opacity: .95; }
.tx-compte .detail { font-size: .75rem; opacity: .85; min-height: 1rem; }
.tx-compte .solde { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-top: .4rem; white-space: nowrap; }
.tx-compte .liens { margin-top: .6rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.tx-compte .liens a { font-size: .75rem; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .18); padding: .2rem .55rem; border-radius: .45rem; text-decoration: none; }
.tx-compte .liens a:hover { background: rgba(255, 255, 255, .3); }
.tx-compte svg.fond { position: absolute; right: -.6rem; bottom: -.6rem; width: 5.5rem; height: 5.5rem; opacity: .15; }
.tx-total-tresorerie { font-size: 1.1rem; font-weight: 700; color: var(--tx-titre); }
.dark .tx-total-tresorerie { color: #fff; }
.tx-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.tx-conteneurs { display: flex; gap: .5rem; flex-wrap: wrap; }
.tx-conteneurs span { background: var(--tx-entete-tableau); color: var(--tx-titre); padding: .2rem .6rem; border-radius: .5rem; font-weight: 700; font-size: .85rem; }

/* ───── CORIS COMPTA : page des états ───── */
.cc-etats { display: flex; flex-direction: column; gap: 1.6rem; }
.cc-etats-groupe h2 { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-accent, #b45309); margin-bottom: .6rem; }
.cc-etats-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.cc-etat { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; text-align: left; padding: 1rem 1.1rem;
    background: #fff; border: 1px solid #e7e5e4; border-radius: .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: all .15s; cursor: pointer; }
.cc-etat:hover { border-color: var(--tx-c600, #c2410c); box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.cc-etat-icone { width: 1.6rem; height: 1.6rem; color: var(--tx-c600, #c2410c); }
.cc-etat-titre { font-weight: 700; color: #1c1917; }
.cc-etat-texte { font-size: .82rem; color: #57534e; line-height: 1.35; }
.dark .cc-etat { background: rgb(255 255 255 / .04); border-color: rgb(255 255 255 / .1); }
.dark .cc-etat-titre { color: #f5f5f4; }
.dark .cc-etat-texte { color: #a8a29e; }

/* ───── CORIS COMPTA : synchronisation ───── */
.cc-sync { display: grid; gap: 1rem; }
.cc-sync-lib { font-size: .8rem; color: #57534e; margin-bottom: .3rem; }
.cc-sync-code { display: inline-block; padding: .45rem .7rem; background: #f5f5f4; border: 1px solid #e7e5e4; border-radius: .5rem; font-size: .9rem; word-break: break-all; }
.cc-sync-cle { background: #ecfdf5; border-color: #6ee7b7; font-weight: 700; }
.cc-sync-alerte { display: block; margin-top: .35rem; color: #b45309; font-weight: 600; font-size: .85rem; }
.cc-sync-liste { list-style: disc; padding-left: 1.2rem; font-size: .9rem; line-height: 1.7; }
.dark .cc-sync-code { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .1); }

/* ───── Société ouverte (menu du haut de la barre latérale) : couleur du thème, en gras ───── */
.fi-tenant-menu-trigger-tenant-name { color: var(--tx-societe, #fb923c) !important; font-weight: 800 !important; letter-spacing: .01em; }
.fi-tenant-menu-trigger-current-tenant-label { color: rgb(255 255 255 / .65) !important; }
.fi-tenant-menu-trigger .fi-icon { color: rgb(255 255 255 / .7) !important; }
.fi-tenant-menu-trigger:hover { background: rgb(255 255 255 / .08) !important; }

/* ───── Imports, révision, suivi ───── */
.cc-ok { color: #047857; font-weight: 700; }
.cc-erreur { color: #b91c1c; font-weight: 700; }
.cc-erreurs { margin-top: .6rem; padding-left: 1.2rem; list-style: disc; font-size: .85rem; line-height: 1.6; color: #7f1d1d; max-height: 22rem; overflow: auto; }
.dark .cc-erreurs { color: #fecaca; }
.cc-barre { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: .25rem; }
.cc-barre label { display: grid; gap: .25rem; font-size: .8rem; color: #57534e; }
.cc-barre select, .cc-barre input { min-width: 12rem; border: 1px solid #d6d3d1; border-radius: .5rem; padding: .4rem .6rem; font-size: .9rem; background: #fff; }
.dark .cc-barre select, .dark .cc-barre input { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .15); color: inherit; }
.cc-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.cc-table th { text-align: left; font-weight: 600; color: #57534e; border-bottom: 2px solid #e7e5e4; padding: .5rem .6rem; white-space: nowrap; }
.cc-table td { border-bottom: 1px solid #f5f5f4; padding: .45rem .6rem; vertical-align: top; }
.cc-table .d { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-table tfoot td { font-weight: 700; border-top: 2px solid #e7e5e4; }
.cc-table tr:hover td { background: rgb(0 0 0 / .02); }
.dark .cc-table th { color: #d6d3d1; border-color: rgb(255 255 255 / .1); }
.dark .cc-table td { border-color: rgb(255 255 255 / .06); }
.cc-retard { color: #b91c1c; font-weight: 700; }
.cc-controle { display: flex; gap: .75rem; padding: .7rem .8rem; border-radius: .6rem; border: 1px solid; margin-bottom: .5rem; }
.cc-controle strong { display: block; }
.cc-controle-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.cc-controle-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.cc-controle-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.cc-controle-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.dark .cc-controle { background: rgb(255 255 255 / .04); color: inherit; }
.cc-grille-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.cc-lien { color: var(--primary-600, #c2410c); font-weight: 600; cursor: pointer; }
.cc-lien:hover { text-decoration: underline; }
