:root {
  --mp-blue: #29ABE2;
  --mp-dark: #2D2D2D;
}

/* Layout */
.wrapper { min-height: 100vh; }
.sidebar { background: var(--mp-dark); width: 250px; min-height: 100vh; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main-content { flex: 1; background: #f8f9fa; min-height: 100vh; overflow-y: auto; }
.topbar { background: white; border-bottom: 2px solid var(--mp-blue); min-height: 56px; }

/* Sidebar */
.sidebar .nav-link { color: rgba(255,255,255,0.7); padding: 8px 12px; border-radius: 6px; margin: 2px 0; transition: all 0.2s; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { color: var(--mp-blue); background: rgba(41,171,226,0.15); }
.sidebar-header { border-bottom: 1px solid rgba(255,255,255,0.1); }

/* Avatar */
.avatar-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--mp-blue); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; flex-shrink: 0; }
.avatar-xs { width: 24px; height: 24px; border-radius: 50%; background: var(--mp-blue); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 11px; }

/* Role badges */
.badge-role { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.badge-role-admin { background: #dc3545; color: white; }
.badge-role-technicien { background: var(--mp-blue); color: white; }
.badge-role-vendeur { background: #198754; color: white; }
.badge-role-partenaire { background: #ffc107; color: #000; }
.badge-role-responsable_qualirepar { background: #198754; color: white; }
.badge-role-responsable_magasin { background: #6f42c1; color: white; }

/* Status badges */
.status-badge { font-size: 11px; }
.status-recu { background: #6c757d !important; }
.status-en_diagnostic { background: #0dcaf0 !important; color: #000 !important; }
.status-en_reparation { background: #ffc107 !important; color: #000 !important; }
.status-en_attente_piece { background: #FF6B00 !important; }
.status-pret { background: #198754 !important; }
.status-livre { background: #212529 !important; color: #fff !important; }
.btn.status-livre { --bs-btn-color: #fff; color: #fff !important; }
.status-annule { background: #dc3545 !important; }

/* Stat cards */
.stat-card { background: white; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #e9ecef; text-align: center; }
.stat-card.border-success { border-color: #198754 !important; }
.stat-card.border-danger { border-color: #dc3545 !important; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; color: white; display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: #2D2D2D; line-height: 1; }
.stat-label { font-size: 12px; color: #6c757d; margin-top: 4px; }

/* Kanban */
.kanban-board { min-height: 70vh; }
.kanban-column { width: 280px; }
.kanban-col-header { background: white; padding: 12px; border-radius: 8px 8px 0 0; border: 1px solid #e9ecef; border-bottom: none; }
.kanban-col-body { background: #f1f3f5; border: 1px solid #e9ecef; border-radius: 0 0 8px 8px; padding: 8px; min-height: 400px; max-height: calc(100vh - 220px); overflow-y: auto; }
.kanban-card { background: white; border-radius: 8px; padding: 12px; margin-bottom: 8px; border: 1px solid #e9ecef; box-shadow: 0 1px 4px rgba(0,0,0,0.05); cursor: pointer; transition: box-shadow 0.2s; }
.kanban-card:hover { box-shadow: 0 4px 12px rgba(41,171,226,0.2); border-color: var(--mp-blue); }
.kanban-empty { text-align: center; padding: 24px; color: #adb5bd; }

/* Ticket timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: #e9ecef; }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--mp-blue); border: 2px solid white; box-shadow: 0 0 0 2px var(--mp-blue); }

/* Login */
.login-body { background: linear-gradient(135deg, #2D2D2D 0%, #1a1a1a 50%, #29ABE2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 420px; padding: 16px; }
.login-card { background: white; border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }

/* Buttons */
.btn-primary { background-color: var(--mp-blue) !important; border-color: var(--mp-blue) !important; }
.btn-primary:hover { background-color: #1a96cc !important; border-color: #1a96cc !important; }
.btn-outline-primary { color: var(--mp-blue) !important; border-color: var(--mp-blue) !important; }
.btn-outline-primary:hover { background-color: var(--mp-blue) !important; color: white !important; }
.text-primary { color: var(--mp-blue) !important; }
.bg-primary { background-color: var(--mp-blue) !important; }

/* Photo gallery */
.photo-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 2px solid #e9ecef; cursor: pointer; transition: border-color 0.2s; }
.photo-thumb:hover { border-color: var(--mp-blue); }

/* Print styles */
@media print {
  .sidebar, .topbar, .btn, form, nav { display: none !important; }
  .main-content { margin: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -250px; z-index: 1000; transition: left 0.3s; }
  .sidebar.show { left: 0; }
  .kanban-column { width: 250px; }
}

/* Difficulty stars */
.difficulty-star { color: #ffc107; font-size: 14px; }
.difficulty-star.empty { color: #dee2e6; }

/* Card hover */
.card-hover { transition: transform 0.2s, box-shadow 0.2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(41,171,226,0.15) !important; }

/* Table improvements */
.table > :not(caption) > * > * { padding: 10px 12px; }
.table-hover > tbody > tr:hover { background-color: rgba(41,171,226,0.04); }

/* Badge improvements */
.badge { font-weight: 500; }

/* Form improvements */
.form-control:focus, .form-select:focus { border-color: var(--mp-blue); box-shadow: 0 0 0 0.2rem rgba(41,171,226,0.25); }

/* Link improvements */
a { color: var(--mp-blue); }
a:hover { color: #1a96cc; }

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* Alert improvements */
.alert { border-radius: 10px; }

/* Card styling */
.card { border-radius: 10px; }
.card-header { border-radius: 10px 10px 0 0 !important; }

/* Page header */
h4 { font-weight: 700; }

/* Responsive table wrapper */
.table-responsive { border-radius: 0 0 10px 10px; }
