/* FM3A Evaluation System - Styles */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

:root {
  --bg: #0f1117;
  --bg2: #171b27;
  --bg3: #1e2336;
  --border: #2a3050;
  --text: #e8ecf4;
  --text2: #8892b0;
  --text3: #4a5578;
  --accent: #6366f1;
  --accent2: #818cf8;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --orange: #f97316;
  --sky: #0ea5e9;
  --pink: #ec4899;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- LAYOUT ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent2);
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-badge span {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sidebar-logo p {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 0.25rem;
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.nav-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--bg3);
  color: var(--text);
  border-left-color: var(--border);
}

.sidebar-nav a.active {
  background: rgba(99,102,241,0.12);
  color: var(--accent2);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-nav a .icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text3);
}

.sidebar-footer a { color: var(--red); text-decoration: none; }
.sidebar-footer a:hover { text-decoration: underline; }

.main-content {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text2);
}

.avatar {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}

.content-area {
  padding: 2rem;
  flex: 1;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-color, var(--accent));
}

.stat-card .stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  margin: 0.25rem 0;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-card .stat-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: 0.08;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--amber); color: #1a1a1a; }
.btn-warning:hover { background: #d97706; }

.btn-ghost { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(42,48,80,0.5);
  font-size: 0.9rem;
  vertical-align: middle;
}

table tbody tr { transition: background var(--transition); }
table tbody tr:hover { background: var(--bg3); }
table tbody tr:last-child td { border-bottom: none; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

select option { background: var(--bg3); }

textarea { resize: vertical; min-height: 90px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-hint { font-size: 0.75rem; color: var(--text3); margin-top: 0.25rem; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 4px solid;
}

.alert-success { background: rgba(16,185,129,0.1); border-color: var(--green); color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,0.1);  border-color: var(--red);   color: #fca5a5; }
.alert-info    { background: rgba(99,102,241,0.1); border-color: var(--accent); color: var(--accent2); }
.alert-warning { background: rgba(245,158,11,0.1); border-color: var(--amber); color: #fcd34d; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-green  { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-amber  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-blue   { background: rgba(99,102,241,0.15); color: var(--accent2); }
.badge-sky    { background: rgba(14,165,233,0.15); color: #38bdf8; }
.badge-gray   { background: rgba(148,163,184,0.12); color: #94a3b8; }

/* ---- NOTE DISPLAY ---- */
.note-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  font-family: 'Syne', sans-serif;
  border: 2px solid;
}

.note-stars { color: var(--amber); letter-spacing: -1px; }

/* ---- EVALUATION TABLE ---- */
.eval-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }

.eval-table .critere-header td {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 8px;
  color: var(--accent2);
}

.eval-table .sous-critere td {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
}

.eval-table .sous-critere:first-of-type td { border-top: none; }

.note-input-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.note-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
}

.note-btn:hover { border-color: var(--accent); color: var(--accent2); background: rgba(99,102,241,0.1); }
.note-btn.selected-1 { background: #ef4444; border-color: #ef4444; color: white; }
.note-btn.selected-2 { background: #f97316; border-color: #f97316; color: white; }
.note-btn.selected-3 { background: #f59e0b; border-color: #f59e0b; color: #1a1a1a; }
.note-btn.selected-4 { background: #6366f1; border-color: #6366f1; color: white; }
.note-btn.selected-5 { background: #10b981; border-color: #10b981; color: white; }

.note-clear {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text3);
  border-radius: 4px;
  cursor: pointer;
  align-self: center;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.note-clear:hover { color: var(--red); border-color: var(--red); }

.critere-score-display {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 40px;
  text-align: center;
}

/* ---- CHART CONTAINER ---- */
.chart-container { position: relative; width: 100%; }
.chart-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.chart-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.chart-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.12), transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: -0.03em;
}

.login-logo p { color: var(--text2); font-size: 0.85rem; margin-top: 0.25rem; }

/* ---- CONSULTANT CARD ---- */
.consultant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.consultant-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
  color: var(--text);
}

.consultant-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.15);
}

.consultant-card .c-avatar {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: white;
  margin-bottom: 0.75rem;
  font-family: 'Syne', sans-serif;
}

.consultant-card .c-name {
  font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem;
}
.consultant-card .c-spec { font-size: 0.8rem; color: var(--text2); margin-bottom: 0.75rem; }
.consultant-card .c-stats {
  display: flex; gap: 1rem; font-size: 0.78rem; color: var(--text3);
}

/* ---- PROGRESS ---- */
.progress-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ---- RADAR/CHART AREA ---- */
canvas { max-width: 100%; }

/* ---- PAGINATION ---- */
.pagination {
  display: flex; gap: 0.4rem; align-items: center; justify-content: center;
  margin-top: 1.5rem;
}
.page-link {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text2);
  font-size: 0.85rem;
  transition: all var(--transition);
}
.page-link:hover, .page-link.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ---- MOBILE ---- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content-area { padding: 1rem; }
  .consultant-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-box { margin: 1rem; }
}

/* ---- MISC ---- */
.text-muted { color: var(--text2); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text3);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

.tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

.critere-color-bar {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  height: 100%;
  min-height: 20px;
}

.score-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.score-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  border-top: 3px solid var(--c-color, var(--accent));
}

.score-card .score-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.25rem 0;
}

.score-card .score-name { font-size: 0.75rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.score-card .score-sub  { font-size: 0.7rem; color: var(--text3); margin-top: 0.2rem; }

/* Timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.5rem; top: 0.4rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg2);
}
.timeline-date { font-size: 0.75rem; color: var(--text3); font-weight: 600; }
.timeline-content {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.85rem; margin-top: 0.4rem;
}
