/**
 * Styles pour application Droits syndicaux
 * Respect de la charte graphique avec variables CSS modernes
 */

:root {
  /* Couleurs principales */
  --ds-primary: #4F46E5;
  --ds-primary-hover: #1c13b2;
  --ds-primary-light: #ffffff;
  --ds-primary-dark: #020098;

  /* Couleurs secondaires */
  --ds-secondary: #10B981;
  --ds-secondary-hover: #00864e;
  --ds-secondary-light: #f5ffff;

  /* Accent */
  --ds-accent: #F59E0B;
  --ds-accent-hover: #c26b00;

  /* Neutres */
  --ds-gray-50: #F9FAFB;
  --ds-gray-100: #F3F4F6;
  --ds-gray-200: #E5E7EB;
  --ds-gray-300: #D1D5DB;
  --ds-gray-400: #9CA3AF;
  --ds-gray-500: #6B7280;
  --ds-gray-600: #4B5563;
  --ds-gray-700: #374151;
  --ds-gray-800: #1F2937;
  --ds-gray-900: #111827;

  /* Statuts */
  --ds-success: #10B981;
  --ds-danger: #EF4444;
  --ds-warning: #F59E0B;
  --ds-info: #3B82F6;

  /* Typographie */
  --ds-font-family: 'Inter', -apple-system, sans-serif;
  --ds-font-size-base: 16px;
  --ds-line-height: 1.5;

  /* Espacements & rayons */
  --ds-spacing: 1rem;
  --ds-radius: 8px;
  --ds-radius-lg: 12px;
  --ds-radius-xl: 16px;

  /* Ombres */
  --ds-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ds-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --ds-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --ds-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --ds-transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--ds-font-family);
  font-size: var(--ds-font-size-base);
  line-height: var(--ds-line-height);
  color: var(--ds-gray-900);
  background: var(--ds-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.ds-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--ds-spacing);
}

/* Header */
.ds-header {
  background: white;
  border-bottom: 1px solid var(--ds-gray-200);
  padding: var(--ds-spacing) 0;
  margin-bottom: calc(var(--ds-spacing) * 2);
  box-shadow: var(--ds-shadow-sm);
}

.ds-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--ds-spacing);
}

.ds-header-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ds-gray-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ds-header-title svg {
  color: var(--ds-gray-500);
}

/* Cards */
.ds-card {
  background: white;
  border-radius: var(--ds-radius-lg);
  padding: calc(var(--ds-spacing) * 1.5);
  box-shadow: var(--ds-shadow);
  margin-bottom: var(--ds-spacing);
}

.ds-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--ds-spacing);
  padding-bottom: var(--ds-spacing);
  border-bottom: 1px solid var(--ds-gray-200);
}

.ds-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ds-gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ds-card-title svg {
  color: var(--ds-gray-500);
}

/* Boutons */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--ds-radius);
  font-family: var(--ds-font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--ds-transition);
  text-decoration: none;
}

.ds-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.ds-btn-primary:hover:not(:disabled) {
  background: var(--ds-primary-hover);
  box-shadow: var(--ds-shadow-md);
}

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

.ds-btn-secondary:hover:not(:disabled) {
  background: var(--ds-secondary-hover);
  box-shadow: var(--ds-shadow-md);
}

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

.ds-btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: var(--ds-shadow-md);
}

.ds-btn-outline {
  background: white;
  color: var(--ds-gray-700);
  border: 1px solid var(--ds-gray-300);
}

.ds-btn-outline:hover:not(:disabled) {
  background: var(--ds-gray-50);
  border-color: var(--ds-gray-400);
}

/* Icônes grises minimalistes */
.ds-icon {
  color: var(--ds-gray-500);
  transition: var(--ds-transition);
}

.ds-icon:hover {
  color: var(--ds-gray-700);
}

/* Input & Search */
.ds-input-group {
  margin-bottom: var(--ds-spacing);
}

.ds-input-label {
  display: block;
  font-weight: 500;
  color: var(--ds-gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.ds-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--ds-gray-300);
  border-radius: var(--ds-radius);
  font-family: var(--ds-font-family);
  font-size: 0.875rem;
  transition: var(--ds-transition);
}

.ds-input:focus {
  outline: none;
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ds-search-box {
  position: relative;
}

.ds-search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ds-gray-400);
  pointer-events: none;
}

.ds-search-box input {
  padding-left: 3rem;
}

/* Alert/Status boxes */
.ds-alert {
  padding: 1rem;
  border-radius: var(--ds-radius);
  margin-bottom: var(--ds-spacing);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

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

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

.ds-alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.ds-alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Stats Grid */
.ds-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--ds-spacing);
  margin-bottom: calc(var(--ds-spacing) * 2);
}

.ds-stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ds-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ds-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ds-stat-icon.primary {
  background: var(--ds-primary);
}

.ds-stat-icon.success {
  background: var(--ds-success);
}

.ds-stat-icon.warning {
  background: var(--ds-warning);
}

.ds-stat-icon.info {
  background: var(--ds-info);
}

.ds-stat-content h3 {
  font-size: 0.875rem;
  color: var(--ds-gray-600);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.ds-stat-content p {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ds-gray-900);
}

/* Table */
.ds-table-wrapper {
  overflow-x: auto;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-gray-200);
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.ds-table th {
  background: var(--ds-gray-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ds-gray-700);
  border-bottom: 1px solid var(--ds-gray-200);
}

.ds-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ds-gray-200);
  font-size: 0.875rem;
}

.ds-table tr:last-child td {
  border-bottom: none;
}

.ds-table tr:hover {
  background: var(--ds-gray-50);
}

/* Badge */
.ds-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.ds-badge-primary {
  background: var(--ds-primary-light);
  color: var(--ds-primary);
}

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

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

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

/* Progress bar */
.ds-progress {
  width: 100%;
  height: 8px;
  background: var(--ds-gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.ds-progress-bar {
  height: 100%;
  background: var(--ds-primary);
  transition: width 0.3s ease;
}

/* Breadcrumb */
.ds-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--ds-gray-50);
  border-radius: var(--ds-radius);
  font-size: 0.875rem;
  margin-bottom: var(--ds-spacing);
}

.ds-breadcrumb a {
  color: var(--ds-primary);
  text-decoration: none;
  transition: var(--ds-transition);
}

.ds-breadcrumb a:hover {
  color: var(--ds-primary-hover);
}

.ds-breadcrumb-separator {
  color: var(--ds-gray-400);
}

/* Tree structure */
.ds-tree {
  list-style: none;
}

.ds-tree-item {
  padding: 0.5rem 0;
  border-left: 2px solid var(--ds-gray-200);
  padding-left: 1rem;
  margin-left: 0.5rem;
}

.ds-tree-item:hover {
  border-left-color: var(--ds-primary);
}

.ds-tree-link {
  color: var(--ds-gray-700);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--ds-transition);
}

.ds-tree-link:hover {
  color: var(--ds-primary);
}

.ds-tree-code {
  color: var(--ds-gray-500);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Loading */
.ds-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--ds-gray-500);
}

.ds-spinner {
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .ds-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .ds-header-content {
    flex-direction: column;
    gap: 1rem;
  }
}
