:root {
  /* Modern, fresh medical palette — solid colors, no gradients */
  --primary: #4f46e5;        /* indigo */
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --primary-bg: rgba(79, 70, 229, 0.08);
  --accent: #14b8a6;          /* teal */
  --accent-bg: rgba(20, 184, 166, 0.1);
  --accent-2: #f97316;        /* warm orange */
  --accent-2-bg: rgba(249, 115, 22, 0.1);
  --rose: #ec4899;
  --rose-bg: rgba(236, 72, 153, 0.1);
  --secondary: #64748b;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #0ea5e9;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.03);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --nav-height: 72px;
  --header-height: 68px;
  --app-max-width: 480px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #eef2ff;
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== AUTH PAGES (Modern, minimal) ==================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  padding: 24px 16px;
  position: relative;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,0.08), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(15,23,42,0.06), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 24px 60px -20px rgba(15,23,42,0.15);
  border: 1px solid var(--gray-100);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--gray-900);
  background: transparent;
  border-radius: 0;
  overflow: hidden;
}

.auth-logo img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 16px;
}

.auth-title {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  color: var(--gray-500);
  font-size: 14px;
}

.auth-form {
  margin-top: 20px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
  color: var(--gray-500);
  font-size: 13px;
}

.auth-footer a {
  color: var(--gray-900);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Logo upload preview on registration */
.logo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.logo-upload:hover {
  border-color: var(--gray-400);
  background: var(--white);
}

.logo-upload-preview {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-upload-text {
  flex: 1;
  font-size: 13px;
  color: var(--gray-600);
}

.logo-upload-text strong {
  display: block;
  font-size: 14px;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.logo-upload input[type="file"] {
  display: none;
}

/* ==================== ALERTS ==================== */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

/* ==================== FORM ELEMENTS ==================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
}

.form-input, .form-select, .form-textarea, textarea.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  transition: all 0.15s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus, textarea.form-input:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.form-input::placeholder { color: var(--gray-400); }

.input-icon-wrapper { position: relative; }

.input-icon-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.input-icon-wrapper .form-input { padding-left: 44px; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(79,70,229,0.35); }

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(20,184,166,0.25);
}
.btn-accent:hover { background: #0d9488; }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--gray-900); color: var(--gray-900); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius);
}

.btn-icon-sm {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==================== APP LAYOUT (Mobile-first, app-style on desktop) ==================== */
.app-wrapper {
  min-height: 100vh;
  background: var(--gray-100);
}

/* Desktop Sidebar */
@media (min-width: 1024px) {
  .app-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    box-shadow: 0 0 60px rgba(15,23,42,0.06);
    min-height: 100vh;
  }

  body { background: var(--gray-100); }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 240px;
    background: var(--white);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--gray-100);
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    margin-bottom: 28px;
  }

  .sidebar-logo {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-900);
    overflow: hidden;
  }

  .sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
  }

  .sidebar-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  .sidebar-nav { flex: 1; }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s;
  }

  .nav-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
  }

  .nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
  }

  .nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

  .sidebar-footer {
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
  }

  .main-content { min-height: 100vh; }

  .mobile-header,
  .bottom-nav { display: none !important; }
}

/* Mobile Layout */
@media (max-width: 1023px) {
  .sidebar { display: none; }

  .main-content { padding-bottom: calc(var(--nav-height) + 20px); }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-logo {
    width: 38px;
    height: 38px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-900);
    overflow: hidden;
  }

  .mobile-logo img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
  }

  .mobile-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-start;
    padding: 8px 6px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }

  .nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.15s;
    position: relative;
    flex: 1 0 auto;
    min-width: 64px;
  }

  .nav-tab svg { width: 22px; height: 22px; }

  .nav-tab span { font-size: 11px; font-weight: 600; }

  .nav-tab.active { color: var(--primary); }

  .nav-tab.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }
}

/* ==================== PAGE HEADER ==================== */
.page-header {
  padding: 22px 20px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}

@media (min-width: 1024px) {
  .page-header { padding: 28px 32px 22px; }
}

.page-title {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.page-subtitle {
  color: var(--gray-500);
  font-size: 13.5px;
}

/* ==================== CONTENT AREA ==================== */
.content-area { padding: 18px; }

@media (min-width: 1024px) {
  .content-area { padding: 28px 32px; }
}

/* ==================== SEARCH BOX ==================== */
.search-wrapper {
  background: var(--white);
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--gray-100);
}

@media (min-width: 1024px) {
  .search-wrapper { padding: 18px 32px; top: 0; }
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  transition: all 0.15s;
}

.search-box:focus-within {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.search-box svg {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  outline: none;
}

.search-box input::placeholder { color: var(--gray-400); }

/* ==================== MEDICINE LIST ==================== */
.medicine-list {
  display: flex;
  flex-direction: column;
}

.medicine-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all 0.15s;
}

.medicine-card:hover { background: var(--gray-50); }

.medicine-card.selected {
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
}

@media (min-width: 1024px) {
  .medicine-card { padding: 16px 32px; }
}

.med-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.med-icon svg { width: 22px; height: 22px; }

.med-icon.tablet { background: #f3f0ff; color: #6d28d9; }
.med-icon.capsule { background: #fdf2f8; color: #be185d; }
.med-icon.syrup { background: #ecfdf5; color: #047857; }
.med-icon.injection { background: #fef2f2; color: #b91c1c; }
.med-icon.ointment, .med-icon.cream { background: #fffbeb; color: #b45309; }
.med-icon.drops { background: #eff6ff; color: #1d4ed8; }
.med-icon.inhaler { background: #eef2ff; color: #4338ca; }
.med-icon.suppository { background: #f5f3ff; color: #6d28d9; }
.med-icon.other { background: var(--gray-100); color: var(--gray-700); }

.med-info { flex: 1; min-width: 0; }

.med-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.med-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--gray-500);
}

.med-generic { color: var(--gray-700); font-weight: 500; }

.med-strength {
  background: var(--gray-100);
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 500;
  color: var(--gray-700);
  font-size: 11.5px;
}

.med-company { color: var(--gray-400); }
.med-type { color: #4f46e5; background: #eef2ff; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 4px; }

.med-action { color: var(--gray-300); }
.med-action svg { width: 22px; height: 22px; }
.medicine-card.selected .med-action { color: var(--success); }
.med-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.med-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-weight: 500; }
.med-chip.price { background: #dcfce7; color: #065f46; }
.med-chip.ok { background: #e0e7ff; color: #3730a3; }
.med-chip.warn { background: #fef3c7; color: #92400e; }
.med-chip.danger { background: #fee2e2; color: #991b1b; }

/* ==================== SELECTED BAR ==================== */
.selected-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(79,70,229,0.35);
  z-index: 90;
  animation: slideUp 0.25s ease;
  max-width: calc(100vw - 32px);
  white-space: nowrap;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(80px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@media (min-width: 1024px) {
  .selected-bar { bottom: 28px; }
}

.selected-bar span { font-weight: 500; font-size: 12.5px; }

.selected-bar .btn {
  border-radius: var(--radius-full);
  padding: 7px 14px;
  background: white;
  color: var(--primary);
  font-size: 12.5px;
  box-shadow: none;
  gap: 6px;
}

.selected-bar .btn svg { width: 15px; height: 15px; }

.selected-bar .btn:hover { background: var(--gray-100); transform: none; box-shadow: none; }

/* ==================== CARDS ==================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--gray-100);
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body { padding: 20px; }

/* ==================== TABS ==================== */
.tabs {
  display: flex;
  background: var(--gray-100);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 22px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==================== LIST ITEMS ==================== */
.list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.list-item:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.list-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-icon svg { width: 20px; height: 20px; }

.list-item-content { flex: 1; min-width: 0; }

.list-item-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 14.5px;
  margin-bottom: 2px;
}

.list-item-subtitle {
  font-size: 12.5px;
  color: var(--gray-500);
}

.list-item-actions { display: flex; gap: 8px; }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}

@media (min-width: 768px) {
  .modal-overlay { align-items: center; }
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
  background: var(--white);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 768px) {
  .modal-container {
    border-radius: var(--radius-xl);
    max-height: 88vh;
  }
}

.modal-overlay.active .modal-container { transform: translateY(0); }

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.modal-footer .btn {
  flex-shrink: 0;
  padding: 9px 12px;
  font-size: 13px;
  gap: 6px;
}

.modal-footer .btn svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .modal-footer .btn { padding: 8px 10px; font-size: 12px; }
}

/* ==================== RECEIPT ==================== */
.receipt {
  background: var(--white);
  padding: 28px 24px;
  max-width: 420px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
}

.receipt-header {
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 2px dashed var(--gray-300);
  margin-bottom: 18px;
}

.receipt-logo {
  width: 48px;
  height: 48px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  color: var(--primary);
  overflow: hidden;
}

.receipt-logo img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: transparent;
}

.receipt-logo svg { width: 28px; height: 28px; }

.receipt-pharmacy-name {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.receipt-pharmacy-name.bn {
  font-family: 'Hind Siliguri', 'Inter', sans-serif;
}

.receipt-pharmacy-info {
  font-size: 12.5px;
  color: var(--gray-600);
  margin-bottom: 2px;
}

.receipt-date {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 10px;
}

.receipt-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-600);
  margin: 14px 0;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.receipt-meta-row {
  display: flex;
  flex-direction: column;
}

.receipt-meta-label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--gray-400);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}

.receipt-meta-value {
  font-size: 13px;
  color: var(--gray-900);
  font-weight: 600;
}

.receipt-items { margin-bottom: 18px; }

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.receipt-item:last-child { border-bottom: none; }

.receipt-item-info { flex: 1; }

.receipt-item-name {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 3px;
  font-size: 14px;
}

.receipt-item-meta {
  font-size: 12.5px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.receipt-item-shelf {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
  margin-right: 4px;
}

.receipt-item-shelf-desc {
  display: block;
  font-size: 11.5px;
  color: var(--gray-500);
  margin-top: 4px;
  font-style: italic;
}

.receipt-item-action { margin-left: 10px; }

.receipt-total {
  padding-top: 16px;
  border-top: 2px dashed var(--gray-300);
  text-align: right;
}

.receipt-total-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.receipt-total-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.receipt-shop-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px dashed var(--gray-300);
  text-align: center;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
}

.receipt-shop-footer .line { margin-bottom: 2px; }

.receipt-footer {
  text-align: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--gray-200);
  font-size: 11.5px;
  color: var(--gray-500);
}

.receipt-footer strong {
  color: var(--gray-700);
  display: block;
  margin-bottom: 2px;
}

/* Customer mobile/info input above receipt */
.customer-info-form {
  background: var(--gray-50);
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid var(--gray-100);
}

.customer-info-form .form-group { margin-bottom: 10px; }
.customer-info-form .form-group:last-child { margin-bottom: 0; }

/* ==================== PAYMENT TABLE ==================== */
.payment-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.payment-table th {
  text-align: left;
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-200);
}

.payment-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  font-size: 13px;
}

.payment-table .qty-input,
.payment-table .price-input {
  width: 64px;
  padding: 6px 8px;
  text-align: center;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  background: var(--gray-50);
}

.payment-table .qty-input:focus,
.payment-table .price-input:focus {
  border-color: var(--primary);
  background: var(--white);
  outline: none;
}

/* ==================== PROFILE ==================== */
.profile-header {
  background: var(--primary);
  padding: 36px 24px 32px;
  text-align: center;
  color: white;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 2px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

.profile-avatar svg { width: 40px; height: 40px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.profile-email { opacity: 0.85; font-size: 13.5px; }

.settings-group { padding: 16px; }

@media (min-width: 1024px) {
  .settings-group { padding: 22px 32px; }
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}

.settings-item:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.settings-icon {
  width: 42px;
  height: 42px;
  background: var(--gray-100);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  flex-shrink: 0;
}

.settings-icon svg { width: 22px; height: 22px; }

.settings-content { flex: 1; }

.settings-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 14.5px;
  margin-bottom: 2px;
}

.settings-desc { font-size: 12.5px; color: var(--gray-500); }

.settings-arrow { color: var(--gray-400); }
.settings-arrow svg { width: 18px; height: 18px; }

.settings-item.danger .settings-icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.settings-item.danger .settings-title { color: var(--danger); }

/* ==================== DROPDOWN ==================== */
.dropdown-wrapper { position: relative; }

.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: var(--shadow-lg);
}

.dropdown-list.show { display: block; }

.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13.5px;
}

.dropdown-item:hover { background: var(--gray-100); }

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
}

.empty-state svg {
  width: 72px;
  height: 72px;
  color: var(--gray-300);
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.empty-state-text {
  color: var(--gray-500);
  font-size: 13.5px;
}

/* ==================== LOADING ==================== */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ==================== TOAST ==================== */
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--gray-900);
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 2000;
  transition: transform 0.25s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ==================== PRINT STYLES ==================== */
@media print {
  @page {
    size: 80mm auto;
    margin: 5mm;
  }

  html, body {
    background: white !important;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print,
  .sidebar,
  .mobile-header,
  .bottom-nav,
  .selected-bar,
  .modal-footer,
  .modal-header,
  .modal-close,
  .receipt-item-action,
  .customer-info-form {
    display: none !important;
  }

  .app-wrapper {
    box-shadow: none !important;
    display: block !important;
    max-width: none !important;
  }

  .main-content { padding: 0 !important; }

  .modal-overlay {
    position: static !important;
    background: none !important;
    backdrop-filter: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
  }

  .modal-container {
    box-shadow: none !important;
    max-height: none !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .modal-body {
    padding: 0 !important;
    overflow: visible !important;
  }

  .receipt {
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 8px !important;
    margin: 0 !important;
    page-break-inside: avoid;
  }

  .receipt-pharmacy-name { font-size: 18px !important; }
  .receipt-item-name { font-size: 13px !important; }

  .payment-table .qty-input,
  .payment-table .price-input {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    text-align: center;
    width: auto !important;
  }
}

/* ==================== BRAND NAME FONTS ==================== */
.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  max-width: 100%;
}

.brand-en {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.brand-bn {
  font-family: 'Hind Siliguri', 'Inter', sans-serif;
  font-weight: 600;
}

/* Sidebar / mobile-header sizing */
.sidebar .brand-name { font-size: 18px; }
.mobile-header .brand-name { font-size: 18px; }

/* ==================== MONEY ICON UTILITY ==================== */
.money {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.money svg {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}

/* ==================== REPORT TABS ==================== */
.report-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  background: var(--white);
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
}

.report-tab {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}

.report-tab svg { width: 16px; height: 16px; }

.report-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

.report-tab:not(.active):hover { background: var(--primary-bg); color: var(--primary); }

.report-section { display: none; }
.report-section.active { display: block; }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .filter-bar { padding: 12px; gap: 8px; }
  .filter-bar .form-group { min-width: 100%; }
  .filter-bar .form-group[style*="flex:0 0 auto"] { min-width: auto; flex: 1 1 auto; }
}

/* ==================== AUTH ICON OVERRIDE ==================== */
.auth-icon {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 22px;
}

.auth-icon svg { width: 38px; height: 38px; }

/* ==================== RECEIPT TWO-COLUMN HEADER ==================== */
.receipt-brand {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--gray-300);
}

.receipt-brand .receipt-logo {
  margin: 0 auto 8px;
}

.receipt-cols {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 16px;
  border-bottom: 2px dashed var(--gray-300);
  margin-bottom: 16px;
}

.receipt-col {
  flex: 1;
  min-width: 0;
}

.receipt-col h4 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 5px;
}

.receipt-col .line {
  font-size: 12.5px;
  color: var(--gray-700);
  line-height: 1.45;
  word-break: break-word;
}

.receipt-col .name-line {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.receipt-col.right { text-align: right; }

/* ==================== REPORTS / SALES BADGE ==================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.header-icon-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.header-icon-btn svg { width: 20px; height: 20px; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  display: none;
}

.notif-badge.show { display: flex; }

.notif-amount {
  position: absolute;
  top: 100%;
  margin-top: 6px;
  right: 0;
  background: var(--gray-900);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  display: none;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

.notif-amount.show { display: block; }

/* ==================== REPORTS PAGE ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(30px, -30px);
}

.stat-card.primary::after { background: var(--primary); }
.stat-card.accent::after { background: var(--accent); }
.stat-card.orange::after { background: var(--accent-2); }
.stat-card.rose::after { background: var(--rose); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-card.primary .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-card.accent .stat-icon { background: var(--accent-bg); color: var(--accent); }
.stat-card.orange .stat-icon { background: var(--accent-2-bg); color: var(--accent-2); }
.stat-card.rose .stat-icon { background: var(--rose-bg); color: var(--rose); }

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--white);
  padding: 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  align-items: end;
  border: 1px solid var(--gray-100);
}

.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

.sales-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-100);
}

.sales-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.sales-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13.5px;
  color: var(--gray-800);
}

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

.sales-table tr:hover td { background: var(--gray-50); }

@media (max-width: 640px) {
  .sales-table thead { display: none; }
  .sales-table tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--gray-100); }
  .sales-table td {
    display: flex; justify-content: space-between; padding: 4px 0; border: none; font-size: 13px;
  }
  .sales-table td::before {
    content: attr(data-label);
    font-weight: 600; color: var(--gray-500); font-size: 11.5px; text-transform: uppercase;
  }
}

/* ==================== UTILITIES ==================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
