﻿/* Ste Marie Pharma — App Web Pharmacie (Express + EJS) */
/* Custom styles — Tailwind is loaded via CDN */

/* ─── CSS Custom Properties ─── */
:root {
  --color-primary: #10b981;
  --color-primary-dark: #059669;
  --color-primary-darker: #047857;
  --color-primary-light: #d1fae5;
  --color-primary-50: #ecfdf5;
  --color-secondary: #14b8a6;
  --color-secondary-dark: #0d9488;
  --color-secondary-darker: #0f766e;
  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-info: #3b82f6;
  --color-surface: #ffffff;
  --color-bg: #f8fafc;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.08);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.12);
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

@layer base {
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--color-bg); color: var(--color-text); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
  button { font: inherit; cursor: pointer; border: none; background: none; transition: all var(--transition-fast); }
  input, select, textarea { font: inherit; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

/* ─── Auth ─── */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 50%, #ecfeff 100%); }
.auth-card { background: white; border-radius: var(--radius-xl); padding: 40px; max-width: 480px; width: 100%; box-shadow: var(--shadow-xl); }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo { font-size: 56px; margin-bottom: 12px; }
.auth-header h1 { font-size: 24px; color: var(--color-secondary-darker); margin-bottom: 8px; }
.auth-header p { font-size: 14px; color: var(--color-text-secondary); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #475569; font-weight: 600; }
.auth-form input { padding: 12px 14px; border: 1.5px solid var(--color-border); border-radius: var(--radius-md); font-size: 15px; }
.auth-form input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }

/* ─── Auth switch (login ↔ register) ─── */
.auth-card-wide { max-width: 560px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--color-text-secondary); }
.auth-switch-link { background: none; border: none; color: var(--color-secondary-dark); font-weight: 600; cursor: pointer; font-size: 14px; text-decoration: underline; }
.auth-switch-link:hover { color: var(--color-secondary-darker); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row label { gap: 6px; }

/* ─── Consent (Loi 22/030) ─── */
.consent-section { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; }
.consent-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.consent-icon { font-size: 24px; }
.consent-header strong { display: block; font-size: 13px; color: var(--color-text); }
.consent-header small { font-size: 11px; color: var(--color-text-secondary); font-style: italic; }
.consent-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #475569; cursor: pointer; margin-top: 10px; line-height: 1.5; }
.consent-checkbox input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--color-primary); flex-shrink: 0; }
.policy-preview { max-height: 260px; overflow-y: auto; background: white; border: 1px solid var(--color-border); border-radius: 8px; padding: 12px; margin: 10px 0; }
.policy-law { font-size: 11px; color: var(--color-text-secondary); font-style: italic; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border-light); }
.policy-section { margin-bottom: 8px; }
.policy-section strong { display: block; font-size: 12px; color: var(--color-secondary-darker); margin-bottom: 2px; }
.policy-section p { font-size: 12px; color: #475569; line-height: 1.5; }

.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ─── Stats cards ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; padding: 20px; border-radius: var(--radius-lg); border: 1.5px solid; box-shadow: var(--shadow-sm); transition: transform var(--transition-base), box-shadow var(--transition-base); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-emerald { border-color: #a7f3d0; background: linear-gradient(135deg, #fff 0%, #ecfdf5 100%); }
.stat-amber { border-color: #fde68a; background: linear-gradient(135deg, #fff 0%, #fffbeb 100%); }
.stat-red { border-color: #fecaca; background: linear-gradient(135deg, #fff 0%, #fef2f2 100%); }
.stat-cyan { border-color: #a5f3fc; background: linear-gradient(135deg, #fff 0%, #ecfeff 100%); }
.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; color: var(--color-text); }
.stat-label { font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }

/* ─── Card ─── */
.card { background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border-light); transition: box-shadow var(--transition-base); }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--color-border); }
.card-header h2 { font-size: 18px; color: var(--color-text); margin-bottom: 4px; font-weight: 700; }
.card-header p { font-size: 13px; color: var(--color-text-secondary); }
.card-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.card-body { padding: 20px 24px; }
.input { padding: 10px 14px; border: 1.5px solid var(--color-border); border-radius: 8px; font-size: 14px; background: white; }
.input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; cursor: pointer; }

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: all var(--transition-fast); border: 1.5px solid transparent; }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: 0 2px 8px rgba(16,185,129,.25); }
.btn-primary:disabled { background: #d1fae5; cursor: not-allowed; box-shadow: none; }
.btn-outline { background: white; color: var(--color-secondary-darker); border-color: #a7f3d0; }
.btn-outline:hover { background: var(--color-primary-50); border-color: var(--color-primary); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: #f1f5f9; color: var(--color-text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; background: white; border: 1px solid var(--color-border); color: var(--color-secondary-darker); font-weight: bold; font-size: 18px; border-radius: var(--radius-sm); }
.btn-icon:hover { background: #f1f5f9; }
.btn-danger { background: var(--color-danger-dark); color: white; padding: 10px 16px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; font-size: 14px; }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 2px 8px rgba(220,38,38,.25); }
.btn-danger:disabled { background: #fca5a5; cursor: not-allowed; }

/* ─── Stock table ─── */
.stock-table { width: 100%; border-collapse: collapse; }
.stock-table th, .stock-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border-light); }
.stock-table th { font-size: 11px; text-transform: uppercase; color: var(--color-text-secondary); font-weight: 700; background: var(--color-bg); letter-spacing: 0.05em; position: sticky; top: 0; z-index: 5; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.stock-table tbody tr { transition: background var(--transition-fast); }
.stock-table tbody tr:nth-child(even) { background: #fafbfc; }
.stock-table tbody tr:hover { background: #f0fdf4; }
.med-name { font-weight: 600; color: var(--color-text); }
.med-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.barcode { color: var(--color-text-muted); font-family: monospace; margin-left: 6px; }
.stock-num { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.price-cell { font-weight: 600; color: var(--color-secondary-dark); font-size: 15px; }
.stock-actions { display: flex; gap: 6px; align-items: center; justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.chip-default { background: #f1f5f9; color: #475569; border-color: var(--color-border); }
.chip-red { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.chip-amber { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.chip-green { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.chip-emerald { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ─── Search cards ─── */
.search-list { display: flex; flex-direction: column; gap: 12px; }
.search-card { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border: 2px solid #fde68a; border-radius: 12px; padding: 16px; }
.search-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.badge-amber { background: #f59e0b; color: white; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.search-time { font-size: 11px; color: #92400e; }
.search-med { font-size: 18px; font-weight: 700; color: #78350f; margin-bottom: 4px; }
.search-patient { font-size: 13px; color: #92400e; margin-bottom: 8px; }
.search-msg { font-style: italic; font-size: 12px; color: #92400e; background: rgba(255,255,255,.5); padding: 8px; border-radius: 6px; margin-bottom: 8px; }
.search-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 56px; opacity: .3; margin-bottom: 16px; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.empty-text { font-size: 13px; color: var(--color-text-secondary); max-width: 320px; margin: 0 auto; }
.loading { text-align: center; padding: 40px; color: var(--color-text-secondary); }

/* ─── Skeleton loading ─── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }

/* ─── Stats detail ─── */
.stats-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.bar-row { margin-bottom: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.bar-track { background: #f1f5f9; border-radius: var(--radius-full); height: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.6s ease-out; }
.bar-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.bar-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-red { background: linear-gradient(90deg, #ef4444, #f87171); }
.rt-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--color-border-light); font-size: 14px; }
.rt-row:last-child { border-bottom: none; }
.rt-row strong { color: var(--color-secondary-dark); }
.rt-tip { margin-top: 12px; padding: 14px; background: var(--color-primary-50); border-radius: var(--radius-md); font-size: 12px; color: #064e3b; border: 1px solid #a7f3d0; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: var(--radius-xl); padding: 28px; max-width: 600px; width: 90%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-xl); animation: modal-in var(--transition-slow) ease; }
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal h2 { margin-bottom: 16px; font-size: 20px; font-weight: 700; }
.modal label { display: block; margin-bottom: 12px; font-size: 13px; color: #475569; font-weight: 600; }
.modal input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--color-border); border-radius: 8px; margin-top: 4px; font-size: 15px; }
.modal input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-border-light); }
.med-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin: 12px 0; }
.med-list-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--color-border-light); transition: background var(--transition-fast); }
.med-list-item:hover { background: var(--color-bg); }
.med-list-item.selected { background: var(--color-primary-50); border-left: 4px solid var(--color-primary); }
.med-list-item strong { display: block; font-size: 14px; color: var(--color-text); }
.med-list-item small { font-size: 11px; color: var(--color-text-muted); }

/* ─── Map controls ─── */
.map-controls { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.map-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #475569; font-weight: 600; }
.map-controls input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.map-controls textarea { padding: 10px; border: 1.5px solid var(--color-border); border-radius: 8px; resize: vertical; font-family: inherit; }
.map-controls textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }

/* ─── Toast ─── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1e293b; color: white; padding: 14px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-width: 380px; font-size: 14px; font-weight: 500; animation: slide-up var(--transition-slow) ease; display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; }
.toast::after { content: ''; position: absolute; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,.3); animation: toast-progress linear forwards; }
@keyframes toast-progress { from { width: 100%; } to { width: 0%; } }
.toast.success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ─── Conflict dialog ─── */
.conflict-info { background: #fef3c7; border: 1px solid #fde68a; border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; }
.conflict-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.conflict-row span { color: #475569; }
.conflict-divider { font-size: 12px; color: #92400e; margin-top: 12px; margin-bottom: 6px; font-weight: 600; }

/* ─── Aliases ─── */
.aliases { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.alias-chip { background: #e0f2fe; color: #0369a1; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.alias-more { font-size: 10px; color: var(--color-text-secondary); padding: 1px 4px; }

/* ─── Version badge ─── */
.version-badge { display: inline-block; background: #f1f5f9; color: #475569; padding: 2px 8px; border-radius: var(--radius-full); font-size: 10px; font-weight: 600; font-family: monospace; }

/* ─── Accessibilité WCAG 2.1 AA ─── */
*:focus-visible { outline: 2px solid var(--color-secondary-dark) !important; outline-offset: 2px !important; border-radius: 4px; }
.skip-link { position: absolute; top: -40px; left: 0; background: var(--color-secondary-dark); color: white; padding: 8px 16px; z-index: 1000; text-decoration: none; border-radius: 0 0 8px 0; transition: top var(--transition-fast); }
.skip-link:focus { top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (prefers-contrast: high) {
  * { border-color: currentColor !important; }
}

/* ─── Privacy settings ─── */
.account-active { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-md); padding: 14px; margin-bottom: 20px; }
.privacy-policy-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.privacy-policy-section h3 { font-size: 16px; margin-bottom: 4px; color: var(--color-text); }
.privacy-law { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 16px; font-style: italic; }
.privacy-sections { display: grid; gap: 12px; }
.privacy-section-item { background: var(--color-bg); padding: 12px; border-radius: 8px; border-left: 3px solid var(--color-primary); }
.privacy-section-item strong { display: block; font-size: 13px; color: var(--color-secondary-darker); margin-bottom: 4px; }
.privacy-section-item p { font-size: 12px; color: #475569; line-height: 1.5; }
.danger-zone { margin-top: 24px; padding: 20px; background: #fef2f2; border: 2px solid #fecaca; border-radius: 12px; }
.danger-zone h3 { color: #991b1b; margin-bottom: 8px; font-size: 16px; }
.danger-zone p { font-size: 13px; color: #7f1d1d; margin-bottom: 12px; }
.delete-confirm { background: white; padding: 16px; border-radius: 8px; border: 1px solid #fecaca; }
.delete-confirm p { margin-bottom: 8px; }
.deletion-banner { display: flex; gap: 16px; background: #fffbeb; border: 2px solid #fde68a; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.deletion-banner .deletion-icon { font-size: 32px; }
.deletion-banner h3 { color: #92400e; margin-bottom: 4px; }
.deletion-banner p { color: #78350f; font-size: 13px; margin-bottom: 4px; }

/* ─── Page Header ─── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 26px; color: var(--color-text); margin-bottom: 4px; font-weight: 800; letter-spacing: -0.02em; }
.page-header p { font-size: 14px; color: var(--color-text-secondary); }

/* ─── Quick Actions ─── */
.quick-actions { margin-top: 24px; }
.quick-actions h2 { font-size: 16px; color: var(--color-text); margin-bottom: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.quick-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: white; border-radius: 12px; border: 1.5px solid var(--color-border); text-decoration: none; color: var(--color-text); transition: all var(--transition-base); }
.quick-card:hover { border-color: var(--color-primary); box-shadow: 0 4px 12px rgba(16,185,129,.1); transform: translateY(-2px); }
.quick-icon { font-size: 24px; }
.quick-text strong { display: block; font-size: 14px; }
.quick-text small { font-size: 11px; color: var(--color-text-secondary); }
.quick-badge { background: var(--color-danger); color: white; font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); min-width: 20px; text-align: center; margin-left: auto; font-weight: 700; }

/* ─── Dashboard Sections ─── */
.dashboard-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-top: 24px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--color-bg); border-radius: 8px; transition: background var(--transition-fast); }
.recent-item:hover { background: #f0fdf4; }
.recent-item .recent-icon { font-size: 20px; }
.recent-item div { flex: 1; }
.recent-item strong { display: block; font-size: 13px; color: var(--color-text); }
.recent-item small { font-size: 11px; color: var(--color-text-muted); }

/* ─── Real-time cards ─── */
.rt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.rt-card { text-align: center; padding: 16px; background: var(--color-bg); border-radius: var(--radius-md); transition: transform var(--transition-base); }
.rt-card:hover { transform: translateY(-1px); }
.rt-value { font-size: 28px; font-weight: 800; color: var(--color-text); }
.rt-label { font-size: 12px; color: var(--color-text-secondary); margin-top: 4px; }
.rt-indicator { width: 12px; height: 12px; border-radius: 50%; margin: 8px auto 0; }
.rt-indicator.connected { background: var(--color-primary); box-shadow: 0 0 8px var(--color-primary); }
.rt-indicator.disconnected { background: var(--color-danger); }

/* ─── Pulse animation for RT status ─── */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.pulse-dot { animation: pulse-ring 2s infinite; }
.pulse-dot-red { animation: pulse-ring-red 2s infinite; }
@keyframes pulse-ring-red {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ─── Not Found page ─── */
.not-found { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--color-bg); }
.not-found-content { text-align: center; padding: 40px; }
.not-found-icon { font-size: 64px; margin-bottom: 16px; }
.not-found h1 { font-size: 72px; font-weight: 800; color: var(--color-primary); margin-bottom: 8px; }
.not-found h2 { font-size: 20px; color: var(--color-text); margin-bottom: 8px; }
.not-found p { font-size: 14px; color: var(--color-text-secondary); margin-bottom: 24px; }
.not-found-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── Animations ─── */
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scale-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.animate-fade-in { animation: fade-in .3s ease; }
.animate-slide-up { animation: slide-up .3s ease; }
.animate-scale-in { animation: scale-in .3s ease; }

/* Staggered list animation */
.stagger-item { animation: fade-in .3s ease both; }
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }

/* ─── Data Usage Dropdown ─── */
.data-usage { position: relative; }
.data-usage-btn-top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--color-text-secondary); background: var(--color-bg); border: 1px solid var(--color-border); cursor: pointer; transition: all var(--transition-fast); }
.data-usage-btn-top:hover { background: white; border-color: var(--color-primary); }
.data-usage-btn-top small { color: var(--color-text-muted); }
.data-usage-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: white; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; min-width: 240px; box-shadow: var(--shadow-lg); z-index: 50; }
.data-usage-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--color-text-secondary); }
.data-usage-row strong { color: var(--color-text); }
.data-usage-actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-border-light); }
.data-usage-tip { margin-top: 8px; padding: 8px; background: var(--color-primary-50); border-radius: var(--radius-sm); font-size: 11px; color: #064e3b; }

/* ─── Nav badge counter ─── */
.nav-badge { background: var(--color-danger); color: white; font-size: 10px; padding: 1px 6px; border-radius: var(--radius-full); min-width: 18px; text-align: center; font-weight: 700; line-height: 1.4; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
  .stock-table { font-size: 12px; }
  .stock-table th, .stock-table td { padding: 8px; }
  .med-sub { display: none; }
  .card-actions { flex-direction: column; align-items: stretch; }
  .input { min-width: 0; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-sections { grid-template-columns: 1fr; }
  .modal { padding: 20px; width: 95%; }
}
