/* Styles personnalisés pour Distrans Express Cockpit Comptable & Fiscal */

@layer base {
    body {
        font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    }
}

/* Tooltip customisé */
.tooltip-trigger {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #94a3b8;
}

.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #0f172a;
    color: #f8fafc;
    font-size: 0.75rem;
    line-height: 1.25;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    z-index: 50;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.tooltip-trigger:hover::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
    z-index: 50;
}

/* Impression professionnelle (Liasse comptable) */
@media print {
    body {
        background-color: white !important;
        color: black !important;
        font-size: 11pt;
    }
    
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    .page-break {
        page-break-before: always;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 1px solid #cbd5e1 !important;
        padding: 4px 8px !important;
    }

    .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl {
        box-shadow: none !important;
    }
}

/* Animations légères */
.tab-content {
    display: none;
    animation: fadeIn 0.25s ease-in-out forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-out forwards;
}

/* Styles spécialisés Bilan CGNC Officiel */
.cgnc-table {
    border-collapse: collapse;
    width: 100%;
}

.cgnc-table th, 
.cgnc-table td {
    border: 1px solid #cbd5e1;
    padding: 3px 6px;
}

.cgnc-vertical-mass {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-orientation: mixed;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.15em;
    font-weight: 800;
    text-transform: uppercase;
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 8px 4px !important;
}

.cgnc-table tr:hover {
    background-color: #f8fafc;
}

.cgnc-subtotal-row {
    background-color: #f8fafc;
    font-weight: 700;
}

.cgnc-total-row {
    background-color: #e2e8f0;
    font-weight: 800;
    border-top: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
}

.cgnc-grand-total-row {
    background-color: #cbd5e1;
    font-weight: 900;
    border-top: 2px solid #334155;
    border-bottom: 4px double #0f172a;
}


/* Défilement fluide des tableaux */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Masquer la barre de défilement tout en permettant le scroll (notamment pour les onglets mobiles) */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Optimisation tactile et responsive mobile */
@media (max-width: 640px) {
    /* Touch scrolling fluide */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Éviter le zoom incontrôlé sur focus sur iOS tout en gardant une typographie propre */
    input, select, textarea {
        font-size: 13px !important;
    }
}

