/* ==========================================================================
   MODULE LABORATOIRE & BIOLOGIE MÉDICALE - CLINIQUE NOFLAY
   Fichier : assets/css/laboratoire.css
   ========================================================================== */

/* --- 1. Structure du Layout Laboratoire --- */
.labo-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-body, #f8fafc);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.labo-sidebar {
  width: 260px;
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.labo-sidebar .sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.labo-sidebar .sidebar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.labo-sidebar .sidebar-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.labo-sidebar .sidebar-title span {
  font-size: 0.75rem;
  color: #94a3b8;
}

.labo-sidebar .sidebar-nav {
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.labo-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.labo-sidebar .nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.labo-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.labo-sidebar .nav-link.active {
  background: #0284c7;
  color: #ffffff;
}

.labo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.labo-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.labo-topbar h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
}

.labo-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- 2. Cartes KPI --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kpi-card.highlight-warning {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}

.kpi-card.highlight-success {
  border-left: 4px solid #10b981;
  background: #ecfdf5;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.kpi-card.highlight-warning .kpi-value {
  color: #d97706;
}

.kpi-card.highlight-success .kpi-value {
  color: #059669;
}

/* --- 3. Table des Analyses --- */
.table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.badge-biologie {
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-block;
}

/* Boutons d'action */
.btn-action-labo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #0284c7;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-action-labo:hover {
  background: #0369a1;
}

/* --- 4. Modale de Saisie des Résultats & Design Moderne --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-container {
  background: #ffffff;
  border-radius: 12px;
  width: 95%;
  max-width: 820px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}

.btn-close:hover {
  color: #0f172a;
}

.modal-body-scroll {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Tableau des paramètres dans la modale */
.table-parametres {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.table-parametres th {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 4px 8px;
  text-align: left;
}

.table-parametres td {
  padding: 2px 4px;
}

/* Champs de formulaires modernes (élimine le style rétro) */
.input-labo {
  font-family: inherit !important;
  font-size: 0.88rem !important;
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 0.55rem 0.75rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.input-labo:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Boutons de la modale */
.btn-sm.btn-success {
  background: #059669 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 0.6rem 1.2rem !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: background 0.15s ease !important;
}

.btn-sm.btn-success:hover {
  background: #047857 !important;
}

.btn-sm.btn-ghost {
  background: transparent !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 0.55rem 1rem !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.btn-sm.btn-ghost:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Bouton pour ajouter un paramètre personnalisé */
.btn-add-param {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #334155;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s ease;
}

.btn-add-param:hover {
  background: #f0fdf4;
  border-color: #10b981;
  color: #059669;
}

/* Bouton rouge de suppression sélective ✕ */
.btn-delete-param {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  border-radius: 6px !important;
  width: 26px !important;
  height: 26px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  transition: all 0.15s ease !important;
}

.btn-delete-param:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.d-none { 
  display: none !important; 
}
