/* ═══════════════════════════════════════════════════════════════
   OrthoSuite Pro — Design System CSS v1.0
   Stack: Bootstrap 5 + Variables CSS + Composants orthopédiques
════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --ortho-primary:      #1e40af;
  --ortho-primary-light:#3b82f6;
  --ortho-primary-dark: #1e3a8a;
  --ortho-accent:       #0ea5e9;
  --ortho-success:      #10b981;
  --ortho-warning:      #f59e0b;
  --ortho-danger:       #ef4444;
  --ortho-info:         #6366f1;
  --ortho-secondary:    #64748b;
  --ortho-dark:         #0f172a;
  --sidebar-width:      260px;
  --sidebar-bg:         #0f2744;
  --sidebar-hover:      #1e293b;
  --sidebar-active:     rgba(59,130,246,.18);
  --topbar-h:           60px;
  --topbar-bg:          #ffffff;
  --body-bg:            #f1f5f9;
  --card-bg:            #ffffff;
  --card-radius:        12px;
  --card-shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --border-color:       #e2e8f0;
  --text-primary:       #0f172a;
  --text-secondary:     #64748b;
  --font-main:          'Inter', system-ui, -apple-system, sans-serif;
  --transition:         .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--body-bg);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: var(--ortho-primary-light); text-decoration: none; }
a:hover { color: var(--ortho-primary); }

/* ── Layout ─────────────────────────────────────────────────── */
.ortho-wrapper { display: flex; min-height: 100vh; }
.ortho-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.ortho-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--ortho-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.sidebar-brand-text { flex: 1; overflow: hidden; }
.sidebar-brand-title {
  font-weight: 700; font-size: 15px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-sub { font-size: 11px; color: rgba(255,255,255,.5); }

/* Navigation */
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-section {
  padding: 4px 16px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; margin: 1px 8px;
  border-radius: 8px; cursor: pointer;
  color: rgba(255,255,255,.7);
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.sidebar-item:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-item.active { background: var(--sidebar-active); color: #60a5fa; border-left: 2px solid #3b82f6; }
.sidebar-item .si-icon { width: 20px; text-align: center; font-size: 14px; flex-shrink: 0; }
.sidebar-item .si-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item .si-badge {
  background: var(--ortho-danger);
  color: #fff; border-radius: 10px;
  font-size: 10px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ortho-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.5); }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.ortho-topbar {
  position: sticky; top: 0; z-index: 900;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-title { font-weight: 700; font-size: 16px; flex: 1; }
.topbar-search { position: relative; }
.topbar-search input {
  border: 1px solid var(--border-color); border-radius: 8px;
  padding: 7px 12px 7px 34px; font-size: 13px;
  background: var(--body-bg); width: 220px;
  transition: all var(--transition); outline: none;
}
.topbar-search input:focus { border-color: var(--ortho-primary-light); width: 280px; background: #fff; }
.topbar-search .ts-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border-color); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 15px;
  transition: all var(--transition); position: relative;
}
.topbar-btn:hover { background: var(--body-bg); color: var(--ortho-primary); }
.topbar-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--ortho-danger); color: #fff;
  border-radius: 10px; font-size: 9px; padding: 1px 4px; min-width: 16px; text-align: center;
  border: 2px solid #fff;
}
.topbar-rdv-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--ortho-primary); color: #fff;
  border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.topbar-rdv-btn:hover { background: var(--ortho-primary-dark); }

/* ── PAGE CONTENT ────────────────────────────────────────────── */
.ortho-main { padding: 24px; flex: 1; }
.page-header { margin-bottom: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-header h1 { font-size: 20px; font-weight: 700; flex: 1; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 10px;
}
.card-header h5, .card-header h6 { margin: 0; font-weight: 600; flex: 1; font-size: 14px; }
.card-body  { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); background: var(--body-bg); }

/* ── KPI CARDS ───────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  padding: 20px; display: flex; align-items: flex-start; gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kpi-icon.bg-blue   { background:#eff6ff; color:#2563eb; }
.kpi-icon.bg-green  { background:#f0fdf4; color:#16a34a; }
.kpi-icon.bg-orange { background:#fff7ed; color:#ea580c; }
.kpi-icon.bg-purple { background:#faf5ff; color:#9333ea; }
.kpi-icon.bg-red    { background:#fef2f2; color:#dc2626; }
.kpi-icon.bg-teal   { background:#f0fdfa; color:#0d9488; }
.kpi-info { flex: 1; }
.kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.kpi-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 6px;
  display: inline-block;
}
.kpi-badge.up   { background:#f0fdf4; color:#16a34a; }
.kpi-badge.down { background:#fef2f2; color:#dc2626; }

/* ── TABLES ──────────────────────────────────────────────────── */
.ortho-table-wrap { overflow-x: auto; }
.ortho-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.ortho-table thead th {
  background: var(--body-bg); padding: 10px 14px;
  font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.ortho-table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.ortho-table tbody tr:hover { background: #f8fafc; }
.ortho-table tbody tr:last-child td { border-bottom: none; }

/* ── BADGES & STATUS ─────────────────────────────────────────── */
.badge-ortho {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-confirme  { background:#eff6ff; color:#1d4ed8; }
.badge-attente   { background:#fffbeb; color:#b45309; }
.badge-present   { background:#f0fdf4; color:#15803d; }
.badge-annule    { background:#fef2f2; color:#b91c1c; }
.badge-urgent    { background:#fef2f2; color:#dc2626; border:1px solid #fca5a5; }
.badge-termine   { background:#f8fafc; color:#64748b; }
.badge-payee     { background:#f0fdf4; color:#15803d; }
.badge-impayee   { background:#fef2f2; color:#b91c1c; }
.badge-devis     { background:#faf5ff; color:#7c3aed; }
.badge-brouillon { background:#f8fafc; color:#64748b; }
.badge-valide    { background:#f0fdf4; color:#15803d; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.form-control, .form-select, .form-control-sm {
  border: 1px solid var(--border-color); border-radius: 8px;
  padding: 8px 12px; font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff; width: 100%;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ortho-primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  outline: none;
}
.form-control-sm { padding: 5px 10px; font-size: 12px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; }

/* EVA Slider */
.eva-slider-wrap { padding: 8px 0; }
.eva-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 4px;
  background: linear-gradient(to right, #10b981, #f59e0b, #ef4444);
  outline: none; cursor: pointer;
}
.eva-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: #fff;
  border: 3px solid var(--ortho-primary-light);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  cursor: pointer;
}
.eva-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-secondary); margin-top: 4px; }

/* Muscle testing */
.muscle-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.muscle-row  { display: flex; align-items: center; gap: 8px; }
.muscle-label { font-size: 12px; flex: 1; color: var(--text-secondary); }
.muscle-btns  { display: flex; gap: 3px; }
.muscle-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-color);
  background: var(--body-bg); font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
}
.muscle-btn.selected { background: var(--ortho-primary); color:#fff; border-color: var(--ortho-primary); }

/* Score ring */
.score-ring { display: inline-flex; align-items: center; justify-content: center; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring-val { position: absolute; font-weight: 700; font-size: 16px; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-primary   { background: var(--ortho-primary); color: #fff; }
.btn-primary:hover { background: var(--ortho-primary-dark); }
.btn-success   { background: var(--ortho-success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning   { background: var(--ortho-warning); color: #fff; }
.btn-danger    { background: var(--ortho-danger); color: #fff; }
.btn-secondary { background: var(--body-bg); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline-primary { background: transparent; color: var(--ortho-primary); border: 1px solid var(--ortho-primary); }
.btn-outline-primary:hover { background: var(--ortho-primary); color: #fff; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; justify-content: center; }
.btn-full { width: 100%; justify-content: center; }

/* ── TABS ────────────────────────────────────────────────────── */
.ortho-tabs { border-bottom: 2px solid var(--border-color); display: flex; gap: 0; margin-bottom: 20px; overflow-x: auto; }
.ortho-tab {
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition); white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.ortho-tab:hover { color: var(--ortho-primary-light); }
.ortho-tab.active { color: var(--ortho-primary); border-bottom-color: var(--ortho-primary); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .2s; }

/* ── MODALS ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1050; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: min(90vw, 600px); max-height: 90vh;
  overflow-y: auto; transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 10px;
}
.modal-header h5 { flex: 1; margin: 0; font-size: 15px; font-weight: 700; }
.modal-close { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--text-secondary); padding: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.modal-close:hover { background: var(--body-bg); }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 8px; }

/* ── TOASTS ──────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 14px 18px; min-width: 280px; display: flex; align-items: flex-start; gap: 10px;
  animation: slideIn .3s; border-left: 4px solid;
}
.toast.success { border-color: var(--ortho-success); }
.toast.error   { border-color: var(--ortho-danger); }
.toast.warning { border-color: var(--ortho-warning); }
.toast.info    { border-color: var(--ortho-info); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--ortho-success); }
.toast.error   .toast-icon { color: var(--ortho-danger); }
.toast.warning .toast-icon { color: var(--ortho-warning); }
.toast.info    .toast-icon { color: var(--ortho-info); }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 13px; }
.toast-msg   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── SEARCH RESULTS ──────────────────────────────────────────── */
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border-color);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18);
  z-index: 99999 !important; max-height: 300px; overflow-y: auto;
}
.search-result-item {
  padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-color); transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--body-bg); }
.sri-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ortho-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sri-info { flex: 1; }
.sri-name  { font-size: 13px; font-weight: 600; }
.sri-meta  { font-size: 11px; color: var(--text-secondary); }

/* ── AGENDA / CALENDAR ───────────────────────────────────────── */
.rdv-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot-confirme { background: #3b82f6; }
.dot-attente  { background: #f59e0b; }
.dot-present  { background: #10b981; }
.dot-annule   { background: #ef4444; }
.dot-urgent   { background: #dc2626; }
.dot-termine  { background: #6b7280; }

.salle-attente-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: #fff; border: 1px solid var(--border-color);
  margin-bottom: 8px; transition: all var(--transition);
}
.salle-attente-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.sa-num { font-size: 18px; font-weight: 700; color: var(--ortho-primary-light); width: 28px; }
.sa-info { flex: 1; }
.sa-name { font-weight: 600; font-size: 13px; }
.sa-time { font-size: 11px; color: var(--text-secondary); }
.sa-motif { font-size: 12px; color: var(--text-secondary); }
.sa-actions { display: flex; gap: 4px; }

/* ── DOSSIER PATIENT ─────────────────────────────────────────── */
.patient-header {
  background: linear-gradient(135deg, var(--ortho-primary-dark), var(--ortho-primary));
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  padding: 24px; color: #fff;
  display: flex; align-items: center; gap: 16px;
}
.patient-avatar-lg {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; flex-shrink: 0;
}
.patient-header-info { flex: 1; }
.patient-header-name { font-size: 20px; font-weight: 700; }
.patient-header-sub  { opacity: .8; font-size: 13px; margin-top: 4px; }
.patient-header-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.patient-tag { background: rgba(255,255,255,.2); border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 500; }

/* ── SCORES PANEL ────────────────────────────────────────────── */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; }
.score-box {
  background: var(--body-bg); border-radius: 10px; padding: 14px;
  text-align: center; border: 1px solid var(--border-color);
}
.score-box-val { font-size: 22px; font-weight: 700; color: var(--ortho-primary); }
.score-box-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.score-box-ref { font-size: 10px; color: #94a3b8; }

/* ── DICOM VIEWER ────────────────────────────────────────────── */
.dicom-container { background: #000; border-radius: 10px; overflow: hidden; position: relative; }
.dicom-toolbar {
  background: #1a1a1a; padding: 8px 12px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.dicom-tool-btn {
  padding: 5px 10px; border-radius: 6px; border: 1px solid #444;
  background: #2a2a2a; color: #ccc; font-size: 12px; cursor: pointer;
  transition: all .15s; display: flex; align-items: center; gap: 5px;
}
.dicom-tool-btn:hover, .dicom-tool-btn.active { background: var(--ortho-primary); color: #fff; border-color: var(--ortho-primary); }
.dicom-canvas-wrap { position: relative; }
#dicomCanvas { display: block; width: 100%; }
.dicom-info { position: absolute; top: 8px; left: 8px; color: #0f0; font-size: 11px; font-family: monospace; pointer-events: none; }

/* ── VOICE RECORDER ──────────────────────────────────────────── */
.voice-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  color: inherit;
  position: relative;
}
.voice-indicator {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.voice-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #374151; transition: all .3s;
}
.voice-dot.recording { background: #ef4444; animation: pulse 1s infinite; }
.voice-dot.processing { background: #f59e0b; animation: spin 1s linear infinite; }
.voice-dot.ready { background: #10b981; }
.voice-waveform { flex: 1; height: 40px; }
.voice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.voice-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.voice-btn-record  { background: #ef4444; color: #fff; }
.voice-btn-stop    { background: #64748b; color: #fff; }
.voice-btn-play    { background: #3b82f6; color: #fff; }
.voice-btn-apply   { background: #10b981; color: #fff; }
.voice-status { font-size: 12px; color: #94a3b8; text-align: center; padding: 8px 0; }
.voice-transcript { background: #1e293b; border-radius: 8px; padding: 10px; font-size: 13px; min-height: 60px; color: #e2e8f0; margin-top: 10px; }
.voice-segments { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; margin-top: 10px; }
.voice-segment {
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 6px 10px;
  font-size: 11px; cursor: pointer; color: #475569;
  transition: all .15s; position: relative; z-index: 1;
}
.voice-segment:hover { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.voice-segment:hover { border-color: var(--ortho-primary-light); color: #fff; }

/* ── STATS / CHARTS ──────────────────────────────────────────── */
.chart-wrap { position: relative; height: 250px; }

/* ── TIMELINE ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -20px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ortho-primary-light); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--ortho-primary-light);
}
.timeline-body { background: var(--body-bg); border-radius: 8px; padding: 10px 14px; border: 1px solid var(--border-color); }
.timeline-date { font-size: 11px; color: var(--text-secondary); }

/* ── PRINT ───────────────────────────────────────────────────── */
@media print {
  .ortho-sidebar, .ortho-topbar, .topbar-actions, .page-header-actions, .voice-panel,
  .btn:not(.btn-print), .ortho-tabs, nav, .modal-overlay, .toast-container { display: none !important; }
  .ortho-content { margin-left: 0 !important; }
  .ortho-main { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  @page { margin: 15mm; }
  body { font-size: 12px; }
}

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeIn   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes pulse    { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(1.2); } }
@keyframes spin     { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer  { from { background-position: -400px 0; } to { background-position: 400px 0; } }

/* ── UTILITIES ───────────────────────────────────────────────── */
.text-muted      { color: var(--text-secondary) !important; }
.text-primary    { color: var(--ortho-primary) !important; }
.text-success    { color: var(--ortho-success) !important; }
.text-danger     { color: var(--ortho-danger) !important; }
.text-warning    { color: var(--ortho-warning) !important; }
.fw-600          { font-weight: 600; }
.fw-700          { font-weight: 700; }
.fs-11           { font-size: 11px; }
.fs-12           { font-size: 12px; }
.fs-13           { font-size: 13px; }
.gap-6           { gap: 6px; }
.gap-8           { gap: 8px; }
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1          { flex: 1; }
.w-100           { width: 100%; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 20px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ortho-sidebar { transform: translateX(-100%); }
  .ortho-sidebar.open { transform: none; }
  .ortho-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .topbar-search { display: none; }
  .ortho-main { padding: 14px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

.search-input-wrap { position: relative !important; }

.card-overflow-visible { overflow: visible !important; }
.card-overflow-visible .card-body { overflow: visible !important; }

/* ── TOASTS ─────────────────────────────────────────────── */
@keyframes toastSlideIn {
  from { opacity:0; transform:translateX(110%); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes toastSlideOut {
  from { opacity:1; transform:translateX(0); }
  to   { opacity:0; transform:translateX(110%); }
}
/* toastContainer positionné via JS/HTML pour éviter les conflits */
.toast-msg { line-height: 1.5; }
