@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Clinical Premium Theme (Mint / Teal accents) */
  --primary-h: 171;
  --primary-s: 77%;
  --primary-l: 40%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-rgb: 13, 148, 136;
  --primary-hover: hsl(var(--primary-h), var(--primary-s), 33%);
  --primary-light: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
  --primary-light-hover: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.18);
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);

  --secondary: #0c121e; /* Slate-black 950 */
  --secondary-rgb: 12, 18, 30;
  
  /* Background colors with a subtle clinical mint-fresh hue in light mode */
  --bg-primary: #f2f8f6; 
  --bg-secondary: #ffffff;
  --bg-tertiary: #e5effc; 
  
  --text-primary: #0a0f1d;
  --text-secondary: #4a5568;
  --text-muted: #8a99ad;
  
  --border: #e1eaf0;
  --border-focus: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.4);
  
  /* Glassmorphism system */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(13, 148, 136, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(13, 148, 136, 0.04);

  /* Status Colors */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #06b6d4;
  --info-light: rgba(6, 182, 212, 0.15);

  /* Shadows and Offsets */
  --shadow-sm: 0 2px 4px 0 rgba(13, 148, 136, 0.02);
  --shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.05), 0 8px 16px -6px rgba(13, 148, 136, 0.03);
  --shadow-md: 0 20px 30px -10px rgba(13, 148, 136, 0.08), 0 10px 20px -8px rgba(13, 148, 136, 0.04);
  --shadow-lg: 0 30px 50px -15px rgba(13, 148, 136, 0.12), 0 15px 30px -10px rgba(13, 148, 136, 0.06);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Fonts */
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Plus Jakarta Sans', sans-serif;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Sizing */
  --sidebar-width: 260px;
  --header-height: 70px;
}

/* Premium Dark Mode ("fond un peu noir" theme) */
[data-theme="dark"] {
  --bg-primary: #05080f; /* Rich deep black-blue */
  --bg-secondary: #0b111e; /* Sleek dark card container */
  --bg-tertiary: #131c2e; /* Slate/dark-blue accent background */
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border: rgba(255, 255, 255, 0.07);
  --border-focus: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.6);
  
  --glass-bg: rgba(11, 17, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 16px -6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 20px 30px -10px rgba(0, 0, 0, 0.6), 0 10px 20px -8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 50px -15px rgba(0, 0, 0, 0.7), 0 15px 30px -10px rgba(0, 0, 0, 0.5);
}

html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Resets & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-semibold { font-weight: 500; }
.text-bold { font-weight: 700; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.truncate-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Common Layout Containers */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    padding-bottom: 64px; /* room for the fixed mobile quick-actions bar */
  }
}

/* ===== Mobile quick-actions bar (Patient / Rendez-vous / Dépôt) ===== */
.mobile-quick-actions {
  display: none;
}

@media (max-width: 768px) {
  .mobile-quick-actions {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }

  .mobile-quick-actions-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
  }

  .mobile-quick-actions-btn:active {
    background-color: var(--bg-tertiary);
    color: var(--primary);
  }
}

.page-container {
  padding: 2rem;
  flex-grow: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-container {
    padding: 1rem 0.75rem;
  }
}

/* Header & Card styles */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
}

/* ===== Global ripple effect (see utils/ripple.ts) ===== */
@keyframes ripple-anim {
  from { transform: scale(0); opacity: 0.35; }
  to { transform: scale(1); opacity: 0; }
}

.ripple-span {
  position: absolute;
  border-radius: 50%;
  background-color: currentColor;
  transform: scale(0);
  opacity: 0.35;
  animation: ripple-anim 600ms ease-out forwards;
  pointer-events: none;
}

/* ===== Stat card entrance + hover lift (Dashboard, Accounting journal, etc.) ===== */
@keyframes stat-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card-animate {
  animation: stat-card-in 450ms ease-out both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card-animate:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}
.stat-card-animate:nth-child(1) { animation-delay: 0ms; }
.stat-card-animate:nth-child(2) { animation-delay: 60ms; }
.stat-card-animate:nth-child(3) { animation-delay: 120ms; }
.stat-card-animate:nth-child(4) { animation-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  .ripple-span { animation: none; display: none; }
  .stat-card-animate { animation: none; }
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
}

.grid-cols-1 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 1024px) {
  .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ===== Reusable "main content + narrow side panel" split (form pages, detail pages) ===== */
.side-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .side-panel-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Wider variant for dense two-column detail views (timeline + action widgets) */
.detail-split-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .detail-split-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Small 3-across grid for compact numeric inputs (vitals, etc.) */
.compact-3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

@media (max-width: 480px) {
  .compact-3-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full); /* Rounded Pill! */
  font-weight: 600;
  font-family: var(--font-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  font-size: 0.875rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(var(--primary-rgb), 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(var(--primary-rgb), 0.35);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background-color: var(--border);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(239, 68, 68, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Badges / Chips */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-info { background-color: var(--info-light); color: var(--info); }

/* Tables */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

.custom-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background-color: var(--bg-tertiary);
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

@media (max-width: 640px) {
  .custom-table th, .custom-table td {
    padding: 0.75rem 0.875rem;
    font-size: 0.85rem;
  }
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr:hover {
  background-color: var(--bg-primary);
}

/* Inputs & Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-control {
  width: 100%;
  max-width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

.input-control::placeholder {
  color: var(--text-muted);
}

/* Phone input with country/dial-code selector (react-phone-number-input) */
.phone-input-wrapper .PhoneInput {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  transition: var(--transition);
}

.phone-input-wrapper .PhoneInput--focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

.phone-input-wrapper .PhoneInputCountry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.phone-input-wrapper .PhoneInputCountrySelect {
  background: none;
  border: none;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

/* The dropdown popup is rendered natively by the OS/browser with a light
   background regardless of page theme — force readable dark-on-light text
   for the option list itself, independent of the (invisible) closed select. */
.phone-input-wrapper .PhoneInputCountrySelect option {
  color: #111827;
  background-color: #ffffff;
}

.phone-input-wrapper .PhoneInputCountryIcon {
  width: 22px;
  box-shadow: none;
}

.phone-input-wrapper .PhoneInputCountrySelectArrow {
  color: var(--text-muted);
  opacity: 1;
}

.phone-input-wrapper .PhoneInputInput {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.125rem 0;
}

.phone-input-wrapper .PhoneInputInput::placeholder {
  color: var(--text-muted);
}

.phone-input-wrapper .PhoneInput--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Modal backdrop & animations */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Many modals wrap .modal-body + .modal-footer in a <form> that's a direct
   child of .modal-content. .modal-content is a flex column, but <form>
   defaults to display:block, which breaks the flex chain — .modal-body's
   flex/overflow-y rules below only apply when it's an actual flex item, so
   without this the body never scrolls and .modal-content's overflow:hidden
   just silently clips content instead (footer can end up squeezed/hidden).
   This keeps the flex column going through the <form>. */
.modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.rx-med-line-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 0.8fr 30px;
  gap: 8px;
  align-items: center;
}

@media (max-width: 640px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 0.5rem;
  }
  .modal-content {
    max-height: 95vh;
  }
  .modal-header, .modal-body, .modal-footer {
    padding: 1rem;
  }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    width: 100%;
  }
  .rx-med-line-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .rx-med-line-grid > div:nth-child(1) {
    grid-column: 1 / -1;
  }
  .rx-med-line-grid > .rx-med-line-remove {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--bg-tertiary);
  flex-shrink: 0;
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes logoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}
.app-loading-logo {
  animation: logoPulse 1.6s ease-in-out infinite;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utility Flex */
.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }

/* Alerts banner */
.alert-banner {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid transparent;
}
.alert-banner-danger {
  background-color: var(--danger-light);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.alert-banner-warning {
  background-color: var(--warning-light);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}
.alert-banner-info {
  background-color: var(--info-light);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--info);
}

/* Responsive Sidebar toggling */
.sidebar {
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
  .sidebar {
    width: min(78vw, 240px) !important;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle-btn {
    display: flex !important;
  }

  .sidebar-close-btn {
    display: flex !important;
  }
}

/* ===== Landing Page (mobile-first: unprefixed = 375px base, min-width layers up) ===== */
.landing-page {
  background-color: #0b0f19;
  color: #f9fafb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-primary);
}

.landing-nav {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #1f2937;
}

.landing-nav-links {
  display: none;
  gap: 2rem;
}

.landing-nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #e5e7eb;
  cursor: pointer;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .landing-nav-actions { gap: 1rem; }
}

@media (min-width: 768px) {
  .landing-nav { padding: 1.5rem 2rem; }
  .landing-nav-links { display: flex; }
}

.landing-hero {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .landing-hero {
    flex-direction: row;
    align-items: center;
    padding: 4rem 2rem;
    gap: 3rem;
  }
}

.landing-hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .landing-hero-content { flex: 1; max-width: 560px; }
}

.landing-hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  font-family: var(--font-secondary);
}

@media (min-width: 640px) {
  .landing-hero-title { font-size: 2.75rem; }
}

@media (min-width: 1024px) {
  .landing-hero-title { font-size: 3.25rem; }
}

.landing-cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.landing-cta-row .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 480px) {
  .landing-cta-row { flex-direction: row; }
  .landing-cta-row .btn { width: auto; }
}

.landing-hero-visual {
  position: relative;
}

@media (min-width: 1024px) {
  .landing-hero-visual { flex: 1; max-width: 440px; }
}

.landing-preview-panel {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 20px 40px -20px rgba(13, 148, 136, 0.25);
}

.landing-preview-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #0b0f19;
  border: 1px solid #1f2937;
  border-radius: var(--radius-sm);
}

.landing-preview-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.15);
  color: rgb(13, 148, 136);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.landing-section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

@media (min-width: 768px) {
  .landing-section { padding: 4rem 2rem; }
}

.landing-section-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-family: var(--font-secondary);
}

@media (min-width: 768px) {
  .landing-section-title { font-size: 2rem; margin-bottom: 0.75rem; }
}

.landing-section-lead {
  text-align: center;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 0.9375rem;
}

@media (min-width: 768px) {
  .landing-section-lead { font-size: 1rem; }
}

.landing-feature-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 1.5rem;
}

.landing-feature-icon {
  background: rgba(13, 148, 136, 0.1);
  color: rgb(13, 148, 136);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.landing-cta-band {
  background: linear-gradient(180deg, #0d1527 0%, #070d18 100%);
  border-top: 1px solid rgba(13, 148, 136, 0.25);
  border-bottom: 1px solid #1f2937;
  padding: 4rem 1.25rem;
  text-align: center;
  position: relative;
}

@media (min-width: 768px) {
  .landing-cta-band { padding: 5rem 2rem; }
}

.landing-cta-band h2 {
  color: #ffffff !important;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .landing-cta-band h2 { font-size: 2.5rem; }
}

.landing-cta-band p {
  color: #cbd5e1 !important;
  font-size: 1.05rem;
  line-height: 1.6;
}

.landing-cta-band .landing-cta-row {
  max-width: 360px;
  margin: 2rem auto 0;
}

@media (min-width: 480px) {
  .landing-cta-band .landing-cta-row { max-width: none; justify-content: center; }
}

.landing-image-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(13, 148, 136, 0.35);
  border: 1px solid rgba(13, 148, 136, 0.3);
  width: 100%;
  max-width: 520px;
  margin: 0 auto 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landing-image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -10px rgba(13, 148, 136, 0.45);
}

.landing-image-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.landing-footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: #6b7280;
  font-size: 0.8125rem;
  margin-top: auto;
  border-top: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .landing-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 2rem;
  }
}

.landing-footer-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Auth Page (mobile-first) ===== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(circle at 50% 120%, rgba(13, 148, 136, 0.15), rgba(5, 8, 15, 0));
}

@media (min-width: 1024px) {
  .auth-shell { flex-direction: row; }
}

.auth-brand-panel {
  background-color: #0b0f19;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-brand-extra {
  display: none;
}

.auth-brand-copyright {
  display: none;
}

@media (min-width: 1024px) {
  .auth-brand-panel {
    width: 42%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 3rem;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }

  .auth-brand-extra { display: block; }

  .auth-brand-copyright {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    opacity: 0.5;
  }
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

@media (min-width: 640px) {
  .auth-form-panel { padding: 2.5rem 2rem; }
}

/* ===== Terms of Service — Banani pixel-parity light theme =====
   Deliberate one-page exception to the fixed-dark Landing/Auth shell (user
   decision, 2026-07-27 re-fetch): tokens copied verbatim from the Banani
   flow's shared style.css, same source as the Platform Admin token pass. */
.terms-page {
  --tp-bg: #F4F3F0;
  --tp-fg: #1E2A2A;
  --tp-border: #D6D2CB;
  --tp-input: #ECEAE5;
  --tp-secondary: #D4E0DC;
  --tp-primary: #3D6B5E;
  --tp-muted: #7A8585;
  background-color: var(--tp-bg);
  color: var(--tp-fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.terms-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-bg);
}

@media (min-width: 768px) {
  .terms-nav { padding: 1rem 4rem; }
}

.terms-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.terms-nav-actions a {
  font-size: 0.85rem;
  color: var(--tp-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.terms-header {
  background: var(--tp-fg);
  padding: 2rem 1.25rem;
}

@media (min-width: 768px) {
  .terms-header { padding: 3rem 4rem; }
}

.terms-layout {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  flex: 1;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .terms-layout { padding: 3rem 4rem; flex-direction: row; gap: 3rem; }
}

.terms-toc {
  display: none;
}

@media (min-width: 768px) {
  .terms-toc {
    display: block;
    width: 220px;
    flex-shrink: 0;
  }
  .terms-toc-inner { position: sticky; top: 2rem; }
}

.terms-toc a {
  display: block;
  font-size: 0.8125rem;
  color: var(--tp-muted);
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.terms-toc a:hover {
  color: var(--tp-fg);
  background: var(--tp-input);
}

.terms-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 720px;
}

.terms-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--tp-border);
}

.terms-section:last-of-type {
  border-bottom: none;
}

.terms-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--tp-border);
}

@media (min-width: 768px) {
  .terms-footer { justify-content: space-between; padding: 1.5rem 4rem; }
}

/* ===== Landing Page Responsive Styles ===== */
.landing-nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.landing-nav-actions-desktop {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.landing-mobile-toggle {
  display: none;
}

@media (max-width: 900px) {
  .landing-nav-desktop,
  .landing-nav-actions-desktop {
    display: none !important;
  }
  .landing-mobile-toggle {
    display: flex !important;
  }
  .landing-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
  .landing-hero-title {
    font-size: 2.25rem !important;
  }
  .landing-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
  .landing-showcase-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
  .landing-pricing-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 500px) {
  .landing-hero-title {
    font-size: 1.85rem !important;
  }
  /* Keep a 2-column grid instead of collapsing to one tall stacked list —
     a dense grid of small cards reads as "designed"; a full-width list of
     rows reads as unstyled/unfinished. */
  .landing-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  .landing-feature-pills {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }
}

/* Very narrow phones: 2 columns get too cramped, drop to 1 */
@media (max-width: 380px) {
  .landing-stats-grid,
  .landing-feature-pills {
    grid-template-columns: 1fr !important;
  }
}

/* ===== Landing Page: Infinite Module Marquee ===== */
@keyframes landing-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.landing-marquee-wrapper {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.landing-marquee-track {
  display: flex;
  width: max-content;
  gap: 1rem;
  animation: landing-marquee-scroll 28s linear infinite;
}

.landing-marquee-wrapper:hover .landing-marquee-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .landing-marquee-track {
    animation: none;
  }
}

/* ===== Landing Page: Entrance & Hover Micro-interactions ===== */
@keyframes landing-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Staggered entrance for the hero column's direct children */
.landing-entrance > * {
  opacity: 0;
  animation: landing-fade-up 550ms ease-out forwards;
}
.landing-entrance > *:nth-child(1) { animation-delay: 60ms; }
.landing-entrance > *:nth-child(2) { animation-delay: 140ms; }
.landing-entrance > *:nth-child(3) { animation-delay: 220ms; }
.landing-entrance > *:nth-child(4) { animation-delay: 300ms; }
.landing-entrance > *:nth-child(5) { animation-delay: 380ms; }

/* Scroll-reveal: JS toggles .is-visible via IntersectionObserver */
.landing-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.landing-reveal.landing-reveal-left { transform: translateX(-28px); }
.landing-reveal.landing-reveal-right { transform: translateX(28px); }
.landing-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Buttons: slight relief + cyan halo on hover */
.landing-btn-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.landing-btn-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.22), 0 10px 22px rgba(13, 148, 136, 0.22) !important;
}
.landing-btn-lift:active {
  transform: translateY(0);
}

/* Cards: lift + shadow grow on hover (pricing) */
.landing-card-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.landing-card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(30, 77, 64, 0.16);
}

/* Feature pills: lift + tint + soft shadow on hover */
.landing-pill-hover {
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.landing-pill-hover:hover {
  transform: translateY(-2px);
  background-color: #e6f4ea;
  border-color: #bbf7d0;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.12);
}

/* Marquee cards: subtle lift on hover (in addition to the wrapper's pause-on-hover) */
.landing-marquee-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-marquee-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

/* Nav / text links: sliding underline on hover */
.landing-link {
  position: relative;
  transition: color 0.2s ease;
}
.landing-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #0d9488;
  transition: width 0.25s ease;
}
.landing-link:hover {
  color: #0f172a !important;
}
.landing-link:hover::after {
  width: 100%;
}

/* Footer links: brighten + sliding cyan underline on hover */
.landing-footer-link {
  position: relative;
  transition: color 0.2s ease;
}
.landing-footer-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #5eead4;
  transition: width 0.25s ease;
}
.landing-footer-link:hover {
  color: #ffffff !important;
}
.landing-footer-link:hover::after {
  width: 100%;
}

/* Logo mark: subtle pop on hover */
.landing-logo-mark {
  transition: transform 0.2s ease;
}
.landing-logo-mark:hover {
  transform: scale(1.08);
}

/* Stat/highlight icons: pop on hover */
.landing-highlight svg {
  transition: transform 0.2s ease;
}
.landing-highlight:hover svg {
  transform: scale(1.15);
}

/* Stats grid: divider lines between items on desktop's single row */
.landing-stats-grid > .landing-highlight {
  padding: 0.25rem 1rem;
}
@media (min-width: 901px) {
  .landing-stats-grid > .landing-highlight:not(:first-child) {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
  }
}
/* Tablet/mobile: a thin-divider text list reads as unstyled, not a designed
   component — swap to tinted rounded chip cards (icon beside, not above,
   the label) so a 2-column phone grid still looks intentional. */
@media (max-width: 900px) {
  .landing-stats-grid > .landing-highlight {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
    padding: 0.85rem 0.9rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
  }
  .landing-stats-grid > .landing-highlight svg {
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }
}

/* Pricing section 3-card grid (Landing Page) — 1 col mobile, 3 cols 850px+.
   Separate from Settings' local .plan-cards-grid (same pattern, different
   file) to avoid touching that already-shipped page for this change. */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 850px) {
  .pricing-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Payment provider badges: lift on hover */
.landing-payment-badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-payment-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Image zoom-on-hover frames (hero + showcase photos) */
.landing-img-zoom img {
  transition: transform 0.4s ease;
}
.landing-img-zoom:hover img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .landing-entrance > * { animation: none; opacity: 1; transform: none; }
  .landing-reveal { transition: none; opacity: 1; transform: none; }
  .landing-btn-lift:hover,
  .landing-card-lift:hover,
  .landing-pill-hover:hover,
  .landing-marquee-card:hover,
  .landing-payment-badge:hover,
  .landing-logo-mark:hover,
  .landing-highlight:hover svg,
  .landing-img-zoom:hover img {
    transform: none;
  }
}

/* ===== Shared root page wrapper (Patients, Pharmacy, Laboratory, Prescriptions) ===== */
.app-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background-color: var(--bg-primary);
  min-height: calc(100vh - var(--header-height));
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .app-page {
    padding: 1rem 0.875rem;
    gap: 1.15rem;
  }
}

/* ===== Shared page-header primary CTA button (Ajouter/Nouveau buttons) ===== */
@media (max-width: 640px) {
  .page-cta-btn {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
  }
}

/* ===== Shared page-header search/actions toolbar (Patients, Pharmacy, Laboratory, Prescriptions) ===== */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-search-box {
  position: relative;
  width: 280px;
  max-width: 100%;
}

@media (max-width: 640px) {
  .page-header-actions {
    width: 100%;
  }
  .page-search-box {
    flex: 1 1 auto;
    width: auto;
  }
}

/* ===== Dashboard Mobile Responsive Styles ===== */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background-color: var(--bg-primary);
  min-height: calc(100vh - var(--header-height));
  box-sizing: border-box;
}

.dashboard-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-top-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

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

.dashboard-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dashboard-appt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  transition: var(--transition);
}

/* Media Queries for Mobile & Tablet */
@media (max-width: 992px) {
  .dashboard-container {
    padding: 1rem !important;
  }
  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }
}

@media (max-width: 640px) {
  .dashboard-top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .dashboard-top-right {
    width: 100% !important;
  }
  .dashboard-top-right > div:first-child {
    flex: 1 !important;
    width: 100% !important;
  }
  .dashboard-quick-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }
  .dashboard-quick-actions button {
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    justify-content: center !important;
  }
  .dashboard-trial-badge {
    grid-column: 1 / -1 !important;
    margin-left: 0 !important;
  }
  .dashboard-stats-grid {
    grid-template-columns: 1fr !important;
  }
  .dashboard-legend {
    display: none !important;
  }
  .dashboard-appt-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .dashboard-appt-row {
    padding: 10px 12px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
}

/* ===== Platform Admin — Banani pixel-parity tokens =====
   Fixed light palette independent of the app-wide dark/light toggle: this is
   a separate operator console (own dark sidebar already, see
   PlatformAdminPage.tsx), not a clinic-facing themed page, so it doesn't
   need to track the visitor's theme preference the way the rest of the app
   does. Values copied verbatim from the Banani flow's shared style.css. */
.platform-admin-shell {
  --bg-primary: #F4F3F0;
  --bg-secondary: #FFFFFF;
  --text-primary: #1E2A2A;
  --text-secondary: #1E2A2A;
  --text-muted: #7A8585;
  --border: #D6D2CB;
  --border-focus: rgba(61, 107, 94, 0.35);
  --success: #3D8A6A;
  --success-light: rgba(61, 138, 106, 0.15);
  --warning: #D4813A;
  --warning-light: rgba(212, 129, 58, 0.15);
  --danger: #C0392B;
  --danger-light: rgba(192, 57, 43, 0.15);
  --info: #3D6B5E;
  --info-light: rgba(61, 107, 94, 0.12);
  --font-secondary: 'DM Sans', sans-serif;
}

.platform-admin-shell input,
.platform-admin-shell select,
.platform-admin-shell button {
  font-family: 'DM Sans', sans-serif;
}

/* Banani badges/pills are rounded-md (6px), not the app-wide full-pill shape */
.platform-admin-shell .badge {
  border-radius: 6px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  font-size: 0.72rem;
}

.platform-admin-shell .filter-pill {
  border-radius: 6px !important;
}

/* Real <th>/<td> styling — these tables are bare <table> elements (no
   .custom-table class), so without this they fall back to UA defaults */
.platform-admin-shell table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.platform-admin-shell thead tr {
  background-color: #ECEAE5; /* Banani --color-input */
}
.platform-admin-shell th {
  padding: 0.75rem 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.platform-admin-shell td {
  padding: 0.75rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.platform-admin-shell tbody tr:last-child td {
  border-bottom: none;
}

/* Stat-card icon box — Banani wraps each stat icon in a small tinted square */
.platform-admin-shell .stat-icon-box {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background-color: #D4E0DC;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .platform-admin-shell th,
  .platform-admin-shell td {
    padding: 0.6rem 0.7rem;
    font-size: 0.78rem;
  }
}

/* Mobile-first responsive shell — Banani's mockup is desktop-only
   (screenSize: 'desktop'), so this collapse pattern is our own design
   decision: sidebar becomes a horizontal scrollable icon strip under
   900px instead of a fixed 240px column, matching the mobile nav pattern
   already used by the real clinic Sidebar (MobileQuickActionsBar). */
@media (max-width: 899px) {
  .platform-admin-shell {
    flex-direction: column !important;
  }
  .platform-admin-sidebar {
    width: 100% !important;
    min-height: auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-x: auto;
  }
  .platform-admin-sidebar-header {
    display: none !important;
  }
  .platform-admin-sidebar-nav {
    flex-direction: row !important;
    padding: 0.5rem 0.6rem !important;
    gap: 4px !important;
  }
  .platform-admin-sidebar-nav button,
  .platform-admin-sidebar-nav .coming-soon-item {
    flex-direction: column !important;
    gap: 3px !important;
    font-size: 0.62rem !important;
    padding: 6px 8px !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
  .platform-admin-sidebar-divider {
    display: none !important;
  }
  /* Footer stays visible (it's the only way to exit the console / log out)
     but becomes a compact horizontal action pair instead of a stacked block */
  .platform-admin-sidebar-footer {
    flex-direction: row !important;
    border-top: none !important;
    padding: 0.5rem 0.6rem !important;
    gap: 4px !important;
    flex-shrink: 0;
  }
  .platform-admin-sidebar-footer button {
    flex-direction: column !important;
    gap: 3px !important;
    font-size: 0.58rem !important;
    line-height: 1.15 !important;
    padding: 6px 6px !important;
    white-space: normal !important;
    text-align: center !important;
    max-width: 72px !important;
  }
  .platform-admin-sidebar-username {
    display: none !important;
  }
  .platform-admin-main-header {
    padding: 1rem 1.25rem !important;
  }
  .platform-admin-main-body {
    padding: 1rem 1.25rem !important;
  }
}



/* CSS variables. */
:root {
	--PhoneInput-color--focus: #03b2cb;
	--PhoneInputInternationalIconPhone-opacity: 0.8;
	--PhoneInputInternationalIconGlobe-opacity: 0.65;
	--PhoneInputCountrySelect-marginRight: 0.35em;
	--PhoneInputCountrySelectArrow-width: 0.3em;
	--PhoneInputCountrySelectArrow-marginLeft: var(--PhoneInputCountrySelect-marginRight);
	--PhoneInputCountrySelectArrow-borderWidth: 1px;
	--PhoneInputCountrySelectArrow-opacity: 0.45;
	--PhoneInputCountrySelectArrow-color: currentColor;
	--PhoneInputCountrySelectArrow-color--focus: var(--PhoneInput-color--focus);
	--PhoneInputCountrySelectArrow-transform: rotate(45deg);
	--PhoneInputCountryFlag-aspectRatio: 1.5;
	--PhoneInputCountryFlag-height: 1em;
	--PhoneInputCountryFlag-borderWidth: 1px;
	--PhoneInputCountryFlag-borderColor: rgba(0,0,0,0.5);
	--PhoneInputCountryFlag-borderColor--focus: var(--PhoneInput-color--focus);
	--PhoneInputCountryFlag-backgroundColor--loading: rgba(0,0,0,0.1);
}

.PhoneInput {
	/* This is done to stretch the contents of this component. */
	display: flex;
	align-items: center;
}

.PhoneInputInput {
	/* The phone number input stretches to fill all empty space */
	flex: 1;
	/* The phone number input should shrink
	   to make room for the extension input */
	min-width: 0;
}

.PhoneInputCountryIcon {
	width: calc(var(--PhoneInputCountryFlag-height) * var(--PhoneInputCountryFlag-aspectRatio));
	height: var(--PhoneInputCountryFlag-height);
}

.PhoneInputCountryIcon--square {
	width: var(--PhoneInputCountryFlag-height);
}

.PhoneInputCountryIcon--border {
	/* Removed `background-color` because when an `<img/>` was still loading
	   it would show a dark gray rectangle. */
	/* For some reason the `<img/>` is not stretched to 100% width and height
	   and sometime there can be seen white pixels of the background at top and bottom. */
	background-color: var(--PhoneInputCountryFlag-backgroundColor--loading);
	/* Border is added via `box-shadow` because `border` interferes with `width`/`height`. */
	/* For some reason the `<img/>` is not stretched to 100% width and height
	   and sometime there can be seen white pixels of the background at top and bottom,
	   so an additional "inset" border is added. */
	box-shadow: 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor),
		inset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor);
}

.PhoneInputCountryIconImg {
	/* Fixes weird vertical space above the flag icon. */
	/* https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/7#note_348586559 */
	display: block;
	/* 3rd party <SVG/> flag icons won't stretch if they have `width` and `height`.
	   Also, if an <SVG/> icon's aspect ratio was different, it wouldn't fit too. */
	width: 100%;
	height: 100%;
}

.PhoneInputInternationalIconPhone {
	opacity: var(--PhoneInputInternationalIconPhone-opacity);
}

.PhoneInputInternationalIconGlobe {
	opacity: var(--PhoneInputInternationalIconGlobe-opacity);
}

/* Styling native country `<select/>`. */

.PhoneInputCountry {
	position: relative;
	align-self: stretch;
	display: flex;
	align-items: center;
	margin-right: var(--PhoneInputCountrySelect-marginRight);
}

.PhoneInputCountrySelect {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	z-index: 1;
	border: 0;
	opacity: 0;
	cursor: pointer;
}

.PhoneInputCountrySelect[disabled],
.PhoneInputCountrySelect[readonly] {
	cursor: default;
}

.PhoneInputCountrySelectArrow {
	display: block;
	content: '';
	width: var(--PhoneInputCountrySelectArrow-width);
	height: var(--PhoneInputCountrySelectArrow-width);
	margin-left: var(--PhoneInputCountrySelectArrow-marginLeft);
	border-style: solid;
	border-color: var(--PhoneInputCountrySelectArrow-color);
	border-top-width: 0;
	border-bottom-width: var(--PhoneInputCountrySelectArrow-borderWidth);
	border-left-width: 0;
	border-right-width: var(--PhoneInputCountrySelectArrow-borderWidth);
	transform: var(--PhoneInputCountrySelectArrow-transform);
	opacity: var(--PhoneInputCountrySelectArrow-opacity);
}

.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon + .PhoneInputCountrySelectArrow {
	opacity: 1;
	color: var(--PhoneInputCountrySelectArrow-color--focus);
}

.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon--border {
	box-shadow: 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus),
		inset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus);
}

.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon .PhoneInputInternationalIconGlobe {
	opacity: 1;
	color: var(--PhoneInputCountrySelectArrow-color--focus);
}