/* ============================================
   Dashboard Admin - Styles Principaux
   Thème: #f9d406 (jaune) & #06621f (vert foncé)
   ============================================ */

:root {
    --primary-yellow: #f9d406;
    --primary-green: #06621f;
    --dark-green: #044a17;
    --light-yellow: #fff9d6;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Layout Principal
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-green) 0%, var(--dark-green) 100%);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.sidebar-logo h2 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-logo span {
    color: var(--primary-yellow);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    cursor: pointer;
    border-left: 3px solid transparent;
    margin: 4px 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background: rgba(249, 212, 6, 0.15);
    color: var(--primary-yellow);
    border-left-color: var(--primary-yellow);
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
}

.nav-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

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

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.logout-btn i {
    margin-right: 8px;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 300px;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--gray-50);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-green);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(6, 98, 31, 0.1);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: var(--gray-200);
}

.notification-btn i {
    font-size: 1.2rem;
    color: var(--gray-600);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-yellow), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ============================================
   Page Content
   ============================================ */
.page-content {
    padding: 30px;
}

/* ============================================
   Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.expenses::before {
    background: var(--danger);
}

.stat-card.balance::before {
    background: var(--primary-green);
}

.stat-card.savings::before {
    background: var(--primary-yellow);
}

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.expenses {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-icon.balance {
    background: rgba(6, 98, 31, 0.1);
    color: var(--primary-green);
}

.stat-icon.savings {
    background: rgba(249, 212, 6, 0.2);
    color: #b8960c;
}

.stat-icon i {
    font-size: 1.5rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ============================================
   Content Card
   ============================================ */
.content-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 24px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark-green);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-warning {
    background: var(--primary-yellow);
    color: var(--gray-800);
}

.btn-warning:hover {
    background: #e0c005;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(6, 98, 31, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Radio & Checkbox */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-item, .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-item input, .checkbox-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
    cursor: pointer;
}

/* ============================================
   Tables / DataTables
   ============================================ */
.table-container {
    overflow-x: auto;
}

/* Fix : dropdown visible dans le tableau */
.table-container .dropdown-menu.show {
    position: fixed !important;
    z-index: 1060;
    will-change: transform;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table td {
    color: var(--gray-700);
    font-size: 0.9rem;
}

/* DataTables Override */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_filter input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    margin-left: 8px;
}

.dataTables_length select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    margin: 0 8px;
}

.dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    border-radius: var(--radius) !important;
    margin: 0 2px !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-green) !important;
    color: var(--white) !important;
    border: none !important;
}

.dataTables_info {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ============================================
   Status Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal.modal-lg {
    max-width: 900px;
}

.modal.modal-xl {
    max-width: 1200px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ============================================
   Dropdown
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 180px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--gray-700);
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item i {
    width: 18px;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: rgba(6, 98, 31, 0.02);
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.month-filter {
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
}

/* ============================================
   Invoice Preview
   ============================================ */
.invoice-preview {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 40px;
    margin-top: 20px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-green);
}

.invoice-logo img {
    max-height: 60px;
}

.invoice-title {
    text-align: right;
}

.invoice-title h1 {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.invoice-title .invoice-number {
    font-size: 1rem;
    color: var(--gray-600);
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.invoice-party h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.invoice-party p {
    margin-bottom: 4px;
    color: var(--gray-700);
}

.invoice-party strong {
    color: var(--gray-800);
}

.invoice-dates {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.invoice-date {
    font-size: 0.9rem;
}

.invoice-date span {
    color: var(--gray-500);
}

.invoice-table {
    width: 100%;
    margin-bottom: 30px;
    border-collapse: collapse;
}

.invoice-table th {
    background: var(--gray-100);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.invoice-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.invoice-table .text-right {
    text-align: right;
}

.invoice-totals {
    display: flex;
    justify-content: flex-end;
}

.invoice-totals-table {
    width: 300px;
}

.invoice-totals-table tr td {
    padding: 8px 16px;
}

.invoice-totals-table tr td:first-child {
    text-align: right;
    color: var(--gray-600);
}

.invoice-totals-table tr td:last-child {
    text-align: right;
    font-weight: 500;
}

.invoice-totals-table .total-row {
    background: var(--primary-green);
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
}

.invoice-totals-table .total-row td {
    border-radius: var(--radius);
}

.invoice-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.invoice-notes {
    margin-bottom: 20px;
}

.invoice-notes h4 {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.invoice-notes p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.invoice-qr {
    text-align: center;
}

.invoice-qr canvas {
    max-width: 100px;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--light-yellow) 100%);
    padding: 20px;
}

.login-container {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
}

.login-image {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--white);
}

.login-image h1 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.login-image p {
    opacity: 0.9;
    text-align: center;
}

.login-form-container {
    flex: 1;
    padding: 60px 40px;
}

.login-form-header {
    margin-bottom: 32px;
}

.login-form-header h2 {
    font-size: 1.75rem;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.login-form-header p {
    color: var(--gray-500);
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ============================================
   Settings Page
   ============================================ */
.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        padding: 0 20px;
    }
    
    .header-search input {
        width: 200px;
    }
    
    .invoice-parties {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-image {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-search {
        display: none;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
    
    .page-content {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .user-info {
        display: none;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* ============================================
   Phone Input Customization
   ============================================ */
.iti {
    width: 100%;
}

.iti__flag-container {
    padding: 0;
}

.iti__selected-flag {
    padding: 0 12px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    
    .invoice-preview {
        padding: 0;
        border: none;
        box-shadow: none;
    }
}

/* ============================================
   Font Awesome Icon Sizing (remplacement Feather)
   ============================================ */

/* Taille par défaut des icônes FA dans la sidebar et le layout */
.sidebar-nav .nav-item i,
.sidebar-footer i,
.header i,
.quick-action-btn i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Icônes dans les stat-cards */
.stat-icon i {
    font-size: 20px;
}

/* Icônes dans les boutons */
.btn i.fa-solid,
.btn i.fa-regular {
    font-size: 14px;
}

/* Icônes dans les card-title */
.card-title i {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 6px;
}

/* Dropdown action bouton - trois points */
.dropdown .btn-sm i.fa-solid,
.dropdown .btn-sm i.fa-regular,
table .dropdown .btn i,
.data-table .dropdown .btn i {
    font-size: 16px;
    line-height: 1;
}

/* Dropdown menu items */
.dropdown-menu .dropdown-item i,
.dropdown-menu .dropdown-item i.fa-solid {
    font-size: 14px;
    width: 20px;
    text-align: center;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

/* Forcer l'affichage des icônes FA dans les cellules de tableau */
td i.fa-solid,
td i.fa-regular,
td .dropdown i {
    font-size: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Stat trend arrows */
.stat-trend i {
    font-size: 12px;
}

/* Notification badge bell */
.notification-btn i {
    font-size: 18px;
}

/* Modal close button */
.modal-close i {
    font-size: 16px;
}

/* Badge dans les filtres */
.filter-bar .btn i {
    font-size: 12px;
}

/* ============================================
   Btn Loading Spinner
   ============================================ */
.loader-btn {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loader-btn-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes loader-btn-spin {
    to { transform: rotate(360deg); }
}
.btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}
