/* Styles généraux */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: ltr;
}

/* Support RTL pour l'arabe */
[dir="rtl"] body {
    direction: rtl;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

/* Styles du tableau de bord */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.main-content {
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Styles des cartes */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* Styles des tableaux */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #2c2c2c;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 16px;
    color: white;
}

/* Styles spécifiques pour le tableau Excel des commandes */
#commands-table {
    font-size: 14px;
}

#commands-table thead tr:first-child th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
}

#commands-table thead tr.table-primary th {
    background-color: #0d6efd !important;
    color: white;
    border: 1px solid #0b5ed7;
    font-weight: bold;
}

#commands-table tfoot tr.table-warning td,
#commands-table tfoot tr.table-info td {
    border: 2px solid #000;
    font-size: 16px;
    padding: 10px;
}

#commands-table .article-row:hover {
    background-color: #f8f9fa;
}

#commands-table .form-control {
    font-size: 14px;
    padding: 8px;
}

#commands-table .montant-article {
    background-color: #e9ecef;
    font-weight: bold;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Styles des boutons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

/* Styles du formulaire Excel-like */
.excel-table {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.excel-table .table {
    margin-bottom: 0;
}

.excel-table .form-control {
    border: 1px solid #dee2e6;
    border-radius: 0;
    font-size: 14px;
}

.excel-table .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.excel-table .table th {
    background-color: #2c2c2c;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border: 1px solid #dee2e6;
}

.excel-table .table td {
    padding: 8px;
    border: 1px solid #dee2e6;
}

/* Styles des totaux */
.totals-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.totals-card .card-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.totals-card .card-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0;
}

/* Styles des modales */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

/* Styles des alertes */
.alert {
    border-radius: 8px;
    border: none;
}

/* Styles responsives */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .excel-table {
        font-size: 12px;
    }

    .excel-table .table th,
    .excel-table .table td {
        padding: 6px;
    }
}

/* Styles d'animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Styles des boutons d'action */
.action-buttons .btn {
    margin: 0 2px;
    padding: 4px 8px;
    font-size: 12px;
}

/* Styles du sélecteur de langue */
.lang-selector {
    position: absolute;
    top: 10px;
    right: 10px;
}

[dir="rtl"] .lang-selector {
    right: auto;
    left: 10px;
}

/* Styles pour les statuts colorés dans dettes_clients.php */
.status-cell option[value="non_payee"] {
    color: #dc3545 !important;
    font-weight: bold;
}

.status-cell option[value="partiellement_payee"] {
    color: #fd7e14 !important;
    font-weight: bold;
}

.status-cell option[value="payee"] {
    color: #28a745 !important;
    font-weight: bold;
}

/* Améliorer la visibilité des couleurs dans le select */
.status-cell {
    font-weight: bold;
}

/* Style pour le restant en rouge */
.text-danger.fw-bold {
    color: #dc3545 !important;
    font-weight: bold !important;
}

/* Style pour les cellules de montant payé */
.paid-amount-cell {
    border-left: 2px solid #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.paid-amount-cell:focus {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
}
