/* ==========================================================================
   CSS PROFESSIONNEL POUR INTERFACE GESTION CLIENTS
   ========================================================================== */

/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #f8fafc;
    --success-color: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
}

/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   TITLE BAR
   ========================================================================== */

.is-title-bar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.is-title-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.is-title-bar ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
}

.is-title-bar ul li {
    position: relative;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.is-title-bar ul li:not(:last-child)::after {
    content: '›';
    margin-left: 0.75rem;
    color: var(--text-muted);
    font-weight: 300;
    font-size: 1.1em;
}

.is-title-bar ul li:last-child {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.is-title-bar ul li:hover:not(:last-child) {
    background: var(--light-color);
    color: var(--text-primary);
}

/* ==========================================================================
   BOUTONS
   ========================================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* padding: 0.75rem 1.5rem; */
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    line-height: 1.25;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    outline: none;
    font-family: inherit;
}

.button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

.button.small {
    padding: 0px !important;
    /* padding: 0.5rem 1rem; */
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.button .icon {
    font-size: 1.125em;
    line-height: 1;
}

.button.small .icon {
    font-size: 1em;
}

/* Bouton Bleu (Primaire) */
.button.blue {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary-color);
}

.button.blue:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--primary-hover);
}

.button.blue:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Bouton Vert (Succès) */
.button.green {
    background: var(--success-color);
    color: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--success-color);
}

.button.green:hover {
    background: var(--success-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--success-hover);
}

.button.green:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Bouton Rouge (Danger) */
.button.red {
    background: var(--danger-color);
    color: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--danger-color);
}

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

.button.red:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Bouton Clair */
.button.light {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.button.light:hover {
    background: var(--light-color);
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.button.light:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Bouton Textuel */
.button.textual {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    box-shadow: none;
    padding: 0.5rem 1rem;
}

.button.textual:hover {
    background: var(--light-color);
    color: var(--text-primary);
    transform: none;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2rem;
    right: 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 50%, transparent 100%);
}

.card-header-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.125rem;
}

.card-header-title .icon {
    color: var(--primary-color);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.card-header-icon {
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}

.card-header-icon:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.card-content {
    padding: 2rem;
}

.card.has-table .card-content {
    padding: 0;
}

/* ==========================================================================
   FORMULAIRES
   ========================================================================== */

.field {
    margin-bottom: 1.5rem;
}

.field:last-child {
    margin-bottom: 0;
}

.label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.control {
    position: relative;
}

.input, .textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
    line-height: 1.5;
    font-family: inherit;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
    background: white;
}

.input::placeholder, .textarea::placeholder {
    color: var(--text-muted);
}

.input.is-danger, .textarea.is-danger {
    border-color: var(--danger-color);
    background: var(--danger-light);
}

.input.is-danger:focus, .textarea.is-danger:focus {
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
    border-color: var(--danger-color);
    background: white;
}

.textarea {
    resize: vertical;
    min-height: 6rem;
}

.help {
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: block;
}

.help.is-danger {
    color: var(--danger-color);
    font-weight: 500;
}

/* Select */
.select {
    position: relative;
    display: block;
}

.select.is-fullwidth {
    width: 100%;
}
form{
    padding: 1rem;
}

.select select {
    width: 100%;
    /* padding: 0.75rem 2.5rem 0.75rem 1rem; */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

.select select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.select.is-danger select {
    border-color: var(--danger-color);
    background-color: var(--danger-light);
}

.select.is-danger select:focus {
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
    border-color: var(--danger-color);
    background-color: white;
}

/* File Input */
input[type="file"] {
    width: 100%;
    padding: 0.3rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--light-color);
    color: var(--text-primary);
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Checkbox */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Grouped Fields */
.field.grouped {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

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

.table.is-striped tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.table.is-striped tbody tr:nth-child(even):hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ==========================================================================
   TAGS
   ========================================================================== */

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    transition: var(--transition);
}

.tag.green {
    background: var(--success-light);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

.tag.red {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.3);
}

.tag.light {
    background: var(--light-color);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ==========================================================================
   NOTIFICATIONS
   ========================================================================== */

.notification {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.notification.green {
    background: var(--success-light);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

.notification.red {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.3);
}

.notification.dark {
    background: var(--dark-color);
    color: white;
    border-color: var(--dark-color);
}

/* ==========================================================================
   ACTIONS & BUTTONS
   ========================================================================== */

.buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.buttons.right {
    justify-content: flex-end;
}

.buttons.nowrap {
    flex-wrap: nowrap;
}

.actions-cell {
    white-space: nowrap;
    width: 1%;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.level {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.level-left, .level-right {
    flex: 1;
}

.level-right {
    text-align: right;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   UTILITAIRES
   ========================================================================== */

/* Spacing */
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.inline-flex { display: inline-flex; }

/* Text */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-gray-500 { color: var(--text-muted); }
.text-gray-600 { color: var(--text-secondary); }
.text-gray-400 { color: var(--text-muted); }
.text-red-600 { color: var(--danger-color); }
.text-red-400 { color: var(--danger-color); }

.capitalize { text-transform: capitalize; }
.whitespace-nowrap { white-space: nowrap; }

/* Dark mode support */
.dark\:bg-gray-800 { background-color: var(--dark-color); }
.dark\:bg-gray-900 { background-color: #0f172a; }
.dark\:text-gray-400 { color: var(--text-muted); }
.dark\:border-gray-700 { border-color: #374151; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .is-title-bar {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .is-title-bar ul {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .card-content {
        padding: 1.5rem;
    }

    .card-header {
        padding: 1rem 1.5rem;
    }

    .field.grouped {
        flex-direction: column;
        gap: 1rem;
    }

    .field.grouped .control {
        width: 100%;
    }

    .buttons {
        width: 100%;
        justify-content: stretch;
    }

    .buttons .button {
        flex: 1;
        justify-content: center;
    }

    .table-wrapper {
        margin: 0 -1.5rem;
    }

    .table th, .table td {
        padding: 0.75rem 1rem;
    }

    .level {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .level-right {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .is-title-bar ul li {
        font-size: 0.8125rem;
    }

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

    .button {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }

    .button.small {
        padding: 0px !important;
        /* padding: 0.1rem 0.3rem; */
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.notification {
    animation: slideIn 0.3s ease-out;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .button, .notification {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .table {
        border: 1px solid #000;
    }

    .table th, .table td {
        border: 1px solid #000;
    }
}
