/* Main Styles */
:root {
    --primary: #e41e26; /* Red from logo */
    --secondary: #212121; /* Black from logo */
    --light: #f8f9fa;
    --dark: #333;
    --white: #ffffff;
    --gray: #e9ecef;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login Form */
.login-container {
    max-width: 450px;
    margin: 80px auto;
    padding: 30px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
}

.login-logo i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(228, 30, 38, 0.25);
}

.btn-login {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    padding: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background-color: #c31920;
    border-color: #b5171d;
}

/* Dashboard */
.dashboard-card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

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

.dashboard-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

/* Dashboard Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    padding: 20px;
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(228, 30, 38, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.stat-details {
    flex-grow: 1;
}

.stat-title {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--secondary);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary);
}

.stat-summary {
    font-size: 0.9rem;
    color: var(--dark);
}

/* Chart styles */
.chart-container {
    margin-top: 20px;
}

/* Recent activity */
#recent-activity-list .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Alerts */
.alert {
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--secondary);
    color: var(--white);
    padding: 20px 0;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 0 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 100px;
    margin-bottom: 10px;
}

.sidebar-brand {
    color: var(--white);
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left: 4px solid var(--primary);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.sidebar-toggle {
    position: fixed;
    left: var(--sidebar-width);
    top: 10px;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0 5px 5px 0;
    padding: 10px;
    z-index: 1001;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.sidebar-collapsed .sidebar-toggle {
    left: 0;
}

.content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: all 0.3s ease;
    width: calc(100% - var(--sidebar-width));
    padding-top: 40px; /* Increased padding to the top */
}

.sidebar-collapsed .content-wrapper {
    margin-left: 0;
    width: 100%;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
}

/* Footer */
footer {
    border-top: 1px solid var(--gray);
    margin-top: auto;
}

/* Note de frais */
.note-frais-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.note-frais-table {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.note-frais-table table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    table-layout: fixed;
}

.note-frais-table th, .note-frais-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.note-frais-table .numeric-cell {
    text-align: right;
    position: relative;
    width: 8%;
}

.note-frais-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.note-frais-table .editable {
    background-color: #fff;
    cursor: pointer;
}

.note-frais-table .editable:hover {
    background-color: #f1f1f1;
}

.note-frais-table .editable:focus {
    outline: 2px solid var(--primary);
    background-color: var(--white);
}

/* Details button and panel */
.details-btn {
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 18px;
    font-size: 10px;
    border-radius: 50%;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    vertical-align: middle;
}

.details-btn:hover {
    opacity: 1;
}

.details-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 280px;
    background-color: var(--white);
    border: 1px solid var(--gray);
    border-radius: 5px;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px;
}

.details-panel::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--white);
}

.details-panel::before {
    content: '';
    position: absolute;
    bottom: -11px;
    right: 9px;
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 11px solid var(--gray);
}

.position-relative {
    position: relative;
}

.numeric-cell {
    white-space: nowrap;
}

/* Solde color classes */
.solde-positive {
    background-color: rgba(25, 135, 84, 0.25) !important;
    color: #0f5132;
    font-weight: 500;
}

.solde-negative {
    background-color: rgba(220, 53, 69, 0.25) !important;
    color: #58151c;
    font-weight: 500;
}

/* Price Range Slider */
.price-range-slider {
    width: 100%;
    padding: 0 10px;
}

.price-range-slider .range-slider {
    width: 100%;
    height: 5px;
    background: #ddd;
    border-radius: 5px;
    margin: 30px 0;
    position: relative;
}

.price-range-slider .range-slider .progress {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    position: absolute;
    left: 0%;
    right: 0%;
}

.price-range-slider .range-input {
    position: relative;
}

.price-range-slider .range-input input {
    position: absolute;
    width: 100%;
    height: 5px;
    top: -5px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.price-range-slider .range-input input::-webkit-slider-thumb {
    height: 17px;
    width: 17px;
    border-radius: 50%;
    background: var(--primary);
    pointer-events: auto;
    -webkit-appearance: none;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.price-range-slider .range-input input::-moz-range-thumb {
    height: 17px;
    width: 17px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    pointer-events: auto;
    -moz-appearance: none;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.price-range-slider .price-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.price-range-slider .price-input .field {
    width: 45%;
    display: flex;
    align-items: center;
}

.price-range-slider .price-input .field span {
    margin-right: 5px;
}

.price-range-slider .price-input input {
    width: 100%;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0 10px;
    outline: none;
    text-align: right;
}

.note-frais-table .subheader {
    background-color: #e9ecef;
    font-weight: 500;
}

.note-frais-table .total-row {
    background-color: #f8f9fa;
    font-weight: 600;
}

.note-frais-table .numeric-cell {
    text-align: right;
    position: relative;
    width: 8%;
}

.note-frais-table .solde-cell {
    background-color: rgba(228, 30, 38, 0.05);
}

.note-frais-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.note-frais-form .form-group {
    margin-bottom: 15px;
}

/* Date picker styles */
.date-cell {
    min-width: 120px;
}

.date-cell .date-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
    text-align: center;
}

.date-cell .date-input:focus {
    outline: none;
    box-shadow: none;
}

.flatpickr-calendar {
    font-size: 14px;
}

/* Fiche Comptable styles */
.fiche-comptable-header h2,
.fiche-comptable-header h3 {
    color: var(--secondary);
    margin: 0;
    text-align: center;
}

/* Attachments styles */
.attachments-container {
    margin-top: 10px;
}

.attachment-item .card {
    transition: all 0.3s ease;
    height: 100%;
}

.attachment-item .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.attachment-item .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.attachment-item .fas {
    color: var(--secondary);
}

.attachment-item .fa-file-pdf {
    color: #e74c3c;
}

.attachment-item .fa-file-word {
    color: #2980b9;
}

.attachment-item .fa-file-excel {
    color: #27ae60;
}

.attachment-item .fa-file-powerpoint {
    color: #e67e22;
}

.attachment-item .fa-file-image {
    color: #9b59b6;
}

.attachment-item .fa-file-archive {
    color: #f39c12;
}

.attachment-item .fa-file-alt {
    color: #7f8c8d;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #c31920;
    border-color: #b5171d;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* User profile in sidebar */
.sidebar-user {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.sidebar-user .user-info {
    display: flex;
    align-items: center;
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.sidebar-user .user-name {
    color: var(--white);
    font-weight: 500;
}

.sidebar-user .user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Mobile responsiveness */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar-toggle {
        left: 0;
    }
    
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    body:not(.sidebar-collapsed) .sidebar {
        transform: translateX(0);
    }
    
    body:not(.sidebar-collapsed) .sidebar-toggle {
        left: var(--sidebar-width);
    }
}

/* jQuery UI Autocomplete custom styling */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999 !important;
    border: 1px solid var(--gray);
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ui-autocomplete .ui-menu-item {
    padding: 5px 10px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray);
}

.ui-autocomplete .ui-menu-item:last-child {
    border-bottom: none;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 3px 5px;
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active {
    background-color: var(--primary);
    border: none;
    color: var(--white);
    margin: 0;
}

.fiche-comptable-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
}

.fiche-comptable-header h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.solde-row {
    background-color: #e9ecef;
    font-weight: bold;
}

.fiche-comptable-actions {
    display: flex;
    justify-content: space-between;
}

@media print {
    .fiche-comptable-actions,
    .breadcrumb,
    nav.navbar {
        display: none !important;
    }
    
    .card {
        border: none !important;
    }
    
    .card-body {
        padding: 0 !important;
    }
    
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    @page {
        size: landscape;
        margin: 1cm;
    }
}
.numeric-cell{
	min-width:80px !important;
}

table td,table th{
	white-space:nowrap !important;
}