/* =====================================================
   AXIIO - Modern Design System
   Inspiré par Tailwind - Design épuré et professionnel
   ===================================================== */

/* Import Google Font Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =====================================================
   BASE & RESET
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root {
    /* Couleurs principales */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* Couleurs d'accent */
    --blue-50: #eff6ff;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    
    --green-50: #f0fdf4;
    --green-500: #22c55e;
    --green-600: #16a34a;
    
    --purple-50: #faf5ff;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    
    --orange-50: #fff7ed;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    
    --red-50: #fef2f2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    
    /* Ombres */
    --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 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

body {
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 256px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    z-index: 50;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    flex: 1;
}

.logo-img {
    height: 28px;
    width: auto;
}

.sidebar-company {
    margin: 1.5rem 1.5rem 1rem 1.5rem;
    padding: 0.875rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.company-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gray-200);
}

.company-icon i {
    color: var(--gray-900);
    font-size: 16px;
}

.sidebar-company p {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.sidebar-nav a.active {
    background: var(--gray-100);
    color: var(--gray-900);
    border-right: 2px solid var(--gray-900);
}

.sidebar-nav a i {
    width: 18px;
    font-size: 16px;
    margin-right: 0.75rem;
    color: var(--gray-500);
    transition: var(--transition);
}

.sidebar-nav a:hover i,
.sidebar-nav a.active i {
    color: var(--gray-900);
}

.sidebar-nav hr {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

.sidebar-user {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.sidebar-user-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gray-900);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-avatar i {
    color: white;
    font-size: 14px;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =====================================================
   MOBILE HEADER
   ===================================================== */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 30;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.875rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.burger-menu {
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 0.375rem;
}

.burger-menu:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.mobile-logo {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mobile-logo img {
    height: 24px;
    width: auto;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 40;
    backdrop-filter: blur(2px);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    flex: 1;
    margin-left: 256px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 256px);
    overflow-x: hidden;
}

.content-wrapper {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 400;
}

/* =====================================================
   MODULE CARDS (Actions rapides)
   ===================================================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.module-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 2rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--gray-900);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.module-card:hover::before {
    transform: scaleY(1);
}

.module-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.module-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--gray-50);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.module-icon-wrapper i {
    font-size: 28px;
    color: var(--gray-900);
    transition: var(--transition);
}

.module-card:hover .module-icon-wrapper {
    background: var(--gray-900);
    border-color: var(--gray-900);
}

.module-card:hover .module-icon-wrapper i {
    color: white;
    transform: scale(1.1);
}

.module-content {
    flex: 1;
}

.module-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.module-description {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

/* =====================================================
   DEMO BANNER
   ===================================================== */
.demo-banner {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--orange-50);
    border: 1px solid var(--orange-500);
    color: var(--orange-600);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    /* Base layout */
    body {
        overflow-x: hidden;
    }
    
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .content-wrapper {
        padding: 1.5rem 0.875rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Modules grid */
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .module-card {
        padding: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .module-icon-wrapper {
        width: 56px;
        height: 56px;
    }
    
    .module-icon-wrapper i {
        font-size: 24px;
    }
    
    /* Page header */
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        word-wrap: break-word;
    }
    
    .page-subtitle {
        font-size: 0.875rem;
    }
    
    .demo-banner {
        top: 4rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
    
    /* Buttons */
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Search */
    .search-form {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
        box-sizing: border-box;
    }
    
    .btn-search {
        width: 100%;
    }
    
    .btn-search span {
        display: inline;
    }
    
    /* Tables */
    .clients-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    .clients-list table {
        min-width: 100%;
    }
    
    .clients-list td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
        max-width: 200px;
        word-wrap: break-word;
    }
    
    .clients-list th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .clients-list td a {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    /* Forms */
    .form-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .modern-form {
        width: 100%;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .form-row {
        width: 100%;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        width: 100%;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .page-header-top {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .page-header-top .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Header actions */
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Client info */
    .client-info-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .client-info-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .client-avatar {
        width: 64px;
        height: 64px;
    }
    
    .client-avatar i {
        font-size: 1.5rem;
    }
    
    .client-header-text h2 {
        font-size: 1.25rem;
        word-wrap: break-word;
    }
    
    .client-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-item {
        width: 100%;
    }
    
    /* Sections */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }
    
    .section-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .section-content {
        padding: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .section-content table {
        min-width: 100%;
    }
    
    /* Products */
    .product-item {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .product-fields {
        grid-template-columns: 1fr;
    }
    
    .product-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-delete-product {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }
    
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-wrapper {
        padding: 2rem 1.25rem;
    }
}

@media (min-width: 1025px) {
    .mobile-header {
        display: none;
    }
}

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

/* =====================================================
   STORY SECTION - Split Design
   ===================================================== */
.story-section {
    margin-top: 3rem;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 550px;
}

.story-image-side {
    position: relative;
    background: url('./images/alpiniste.jpg') center/cover no-repeat;
    overflow: hidden;
}

.story-image-side::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.story-content-side {
    padding: 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.story-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gray-900);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.story-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0 0 1rem 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.story-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin: 0 0 2rem 0;
    font-weight: 400;
    line-height: 1.6;
}

.story-text {
    margin-bottom: 2rem;
}

.story-paragraph {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.story-paragraph:last-child {
    margin-bottom: 0;
}

.story-highlight {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-200);
}

.story-cta {
    margin-top: 0;
}

.story-cta .btn {
    padding: 0.875rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 1024px) {
    .story-section {
        grid-template-columns: 1fr;
    }

    .story-image-side {
        min-height: 300px;
        order: -1;
    }

    .story-content-side {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    .story-section {
        margin-top: 2rem;
    }

    .story-image-side {
        min-height: 250px;
    }

    .story-content-side {
        padding: 2rem 1.5rem;
    }

    .story-title {
        font-size: 1.75rem;
    }

    .story-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .story-paragraph {
        font-size: 0.9rem;
    }

    .story-highlight {
        font-size: 1rem;
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }

    .story-cta {
        margin-top: 1.5rem;
    }

    .story-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   BUTTONS
   ===================================================== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

/* Formulaire inline dans les action-buttons */
.inline-form {
    display: inline-flex;
    margin: 0;
}

.inline-form button {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn i {
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

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

.btn-search {
    background: var(--gray-900);
    color: white;
}

.btn-search:hover {
    background: var(--gray-800);
}

/* =====================================================
   SEARCH SECTION
   ===================================================== */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-900);
    background: white;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--gray-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-input::placeholder {
    color: var(--gray-400);
}

/* =====================================================
   CLIENTS LIST
   ===================================================== */
.clients-list {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
}

/* Style pour le tableau des clients (généré par PHP) */
.clients-list table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.clients-list thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.clients-list th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clients-list tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

.clients-list tbody tr:last-child {
    border-bottom: none;
}

.clients-list tbody tr:hover {
    background: var(--gray-50);
}

.clients-list td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    word-break: break-word;
    max-width: 300px;
}

.clients-list td:last-child {
    width: 1%;
    white-space: nowrap;
}

.clients-list td a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    background: var(--gray-900);
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.clients-list td a:hover {
    background: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Style pour les boutons d'action dans le tableau */
.clients-list .action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
}

.clients-list .action-link:hover {
    background: var(--gray-900);
    color: white;
}

/* Message si aucun client */
.clients-list .no-clients {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--gray-500);
}

.clients-list .no-clients i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

/* Pagination */
.clients-list .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.clients-list .pagination a,
.clients-list .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.clients-list .pagination a {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.clients-list .pagination a:hover {
    background: var(--gray-900);
    color: white;
    border-color: var(--gray-900);
}

.clients-list .pagination span {
    background: var(--gray-900);
    color: white;
}

/* =====================================================
   FORMS
   ===================================================== */
.page-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 2rem;
}

.modern-form {
    width: 100%;
    max-width: 100%;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--gray-500);
    font-size: 1rem;
}

.form-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--red-500);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-900);
    background: white;
    transition: var(--transition);
    font-family: inherit;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gray-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-error {
    background: var(--red-50);
    color: var(--red-600);
    border: 1px solid var(--red-200);
}

.alert-warning {
    background: var(--orange-50);
    color: var(--orange-600);
    border: 1px solid var(--orange-200);
}

.alert-success {
    background: var(--green-50);
    color: var(--green-600);
    border: 1px solid var(--green-200);
}

/* Delete Section */
.delete-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--red-200);
}

.delete-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--red-600);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-title i {
    font-size: 1rem;
}

.delete-warning {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-danger {
    background: var(--red-500);
    color: white;
    border: 1px solid var(--red-600);
}

.btn-danger:hover {
    background: var(--red-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Product Items (for devis/factures) */
.product-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-delete-product {
    background: var(--red-50);
    color: var(--red-600);
    border: 1px solid var(--red-200);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-delete-product:hover {
    background: var(--red-600);
    color: white;
    border-color: var(--red-600);
}

.product-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .product-fields {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .product-item {
        padding: 1rem;
    }
    
    .product-fields {
        grid-template-columns: 1fr;
    }
}

/* Form row for creer-devis.php */
.form-row2-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row2-2 {
        grid-template-columns: 1fr;
        margin-bottom: 1rem;
    }
}

/* =====================================================
   CLIENT INFO CARD
   ===================================================== */
.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.client-info-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.client-info-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.client-avatar {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid var(--gray-200);
}

.client-avatar i {
    font-size: 2rem;
    color: var(--gray-500);
}

.client-header-text h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.client-date {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.client-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    gap: 1rem;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-icon {
    width: 40px;
    height: 40px;
    background: var(--gray-50);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gray-200);
}

.info-icon i {
    font-size: 1rem;
    color: var(--gray-600);
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.9375rem;
    color: var(--gray-900);
    line-height: 1.5;
}

/* =====================================================
   SECTION CARD (Devis/Factures)
   ===================================================== */
.section-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.section-title i {
    color: var(--gray-500);
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.section-content {
    padding: 1.5rem 2rem;
}

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

.section-content thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.section-content th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-content tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

.section-content tbody tr:last-child {
    border-bottom: none;
}

.section-content tbody tr:hover {
    background: var(--gray-50);
}

.section-content td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.section-content td a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    background: var(--gray-900);
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.section-content td a:hover {
    background: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Message si aucun devis/facture */
.section-content p {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

/* =====================================================
   SWEETALERT2 CUSTOM STYLES
   ===================================================== */
.swal-modern-popup {
    border-radius: 0.75rem !important;
    padding: 2rem !important;
}

.swal-modern-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--gray-900) !important;
    margin-bottom: 0.75rem !important;
}

.swal-modern-html {
    margin: 0 !important;
}

.swal2-icon.swal2-success {
    border-color: var(--gray-900) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--gray-900) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(23, 23, 23, 0.3) !important;
}

.swal2-actions {
    gap: 0.75rem !important;
    margin-top: 1.5rem !important;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.card-shadow {
    box-shadow: var(--shadow);
}

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

.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* =====================================================
   INFO BOX
   ===================================================== */
.info-box {
    background: var(--blue-50);
    border: 1px solid #93c5fd;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-box-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #93c5fd;
}

.info-box-icon i {
    font-size: 1.125rem;
    color: var(--blue-600);
}

.info-box-content {
    flex: 1;
}

.info-box-content p {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.info-box-content p:last-child {
    margin-bottom: 0;
}

.info-box-content strong {
    color: var(--gray-900);
    font-weight: 600;
}

@media (max-width: 768px) {
    .info-box {
        flex-direction: column;
        padding: 1.25rem;
    }
    
    .info-box-icon {
        width: 36px;
        height: 36px;
    }
    
    .info-box-icon i {
        font-size: 1rem;
    }
}

/* =====================================================
   PRODUCTS HEADER
   ===================================================== */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.products-header .form-section-title {
    margin-bottom: 0;
}

/* Product Items dans le devis */
#products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =====================================================
   MODELES
   ===================================================== */
.modeles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.modele-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modele-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.modele-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.modele-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-50);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gray-200);
}

.modele-icon i {
    font-size: 1.25rem;
    color: var(--gray-700);
}

.modele-info {
    flex: 1;
    min-width: 0;
}

.modele-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.modele-count {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.modele-count i {
    font-size: 0.75rem;
}

.modele-card-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.modele-card-actions .inline-form {
    width: 100%;
}

.modele-card-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
}

.empty-state-icon i {
    font-size: 2rem;
    color: var(--gray-400);
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.75rem 0;
}

.empty-state-text {
    font-size: 1rem;
    color: var(--gray-600);
    max-width: 500px;
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .modeles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modele-card {
        padding: 1.25rem;
    }
    
    .modele-icon {
        width: 40px;
        height: 40px;
    }
    
    .modele-icon i {
        font-size: 1.125rem;
    }
    
    .modele-title {
        font-size: 1rem;
    }
    
    .empty-state {
        padding: 3rem 1.5rem;
    }
    
    .empty-state-icon {
        width: 64px;
        height: 64px;
    }
    
    .empty-state-icon i {
        font-size: 1.5rem;
    }
    
    .empty-state-title {
        font-size: 1.25rem;
    }
}

/* =====================================================
   AFFICHAGE DEVIS/FACTURES
   ===================================================== */
.devis-viewer {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.devis-viewer iframe {
    width: 100%;
    min-height: 800px;
    border: none;
    display: block;
}

/* Pour le contenu généré par voirLeDevis() */
.devis-viewer img {
    max-width: 100%;
    height: auto;
    display: block;
}

.devis-viewer embed,
.devis-viewer object {
    width: 100%;
    min-height: 800px;
}

@media (max-width: 768px) {
    .devis-viewer iframe,
    .devis-viewer embed,
    .devis-viewer object {
        min-height: 600px;
    }
}

/* =====================================================
   READONLY INPUTS & PRODUCT ITEMS
   ===================================================== */
.readonly-input {
    background-color: #f8f9fa !important;
    cursor: not-allowed;
    color: #495057;
    border: 1px solid var(--gray-200);
}

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

.product-item-readonly {
    background: #f8f9fa;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.product-item-readonly .product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-300);
}

.product-item-readonly .product-number {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-color);
}

.product-item-readonly .product-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .product-item-readonly .product-fields {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   DEMO BANNER
   ===================================================== */
.demo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* =====================================================
   MODERN TABLE (pour factures, devis, etc.)
   ===================================================== */
.content-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-container {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.modern-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.modern-table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
}

.modern-table thead th i {
    margin-right: 0.5rem;
    color: var(--gray-500);
}

.modern-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.2s ease;
}

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

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody td {
    padding: 1rem 1.5rem;
    color: var(--gray-700);
    vertical-align: middle;
    font-size: 0.875rem;
}

.modern-table .client-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modern-table .client-icon {
    color: var(--gray-600);
    font-size: 1.125rem;
}

.modern-table .btn-table {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.modern-table .btn-view {
    background-color: var(--gray-900);
    color: white;
}

.modern-table .btn-view:hover {
    background-color: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.modern-table .btn-edit {
    background-color: var(--blue-500);
    color: white;
}

.modern-table .btn-edit:hover {
    background-color: var(--blue-600);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.modern-table .btn-delete {
    background-color: var(--red-500);
    color: white;
}

.modern-table .btn-delete:hover {
    background-color: var(--red-600);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.modern-table .table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Table Responsive */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    border-radius: 0.75rem;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.table-responsive thead {
    background-color: var(--gray-900);
    color: white;
}

.table-responsive th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table-responsive td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9375rem;
}

.table-responsive tbody tr {
    transition: background-color 0.2s ease;
}

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

.table-responsive a {
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table-responsive a:hover {
    color: var(--gray-600);
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background-color: var(--gray-900);
    color: white;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
    box-sizing: border-box;
}

.pagination a:hover {
    background-color: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pagination a i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background-color: var(--gray-900);
    color: white;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
    box-sizing: border-box;
}

.pagination-btn:hover {
    background-color: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pagination-btn i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.pagination-info {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.table-responsive th {
    color: #FFF;
}

/* Responsive table */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 0.5rem;
        box-shadow: inset 0 0 0 1px var(--gray-200);
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    .table-responsive thead {
        color: white;
    }
    
    .table-responsive th {
        padding: 0.75rem;
        font-size: 0.8125rem;
        color: white;
        border-bottom: 2px solid var(--gray-900);
    }
    
    .table-responsive td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .modern-table {
        display: block;
    }
    
    .modern-table thead {
        display: none;
    }
    
    .modern-table tbody {
        display: block;
    }
    
    .modern-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--gray-200);
        border-radius: 0.75rem;
        overflow: hidden;
    }
    
    .modern-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .modern-table tbody td:last-child {
        border-bottom: none;
    }
    
    .modern-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        margin-right: 1rem;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .modern-table .client-info {
        flex-direction: row;
    }
    
    .modern-table .table-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .pagination {
        gap: 0.5rem;
        padding: 1rem 0.875rem;
    }
    
    .pagination a {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-width: auto;
        gap: 0.25rem;
    }
    
    .pagination a i {
        font-size: 0.625rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-width: auto;
        gap: 0.25rem;
    }
    
    .pagination-btn i {
        font-size: 0.625rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
    }
}

/* =====================================================
   MON COMPTE - LOGO SECTION
   ===================================================== */
.logo-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo-preview {
    display: flex;
    justify-content: center;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    border: 2px dashed var(--gray-300);
}

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

.logo-upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-input {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
}

.file-input:focus {
    outline: none;
    border-color: var(--gray-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.error-message {
    color: var(--red-500);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* =====================================================
   MODAL SIREN
   ===================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content-custom {
    background: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header-custom h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.modal-body-custom {
    padding: 1.5rem;
}

.modal-body-custom p {
    margin: 0 0 1rem 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.modal-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-900);
    background: white;
    transition: var(--transition);
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: var(--gray-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.modal-footer-custom {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .modal-content-custom {
        width: 95%;
        margin: 1rem;
    }
    
    .form-section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-section-header .btn {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   SWEETALERT2 CUSTOM STYLES
   ===================================================== */
.custom-swal-popup {
    border-radius: 1rem;
    padding: 2rem;
}

.custom-swal-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.custom-swal-confirm {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-radius: 0.5rem;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
}

.custom-swal-confirm:hover {
    background-color: #333333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.custom-swal-cancel {
    background-color: var(--gray-300) !important;
    color: var(--text-primary) !important;
    border-radius: 0.5rem;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
}

.custom-swal-cancel:hover {
    background-color: var(--gray-400) !important;
    transform: translateY(-2px);
}

/* =====================================================
   STATISTIQUES - Style minimaliste
   ===================================================== */

/* Stats Grid Simple */
.stats-grid-simple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card-simple {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card-simple:hover {
    border-color: var(--gray-900);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.stat-card-header i {
    font-size: 1rem;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

/* Charts Grid Clean */
.charts-grid-clean {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.chart-card-clean {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.chart-card-clean.chart-wide {
    grid-column: span 1;
}

.chart-title-clean {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid-simple {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .charts-grid-clean {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-card-clean.chart-wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .page-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header-top .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid-simple {
        gap: 0.75rem;
    }
    
    .stat-card-simple {
        padding: 1rem;
        box-sizing: border-box;
    }
    
    .stat-card-header {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-card-value {
        font-size: 1.375rem;
    }
    
    .charts-grid-clean {
        gap: 0.75rem;
    }
    
    .chart-card-clean {
        padding: 0.875rem;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .chart-title-clean {
        font-size: 0.875rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    /* Assurer que les graphiques s'adaptent */
    .chart-card-clean > div {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .apexcharts-canvas,
    .apexcharts-svg,
    .apexcharts-graphical {
        max-width: 100% !important;
        overflow: visible !important;
    }
    
    /* Forcer le responsive sur tous les éléments apexcharts */
    [class*="apexcharts"] {
        max-width: 100% !important;
    }
}

/* =====================================================
   PAGINATION LINKS - Priorité absolue
   ===================================================== */
.pagination a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.625rem 1.25rem !important;
    background-color: var(--gray-900) !important;
    color: white !important;
    border-radius: 0.375rem !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    min-width: fit-content !important;
    box-sizing: border-box !important;
}

.pagination a:hover {
    background-color: var(--gray-700) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.pagination a i {
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
}

/* Mobile pagination links */
@media (max-width: 768px) {
    .pagination a {
        padding: 0.625rem 1rem !important;
        font-size: 0.8125rem !important;
        min-width: auto !important;
        gap: 0.375rem !important;
    }
    
    .pagination a i {
        font-size: 0.75rem !important;
    }
}

td a:hover {
    text-decoration: none !important;
    color:#FFF !important;
}

/* =====================================================
   PAGE DE CONNEXION/INSCRIPTION
   ===================================================== */
.auth-body {
    margin: 0;
    padding: 0;
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-md);
    transition: max-width 0.3s ease;
}

.auth-container.wide {
    max-width: 640px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-brand p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.auth-form .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: white;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--gray-900);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.05);
}

.auth-form .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-password-container {
    position: relative;
}

.auth-password-container input {
    padding-right: 3rem;
}

.auth-eye-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1.125rem;
    user-select: none;
    transition: color 0.2s ease;
}

.auth-eye-icon:hover {
    color: var(--gray-600);
}

.auth-helper-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.auth-siren-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--gray-900);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: 0.375rem;
    transition: color 0.2s ease;
}

.auth-siren-link:hover {
    color: var(--gray-700);
}

.auth-error {
    display: none;
    background: var(--red-50);
    border: 1px solid var(--red-500);
    color: var(--red-600);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-error.show {
    display: block;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-divider {
    margin: 1.75rem 0;
    border-top: 1px solid var(--gray-200);
}

.auth-switch {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--gray-600);
}

.auth-switch a {
    color: var(--gray-900);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: var(--gray-700);
}

.auth-forgot {
    text-align: center;
    margin-top: 1rem;
}

.auth-forgot a {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot a:hover {
    color: var(--gray-900);
}

/* Modal SIREN */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.auth-modal.show {
    display: flex;
}

.auth-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.auth-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.auth-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

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

.auth-modal-body p {
    color: var(--gray-600);
    margin-bottom: 1.25rem;
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Cookie Consent */
.auth-cookie-consent {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1.25rem;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-top: 1px solid var(--gray-200);
}

.auth-cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.auth-cookie-text {
    flex: 1;
    min-width: 300px;
}

.auth-cookie-text p {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

.auth-cookie-text a {
    color: var(--gray-900);
    font-weight: 500;
    text-decoration: none;
}

.auth-cookie-text a:hover {
    text-decoration: underline;
}

.auth-cookie-btn {
    padding: 0.625rem 1.5rem;
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.auth-cookie-btn:hover {
    background: var(--gray-800);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container,
    .auth-container.wide {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .auth-brand h1 {
        font-size: 1.5rem;
    }

    .auth-form .form-row-2 {
        grid-template-columns: 1fr;
    }
    
    /* Force single column on mobile even in inscription mode */
    #auth-credentials {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .auth-cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .auth-cookie-btn {
        width: 100%;
    }
}

/* =====================================================
   SWEETALERT2 CUSTOM STYLING
   ===================================================== */
.swal2-popup {
    border-radius: 12px !important;
    padding: 2rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.swal2-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--gray-900) !important;
    margin-bottom: 1rem !important;
}

.swal2-html-container {
    font-size: 0.9375rem !important;
    color: var(--gray-600) !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

.swal2-icon {
    margin: 0 auto 1.5rem !important;
}

.swal2-icon.swal2-success {
    border-color: var(--gray-900) !important;
    color: var(--gray-900) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--gray-900) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(26, 26, 26, 0.3) !important;
}

.swal2-icon.swal2-error {
    border-color: var(--red-500) !important;
    color: var(--red-500) !important;
}

.swal2-icon.swal2-warning {
    border-color: var(--orange-500) !important;
    color: var(--orange-500) !important;
}

.swal2-icon.swal2-info {
    border-color: var(--gray-900) !important;
    color: var(--gray-900) !important;
}

.swal2-confirm {
    background: var(--gray-900) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.75rem 2rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.swal2-confirm:hover {
    background: var(--gray-800) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.swal2-cancel {
    background: var(--gray-200) !important;
    color: var(--gray-700) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.75rem 2rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.swal2-cancel:hover {
    background: var(--gray-300) !important;
}

.swal2-actions {
    margin-top: 1.5rem !important;
    gap: 0.75rem !important;
}

.swal2-input,
.swal2-textarea {
    border: 1px solid var(--gray-300) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
    transition: all 0.2s ease !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
    border-color: var(--gray-900) !important;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.05) !important;
    outline: none !important;
}

.swal2-validation-message {
    background: var(--red-50) !important;
    border: 1px solid var(--red-500) !important;
    color: var(--red-600) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
}

.swal2-close {
    color: var(--gray-400) !important;
    transition: color 0.2s ease !important;
}

.swal2-close:hover {
    color: var(--gray-700) !important;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-stat-card {
    height: 120px;
    border: 1px solid var(--gray-200);
}

.skeleton-chart {
    height: 280px;
    border: 1px solid var(--gray-200);
}

.skeleton-chart.chart-wide {
    height: 320px;
}

@media (max-width: 768px) {
    .skeleton-stat-card {
        height: 100px;
    }
    
    .skeleton-chart,
    .skeleton-chart.chart-wide {
        height: 250px;
    }
}

@media screen and (max-width: 768px) {
    .afficher-devis-row {
        grid-template-columns: 1fr;
    }
}