﻿/* =====================================================
   Gestion de Stock - Design Moderne Style Notion
   Palette: Beige, Crème, Accents chaleureux
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =====================================================
   Variables CSS
   ===================================================== */
:root {
    /* Couleurs principales - Palette Beige/Crème */
    --bg-primary: #FAF8F5;
    --bg-secondary: #F5F1EB;
    --bg-card: #FFFFFF;
    --bg-sidebar: #F8F5F0;
    --bg-hover: #EDE8E0;

    /* Accents */
    --accent-primary: #B8860B;
    --accent-secondary: #D4A84B;
    --accent-light: #F5E6C8;
    --accent-success: #4CAF50;
    --accent-warning: #FF9800;
    --accent-danger: #E74C3C;
    --accent-info: #5DADE2;

    /* Texte */
    --text-primary: #2C2C2C;
    --text-secondary: #6B6B6B;
    --text-muted: #9B9B9B;
    --text-light: #FFFFFF;

    /* Bordures */
    --border-light: #E8E4DD;
    --border-medium: #D4CFC6;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);

    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Rayons */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width: 260px;
}

/* =====================================================
   Reset et Base
   ===================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   Layout Principal
   ===================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-xl);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

/* =====================================================
   Sidebar Navigation
   ===================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform var(--transition-normal);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-xl);
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
}

.nav-section {
    margin-bottom: var(--spacing-xl);
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 var(--spacing-sm);
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    opacity: 0.8;
}

.sidebar-user {
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-top: auto;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.sidebar-user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================================================
   Header de page
   ===================================================== */
.page-header {
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* =====================================================
   Cards
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

/* =====================================================
   Stats Cards (Dashboard)
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-md);
}

.stat-card-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8rem;
    margin-top: var(--spacing-sm);
}

.stat-card-trend.positive {
    color: var(--accent-success);
}

.stat-card-trend.negative {
    color: var(--accent-danger);
}

/* =====================================================
   Tables - Style Tableur/Notion
   ===================================================== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.table-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.data-table th:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.data-table th.sortable::after {
    content: '↕';
    margin-left: var(--spacing-sm);
    opacity: 0.3;
}

.data-table th.sorted-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--accent-primary);
}

.data-table th.sorted-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--accent-primary);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table .cell-numeric {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.data-table .cell-actions {
    text-align: right;
    white-space: nowrap;
}

/* Row selection */
.data-table tr.selected {
    background: var(--accent-light);
}

.row-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Cell inline edit (Notion-style) */
.cell-editable {
    cursor: text;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.cell-editable:hover {
    background: var(--bg-hover);
}

.cell-editable:focus {
    outline: 2px solid var(--accent-primary);
    background: var(--bg-card);
}

/* =====================================================
   Boutons
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(184, 134, 11, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-success {
    background: var(--accent-success);
    color: white;
}

.btn-success:hover {
    background: #43A047;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background: #C0392B;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
}

/* =====================================================
   Formulaires
   ===================================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-label.required::after {
    content: ' *';
    color: var(--accent-danger);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:hover {
    border-color: var(--border-medium);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control-error {
    border-color: var(--accent-danger);
}

.form-error {
    font-size: 0.8rem;
    color: var(--accent-danger);
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B6B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Form grid layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

/* =====================================================
   Badges et Tags
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.badge-success {
    background: #E8F5E9;
    color: var(--accent-success);
}

.badge-warning {
    background: #FFF3E0;
    color: var(--accent-warning);
}

.badge-danger {
    background: #FFEBEE;
    color: var(--accent-danger);
}

.badge-info {
    background: #E3F2FD;
    color: var(--accent-info);
}

.badge-neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Stock level badges */
.stock-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-level-ok {
    background: #E8F5E9;
    color: var(--accent-success);
}

.stock-level-low {
    background: #FFF3E0;
    color: var(--accent-warning);
}

.stock-level-critical {
    background: #FFEBEE;
    color: var(--accent-danger);
}

.stock-level::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* =====================================================
   Alertes et Messages Flash
   ===================================================== */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    color: #2E7D32;
}

.alert-error {
    background: #FFEBEE;
    border: 1px solid #EF9A9A;
    color: #C62828;
}

.alert-warning {
    background: #FFF3E0;
    border: 1px solid #FFCC80;
    color: #E65100;
}

.alert-info {
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    color: #1565C0;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* =====================================================
   Modal
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    background: var(--bg-secondary);
}

/* =====================================================
   Empty State
   ===================================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.empty-state-description {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-lg);
}

.pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================================================
   Document Print Styles
   ===================================================== */
.document-preview {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 750px;
    margin: 0 auto;
    font-size: 0.85rem;
    line-height: 1.4;
}

.document-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent-primary);
}

.document-company {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.document-info {
    text-align: right;
}

.document-type {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.document-numero {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.document-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.document-party {
    background: var(--bg-secondary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.document-party-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.document-party-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.document-table {
    width: 100%;
    margin-bottom: var(--spacing-md);
}

.document-table th {
    background: var(--accent-light);
    color: var(--accent-primary);
    padding: 5px 8px;
    font-size: 0.75rem;
}

.document-table td {
    padding: 5px 8px;
    font-size: 0.8rem;
}

.document-totals {
    display: flex;
    justify-content: flex-end;
}

.document-totals-table {
    width: 220px;
}

.document-totals-table td {
    padding: 3px var(--spacing-xs);
    font-size: 0.8rem;
}

.document-totals-table .total-row {
    font-weight: 700;
    font-size: 0.95rem;
    border-top: 2px solid var(--accent-primary);
}

@media print {

    .sidebar,
    .main-content>.page-header .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .document-preview {
        box-shadow: none;
        padding: 20px;
    }
}

/* =====================================================
   Auth Pages (Login/Register)
   ===================================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: var(--spacing-lg);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: var(--spacing-xl);
    text-align: center;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto var(--spacing-md);
    backdrop-filter: blur(8px);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-xs);
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.auth-body {
    padding: var(--spacing-xl);
}

.auth-footer {
    text-align: center;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   Loading States
   ===================================================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* =====================================================
   Tooltips
   ===================================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--text-primary);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* =====================================================
   Search Bar
   ===================================================== */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-left: 40px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.search-box-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* =====================================================
   Responsive Design
   ===================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .document-parties {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Animations utilitaires
   ===================================================== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover card effect */
.hover-lift {
    transition: all var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* =====================================================
   Utility Classes
   ===================================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--accent-success);
}

.text-danger {
    color: var(--accent-danger);
}

.text-warning {
    color: var(--accent-warning);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mt-4 {
    margin-top: var(--spacing-xl);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 2px;
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.mb-4 {
    margin-bottom: var(--spacing-xl);
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

.gap-3 {
    gap: var(--spacing-lg);
}

.w-100 {
    width: 100%;
}

.hidden {
    display: none;
}

/ *   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =           I m p r e s s i o n           = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   * /     @ m e d i a   p r i n t    {
                     / *   C a c h e r   l e s   � � l � � m e n t s   d e   n a v i g a t i o n   e t   d ' i n t e r f a c e   * / 
            . s i d e b a r ,
                 . m o b i l e - m e n u - b t n ,
                 . n o - p r i n t ,
                 . b t n ,
                 . p a g e - h e a d e r ,
                 . a l e r t ,
                 . b r e a d c r u m b    {
                             d i s p l a y :    n o n e    ! i m p o r t a n t ;
                     
    }

                     / *   A j u s t e r   l a   m i s e   e n   p a g e   * /             . m a i n - c o n t e n t    {
                             m a r g i n - l e f t :    0    ! i m p o r t a n t ;
                             p a d d i n g :    0    ! i m p o r t a n t ;
                             w i d t h :    1 0 0 %    ! i m p o r t a n t ;
                     
    }

                     b o d y    {
                             b a c k g r o u n d :    w h i t e ;
                             c o l o r :    b l a c k ;
                     
    }

                     . c a r d ,
                 . d o c u m e n t - p r e v i e w    {
                             b o x - s h a d o w :    n o n e    ! i m p o r t a n t ;
                             b o r d e r :    n o n e    ! i m p o r t a n t ;
                             p a d d i n g :    0    ! i m p o r t a n t ;
                             m a r g i n :    0    ! i m p o r t a n t ;
                     
    }

                     / *   E m p � � c h e r   l ' a f f i c h a g e   d e s   U R L s   d e s   l i e n s   * / 
            a [ h r e f ] : a f t e r    {
                             c o n t e n t :    n o n e    ! i m p o r t a n t ;
                     
    }

                     / *   S u p p r i m e r   l e s   e n - t � � t e s   e t   p i e d s   d e   p a g e   p a r   d � � f a u t   d u   n a v i g a t e u r   ( s i   s u p p o r t � � )   * /             @ p a g e    {
                             m a r g i n - t o p :    1 c m ;
                             m a r g i n - b o t t o m :    1 c m ;
                     
    }

         
}

     