/* =============================================================
   PharmaMAP — Design System (css/main.css)
   =============================================================
   Variables CSS, reset, typographie, layout, glassmorphism,
   composants réutilisables, animations et mode sombre.
   ============================================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

/* =============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================= */
:root {
    /* --- Couleurs primaires (bleu médical) --- */
    --primary-50:  hsl(200, 90%, 95%);
    --primary-100: hsl(200, 85%, 88%);
    --primary-200: hsl(200, 80%, 75%);
    --primary-300: hsl(200, 75%, 62%);
    --primary-400: hsl(200, 70%, 50%);
    --primary-500: hsl(200, 75%, 42%);
    --primary-600: hsl(200, 80%, 35%);
    --primary-700: hsl(200, 85%, 28%);
    --primary-800: hsl(200, 88%, 20%);
    --primary-900: hsl(200, 90%, 12%);

    /* --- Couleurs accent (vert santé) --- */
    --accent-400: hsl(160, 65%, 45%);
    --accent-500: hsl(160, 70%, 38%);
    --accent-600: hsl(160, 75%, 30%);

    /* --- Couleurs dorées (premium) --- */
    --gold-400: hsl(42, 85%, 55%);
    --gold-500: hsl(42, 90%, 48%);

    /* --- Sémantiques --- */
    --success: hsl(145, 65%, 42%);
    --warning: hsl(38, 92%, 50%);
    --danger:  hsl(0, 72%, 51%);
    --info:    hsl(210, 80%, 56%);

    /* --- Mode sombre (défaut) --- */
    --bg-primary:   hsl(220, 25%, 8%);
    --bg-secondary: hsl(220, 22%, 12%);
    --bg-tertiary:  hsl(220, 20%, 16%);
    --bg-card:      hsla(220, 22%, 14%, 0.8);
    --bg-glass:     hsla(220, 25%, 15%, 0.6);

    --text-primary:   hsl(0, 0%, 95%);
    --text-secondary: hsl(0, 0%, 72%);
    --text-muted:     hsl(0, 0%, 50%);
    --text-inverse:   hsl(220, 25%, 8%);

    --border-color:   hsla(0, 0%, 100%, 0.08);
    --border-light:   hsla(0, 0%, 100%, 0.12);
    --border-accent:  hsla(200, 75%, 42%, 0.3);

    /* --- Espacements --- */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* --- Typographie --- */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;

    /* --- Bordures --- */
    --radius-sm:   0.375rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-2xl:  1.25rem;
    --radius-full: 50%;

    /* --- Ombres --- */
    --shadow-sm:  0 1px 2px hsla(0,0%,0%,0.3);
    --shadow-md:  0 4px 12px hsla(0,0%,0%,0.25);
    --shadow-lg:  0 8px 24px hsla(0,0%,0%,0.3);
    --shadow-xl:  0 16px 48px hsla(0,0%,0%,0.35);
    --shadow-glow: 0 0 20px hsla(200,75%,42%,0.25);

    /* --- Transitions --- */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Z-index --- */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-modal:    300;
    --z-toast:    400;
    --z-tooltip:  500;
}

/* =============================================================
   CSS RESET
   ============================================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-300); }

img { max-width: 100%; display: block; }

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: var(--text-base);
}

ul, ol { list-style: none; }

/* =============================================================
   LAYOUT
   ============================================================= */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-300), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    margin-top: var(--space-xs);
}

/* --- Grid --- */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Flex --- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* =============================================================
   GLASSMORPHISM CARD
   ============================================================= */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: hsla(0,0%,100%,0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: 0 2px 8px hsla(200,75%,42%,0.3);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px hsla(200,75%,42%,0.4);
    transform: translateY(-1px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), hsl(0, 72%, 42%));
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: var(--text-xs); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); }

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

/* =============================================================
   FORMS
   ============================================================= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px hsla(200,75%,42%,0.15);
}

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

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    font-size: var(--text-xs);
    color: var(--danger);
}

/* =============================================================
   TABLES
   ============================================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

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

.data-table th {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.75rem 1rem;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: hsla(200, 75%, 42%, 0.05);
}

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

/* =============================================================
   BADGES
   ============================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success { background: hsla(145,65%,42%,0.15); color: var(--success); }
.badge-warning { background: hsla(38,92%,50%,0.15); color: var(--warning); }
.badge-danger  { background: hsla(0,72%,51%,0.15); color: var(--danger); }
.badge-info    { background: hsla(210,80%,56%,0.15); color: var(--info); }
.badge-primary { background: hsla(200,75%,42%,0.15); color: var(--primary-400); }

/* =============================================================
   STAT CARDS
   ============================================================= */
.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: hsla(200,75%,42%,0.15); color: var(--primary-400); }
.stat-icon.green  { background: hsla(160,65%,45%,0.15); color: var(--accent-400); }
.stat-icon.gold   { background: hsla(42,85%,55%,0.15); color: var(--gold-400); }
.stat-icon.red    { background: hsla(0,72%,51%,0.15); color: var(--danger); }

.stat-value {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* =============================================================
   MAP
   ============================================================= */
.map-container {
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    height: 500px;
    width: 100%;
}

.map-container .leaflet-container {
    height: 100%;
    width: 100%;
}

.user-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.user-marker {
    position: relative;
    width: 40px;
    height: 40px;
}

.user-marker-dot {
    width: 14px;
    height: 14px;
    background: var(--primary-500);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.user-marker-pulse {
    width: 40px;
    height: 40px;
    background: hsla(200, 75%, 42%, 0.35);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: user-pulse 2s ease-out infinite;
}

@keyframes user-pulse {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.pharmacy-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.pharmacy-marker {
    position: relative;
    width: 36px;
    height: 44px;
}

.pharmacy-marker-pin {
    position: absolute;
    top: 0;
    left: 50%;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    background: linear-gradient(135deg, hsl(220, 12%, 52%), hsl(220, 15%, 38%));
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pharmacy-marker-icon {
    display: block;
    transform: rotate(45deg);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.pharmacy-marker--stock .pharmacy-marker-pin {
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
}

.pharmacy-marker--garde .pharmacy-marker-pin {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
}

.pharmacy-marker--garde.pharmacy-marker--stock .pharmacy-marker-pin {
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    box-shadow:
        0 0 0 2px var(--gold-400),
        0 3px 10px rgba(0, 0, 0, 0.35);
}

.pharmacy-marker:hover .pharmacy-marker-pin {
    transform: rotate(-45deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.leaflet-popup.pharmacy-popup .leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 0;
}

.leaflet-popup.pharmacy-popup .leaflet-popup-content {
    margin: 0;
    line-height: 1.45;
}

.leaflet-popup.pharmacy-popup .leaflet-popup-tip {
    background: var(--bg-secondary);
}

.leaflet-popup.pharmacy-popup .leaflet-popup-close-button {
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 8px 10px 0 0;
}

.map-popup-pharmacy {
    padding: var(--space-md);
    min-width: 240px;
}

.map-popup-header {
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.map-popup-title {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.map-popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.map-popup-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.map-popup-badge--garde {
    background: hsla(42, 90%, 48%, 0.2);
    color: var(--gold-400);
}

.map-popup-badge--stock {
    background: hsla(160, 65%, 45%, 0.2);
    color: var(--accent-400);
}

.map-popup-details {
    list-style: none;
    margin: 0 0 var(--space-md);
    padding: 0;
}

.map-popup-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid hsla(220, 20%, 22%, 0.6);
    font-size: var(--text-sm);
}

.map-popup-detail:last-child {
    border-bottom: none;
}

.map-popup-detail--highlight .map-popup-value {
    color: var(--accent-400);
    font-weight: 700;
}

.map-popup-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.map-popup-value {
    color: var(--text-primary);
    word-break: break-word;
}

.map-popup-value--distance {
    color: var(--primary-300);
    font-weight: 600;
}

.map-popup-actions {
    display: flex;
    gap: var(--space-sm);
}

.map-popup-route-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.map-popup-route-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.map-popup-route-btn:active {
    transform: translateY(0);
}

/* =============================================================
   ANIMATIONS
   ============================================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.fade-in       { animation: fadeIn 0.4s ease-out; }
.slide-up      { animation: slideUp 0.5s ease-out; }
.slide-down    { animation: slideDown 0.4s ease-out; }
.scale-in      { animation: scaleIn 0.3s ease-out; }

/* --- Staggered animation --- */
.stagger > * { animation: fadeIn 0.4s ease-out both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

/* =============================================================
   SCROLLBAR
   ============================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
    background: var(--primary-700);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-600); }

/* =============================================================
   UTILITIES
   ============================================================= */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.hidden { display: none !important; }

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

@media (max-width: 768px) {
    .main-content { padding: var(--space-md); }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .page-title { font-size: var(--text-2xl); }
    .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .main-content { padding: var(--space-sm); }
}

/* =============================================================
   HEADER & NAVIGATION
   ============================================================= */
.header {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.header h1 {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--primary-300), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

#nav-menu {
    display: flex;
    list-style: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    gap: var(--space-lg);
}

#nav-menu li {
    flex: 1;
}

#nav-menu a {
    display: block;
    padding: var(--space-lg);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    text-align: center;
}

#nav-menu a:hover,
#nav-menu a.active {
    color: var(--primary-300);
    border-bottom-color: var(--primary-400);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
    flex: 1;
}

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

/* =============================================================
   HERO SECTION & VIEWS
   ============================================================= */
.hero {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.hero h2 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.hero p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.search-box {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px hsla(200,75%,42%,0.15);
}

.view-section {
    animation: fadeIn 0.3s ease-out;
}

.view-section h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

/* =============================================================
   PHARMACY CARDS (page + sidebar — en-tête nom partagé)
   ============================================================= */
.pharmacies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.pharmacy-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: linear-gradient(
        135deg,
        hsla(200, 75%, 42%, 0.22) 0%,
        hsla(200, 70%, 50%, 0.06) 55%,
        transparent 100%
    );
    border-bottom: 1px solid hsla(200, 75%, 42%, 0.2);
    position: relative;
}

.pharmacy-card-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-400), transparent 70%);
    opacity: 0.5;
}

.pharmacy-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, var(--primary-400), var(--primary-700));
    border-radius: var(--radius-md);
    box-shadow: 0 3px 10px hsla(200, 75%, 42%, 0.35);
    border: 1px solid hsla(200, 80%, 70%, 0.25);
}

.pharmacy-card-header-main {
    flex: 1;
    min-width: 0;
}

.pharmacy-card-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.pharmacy-card-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.pharmacy-card-badge--garde {
    background: hsla(42, 90%, 48%, 0.2);
    color: var(--gold-400);
    border: 1px solid hsla(42, 90%, 48%, 0.35);
}

.pharmacy-card--garde .pharmacy-card-header {
    background: linear-gradient(
        135deg,
        hsla(42, 90%, 48%, 0.18) 0%,
        hsla(200, 75%, 42%, 0.08) 100%
    );
    border-bottom-color: hsla(42, 90%, 48%, 0.25);
}

.pharmacy-card--garde .pharmacy-card-icon {
    background: linear-gradient(145deg, var(--gold-400), var(--gold-500));
    box-shadow: 0 3px 10px hsla(42, 90%, 48%, 0.35);
}

/* --- Page Pharmacies --- */
.pharmacy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.pharmacy-card:hover {
    border-color: hsla(200, 75%, 42%, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px hsla(200, 75%, 42%, 0.12);
    transform: translateY(-3px);
}

.pharmacy-card .pharmacy-card-name {
    font-size: var(--text-lg);
}

.pharmacy-card-body {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.pharmacy-card-details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pharmacy-card-detail {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: var(--space-sm);
    align-items: start;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid hsla(220, 20%, 22%, 0.5);
    font-size: var(--text-sm);
}

.pharmacy-card-detail:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pharmacy-card-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.pharmacy-card-detail-value {
    color: var(--text-secondary);
    line-height: 1.45;
    word-break: break-word;
}

/* Consultations — réutilise .pharmacy-card sans en-tête dédié */
.consultation-card {
    padding: var(--space-lg);
}

.consultation-card h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--primary-300);
    margin: 0 0 var(--space-md);
}

.consultation-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

/* =============================================================
   AUTH FORMS
   ============================================================= */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.auth-form {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-form h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-form input {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px hsla(200,75%,42%,0.15);
}

.auth-form button {
    padding: 0.875rem 1.75rem;
    font-size: var(--text-base);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px hsla(200,75%,42%,0.4);
}

.auth-form p {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-top: var(--space-md);
}

.auth-form a {
    color: var(--primary-400);
    font-weight: 500;
}

/* =============================================================
   MODAL
   ============================================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    position: relative;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

.close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    font-size: var(--text-2xl);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.close:hover {
    color: var(--text-primary);
}

/* =============================================================
   ERROR & SUCCESS MESSAGES
   ============================================================= */
.error {
    color: var(--danger);
    font-size: var(--text-sm);
    padding: var(--space-md);
    background: hsla(0, 72%, 51%, 0.1);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius-md);
}

.success {
    color: var(--success);
    font-size: var(--text-sm);
    padding: var(--space-md);
    background: hsla(145, 65%, 42%, 0.1);
    border-left: 3px solid var(--success);
    border-radius: var(--radius-md);
}

/* =============================================================
   PROFILE CARD
   ============================================================= */
.profile-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.profile-card p {
    font-size: var(--text-base);
    margin-bottom: var(--space-md);
}

.profile-card strong {
    color: var(--primary-300);
}

/* =============================================================
   HOME DASHBOARD & SPLIT LAYOUT
   ============================================================= */
.home-dashboard {
    display: flex;
    gap: var(--space-lg);
    height: calc(100vh - 180px);
    min-height: 550px;
    margin-top: -1.5rem; /* Réduire espace du container */
    animation: fadeIn 0.4s ease-out;
}

.map-panel {
    flex: 1.5;
    height: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.sidebar-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: var(--space-md);
    overflow: hidden;
}

/* --- Barre de recherche Google-like --- */
.search-section {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.google-search-bar {
    display: flex;
    align-items: center;
    background: #202124; /* Google Dark Search BG */
    border: 1px solid #5f6368; /* Subtle border */
    border-radius: 24px;
    padding: 0.25rem 0.75rem 0.25rem 1.25rem;
    height: 46px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
    transition: background-color 150ms, box-shadow 150ms, border-color 150ms;
    width: 100%;
}

.google-search-bar:focus-within {
    background-color: #303134;
    border-color: transparent;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.google-search-bar .search-icon {
    font-size: 16px;
    color: #9aa0a6;
    margin-right: var(--space-sm);
}

.google-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: #e8eaed; /* light grey text */
    font-size: 16px;
    outline: none;
    padding: 0;
}

.google-search-bar .clear-icon {
    font-size: 20px;
    color: #9aa0a6;
    cursor: pointer;
    padding: 0 var(--space-sm);
    transition: color var(--transition-fast);
}

.google-search-bar .clear-icon:hover {
    color: #e8eaed;
}

/* --- Suggestions Dropdown --- */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #303134; /* Match active Google input */
    border: 1px solid transparent;
    border-radius: 12px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    max-height: 250px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    padding: 8px 0;
    animation: slideDown 0.2s ease-out;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 150ms;
    border-bottom: none;
}

.suggestion-item:hover {
    background: #3c4043;
}

.suggestion-item .med-name {
    font-weight: 500;
    color: #e8eaed;
}

.suggestion-item .med-cat {
    font-size: 11px;
    color: #9aa0a6;
    background: #202124;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.suggestion-item.no-match {
    color: #9aa0a6;
    text-align: center;
    padding: var(--space-md);
    cursor: default;
}

/* --- Section de Résultats / Sidebar --- */
.results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.pharmacies-sidebar-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-right: var(--space-xs);
    -webkit-overflow-scrolling: touch;
}

/* --- Cartes sidebar (liste droite accueil) --- */
.pharmacy-sidebar-card {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.pharmacy-sidebar-card .pharmacy-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin: 0;
    min-height: 52px;
    border-radius: 0;
    background: linear-gradient(135deg, hsl(200, 78%, 30%), hsl(200, 82%, 22%));
    border-bottom: 1px solid hsla(200, 75%, 50%, 0.35);
    flex-shrink: 0;
}

.pharmacy-sidebar-card .pharmacy-card-header::after {
    display: none;
}

.pharmacy-sidebar-card .pharmacy-card-header-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.pharmacy-sidebar-card .pharmacy-card-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.pharmacy-sidebar-card .pharmacy-card-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    background: hsla(0, 0%, 100%, 0.22);
    border: 1px solid hsla(0, 0%, 100%, 0.4);
    box-shadow: none;
}

.pharmacy-sidebar-card .pharmacy-card-badge {
    flex-shrink: 0;
    max-width: 42%;
    text-align: center;
    line-height: 1.2;
}

.pharmacy-sidebar-card.pharmacy-card--garde .pharmacy-card-header {
    background: linear-gradient(135deg, hsl(42, 85%, 38%), hsl(42, 80%, 28%));
    border-bottom-color: hsla(42, 90%, 55%, 0.4);
}

.pharmacy-sidebar-card.availability-card .pharmacy-card-header {
    background: linear-gradient(135deg, hsl(160, 70%, 32%), hsl(160, 75%, 24%));
    border-bottom-color: hsla(160, 65%, 50%, 0.35);
}

.pharmacy-sidebar-card .card-body {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
}

.pharmacy-sidebar-card:hover {
    border-color: hsla(200, 75%, 42%, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.pharmacy-sidebar-card.selected-card {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 1px hsla(200, 75%, 42%, 0.35), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.pharmacy-sidebar-card.selected-card .pharmacy-card-header {
    background: linear-gradient(135deg, hsl(200, 82%, 38%), hsl(200, 85%, 28%));
    box-shadow: inset 0 0 0 2px hsla(200, 90%, 65%, 0.5);
}

.pharmacy-card-meta {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0 0 6px;
    line-height: 1.45;
}

.pharmacy-card-meta-icon {
    flex-shrink: 0;
    opacity: 0.85;
    line-height: 1.35;
}

.pharmacy-card-meta--price strong {
    color: var(--accent-400);
    font-weight: 700;
}

.pharmacy-sidebar-card .card-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    margin-top: 0;
    padding: var(--space-sm) var(--space-md) var(--space-md);
    border-top: 1px solid var(--border-color);
    background: hsla(220, 22%, 10%, 0.85);
}

.distance-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary-300);
    background: hsla(200, 75%, 42%, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* --- Route Info Panel --- */
.route-info-box {
    background: hsla(200, 75%, 42%, 0.12);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    animation: fadeIn 0.3s ease-out;
}

.route-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.route-info-header h4 {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--primary-300);
}

.btn-close-route {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.btn-close-route:hover {
    color: var(--danger);
}

.route-info-details {
    display: flex;
    gap: var(--space-lg);
}

.route-info-details p {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.route-info-details strong {
    color: var(--primary-300);
}

.route-fallback-note {
    margin: var(--space-sm) 0 0;
    font-size: var(--text-xs);
    color: var(--warning);
    line-height: 1.4;
}

.pharmacy-sidebar-card .get-route-btn {
    min-height: 36px;
    white-space: nowrap;
}

.loading-text, .no-results {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

/* Responsive — navigation */
@media (max-width: 768px) {
    .header h1 {
        font-size: var(--text-xl);
    }

    .header p {
        font-size: var(--text-sm);
    }

    #nav-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: var(--space-sm);
        padding: 0 var(--space-md);
        scrollbar-width: none;
    }

    #nav-menu::-webkit-scrollbar {
        display: none;
    }

    #nav-menu li {
        flex: 0 0 auto;
    }

    #nav-menu a {
        padding: var(--space-md) var(--space-sm);
        font-size: var(--text-sm);
        white-space: nowrap;
    }

    .container {
        padding: var(--space-md);
    }
}

/* =============================================================
   NEW COMPONENTS (Profile, Admin, Pharmacy, Consultations)
   ============================================================= */
/* --- Profile --- */
.profile-section { max-width: 800px; margin: 0 auto; }
.profile-layout { display: flex; flex-direction: column; gap: var(--space-xl); }
.profile-avatar { text-align: center; margin-bottom: var(--space-lg); }
.avatar-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    color: white; font-size: 2rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-sm);
}
.profile-info { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-xl); }
.profile-info-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border-light); padding-bottom: var(--space-xs); }
.profile-label { color: var(--text-secondary); font-weight: 500; }
.profile-value { color: var(--text-primary); font-weight: 600; }
.form-message { padding: var(--space-sm); border-radius: var(--radius-md); font-size: var(--text-sm); margin-top: var(--space-sm); }
.success-msg { background: hsla(145, 65%, 42%, 0.1); border: 1px solid var(--success); color: var(--success); }
.error-msg { background: hsla(0, 72%, 51%, 0.1); border: 1px solid var(--danger); color: var(--danger); }
.form-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

/* --- Admin --- */
.admin-section { max-width: 1200px; margin: 0 auto; }
.admin-tabs { display: flex; gap: var(--space-sm); margin: var(--space-xl) 0 var(--space-lg); border-bottom: 1px solid var(--border-color); padding-bottom: var(--space-sm); overflow-x: auto; }
.admin-tab { padding: var(--space-sm) var(--space-lg); background: transparent; color: var(--text-secondary); font-weight: 600; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; }
.admin-tab.active { color: var(--primary-400); border-bottom-color: var(--primary-400); }
.admin-tab:hover:not(.active) { color: var(--text-primary); background: var(--bg-tertiary); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pending-users-list { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); }
.pending-user-card { display: flex; flex-direction: column; gap: var(--space-md); }
.pending-user-info { display: flex; gap: var(--space-md); align-items: flex-start; }
.pending-user-avatar { width: 48px; height: 48px; background: var(--bg-tertiary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.pending-user-details h4 { margin: 0 0 var(--space-xs); font-size: var(--text-lg); }
.pending-user-meta { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--text-secondary); }
.pending-user-actions { display: flex; gap: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--border-light); }
.table-actions { display: flex; gap: var(--space-xs); }

/* --- Pharmacy Dashboard --- */
.pharmacy-info-card { display: flex; flex-direction: column; gap: var(--space-md); border-left: 4px solid var(--primary-500); }
.pharmacy-info-header { display: flex; justify-content: space-between; align-items: center; }
.pharmacy-info-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-sm); color: var(--text-secondary); font-size: var(--text-sm); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); flex-wrap: wrap; gap: var(--space-sm); }

/* --- Consultations --- */
.consultations-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.consultation-card { border-left: 4px solid var(--info); display: flex; flex-direction: column; gap: var(--space-sm); }
.consultation-card-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border-light); }
.consultation-date { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; }
.consultation-card-body p { margin: var(--space-xs) 0; font-size: var(--text-sm); }
.consultation-card-actions { display: flex; gap: var(--space-sm); margin-top: auto; padding-top: var(--space-sm); border-top: 1px solid var(--border-light); }
.booking-card { max-width: 600px; margin-bottom: var(--space-xl); border-top: 4px solid var(--primary-400); }

/* --- Auth --- */
.auth-section { display: flex; align-items: center; justify-content: center; padding: var(--space-2xl) 0; min-height: 70vh; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { text-align: center; margin-bottom: var(--space-lg); font-family: var(--font-display); }
.auth-links { margin-top: var(--space-lg); text-align: center; display: flex; flex-direction: column; gap: var(--space-sm); font-size: var(--text-sm); }

/* Responsive — dashboard carte */
@media (max-width: 900px) {
    .home-dashboard {
        flex-direction: column;
        height: auto;
        min-height: 0;
        margin-top: 0;
        gap: var(--space-md);
    }

    .map-panel {
        height: min(50vh, 380px);
        min-height: 280px;
        order: 1;
        width: 100%;
        flex: none;
    }

    .sidebar-panel {
        height: auto;
        max-height: none;
        order: 2;
        width: 100%;
        flex: none;
    }

    .results-section {
        max-height: 55vh;
        min-height: 240px;
    }

    .route-info-details {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .pharmacy-sidebar-card .card-footer {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .pharmacy-sidebar-card .get-route-btn {
        flex: 1;
        min-width: 120px;
    }

    .pharmacy-card-detail {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .pharmacy-card .pharmacy-card-name {
        font-size: var(--text-base);
    }

    .leaflet-popup.pharmacy-popup .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 48px);
    }

    .map-popup-pharmacy {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .map-panel {
        height: min(45vh, 320px);
        border-radius: var(--radius-lg);
    }

    .google-search-bar {
        height: 42px;
        padding-left: var(--space-md);
    }

    .google-search-bar input {
        font-size: 14px;
    }
}
