/**
 * AUTORIGESTIO - Styles Boulanger-Inspired
 * Design e-commerce moderne, clair et professionnel
 * ================================================
 */

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #0066CC;
    --primary-dark: #004C99;
    --primary-light: #3399FF;
    --accent: #FF6600;
    --accent-dark: #E55A00;
    --success: #00A651;
    --warning: #FFB800;
    --danger: #E53935;
    --black: #1A1A1A;
    --gray-900: #2D2D2D;
    --gray-800: #404040;
    --gray-700: #555555;
    --gray-600: #717171;
    --gray-500: #8A8A8A;
    --gray-400: #A8A8A8;
    --gray-300: #D1D1D1;
    --gray-200: #E8E8E8;
    --gray-100: #F5F5F5;
    --gray-50: #FAFAFA;
    --white: #FFFFFF;
    --font-primary: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-primary); font-size: 0.9375rem; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--black); }
h1 { font-size: 1.75rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1.125rem; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }

/* Layout */
.page-wrapper { display: flex; min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; width: 260px; height: 100vh; background: var(--white); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; z-index: 100; overflow-y: auto; }
.main-content { flex: 1; margin-left: 260px; min-height: 100vh; }

/* Header */
.header-bar { background: var(--white); border-bottom: 1px solid var(--gray-200); padding: var(--space-md) var(--space-xl); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.header-search { display: flex; align-items: center; background: var(--gray-100); border-radius: var(--radius-full); padding: var(--space-sm) var(--space-lg); flex: 1; max-width: 500px; }
.header-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.9rem; color: var(--gray-800); }
.header-search input::placeholder { color: var(--gray-500); }
.header-actions { display: flex; align-items: center; gap: var(--space-md); }
.header-cart { display: flex; align-items: center; gap: var(--space-sm); background: var(--primary); color: var(--white); padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-full); font-weight: 600; transition: background var(--transition-fast); }
.header-cart:hover { background: var(--primary-dark); color: var(--white); text-decoration: none; }
.cart-count { background: var(--accent); color: var(--white); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }

/* Sidebar */
.sidebar-header { padding: var(--space-lg); border-bottom: 1px solid var(--gray-200); background: var(--primary); color: var(--white); }
.sidebar-logo { display: flex; align-items: center; gap: var(--space-md); }
.sidebar-logo-icon { width: 44px; height: 44px; background: var(--white); color: var(--primary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem; }
.sidebar-logo-text { font-size: 1.125rem; font-weight: 800; }
.sidebar-logo-subtitle { font-size: 0.7rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-nav { flex: 1; padding: var(--space-md) 0; }
.nav-section { margin-bottom: var(--space-sm); }
.nav-section-title { padding: var(--space-sm) var(--space-lg); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-500); }
.nav-link { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); color: var(--gray-700); font-weight: 500; transition: all var(--transition-fast); border-left: 3px solid transparent; }
.nav-link:hover { background: var(--gray-100); color: var(--primary); text-decoration: none; }
.nav-link.active { background: rgba(0,102,204,0.08); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-link-icon { width: 20px; height: 20px; opacity: 0.7; }
.nav-link:hover .nav-link-icon, .nav-link.active .nav-link-icon { opacity: 1; }
.sidebar-footer { padding: var(--space-lg); border-top: 1px solid var(--gray-200); background: var(--gray-50); }
.sidebar-user { display: flex; align-items: center; gap: var(--space-md); }
.sidebar-user-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sidebar-user-name { font-weight: 600; font-size: 0.9rem; color: var(--gray-900); }
.sidebar-user-role { font-size: 0.75rem; color: var(--gray-500); }

/* Page Content */
.page-content { padding: var(--space-xl); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-xl); }
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--gray-500); font-size: 0.875rem; margin-top: var(--space-xs); }
.breadcrumb { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.8rem; color: var(--gray-500); margin-bottom: var(--space-md); }

/* Cards */
.card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); overflow: hidden; }
.card-header { padding: var(--space-lg); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); }
.card-title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: var(--space-sm); }
.card-body { padding: var(--space-lg); }
.card-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--gray-200); background: var(--gray-50); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); margin-bottom: var(--space-xl); }
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-lg); border: 1px solid var(--gray-200); display: flex; align-items: center; gap: var(--space-lg); transition: all var(--transition-fast); }
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.stat-icon.primary { background: rgba(0,102,204,0.1); color: var(--primary); }
.stat-icon.success { background: rgba(0,166,81,0.1); color: var(--success); }
.stat-icon.warning { background: rgba(255,184,0,0.1); color: #C99200; }
.stat-icon.accent { background: rgba(255,102,0,0.1); color: var(--accent); }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.2; color: var(--black); }
.stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: 0.625rem 1.25rem; font-family: var(--font-primary); font-size: 0.875rem; font-weight: 600; border: none; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); color: var(--white); }
.btn-secondary { background: var(--gray-800); color: var(--white); }
.btn-secondary:hover { background: var(--black); color: var(--white); }
.btn-outline { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-outline-primary { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; }

/* Forms */
.form-group { margin-bottom: var(--space-lg); }
.form-label { display: block; font-weight: 600; font-size: 0.875rem; color: var(--gray-700); margin-bottom: var(--space-sm); }
.form-control { width: 100%; padding: 0.75rem 1rem; font-family: var(--font-primary); font-size: 0.9375rem; color: var(--gray-800); background: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius-md); transition: all var(--transition-fast); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,0.15); }
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { 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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

/* Alerts */
.alert { padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md); margin-bottom: var(--space-lg); display: flex; align-items: center; gap: var(--space-md); font-weight: 500; }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.alert-danger { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.alert-warning { background: #FFF8E1; color: #F57C00; border: 1px solid #FFE082; }
.alert-info { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; border-radius: var(--radius-sm); }
.badge-primary { background: var(--primary); color: var(--white); }
.badge-success { background: var(--success); color: var(--white); }
.badge-warning { background: var(--warning); color: #7A5900; }
.badge-danger { background: var(--danger); color: var(--white); }
.badge-accent { background: var(--accent); color: var(--white); }

/* Product Grid - Boulanger Style */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); }
.product-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); overflow: hidden; transition: all var(--transition-normal); position: relative; }
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.product-badges { position: absolute; top: var(--space-md); left: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); z-index: 2; }
.product-badge { padding: 0.25rem 0.5rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; border-radius: var(--radius-sm); }
.product-badge.promo { background: var(--accent); color: var(--white); }
.product-badge.new { background: var(--success); color: var(--white); }
.product-badge.best { background: var(--primary); color: var(--white); }
.product-image { width: 100%; height: 200px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; padding: var(--space-lg); }
.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-body { padding: var(--space-lg); }
.product-brand { font-size: 0.7rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-xs); }
.product-name { font-size: 0.95rem; font-weight: 600; color: var(--black); margin-bottom: var(--space-sm); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-name a { color: inherit; }
.product-name a:hover { color: var(--primary); }
.product-specs { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md); }
.product-spec { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--gray-600); background: var(--gray-100); padding: 4px 8px; border-radius: var(--radius-sm); }
.product-footer { display: flex; align-items: flex-end; justify-content: space-between; padding-top: var(--space-md); border-top: 1px solid var(--gray-200); }
.product-price-old { font-size: 0.8rem; color: var(--gray-500); text-decoration: line-through; }
.product-price { font-size: 1.5rem; font-weight: 800; color: var(--black); line-height: 1; }
.product-price sup { font-size: 0.6em; font-weight: 600; }
.product-price-discount { display: inline-flex; background: var(--accent); color: var(--white); font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-sm); margin-left: var(--space-sm); }
.product-stock { font-size: 0.75rem; padding: 4px 8px; border-radius: var(--radius-sm); font-weight: 600; }
.product-stock.in-stock { background: #E8F5E9; color: #2E7D32; }
.product-stock.low-stock { background: #FFF8E1; color: #F57C00; }
.product-stock.out-of-stock { background: #FFEBEE; color: #C62828; }
.product-actions { display: flex; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.product-actions .btn { flex: 1; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--space-md) var(--space-lg); text-align: left; border-bottom: 1px solid var(--gray-200); }
.table th { font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-600); background: var(--gray-50); }
.table tbody tr:hover { background: var(--gray-50); }

/* Login Page */
.login-wrapper { min-height: 100vh; display: flex; background: linear-gradient(135deg, #0066CC 0%, #004C99 50%, #003366 100%); }
.login-brand { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 3rem; color: var(--white); position: relative; }
.login-brand::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff' fill-opacity='.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E"); }
.login-brand-content { position: relative; z-index: 1; max-width: 480px; }
.login-brand-logo { display: flex; align-items: center; gap: var(--space-md); margin-bottom: 2rem; }
.login-brand-logo-icon { width: 56px; height: 56px; background: var(--white); color: var(--primary); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.5rem; }
.login-brand-title { font-size: 1.5rem; font-weight: 800; }
.login-brand h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: var(--space-lg); color: var(--white); }
.login-brand p { font-size: 1.125rem; opacity: 0.9; line-height: 1.7; }
.login-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); margin-top: 2rem; }
.login-feature { text-align: center; }
.login-feature-value { font-size: 2.5rem; font-weight: 800; }
.login-feature-label { font-size: 0.875rem; opacity: 0.8; }
.login-form-wrapper { width: 100%; max-width: 480px; display: flex; flex-direction: column; justify-content: center; padding: 3rem; background: var(--white); }
.login-form-header { margin-bottom: var(--space-xl); }
.login-form-header h2 { font-size: 1.5rem; margin-bottom: var(--space-sm); }
.login-form-header p { color: var(--gray-500); }
.login-form .btn-primary { width: 100%; padding: var(--space-md); font-size: 1rem; }
.login-demo { margin-top: var(--space-xl); padding: var(--space-lg); border-top: 1px solid var(--gray-200); text-align: center; background: var(--gray-50); margin: var(--space-xl) -3rem -3rem; }
.login-demo-title { font-size: 0.8rem; font-weight: 700; color: var(--gray-600); margin-bottom: var(--space-sm); }
.login-demo-info { font-size: 0.8rem; color: var(--gray-500); margin: 0; }
@media (max-width: 768px) { .login-brand { display: none; } .login-form-wrapper { max-width: 100%; } }

/* Empty State */
.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); }
.empty-state-icon { font-size: 4rem; margin-bottom: var(--space-lg); opacity: 0.5; }
.empty-state-title { font-size: 1.125rem; font-weight: 600; color: var(--gray-700); margin-bottom: var(--space-sm); }
.empty-state-text { margin-bottom: var(--space-lg); }

/* Utilities */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease forwards; }
