/* Variables CSS */
:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --header-bg: #78350f;
    --main-bg: #f1f5f9;
    --card-bg: #ffffff;
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #0ea5e9;
    --text-color: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout Principal */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--sidebar-bg);
    color: white;
    display: flex !important;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.sidebar-logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.sidebar-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important pour le flex */
    display: block !important;
    visibility: visible !important;
}

.sidebar-nav .nav-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    min-width: 100%;
    position: relative;
    margin: 0.125rem 0.5rem;
    border-radius: 0.5rem;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    border-radius: 0 3px 3px 0;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: white;
    transform: translateX(4px);
}

.nav-item:hover::before {
    background: rgba(255,255,255,0.5);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-item.active::before {
    background: var(--sidebar-active);
    width: 4px;
}

.nav-item .icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .text {
    flex: 1;
    font-size: 0.95rem;
}

/* Titres de section dans le menu */
.nav-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.25rem 1.5rem 0.5rem 1.5rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.nav-section-title::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    bottom: -1px;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--sidebar-active) 0%, transparent 100%);
}

.nav-section-title:first-child {
    margin-top: 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0, 0, 0, 0.1);
}

/* Badge de rôle dans la sidebar */
.user-role-badge {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-role-badge.admin-principal {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.user-role-badge.admin-magasin {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.user-role-badge.caissier {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.user-info {
    margin-bottom: 0;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.user-info .user-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-info .user-role {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.user-magasin-sidebar {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    display: block;
    margin-top: 0.25rem;
}

/* Zone principale */
.main-content-area {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header en haut */
.top-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 0.5rem;
}

.date-icon {
    font-size: 1.1rem;
}

.date-text {
    font-weight: 600;
    color: var(--primary-color);
}

.header-magasin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 0.5rem;
}

.magasin-icon {
    font-size: 1rem;
}

.magasin-text {
    font-weight: 500;
    color: var(--success-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.header-link:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.header-link-icon {
    font-size: 1.1rem;
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    text-decoration: none;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    padding-right: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.header-user:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.user-role-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-magasin-badge {
    color: var(--success-color);
    font-weight: 500;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.7rem 1rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.22);
    color: white;
    border-color: rgba(239, 68, 68, 0.55);
}

/* Contenu */
.main-content {
    flex: 1;
    padding: 2rem;
    background: var(--main-bg);
}

/* Bannière Admin Principal */
.admin-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.25);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.admin-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    flex-shrink: 0;
}

.admin-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-label {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.admin-magasin {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 400;
}

.admin-magasin strong {
    color: white;
    font-weight: 600;
}

.btn-view-global {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.btn-view-global:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f8fafc;
}

.btn-view-global .btn-icon {
    font-size: 1.3rem;
}

.btn-view-global .btn-text {
    flex: 1;
}

.btn-view-global .btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.btn-view-global:hover .btn-arrow {
    transform: translateX(4px);
}

/* Bannière Magasin */
.magasin-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    margin-bottom: 1.5rem;
}

.magasin-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    flex-shrink: 0;
}

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

.magasin-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.magasin-name {
    color: white;
    font-size: 1rem;
    font-weight: 700;
}

.magasin-code {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 400;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Actions rapides */
.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.quick-action-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-action-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.quick-action-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quick-action-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Métriques */
.metrics-section {
    margin-bottom: 2rem;
}

.metrics-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid transparent;
}

.metric-card.warning {
    border-left-color: var(--warning-color);
}

.metric-card.danger {
    border-left-color: var(--danger-color);
}

.metric-icon {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 0;
}

.card-body {
    padding: 0;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.statistics-section {
    margin-top: 2rem;
}

.statistics-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table thead {
    background: var(--main-bg);
}

.table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--main-bg);
}

.table tfoot {
    background: var(--main-bg);
    font-weight: 600;
}

.table tfoot td {
    border-top: 2px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #0284c7;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-block {
    width: 100%;
}

/* Boutons filtres (chips de catégories) */
.category-btn {
    padding: 0.5rem 1rem;
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-btn:hover:not(.active) {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Bannières d'information */
.info-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.info-banner small {
    color: var(--text-muted);
}

.info-banner a {
    text-decoration: underline;
}

.info-banner--primary {
    background: #eff6ff;
    border-color: var(--primary-color);
}

.info-banner--primary a {
    color: var(--primary-color);
}

.info-banner--warning {
    background: #fef3c7;
    border-color: var(--warning-color);
}

.info-banner--warning a {
    color: var(--warning-color);
}

.info-banner--success {
    background: #f0fdf4;
    border-color: var(--success-color);
}

/* Barre de recherche */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.6;
}

.search-box .form-control {
    padding-left: 2.75rem;
}

/* Filtres produits */
.products-toolbar {
    margin-bottom: 1.5rem;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Grilles de formulaire */
.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-check {
    display: flex;
    align-items: flex-end;
    min-height: 3rem;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
}

/* Modales */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 0.75rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content.modal-lg {
    max-width: 750px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Actions tableau produits */
.products-actions .btn {
    padding: 0.45rem 0.75rem;
    min-width: 2.25rem;
}

.no-results-cell {
    padding: 3rem !important;
}

.no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.25rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--danger-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid var(--warning-color);
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid var(--primary-color);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.d-flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content-area {
        margin-left: 0;
    }
    
    .top-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .header-left {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .header-date,
    .header-magasin {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .header-right {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .header-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .header-link-text {
        display: none;
    }
    
    .user-details {
        display: none;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .header-logout-text {
        display: none;
    }

    .header-logout-btn {
        padding: 0.5rem 0.75rem;
    }
    
    .admin-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    
    .admin-badge {
        min-width: auto;
        margin-bottom: 1rem;
    }
    
    .btn-view-global {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }
    
    .quick-actions-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Login page */
.login-page {
    min-height: 100vh;
    background: var(--main-bg);
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Panneau branding (gauche) */
.login-brand {
    background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 45%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
}

.login-brand::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 60%;
    height: 80%;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.login-logo-img {
    max-height: 4rem;
    max-width: 12rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-brand-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.login-brand-subtitle {
    font-size: 1.05rem;
    opacity: 0.9;
    margin: 0 0 2.5rem;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    opacity: 0.95;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.login-features li:last-child {
    border-bottom: none;
}

.login-feature-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.login-brand-version {
    font-size: 0.8rem;
    opacity: 0.6;
    margin: 0;
}

/* Panneau formulaire (droite) */
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--main-bg);
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.4s ease-out;
}

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

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.5rem;
    letter-spacing: -0.3px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.login-step-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.login-form .form-control {
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input-with-icon {
    padding-left: 2.75rem !important;
}

.login-input-password {
    padding-right: 3.25rem !important;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-2fa-input {
    text-align: center;
    font-size: 1.5rem !important;
    letter-spacing: 0.6rem;
    font-weight: 600;
    padding: 1rem !important;
}

.login-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background 0.2s;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
}

.password-toggle:hover {
    background: rgba(37, 99, 235, 0.08);
}

.password-toggle .eye-icon {
    font-size: 1.1rem;
    opacity: 0.7;
    user-select: none;
    pointer-events: none;
}

.password-toggle:hover .eye-icon {
    opacity: 1;
}

.password-toggle:focus {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-dev-hint {
    text-align: center;
}

.login-dev-hint summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    user-select: none;
    list-style: none;
}

.login-dev-hint summary::-webkit-details-marker {
    display: none;
}

.login-dev-hint summary::before {
    content: '▸ ';
    font-size: 0.7rem;
}

.login-dev-hint[open] summary::before {
    content: '▾ ';
}

.login-dev-hint p {
    margin: 0.75rem 0 0;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-form .btn-block {
    padding: 0.95rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}

.login-form .btn-block:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.login-page .alert {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
}

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

@media (max-width: 900px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .login-brand-content {
        max-width: 100%;
        text-align: center;
    }

    .login-logo {
        display: flex;
        justify-content: center;
    }

    .login-features {
        display: none;
    }

    .login-brand-version {
        display: none;
    }

    .login-brand-title {
        font-size: 1.5rem;
    }

    .login-brand-subtitle {
        margin-bottom: 0;
    }

    .login-panel {
        padding: 1.5rem;
    }

    .login-box {
        padding: 2rem 1.5rem;
        box-shadow: var(--shadow);
    }
}

.alert {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
}

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

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
