/* =============================================
   CLINIQUE LA VALLEE — Design Premium 2025
   Palette: Navy #1a2d6b | Vert #4a9e2f | Or #f0c814
   ============================================= */

/* Fonts loaded locally via vendor/fonts.css */

:root {
  --navy: #1a2d6b;
  --navy-dark: #111e4a;
  --navy-light: #2a4499;
  --green: #4a9e2f;
  --green-dark: #357a20;
  --green-light: #6ec850;
  --gold: #f0c814;
  --gold-light: #fde84a;
  --white: #ffffff;
  --light: #f4f7fb;
  --light-2: #eef2f9;
  --border: #dde3f0;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --danger: #dc2626;
  --success: #16a34a;
  --card-bg: rgba(255, 255, 255, 0.95);
  --shadow-xs: 0 1px 3px rgba(26, 45, 107, .08);
  --shadow-sm: 0 2px 8px rgba(26, 45, 107, .10);
  --shadow-md: 0 6px 24px rgba(26, 45, 107, .14);
  --shadow-lg: 0 16px 48px rgba(26, 45, 107, .18);
  --shadow-xl: 0 24px 80px rgba(26, 45, 107, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm {
  width: 1em;
  height: 1em;
}

.icon-lg {
  width: 2em;
  height: 2em;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

/* ══════════════════════════════════════════
   APP LAYOUT (SIDEBAR + MAIN)
══════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   SIDEBAR VERTICALE — Premium Dashboard
══════════════════════════════════════════ */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 4px 0 24px rgba(17, 30, 74, .15);
  border-right: 1px solid rgba(255, 255, 255, .05);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

/* Decoration subtle pour la sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.sidebar-header {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-dark);
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(240, 200, 20, .3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .5px;
}

.brand-subtitle {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Navigation dans la sidebar */
.sidebar-nav {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
  /* Firefox */
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, .4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-link {
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .25s ease;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .05);
  transform: translateX(4px);
}

.nav-link.active {
  color: #fff;
  background: rgba(240, 200, 20, .1);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

.nav-link.active .nav-icon {
  color: var(--gold);
}

.nav-icon {
  display: flex;
  align-items: center;
  transition: color .2s;
}

.nav-icon svg {
  width: 1.25em;
  height: 1.25em;
}

/* Sidebar notification badges */
.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 10px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  line-height: 1;
  animation: badgePulse 2s ease-in-out infinite;
}

.nav-badge-alert {
  background: var(--danger);
  color: #fff;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Footer de la sidebar (Profil utilisateur) */
.sidebar-footer {
  padding: 20px 24px;
  background: rgba(0, 0, 0, .15);
  border-top: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--light);
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
}

.btn-logout {
  color: rgba(220, 38, 38, .8);
  background: rgba(220, 38, 38, .1);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  text-decoration: none;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, .9);
  color: #fff;
  transform: scale(1.05);
}

/* ══════════════════════════════════════════
   MAIN WRAPPER (Reste de l'ecran)
══════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--light);
  overflow-y: auto;
  position: relative;
  min-width: 0;
  margin-left: 240px;
  width: calc(100% - 240px);
}

/* ══════════════════════════════════════════
   MESSAGES / ALERTS
══════════════════════════════════════════ */
.messages-container {
  margin: 24px 32px 0;
}

.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid;
  box-shadow: var(--shadow-xs);
  animation: slideInDown .3s ease;
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #22c55e;
}

.alert-error,
.alert-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #ef4444;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: var(--gold);
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: .5;
  transition: opacity .2s;
}

.alert-close:hover {
  opacity: 1;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.main-content {
  flex: 1;
  padding: 32px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-width: 0;
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  backdrop-filter: blur(8px);
  transition: box-shadow .2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.form-card {
  max-width: 860px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════ */
.search-container {
  margin-bottom: 20px;
}

.search-bar-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 60px;
  padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s;
  margin-bottom: 14px;
}

.search-bar-wrapper:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(26, 45, 107, .08), var(--shadow-sm);
}

.search-icon {
  font-size: 20px;
  color: var(--text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.search-bar {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.search-bar::placeholder {
  color: var(--text-muted);
}

.search-clear {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  flex-shrink: 0;
  transition: color .2s;
}

.search-clear:hover {
  color: var(--danger);
}

.btn-search {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  letter-spacing: .3px;
  box-shadow: 0 4px 12px rgba(26, 45, 107, .3);
}

.btn-search:hover {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  box-shadow: 0 6px 16px rgba(26, 45, 107, .4);
  transform: translateY(-1px);
}

/* Filters */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
}

.filters-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.filter-select {
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: var(--light);
  color: var(--text);
  width: 100%;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--navy);
  background-color: var(--white);
}

.filter-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding-top: 22px;
  cursor: pointer;
}

.filter-checkbox input[type=checkbox] {
  accent-color: var(--navy);
  width: 15px;
  height: 15px;
}

.filter-group {
  flex: 1 1 160px;
  min-width: 160px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.btn-filter-apply {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(26, 45, 107, .2);
}

.btn-filter-apply:hover {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  transform: translateY(-1px);
}

.btn-reset-filters {
  padding: 9px 16px;
  border-radius: var(--radius-xs);
  background: var(--light-2);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  align-self: flex-end;
  transition: all .2s;
  border: 1px solid var(--border);
}

.btn-reset-filters:hover {
  background: var(--border);
  color: var(--text);
}

/* ══════════════════════════════════════════
   RESULTS
══════════════════════════════════════════ */
.results-container {
  margin-top: 0;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--navy);
  font-size: 15px;
}

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.medecins-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--white);
}

.medecins-table thead {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
}

.medecins-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  white-space: nowrap;
  color: rgba(255, 255, 255, .9);
}

.medecins-table th:first-child {
  color: var(--gold);
}

.medecins-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f0f3fa;
  vertical-align: middle;
  color: var(--text);
}

.medecins-table tbody tr {
  transition: background .15s;
}

.medecins-table tbody tr:hover {
  background: #f8faff;
}

.medecins-table tbody tr:last-child td {
  border-bottom: none;
}

.row-alert {
  background: #fff5f5 !important;
  border-left: 3px solid var(--danger);
}

/* ══════════════════════════════════════════
   DOCTOR ROW
══════════════════════════════════════════ */
.medecin-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.name-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26, 45, 107, .25);
}

.medecin-nom {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.3;
}

.prenom {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .3px;
}

.badge-specialite {
  background: #f0f0ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.badge-specialiste {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-generaliste {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-public {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-prive {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-autre {
  background: #f9fafb;
  color: #374151;
  border: 1px solid var(--border);
}

.badge-ok {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-superadmin-pill {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  font-weight: 800;
}

.badge-admin-pill {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
}

.badge-employee-pill {
  background: var(--light-2);
  color: var(--text-muted);
}

.badge-action {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

/* ══════════════════════════════════════════
   PHONE BUTTON
══════════════════════════════════════════ */
.btn-reveal-phone {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26, 45, 107, .2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-reveal-phone:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 45, 107, .35);
}

.btn-reveal-phone:disabled {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  cursor: default;
  transform: none;
  box-shadow: 0 2px 8px rgba(74, 158, 47, .2);
}

.phone-result {
  margin-top: 8px;
  padding: 10px 14px;

  background: #ecfdf5;
  color: #047857;

  border: 1px solid #86efac;
  border-radius: 10px;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;

  white-space: pre-line;

  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.10),
    0 4px 12px rgba(34, 197, 94, 0.18);
}

.phone-reveal-data {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 12px;
}

.phone-reveal-data strong {
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 700;
}

.phone-alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
}

.hidden {
  display: none;
}

/* ══════════════════════════════════════════
   ACTION BUTTONS
══════════════════════════════════════════ */
.actions-cell {
  white-space: nowrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  transition: all .2s;
  margin-right: 4px;
  border: 1px solid transparent;
}

.btn-view {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.btn-view:hover {
  background: #dbeafe;
  transform: scale(1.1);
}

.btn-edit {
  background: #fffbeb;
  border-color: #fde68a;
}

.btn-edit:hover {
  background: #fef3c7;
  transform: scale(1.1);
}

.btn-delete {
  background: #fef2f2;
  border-color: #fecaca;
}

.btn-delete:hover {
  background: #fee2e2;
  transform: scale(1.1);
}

/* Action buttons: preserve each icon's intended color */
a.btn-action,
a.btn-action:link,
a.btn-action:visited,
a.btn-action:hover,
a.btn-action:active,
a.btn-action:focus {
  text-decoration: none !important;
}

/* View icon */
a.btn-view,
a.btn-view:link,
a.btn-view:visited,
a.btn-view:hover,
a.btn-view:active,
a.btn-view:focus {
  color: #2563eb !important;
}

/* Edit icon */
a.btn-edit,
a.btn-edit:link,
a.btn-edit:visited,
a.btn-edit:hover,
a.btn-edit:active,
a.btn-edit:focus {
  color: #d97706 !important;
}

/* Delete icon */
a.btn-delete,
a.btn-delete:link,
a.btn-delete:visited,
a.btn-delete:hover,
a.btn-delete:active,
a.btn-delete:focus {
  color: #dc2626 !important;
}

/* Ensure SVG and icon elements inherit the button color */
a.btn-action svg,
a.btn-action svg path,
a.btn-action i {
  color: inherit !important;
  stroke: currentColor !important;
}

/* ══════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 0;
}

.page-btn {
  padding: 9px 16px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  min-width: 40px;
  text-align: center;
}

.page-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  transform: translateY(-1px);
}

.page-current {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border-color: var(--navy);
}

/* ══════════════════════════════════════════
   STATS GRID
══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all .3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--green));
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card.stat-alert::before {
  background: linear-gradient(90deg, var(--danger), #f87171);
}

.stat-card.stat-alert {
  border-color: #fecaca;
  background: #fff8f8;
}

.stat-icon {
  font-size: 30px;
  margin-bottom: 10px;
  display: block;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ══════════════════════════════════════════
   FILTER BAR (admin logs)
══════════════════════════════════════════ */
.filter-bar {
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: .2px;
}

.label-icon {
  margin-right: 5px;
}

.form-input,
.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  background: var(--white);
  outline: none;
}

.form-input:focus,
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(26, 45, 107, .08);
}

.form-input::placeholder,
.form-control::placeholder {
  color: #b0babf;
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.field-help {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
  margin-top: 5px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  padding: 11px 22px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .22s;
  border: none;
  letter-spacing: .2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 45, 107, .25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 45, 107, .35);
}

.btn-secondary {
  background: var(--light);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #ef4444);
  color: #fff;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, var(--danger));
  transform: translateY(-1px);
}

.btn-green {
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 158, 47, .25);
}

.btn-green:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(74, 158, 47, .35);
}

/* ══════════════════════════════════════════
   DETAIL MEDECIN
══════════════════════════════════════════ */
.detail-card {
  max-width: 800px;
  margin: 0 auto;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(26, 45, 107, .3);
  font-family: 'Playfair Display', serif;
}

.detail-title h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.detail-item {
  background: var(--light);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .8px;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.phone-section {
  border-top: 2px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}

.phone-section h3 {
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 16px;
  font-weight: 700;
}

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-results {
  text-align: center;
  padding: 100px 24px;
}

.empty-results .empty-icon {
  font-size: 72px;
  margin-bottom: 20px;
  display: block;
}

.empty-results h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 10px;
}

.empty-results p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 15px;
}

.stats-chips {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chip {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(26, 45, 107, .2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════════════════
   CONFIRM DELETE
══════════════════════════════════════════ */
.confirm-card {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.confirm-icon {
  font-size: 52px;
  margin-bottom: 18px;
  display: block;
}

.confirm-name {
  background: var(--light);
  padding: 14px 20px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  margin: 16px 0;
  color: var(--navy);
  border-left: 4px solid var(--navy);
}

.confirm-warning {
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 28px;
}

.confirm-actions {
  justify-content: center;
  border-top: none !important;
  padding-top: 0 !important;
}

/* ══════════════════════════════════════════
   DATE / DETAILS CELLS
══════════════════════════════════════════ */
.date-cell {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.details-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

code {
  background: var(--light-2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* ──────────────────────────────────────────
   Clients module tabs + table styles
   Added at end to avoid interfering with medecins styles
   ────────────────────────────────────────── */
.module-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.module-tab {
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
}

.module-tab:hover {
  color: var(--navy);
  background: rgba(26, 45, 107, 0.04);
}

.module-tab.active {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
}

.module-tab.active:hover {
  opacity: 0.95;
}

.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
}

.client-status {
  padding: 6px 10px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 12px;
}

.client-status-actif {
  background: linear-gradient(135deg, #dff6e6, #e8fbef);
  color: var(--green-dark);
  border: 1px solid #c6f0d0;
}

.client-status-inactif {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e6e8eb;
}

/* Responsive behaviour for clients pages */
@media (max-width: 720px) {
  .module-tabs {
    gap: 6px;
  }

  .module-tab {
    padding: 8px 10px;
    font-size: 13px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .table-wrapper {
    overflow-x: auto;
  }
}

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  transform: translateY(100px) scale(.95);
  opacity: 0;
  transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
  max-width: 380px;
  border-left: 4px solid var(--gold);
}

#toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#toast.error {
  background: linear-gradient(135deg, var(--danger), #ef4444);
  border-color: #fca5a5;
}

/* ══════════════════════════════════════════
   FOOTER (A L'INTERIEUR DE MAIN-WRAPPER)
══════════════════════════════════════════ */
.footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-version {
  font-weight: 600;
  color: var(--navy);
}

.footer-text {
  font-weight: 500;
}

/* ══════════════════════════════════════════════
   LOGIN PAGE — Design premium
══════════════════════════════════════════════ */
.login-body {
  background: linear-gradient(160deg, #0a1628 0%, var(--navy-dark) 40%, #0e2545 70%, #071525 100%);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Animated background grid */
.login-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 45, 107, .3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 45, 107, .3) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
  opacity: .4;
}

@keyframes gridMove {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(60px);
  }
}

.login-container {
  display: flex;
  width: 100%;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Login Card */
.login-card {
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px);
  padding: 48px 52px;
  width: 440px;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(26, 45, 107, .4);
  position: relative;
  overflow: hidden;
}

.login-logo::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px solid rgba(240, 200, 20, .3);
}

.logo-icon {
  font-size: 44px;
  position: relative;
  z-index: 1;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.login-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  margin: 18px auto 0;
  border-radius: 2px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid var(--danger);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 17px;
  opacity: .5;
  transition: opacity .2s;
}

.password-toggle:hover {
  opacity: 1;
}

.btn-login {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .25s;
  margin-top: 4px;
  box-shadow: 0 6px 18px rgba(26, 45, 107, .3);
  letter-spacing: .3px;
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26, 45, 107, .4);
}

.btn-arrow {
  font-size: 20px;
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.login-contact strong {
  color: var(--navy);
}

/* Decoration panel */
.login-decoration {
  flex: 1;
  background: linear-gradient(160deg, var(--navy) 0%, #1e3a8a 50%, var(--navy-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  position: relative;
  overflow-y: auto;
  gap: 0;
}

.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08);
}

.deco-1 {
  width: 400px;
  height: 400px;
  top: -120px;
  right: -100px;
  background: rgba(240, 200, 20, .03);
}

.deco-2 {
  width: 240px;
  height: 240px;
  bottom: 30px;
  left: -80px;
  border-color: rgba(74, 158, 47, .2);
  background: rgba(74, 158, 47, .04);
}

.deco-3 {
  width: 160px;
  height: 160px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(255, 255, 255, .1);
}

.deco-4 {
  width: 80px;
  height: 80px;
  top: 30px;
  left: 30px;
  border-color: var(--gold);
  opacity: .3;
}

.deco-logo {
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  filter: brightness(0) invert(1);
  width: 180px;
  height: auto;
  opacity: .95;
  flex-shrink: 0;
}

.deco-text {
  text-align: center;
  color: #fff;
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.deco-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.deco-text h2 span {
  color: var(--gold);
}

.deco-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, .65);
  line-height: 1.7;
  max-width: 280px;
}

.deco-features {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.deco-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, .07);
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .08);
}

.deco-feature-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.deco-feature-text {
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  font-weight: 500;
}

/* ══════════════════════════════════════════
   mb-3 utility
══════════════════════════════════════════ */
.mb-3 {
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 2px solid rgba(240, 200, 20, .25);
    position: relative;
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-nav {
    overflow-x: auto;
    flex-direction: row;
    gap: 12px;
    padding: 12px 24px;
  }

  .nav-group {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: max-content;
  }

  .nav-group-title {
    display: none;
  }

  .nav-link {
    white-space: nowrap;
  }

  .sidebar-footer {
    padding: 12px 24px;
  }
}

@media (max-width: 768px) {

  /* Masquer colonnes moins importantes */
  .medecins-table .col-activite,
  .medecins-table .col-adresse,
  .medecins-table th:nth-child(5),
  .medecins-table td:nth-child(5) {
    display: none;
  }
}

@media (max-width: 900px) {
  .login-decoration {
    display: none;
  }

  .login-card {
    width: 100%;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 16px;
  }

  .navbar-inner {
    padding: 0 16px;
    height: 60px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 20px;
  }

  .navbar-links .nav-link span.nav-icon {
    margin-right: 0;
  }
}

@media (max-width: 768px) {

  /* Navbar compact */
  .brand-text-block .brand-subtitle {
    display: none;
  }

  .nav-user .user-info {
    display: none;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Filtres empiles */
  .filters-row,
  .filters-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-select {
    width: 100%;
    min-width: unset;
  }

  .filter-checkbox {
    padding-top: 0;
  }

  .btn-reset-filters {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex;
  }

  /* Table : masquer colonnes secondaires */
  .medecins-table th:nth-child(5),
  .medecins-table td:nth-child(5),
  .medecins-table th:nth-child(7),
  .medecins-table td:nth-child(7) {
    display: none;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .login-container {
    margin: 0;
    border-radius: 0;
  }

  .login-card {
    padding: 28px 20px;
  }

  /* Navbar: cacher texte, garder icones */
  .brand-text-block {
    display: none;
  }

  .nav-user .user-info {
    display: none;
  }

  .btn-logout {
    padding: 6px 10px;
    font-size: 11px;
  }

  .navbar-inner {
    height: 56px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  /* Table: scroll horizontal seulement dans le wrapper */
  .table-wrapper {
    border-radius: var(--radius-sm);
  }

  .medecins-table th,
  .medecins-table td {
    padding: 10px 10px;
    font-size: 12px;
  }

  .name-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  /* Cacher colonnes supplémentaires sur mobile */
  .medecins-table th:nth-child(3),
  .medecins-table td:nth-child(3),
  .medecins-table th:nth-child(4),
  .medecins-table td:nth-child(4),
  .medecins-table th:nth-child(6),
  .medecins-table td:nth-child(6) {
    display: none;
  }

  /* Stats: 1 colonne */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-value {
    font-size: 24px;
  }

  /* Pagination */
  .page-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  /* Formulaires */
  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
