/* Centre al Amana - Styles personnalisés */

:root {
  --primary: #4f5de9;
  --primary-dark: #4049d5;
  --accent: #f97316;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; }

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  transition: transform 0.3s ease;
  z-index: 40;
}

#sidebar.collapsed { transform: translateX(-100%); }

/* Layout */
#main-content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
  min-height: 100vh;
}

#main-content.full-width { margin-left: 0; }

@media (max-width: 768px) {
  #sidebar { position: fixed; top: 0; left: 0; height: 100vh; }
  #main-content { margin-left: 0; }
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover { 
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,93,233,0.12);
}

/* Stat cards */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 4px;
}

/* Inputs */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  color: #1e293b;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,93,233,0.12);
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,93,233,0.3); }

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-success { background: #d1fae5; color: #059669; }
.btn-success:hover { background: #059669; color: white; }

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

table { width: 100%; border-collapse: collapse; }
thead { background: #f8fafc; }
th { padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e2e8f0; }
td { padding: 0.875rem 1rem; font-size: 0.875rem; color: #334155; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Status badges */
.status-en_attente { background: #fef3c7; color: #d97706; }
.status-vue { background: #e0e7ff; color: #4338ca; }
.status-retenue { background: #dbeafe; color: #1d4ed8; }
.status-entretien { background: #f3e8ff; color: #7c3aed; }
.status-acceptee { background: #d1fae5; color: #059669; }
.status-refusee { background: #fee2e2; color: #dc2626; }
.status-active { background: #d1fae5; color: #059669; }
.status-fermée { background: #fee2e2; color: #dc2626; }

/* Sidebar nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover { background: #f1f5f9; color: #1e293b; }
.nav-item.active { background: #eef0fd; color: var(--primary); }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 1rem; }

/* Notifications */
.notif-toast {
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  animation: slideIn 0.3s ease;
  color: white;
  font-size: 0.875rem;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: scaleIn 0.2s ease;
}

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

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  flex-shrink: 0;
}

/* Progress bar */
.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  transition: width 0.5s ease;
}

/* Offre card */
.offre-card {
  background: white;
  border-radius: 12px;
  border: 1.5px solid #f1f5f9;
  padding: 1.25rem;
  transition: all 0.2s;
  cursor: pointer;
}

.offre-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(79,93,233,0.1);
  transform: translateY(-2px);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

/* Loader */
.loader { 
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Tabs */
.tab {
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
  background: transparent;
  color: #64748b;
}

.tab:hover { background: #f1f5f9; color: #1e293b; }
.tab.active { background: var(--primary); color: white; }

/* Gradient backgrounds */
.bg-gradient-primary { background: linear-gradient(135deg, #4f5de9, #818cf8); }
.bg-gradient-success { background: linear-gradient(135deg, #10b981, #34d399); }
.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.bg-gradient-danger { background: linear-gradient(135deg, #ef4444, #f87171); }
.bg-gradient-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

/* Auth page */
.auth-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #4f5de9 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

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

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  font-family: 'Poppins', sans-serif;
}

/* Section */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Drag & drop zone */
.upload-zone {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #94a3b8;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: #f8f9ff;
  color: var(--primary);
}

/* Select custom */
select.form-input { cursor: pointer; }

/* Pulse animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse { animation: pulse 2s infinite; }

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

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

/* Chart container */
.chart-container { position: relative; }

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

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