/* Premium Professional Design v4.0 - Gestion Stock */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-darker: #1e3a8a;
    --accent: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 50%, #f3f4f6 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-dark);
}

::selection {
    background: #dbeafe;
    color: var(--primary-darker);
}

/* Premium Sidebar */
#app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 50;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#app-sidebar::-webkit-scrollbar {
    width: 6px;
}

#app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

#app-sidebar .sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

#app-sidebar h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#app-sidebar nav {
    padding: 1rem;
}

#app-sidebar a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: 0.75rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

#app-sidebar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

#app-sidebar a.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    color: white;
    border-left-color: #fbbf24;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#app-sidebar svg {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

/* Main Content */
.ml-64, .sm\:ml-72, .lg\:ml-80 {
    margin-left: 280px;
    min-height: 100vh;
}

main {
    padding: 2rem;
    max-width: 1600px;
}

/* Premium Cards */
.card, .bg-white {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-100);
    transition: all 0.25s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

/* Premium Buttons */
button, .btn, .btn-primary, .btn-secondary {
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary, .bg-amber-600, button[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover, .bg-amber-600:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.btn-secondary, .bg-slate-600, .bg-gray-600 {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover, .bg-slate-600:hover, .bg-gray-600:hover {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    transform: translateY(-2px);
}

.bg-green-600 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.bg-green-600:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
}

.bg-red-600 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.bg-red-600:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
}

.bg-blue-600 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.bg-blue-600:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Premium Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea,
.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--gray-800);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    transition: all 0.15s ease;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

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

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

/* Premium Tables */
table, .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
}

tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.15s ease;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);
    transform: scale(1.002);
}

tbody td {
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

tbody td:first-child {
    font-weight: 600;
    color: var(--gray-900);
}

/* Premium Badges */
.badge, span.px-2, span.inline-flex {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.bg-green-100, .text-green-800 {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.bg-red-100, .text-red-800 {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.bg-blue-100, .text-blue-800 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.bg-amber-100, .text-amber-800, .bg-yellow-100 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1);
}

.bg-gray-100, .text-gray-800 {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    color: var(--gray-700);
}

.bg-purple-100, .text-purple-800 {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #7c3aed;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.1);
}

/* Premium Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-left: 4px solid;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, white 100%);
    color: #047857;
    border-left-color: #10b981;
}

.alert-error, .alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, white 100%);
    color: #b91c1c;
    border-left-color: #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, white 100%);
    color: #b45309;
    border-left-color: #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, white 100%);
    color: #1d4ed8;
    border-left-color: #3b82f6;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Utilities */
.rounded-xl { border-radius: 1rem; }
.shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* RTL Support */
[dir="rtl"] .ml-64,
[dir="rtl"] .sm\:ml-72,
[dir="rtl"] .lg\:ml-80 {
    margin-left: 0;
    margin-right: 280px;
}

[dir="rtl"] #app-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] #app-sidebar svg {
    margin-right: 0;
    margin-left: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    #app-sidebar {
        width: 240px;
    }

    .ml-64, .sm\:ml-72, .lg\:ml-80 {
        margin-left: 240px;
    }

    main {
        padding: 1rem;
    }

    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }

    .card-header, .card-body {
        padding: 1rem;
    }
}

/* Print */
@media print {
    body {
        background: white;
    }

    #app-sidebar,
    button,
    .btn,
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
