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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* Header */
.header {
  background: #2c3e50;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  background: #34495e;
  padding: 0 2rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: #95a5a6;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #ecf0f1;
}

.tab-btn.active {
  color: white;
  border-bottom-color: #3498db;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Tab content */
.tab-content, .emp-tab-content {
  display: none;
}

.tab-content.active, .emp-tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* Position cards within department */
.position-card {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  border-left: 3px solid #3498db;
}

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

/* Contract badges */
.contract-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.contract-cdi {
  background: #d5f5e3;
  color: #1e8449;
}

.contract-alt {
  background: #fef3e2;
  color: #d68910;
}

/* Skill count badge */
.skill-count-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  margin-left: 0.3rem;
  background: #eef2f7;
  color: #7f8c8d;
}

/* Job description editor */
.jobdesc-editor {
  margin: 0.5rem 0;
}

.jobdesc-editor textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 0.4rem;
}

.jobdesc-editor textarea:focus {
  outline: none;
  border-color: #3498db;
}

/* Job description content (employee view) */
.job-desc-content {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Skills section */
.skills-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e0e0e0;
}

/* Category groups */
.category-group {
  margin-bottom: 0.6rem;
}

.category-header {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2c3e50;
  padding: 0.3rem 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.3rem;
}

.category-count {
  font-weight: 400;
  color: #95a5a6;
  font-size: 0.78rem;
}

.category-skills {
  padding: 0.2rem 0;
}

/* Tracking category headers */
.tracking-category {
  margin-bottom: 1.2rem;
}

.tracking-category-header {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  padding: 0.6rem 0.8rem;
  background: #eef2f7;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 3px solid #3498db;
}

/* Forms */
.form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.form-row input,
.form-row select {
  flex: 1;
  min-width: 150px;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-copy {
  background: #8e44ad;
  color: white;
}

.btn-copy:hover {
  background: #7d3c98;
}

.btn-ai {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 500;
}

.btn-ai:hover {
  background: linear-gradient(135deg, #5a6fd6, #6a4196);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Suggestions box */
.suggestions-box {
  margin-top: 0.8rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 8px;
  border: 1px solid #c4b5fd;
}

.suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #c4b5fd;
}

.suggestions-header strong {
  color: #5b21b6;
  font-size: 0.92rem;
}

.suggestion-category {
  margin-bottom: 0.6rem;
}

.suggestion-category strong {
  display: block;
  font-size: 0.82rem;
  color: #6d28d9;
  margin-bottom: 0.3rem;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(196, 181, 253, 0.3);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item span {
  color: #374151;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #eee;
}

th {
  font-weight: 600;
  color: #7f8c8d;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover {
  background: #f8f9fa;
}

/* Comment input */
.comment-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fafafa;
  transition: border-color 0.2s;
}

.comment-input:focus {
  outline: none;
  border-color: #3498db;
  background: white;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  text-align: center;
  min-width: 120px;
}

.status-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.status-non_acquis {
  background: #fde8e8;
  color: #c0392b;
  border: 2px solid #e74c3c;
}

.status-en_cours {
  background: #fef3e2;
  color: #d68910;
  border: 2px solid #f39c12;
}

.status-acquis {
  background: #e8f8f0;
  color: #1e8449;
  border: 2px solid #27ae60;
}

/* Skill tags */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eef2f7;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.82rem;
  margin: 0.15rem;
}

.skill-tag .delete-skill {
  cursor: pointer;
  color: #e74c3c;
  font-weight: bold;
  font-size: 1rem;
  line-height: 1;
}

.skill-tag .delete-skill:hover {
  color: #c0392b;
}

/* Empty state */
.empty {
  text-align: center;
  color: #95a5a6;
  padding: 2rem;
  font-style: italic;
}

/* Employee view page */
.employee-header {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.employee-header h2 {
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 0.3rem;
}

.employee-header .position {
  color: #7f8c8d;
  font-size: 1rem;
}

/* Period selector */
.period-selector {
  padding: 0.6rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  min-width: 200px;
}

.period-selector:focus {
  outline: none;
  border-color: #3498db;
}

/* Employee page tabs */
.emp-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.emp-tab-btn {
  background: white;
  border: 2px solid #ddd;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #7f8c8d;
  transition: all 0.2s;
}

.emp-tab-btn:hover {
  border-color: #3498db;
  color: #3498db;
}

.emp-tab-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* Progress bar (employee view) */
.progress-summary {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.progress-bar-container {
  display: flex;
  height: 12px;
  background: #fde8e8;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.progress-green {
  background: #27ae60;
}

.progress-orange {
  background: #f39c12;
}

.progress-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-green { color: #1e8449; }
.stat-orange { color: #d68910; }
.stat-red { color: #c0392b; }

/* Legend */
.legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #555;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.red { background: #e74c3c; }
.legend-dot.orange { background: #f39c12; }
.legend-dot.green { background: #27ae60; }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #2c3e50;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Employee comment cell (read-only in admin) */
.employee-comment-cell {
  font-size: 0.85rem;
  color: #555;
}

/* Employee status badges */
.emp-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.emp-status-active {
  background: #d5f5e3;
  color: #1e8449;
}

.emp-status-offboarding {
  background: #fef3e2;
  color: #d68910;
}

.emp-status-gone {
  background: #f2f3f4;
  color: #95a5a6;
}

/* Trial period badges */
.trial-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.trial-en_cours {
  background: #d6eaf8;
  color: #2471a3;
}

.trial-renouvellement_possible {
  background: #fef3e2;
  color: #d68910;
}

.trial-validee {
  background: #d5f5e3;
  color: #1e8449;
}

/* Trial urgency indicators */
.trial-expired {
  color: #c0392b;
  font-weight: 700;
}

.trial-urgent {
  color: #e74c3c;
  font-weight: 600;
}

.trial-soon {
  color: #d68910;
  font-weight: 500;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  font-size: 1.2rem;
  color: #2c3e50;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #eef2f7;
}

/* Wider container for employee tables */
.container {
  max-width: 1400px;
}

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 0.8rem 1rem; }
  .tabs { padding: 0 0.5rem; }
  .tab-btn { padding: 0.6rem 0.8rem; font-size: 0.82rem; }
  .container { padding: 0 1rem; margin: 1rem auto; }
  .form-row { flex-direction: column; }
  .form-row input, .form-row select { min-width: auto; }
  table { font-size: 0.82rem; }
  th, td { padding: 0.5rem 0.4rem; }
  .status-badge { min-width: 100px; font-size: 0.78rem; padding: 0.25rem 0.5rem; }
  .emp-tabs { flex-wrap: wrap; }
  .emp-tab-btn { font-size: 0.82rem; padding: 0.5rem 0.8rem; }
  .position-header { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .progress-stats { flex-direction: column; gap: 0.3rem; align-items: center; }
  .suggestion-item { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}
