:root {
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;
  --accent: #f59e0b;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --success: #10b981;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.12);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 90%; /* 10% bigger font scale (1rem = 14.4px), balanced sweet spot for SaaS */
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

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

/* NAVBAR */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.navbar-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar-brand-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.navbar-logo {
  height: 42px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-700);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-text h1 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-role-badge {
  background: var(--primary-100);
  color: var(--primary-800);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 0.35rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-item {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  transition: color 0.15s;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary-700);
}

/* NAVBAR CATEGORIES DROPDOWN */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  text-decoration: none;
}

.nav-chevron {
  transition: transform 0.2s ease;
  color: #94a3b8;
}

.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
  color: var(--primary-700);
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 240px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  pointer-events: none;
}

/* Invisible bridge so mouse hover doesn't drop when moving into menu */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-dropdown-header-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.6rem 0.25rem;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  color: #1e293b;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
  background: #f8fafc;
  color: var(--primary-700);
  transform: translateX(2px);
}

.nav-cat-icon {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.nav-cat-name {
  flex: 1;
}

.nav-dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.35rem 0;
}

.nav-dropdown-cta {
  background: #ecfdf5;
  color: #047857 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  justify-content: center;
  border: 1px solid #a7f3d0;
  margin-top: 0.2rem;
}

.nav-dropdown-cta:hover {
  background: #d1fae5 !important;
  transform: none !important;
}

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

.wallet-chip {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  color: var(--primary-800);
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s;
}

.wallet-chip:hover {
  background: var(--primary-100);
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

.user-menu-container {
  position: relative;
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.user-profile-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  padding: 0.5rem;
  z-index: 100;
  animation: userDropdownFadeIn 0.15s ease-out forwards;
}

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

.user-dropdown-header {
  padding: 0.4rem 0.6rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.35rem;
}

.user-dropdown-name {
  font-weight: 750;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-role {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--primary-100);
  color: var(--primary-800);
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
}

.user-dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.user-dropdown-link:hover {
  background: #f1f5f9;
  color: var(--primary-800);
}

.user-dropdown-footer {
  border-top: 1px solid #f1f5f9;
  margin-top: 0.4rem;
  padding-top: 0.45rem;
}

.btn-navbar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.75rem;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-navbar-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--primary-800);
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-main);
  border-color: var(--text-secondary);
}

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

.btn-danger:hover {
  background: #dc2626;
}

/* LAYOUT WITH SIDEBAR */
.app-container {
  display: flex;
  min-height: calc(100vh - 65px);
}

.sidebar {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.75rem 0.25rem 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: var(--bg-main);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--primary-700);
  color: white;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.15rem 1.75rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* METRICS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--primary-600);
  font-weight: 600;
}

/* SEARCH & HERO */
.search-container {
  position: relative;
  margin: 1.5rem 0;
}

.search-form {
  position: relative;
  width: 100%;
  display: block;
}

.search-input {
  width: 100%;
  padding: 0.95rem 3.5rem 0.95rem 1.5rem;
  font-size: 1.05rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 4px var(--primary-100);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-height: 42px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-700);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(4, 120, 87, 0.25);
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  z-index: 2;
}

.search-btn:hover {
  background: var(--primary-800);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 8px rgba(4, 120, 87, 0.35);
}

.search-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.tag-pill:hover, .tag-pill.active {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-800);
}

/* EXPERT CARD */
.expert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.expert-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.expert-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.expert-header {
  display: flex;
  gap: 1rem;
}

.expert-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-100);
}

.expert-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.expert-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.expert-rate {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-800);
}

.expert-rate span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.badge-online {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: min(500px, calc(100vw - 1.5rem));
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.85rem 1.65rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

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

/* NAVBAR HAMBURGER (Accessible 44x44px target) */
.navbar-hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--text-primary);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.navbar-hamburger:hover,
.navbar-hamburger:active {
  background: var(--bg-main);
  border-color: var(--primary-300);
}

.navbar-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* MOBILE OFF-CANVAS NAVIGATION DRAWER */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 84%;
  max-width: 320px;
  background: #ffffff;
  z-index: 1150;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.25);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-close:active {
  background: var(--bg-main);
  color: var(--text-primary);
}

.mobile-drawer-user {
  padding: 1.15rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.mobile-drawer-menu {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 44px;
  text-decoration: none;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-link:active,
.mobile-drawer-link:hover {
  background: var(--bg-main);
  color: var(--primary-800);
}

.mobile-drawer-link.active {
  background: var(--primary-700);
  color: white;
}

.mobile-drawer-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.85rem 0.85rem 0.35rem;
}

/* STICKY MOBILE BOTTOM NAVIGATION BAR (< 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  z-index: 45;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 700;
  flex: 1;
  height: 100%;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.bottom-nav-item.active {
  color: var(--primary-700);
}

.bottom-nav-icon {
  font-size: 1.15rem;
  line-height: 1.1;
}

/* RESPONSIVE TABLE WRAPPER */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table-responsive table {
  min-width: 600px;
}

/* TOUCH TARGET DEFAULTS */
button, input[type="button"], input[type="submit"], a.btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* RESPONSIVE BREAKPOINTS */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .main-content {
    padding: 1.25rem 1.25rem;
    max-width: 100%;
  }
}

/* Mobile & Tablet Portrait (max-width: 768px) */
@media (max-width: 768px) {
  /* Prevent iOS Safari input auto-zoom */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .sidebar {
    display: none;
  }

  .navbar {
    padding: 0.65rem 1rem;
  }

  .navbar-logo {
    height: 36px;
    max-width: 170px;
  }

  .nav-links {
    display: none;
  }

  .nav-btn-desktop {
    display: none;
  }

  .navbar-hamburger {
    display: flex;
  }

  .main-content {
    padding: 1.15rem 1rem;
    width: 100%;
  }

  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }

  body.has-bottom-nav {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
}

/* Large Mobile (max-width: 640px) */
@media (max-width: 640px) {
  .card {
    padding: 1.25rem 1.15rem;
  }

  .metrics-grid {
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .metric-card {
    padding: 1rem;
  }

  .metric-value {
    font-size: 1.55rem;
  }

  .expert-grid {
    gap: 1rem;
    margin-top: 1rem;
  }

  .expert-card {
    padding: 1.15rem;
  }
}

/* Standard Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .navbar {
    padding: 0.55rem 0.85rem;
  }

  .navbar-logo {
    height: 32px;
    max-width: 145px;
  }

  .nav-brand {
    gap: 0.5rem;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }

  .brand-text span {
    display: none;
  }

  .nav-role-badge {
    display: none;
  }

  .wallet-chip {
    padding: 0.28rem 0.55rem;
    font-size: 0.8rem;
    gap: 0.25rem;
  }

  .user-profile-chip span {
    display: none;
  }

  .user-profile-chip {
    padding: 0.2rem;
    gap: 0;
  }

  .modal-box {
    padding: 1.25rem 1rem;
    width: 95%;
  }

  .main-content {
    padding: 1rem 0.75rem;
  }

  .auth-card {
    padding: 1.5rem 1.15rem !important;
  }
}

/* Small Mobile (max-width: 375px) */
@media (max-width: 375px) {
  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
  }

  .modal-box {
    padding: 1rem 0.75rem;
  }

  .expert-header {
    gap: 0.75rem;
  }

  .expert-avatar {
    width: 52px;
    height: 52px;
  }
}

/* Ultra-Compact Mobile (max-width: 320px) */
@media (max-width: 320px) {
  .navbar {
    padding: 0.45rem 0.65rem;
  }

  .navbar-logo {
    height: 26px;
    max-width: 120px;
  }

  .brand-text h1 {
    font-size: 0.98rem;
  }

  .wallet-chip {
    padding: 0.22rem 0.45rem;
    font-size: 0.75rem;
  }

  .card {
    padding: 1rem 0.75rem;
  }
}
