/* ============================================
   ORANGE B2B BACK OFFICE - MAIN STYLESHEET
   Import all CSS modules
   ============================================ */

/* Variables & Design System */
@import 'variables.css';

/* Themes */
@import 'themes/dark.css';
@import 'themes/light.css';

/* Layout */
@import 'layout/main.css';
@import 'layout/sidebar.css';
@import 'layout/panel.css';

/* Components */
@import 'components/button.css';
@import 'components/card.css';
@import 'components/dropzone.css';
@import 'components/form.css';
@import 'components/kanban.css';
@import 'components/modal.css';
@import 'components/switch.css';
@import 'components/tabs.css';
@import 'components/admin.css';
@import 'components/tase.css';

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

/* Text */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-xxl { font-size: var(--font-size-xxl); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--status-valide); }
.text-error { color: var(--status-rejete); }
.text-warning { color: var(--status-en-attente); }

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

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.font-mono { font-family: var(--font-mono); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Spacing */
.m-0 { margin: 0; }
.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-none { flex: none; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.gap-xxs { gap: var(--space-xxs); }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Borders */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--border-primary); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--border-primary); }
.border-b { border-bottom: 1px solid var(--border-primary); }
.border-l { border-left: 1px solid var(--border-primary); }
.border-r { border-right: 1px solid var(--border-primary); }

/* Backgrounds */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-elevated { background: var(--bg-elevated); }
.bg-hover { background: var(--bg-hover); }
.bg-accent { background: var(--accent-primary); }

/* Shadows */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Transitions */
.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-normal); }
.transition-slow { transition: all var(--transition-slow); }

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

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slide-out-right {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes slide-in-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scale-in {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.animate-fade-in { animation: fade-in var(--transition-normal) ease; }
.animate-slide-in-right { animation: slide-in-right var(--transition-normal) ease; }
.animate-slide-in-up { animation: slide-in-up var(--transition-normal) ease; }
.animate-scale-in { animation: scale-in var(--transition-normal) ease; }
.animate-shake { animation: shake 0.5s ease; }

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

.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: slide-in-up var(--transition-normal) ease;
    max-width: 400px;
}

.toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast__content {
    flex: 1;
}

.toast__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.toast__message {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.toast__close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toast--success {
    border-left: 3px solid var(--status-valide);
}

.toast--success .toast__icon {
    color: var(--status-valide);
}

.toast--error {
    border-left: 3px solid var(--status-rejete);
}

.toast--error .toast__icon {
    color: var(--status-rejete);
}

.toast--warning {
    border-left: 3px solid var(--status-en-attente);
}

.toast--warning .toast__icon {
    color: var(--status-en-attente);
}

.toast--info {
    border-left: 3px solid var(--status-nouveau);
}

.toast--info .toast__icon {
    color: var(--status-nouveau);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xxs);
    padding: var(--space-xxs) var(--space-xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge--primary {
    background: var(--interactive-selected);
    color: var(--accent-primary);
}

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

.badge--warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-en-attente);
}

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

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

.badge--outline {
    background: transparent;
    border: 1px solid currentColor;
}

/* ============================================
   TOOLTIP
   ============================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--shadow-dropdown);
    border: 1px solid var(--border-primary);
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   AVATAR
   ============================================ */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    overflow: hidden;
}

.avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.avatar--xl { width: 64px; height: 64px; font-size: 20px; }

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--bg-secondary);
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}
