/* ===== FARMÁCIA ONLINE – STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --primary: #3d8eb9;
  --primary-dark: #2e7aa3;
  --primary-light: #eaf4fb;
  --accent: #5abf9b;
  --accent-dark: #3da882;
  --accent2: #4a7fc1;
  --bg: #f4f7f9;
  --bg2: #ebeef2;
  --surface: #ffffff;
  --sidebar-bg: #0d1b2a;
  --sidebar-text: #8fa3b8;
  --sidebar-active: #5abf9b;
  --text: #1a2332;
  --text2: #4e6070;
  --text3: #8898aa;
  --border: #e0e8ef;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.13);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-width: 248px;
  --header-height: 64px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --font2: 'DM Sans', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── AUTH ─────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0d1b2a 0%, #1a3550 50%, #0e2235 100%);
  z-index: 9999;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: blobFloat 8s ease-in-out infinite;
}

.blob1 {
  width: 400px;
  height: 400px;
  background: #0ea47a;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.blob2 {
  width: 300px;
  height: 300px;
  background: #118ab2;
  bottom: -80px;
  left: -80px;
  animation-delay: 3s;
}

.blob3 {
  width: 200px;
  height: 200px;
  background: #06d6a0;
  top: 50%;
  left: 30%;
  animation-delay: 5s;
}

@keyframes blobFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

.auth-container {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.75rem;
}

.auth-logo {
  display: flex;
  align-items: center;
}

.auth-logo img {
  height: 44px;
  width: auto;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text2);
  transition: all .2s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.role-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 1rem 0;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text2);
}

.role-card:hover {
  border-color: var(--accent);
  background: rgba(90, 191, 155, 0.08);
  color: var(--accent-dark);
}

.role-card.active {
  border-color: var(--accent);
  background: rgba(90, 191, 155, 0.1);
  color: var(--accent-dark);
}

.role-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.auth-demo-note {
  text-align: center;
  color: var(--text3);
  font-size: 0.78rem;
  margin-top: 0.75rem;
}

/* ── APP LAYOUT ──────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 2.2rem 1.25rem 2rem;
}

.sidebar-brand img {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.sidebar-tagline {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #a4b5cf;
  opacity: 0.9;
  line-height: 1.2;
  max-width: 150px;
}

.auth-tagline {
  text-align: center;
  font-size: 0.85rem;
  color: #6e84a3;
  margin-top: 10px;
  font-weight: 500;
}

.brand-name strong {
  color: #5abf9b;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  width: 100%;
  margin-bottom: 2px;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 1.5rem 1rem 0.5rem;
  letter-spacing: 0.05em;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
  background: rgba(90, 191, 155, 0.18);
  color: #5abf9b;
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 0.72rem;
  color: var(--sidebar-text);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: .2s;
}

.logout-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* Premium Mobile Header - Glassmorphism */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 72px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.hamburger {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  cursor: pointer;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: .2s;
}

.hamburger:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.08);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--text);
  border-radius: 4px;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.mobile-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.mobile-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: .2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: white;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 6px;
  display: flex;
  border-radius: 8px;
  transition: .2s;
}

.notif-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Pages */
.pages {
  padding: 2rem;
  flex: 1;
}

/* ── PAGE COMPONENTS ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text2);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card.teal .stat-icon {
  background: rgba(90, 191, 155, 0.12);
  color: #3da882;
}

.stat-card.green .stat-icon {
  background: #e8f5e9;
  color: #388e3c;
}

.stat-card.blue .stat-icon {
  background: rgba(61, 142, 185, 0.12);
  color: #2e7aa3;
}

.stat-card.orange .stat-icon {
  background: #fff3e0;
  color: #f57c00;
}

.stat-card.red .stat-icon {
  background: #ffebee;
  color: #d32f2f;
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 4px;
  font-weight: 500;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dash-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: .2s;
}

.link-btn:hover {
  background: var(--primary-light);
}

/* Order/Presc rows */
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: .15s;
}

.order-row:last-child {
  border-bottom: none;
}

.order-row:hover {
  opacity: 0.8;
}

.order-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-id {
  font-weight: 700;
  font-size: 0.9rem;
}

.order-ph {
  color: var(--text2);
  font-size: 0.8rem;
}

.order-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-price {
  font-weight: 600;
  font-size: 0.85rem;
}

.presc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.presc-row:last-child {
  border-bottom: none;
}

.presc-row.clickable {
  cursor: pointer;
}

.presc-row.clickable:hover {
  opacity: 0.75;
}

.presc-icon {
  color: var(--primary);
}

.presc-info {
  flex: 1;
}

.presc-id {
  font-weight: 600;
  font-size: 0.875rem;
}

.presc-date {
  color: var(--text3);
  font-size: 0.78rem;
}

/* Reminders */
.reminder-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.reminder-row:last-child {
  border-bottom: none;
}

.reminder-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(61, 142, 185, 0.1);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reminder-info {
  flex: 1;
}

.reminder-med {
  font-weight: 600;
  font-size: 0.875rem;
}

.reminder-time {
  color: var(--text3);
  font-size: 0.78rem;
}

/* Toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}

input:checked+.toggle-slider {
  background: var(--primary);
}

input:checked+.toggle-slider::before {
  transform: translateX(16px);
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  transition: all .2s;
}

.quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Stock alerts */
.stock-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.stock-alert-row:last-child {
  border-bottom: none;
}

.stock-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.stock-ph {
  color: var(--text3);
  font-size: 0.78rem;
}

/* Messages preview */
.msg-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-sender {
  font-weight: 600;
  font-size: 0.85rem;
}

.msg-text {
  color: var(--text2);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-time {
  color: var(--text3);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ── CATALOG ─────────────────────────────────────────── */
.catalog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text2);
  transition: all .2s;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform .2s, box-shadow .2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-badge-area {
  display: flex;
  gap: 6px;
  min-height: 22px;
}

.rx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff3e0;
  color: #e65100;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.oos-badge {
  background: #ffebee;
  color: #c62828;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 191, 155, 0.1);
  color: var(--accent-dark);
  flex-shrink: 0;
}

.product-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
}

.product-desc {
  color: var(--text2);
  font-size: 0.78rem;
  line-height: 1.5;
  flex: 1;
}

.product-meta {}

.product-cat {
  background: var(--bg);
  color: var(--text3);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.product-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.oos-text {
  color: var(--text3);
  font-size: 0.8rem;
}

.btn-add-cart,
.btn-in-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-add-cart {
  background: var(--primary);
  color: white;
}

.btn-add-cart:hover {
  background: var(--primary-dark);
}

.btn-in-cart {
  background: var(--bg);
  color: var(--text2);
  border: 1.5px solid var(--border);
}

/* ── CART ──────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.cart-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 191, 155, 0.1);
  color: var(--accent-dark);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.cart-item-ph {
  color: var(--text2);
  font-size: 0.8rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px 8px;
}

.cart-item-controls button {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
  padding: 0 4px;
  line-height: 1;
}

.cart-item-controls span {
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.cart-item-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.cart-remove {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  border-radius: 4px;
  transition: .2s;
}

.cart-remove:hover {
  color: #ef4444;
  background: #ffebee;
}

.cart-summary {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.cart-summary h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text2);
}

.summary-divider {
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.checkout-form {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkout-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}

.delivery-options {
  display: flex;
  gap: 8px;
}

.delivery-opt {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: .2s;
}

.delivery-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.delivery-opt-body {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.delivery-opt-body strong {
  font-weight: 700;
}

.delivery-opt-body span {
  color: var(--text3);
  font-size: 0.72rem;
}

.delivery-opt input {
  margin-top: 2px;
}

/* ── TABLE ─────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--bg);
  padding: 0.9rem 1.25rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.9rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg);
}

.empty-cell {
  text-align: center;
  color: var(--text3);
  padding: 2rem !important;
}

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-teal {
  background: #e6f7f2;
  color: #0a8060;
}

.badge-green {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-blue {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-orange {
  background: #fff3e0;
  color: #e65100;
}

.badge-red {
  background: #ffebee;
  color: #c62828;
}

.badge-gray {
  background: var(--bg);
  color: var(--text2);
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 164, 122, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1.5px solid var(--border);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: .2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text2);
  transition: .2s;
}

.btn-ghost:hover {
  background: var(--border);
  color: var(--text);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text2);
  transition: .2s;
}

.btn-sm:hover {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.btn-sm.btn-teal {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.btn-sm.btn-teal:hover {
  background: var(--primary);
  color: white;
}

.btn-sm.btn-green {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #4caf50;
}

.btn-sm.btn-green:hover {
  background: #4caf50;
  color: white;
}

.btn-sm.btn-red {
  background: #ffebee;
  color: #c62828;
  border-color: #ef5350;
}

.btn-sm.btn-red:hover {
  background: #ef5350;
  color: white;
}

.btn-sm.btn-blue {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #1976d2;
}

.btn-sm.btn-blue:hover {
  background: #1976d2;
  color: white;
}

.btn-full,
.btn-block {
  width: 100%;
  justify-content: center;
}

.mt-1 {
  margin-top: 0.75rem;
}

/* ── FORMS ──────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: .2s;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 164, 122, 0.1);
}

select {
  cursor: pointer;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.85rem;
  transition: .2s;
}

.upload-area:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: rgba(90, 191, 155, 0.06);
}

.upload-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.upload-sub {
  color: var(--text3);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ── CHAT ──────────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-contacts {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-contacts-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chat-contacts-header h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text2);
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  transition: .15s;
  border-bottom: 1px solid var(--border);
}

.chat-contact:hover {
  background: var(--bg);
}

.chat-contact.active {
  background: var(--primary-light);
}

.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.contact-role {
  color: var(--text3);
  font-size: 0.75rem;
}

.contact-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
}

.contact-status.online {
  background: #22c55e;
}

.chat-main {
  display: flex;
  flex-direction: column;
}

.chat-main-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.chat-main-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-main-role {
  color: var(--text3);
  font-size: 0.78rem;
}

.chat-main-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg);
}

.chat-main-input {
  display: flex;
  gap: 8px;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-main-input input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-family: var(--font);
  font-size: 0.875rem;
}

/* Chat bubbles */
.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.chat-bubble.sent {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble.received {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble-text {
  padding: 0.65rem 1rem;
  border-radius: 18px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chat-bubble.sent .bubble-text {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received .bubble-text {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble-time {
  font-size: 0.7rem;
  color: var(--text3);
  margin-top: 4px;
}

.chat-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text3);
}

.chat-empty-inner {
  text-align: center;
  color: var(--text3);
  font-size: 0.875rem;
  padding: 2rem;
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}

.chat-send:hover {
  background: var(--primary-dark);
}

/* Floating chat */
.chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  box-shadow: 0 4px 20px rgba(14, 164, 122, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}

.chat-fab:hover {
  transform: scale(1.1);
}

.chat-widget {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  z-index: 200;
  width: 340px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transform-origin: bottom right;
  animation: popIn .25s ease;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-header {
  background: var(--primary);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.chat-title {
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.chat-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

.chat-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: .2s;
}

.chat-close:hover {
  color: white;
}

.chat-messages {
  height: 250px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.chat-input-area input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font);
}

/* ── HEALTH ─────────────────────────────────────────────── */
.health-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.presc-info-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--primary-light);
  border: 1px solid #b2dfdb;
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

/* ── NOTIFICATIONS ──────────────────────────────────────── */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: .15s;
}

.notif-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.notif-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.notif-item.unread {
  background: var(--primary-light);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-item:not(.unread) .notif-dot {
  background: var(--border);
}

.notif-msg {
  font-size: 0.875rem;
  font-weight: 500;
}

.notif-time {
  color: var(--text3);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ── PROFILE ────────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.profile-avatar-big {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  color: white;
  font-weight: 800;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-role {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
}

.profile-email {
  color: var(--text3);
  font-size: 0.8rem;
  margin-top: 6px;
}

/* ── INVENTORY ──────────────────────────────────────────── */
.stock-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-bar {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

.stock-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}

.text-red {
  color: #ef4444;
  font-weight: 700;
}

.text-orange {
  color: #f97316;
  font-weight: 700;
}

.text-green {
  color: #22c55e;
  font-weight: 700;
}

/* ── PHARMACIES ─────────────────────────────────────────── */
.pharmacies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.pharmacy-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pharmacy-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 142, 185, 0.1);
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.pharmacy-name {
  font-weight: 700;
  font-size: 1rem;
}

.pharmacy-location,
.pharmacy-phone {
  color: var(--text2);
  font-size: 0.82rem;
}

.pharmacy-actions {
  display: flex;
  gap: 8px;
  margin-top: 0.5rem;
}

/* ── ADMIN ──────────────────────────────────────────────── */
.role-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.role-dist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-dist-label {
  font-size: 0.82rem;
  font-weight: 500;
  min-width: 100px;
}

.role-dist-bar {
  flex: 1;
  height: 8px;
  background: var(--bg2);
  border-radius: 4px;
  overflow: hidden;
}

.role-dist-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s;
}

.role-dist-count {
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 20px;
}

.log-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.log-row:last-child {
  border-bottom: none;
}

.log-user {
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 70px;
  color: var(--primary);
}

.log-action {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text2);
}

.log-time {
  color: var(--text3);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* User row */
.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar-xs {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  color: white;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-section {
  margin-bottom: 1.25rem;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-info-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-info-grid label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
}

.modal-info-grid span {
  font-size: 0.875rem;
  font-weight: 600;
}

.modal-item-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.modal-total {
  text-align: right;
  font-weight: 800;
  font-size: 1rem;
  margin-top: 0.75rem;
  color: var(--primary-dark);
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.otp-code {
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

/* ── EMPTY STATES ───────────────────────────────────────── */
.empty-state {
  color: var(--text3);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.empty-state a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.empty-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 1rem;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 191, 155, 0.1);
  color: var(--accent-dark);
  margin: 0 auto;
}

.empty-page h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.empty-page p {
  color: var(--text2);
  font-size: 0.9rem;
}

/* ── TOAST ──────────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border-radius: 12px;
  padding: 0.9rem 1.1rem 0.9rem 0.9rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13), 0 1px 4px rgba(0, 0, 0, 0.07);
  min-width: 300px;
  max-width: 380px;
  border-left: 4px solid var(--accent);
  pointer-events: auto;
  animation: toastSlideIn .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity .25s, transform .25s;
}

.toast-item.toast-success {
  border-left-color: #22c55e;
}

.toast-item.toast-error {
  border-left-color: #ef4444;
}

.toast-item.toast-info {
  border-left-color: #3b82f6;
}

.toast-item.toast-warning {
  border-left-color: #f59e0b;
}

.toast-item.hiding {
  opacity: 0;
  transform: translateX(24px);
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-item.toast-success .toast-icon {
  background: #f0fdf4;
  color: #22c55e;
}

.toast-item.toast-error .toast-icon {
  background: #fef2f2;
  color: #ef4444;
}

.toast-item.toast-info .toast-icon {
  background: #eff6ff;
  color: #3b82f6;
}

.toast-item.toast-warning .toast-icon {
  background: #fffbeb;
  color: #f59e0b;
}

.toast-item:not(.toast-success):not(.toast-error):not(.toast-info):not(.toast-warning) .toast-icon {
  background: rgba(90, 191, 155, 0.1);
  color: var(--accent-dark);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.toast-msg {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 2px;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  flex-shrink: 0;
  transition: color .15s;
}

.toast-close:hover {
  color: var(--text);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(32px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Legacy .toast kept for safety but hidden */
.toast {
  display: none;
}

/* .hidden */
.hidden {
  display: none !important;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .pages {
    padding: 1rem;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-contacts {
    max-height: 200px;
    overflow-y: auto;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .health-layout {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .chat-widget {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 5rem;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .pharmacies-grid {
    grid-template-columns: 1fr;
  }
}

/* BOTTOM NAV */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  height: 64px;
  z-index: 1000;
  padding: 0 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  width: 100%;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: #a0aec0;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  padding: 6px 0;
  border-radius: 12px;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  opacity: 0.7;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active svg {
  opacity: 1;
  stroke: var(--primary);
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
    /* CRITICAL: Stack header and main-content vertically */
    display: flex;
  }

  :root {
    --header-height: 72px;
    --sidebar-width: 0px;
    --radius: 18px;
    /* Rounder for mobile */
  }

  body {
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
  }

  /* Anti-tiny base font */

  .sidebar {
    display: none !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px !important;
    z-index: 9999;
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
  }

  .mobile-header {
    display: flex;
    width: 100%;
    flex-shrink: 0;
  }

  .topbar {
    display: none;
  }

  html,
  body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
  }

  .main-content {
    margin-left: 0 !important;
    padding-bottom: 90px;
    min-height: calc(100vh - var(--header-height));
    width: 100% !important;
    flex: 1;
  }

  .pages {
    padding: 1.5rem 1rem;
    /* More top padding for breathing room */
  }

  .page-header {
    margin-bottom: 2rem;
    padding-top: 5px;
  }

  .page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  /* AUTH MOBILE - No more tiny forms */
  .auth-overlay {
    padding: 0.75rem;
  }

  .auth-container {
    max-width: 100%;
    width: 100%;
    padding: 2rem 1.5rem;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  }

  .auth-brand {
    margin-bottom: 2rem;
  }

  .auth-tagline {
    font-size: 1rem;
    line-height: 1.4;
    color: #4e6070;
  }

  .form-group label {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .search-input,
  select,
  input[type="text"],
  input[type="email"],
  input[type="password"] {
    height: 54px;
    font-size: 1rem;
    border-radius: 12px;
  }

  /* BOLD GRIDS - Large & Impactful */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.25rem;
    min-height: 100px;
  }

  .stat-num {
    font-size: 2rem;
    margin-top: 4px;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dash-card {
    padding: 1.5rem 1.25rem;
    border-radius: 20px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product-card {
    padding: 1.25rem;
    display: flex;
    gap: 15px;
    align-items: center;
  }

  .product-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .product-info {
    flex: 1;
  }

  .product-name {
    font-size: 1.1rem;
  }

  .product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
  }

  /* Buttons for Mobile */
  .btn-primary,
  .btn-secondary {
    height: 56px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
  }

  /* Bottom Nav Polishing */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 76px;
    padding: 0 0.5rem 12px 0.5rem;
    z-index: 2000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.05);
  }

  .nav-tab {
    font-size: 0.75rem;
    gap: 2px;
  }

  .nav-tab svg {
    width: 24px;
    height: 24px;
  }

  /* DATA TABLE TO CARD TRANSFORMATION */
  .table-card {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .data-table {
    display: block;
    width: 100%;
    border: none;
  }

  .data-table thead {
    display: none;
  }

  /* Hide headers on mobile */
  .data-table tbody {
    display: block;
    width: 100%;
  }

  .data-table tr {
    display: block;
    width: 100%;
    background: white;
    margin-bottom: 1.25rem;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 1rem;
    color: var(--text);
  }

  .data-table td:last-child {
    border-bottom: none;
    padding-top: 1rem !important;
    justify-content: center;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text2);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .data-table tr:hover td {
    background: transparent;
  }

  /* Badge adjustments for mobile cards */
  .badge {
    padding: 4px 12px;
    font-size: 0.85rem;
  }

  .otp-code {
    font-size: 1.1rem;
    padding: 4px 10px;
    background: #f0f4f8;
  }

  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    transition: opacity 0.3s;
  }

  .mobile-overlay.active {
    display: block;
  }

  /* ── CATALOG RESPONSIVE ── */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .product-card {
    padding: 1rem;
    gap: 0.4rem;
  }

  .product-name {
    font-size: 0.85rem;
  }

  .product-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 0.75rem;
  }

  .product-price {
    font-size: 0.9rem;
  }

  .btn-add-cart,
  .btn-in-cart {
    width: 100%;
    justify-content: center;
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  /* ── CART RESPONSIVE ── */
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
    position: relative;
  }

  .cart-item-info {
    width: 100%;
  }

  .cart-item-controls {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .cart-item-price {
    font-size: 1.1rem;
    align-self: flex-end;
  }

  .cart-remove {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .cart-summary {
    position: static;
    margin-top: 1rem;
  }

  .delivery-options {
    flex-direction: column;
  }
}


/* ── PAGINATION & FILTERS ───────────────────────────── */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  padding-bottom: 2rem;
}

.btn-page {
  min-width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text2);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-page.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.header-tools {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: .2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

@media (max-width: 900px) {
  .search-box {
    width: 100%;
  }
}