/* ApexOral Dental Hospital Design System */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --cyan: #06b6d4;
  --cyan-dark: #0891b2;
  --cyan-light: #ecfeff;
  --accent: #10b981;
  --accent-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --navy: #0b192c;
  --navy-light: #1e293b;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #0284c7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 40px rgba(2, 132, 199, 0.15);
  --font-main: 'Outfit', 'Hind Siliguri', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Header & Navbar */
.topbar {
  background: var(--navy);
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a {
  color: #cbd5e1;
}
.topbar a:hover {
  color: var(--cyan);
}

.main-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}
.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}
.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}
.nav-links a {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 8px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}
.btn-secondary {
  background: #f1f5f9;
  color: var(--navy);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-dark);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: #059669;
  color: #fff;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Floating Google One-Tap / Continue Toast Notification */
.google-continue-toast {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 9999;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
  padding: 18px 20px;
  width: 360px;
  max-width: calc(100vw - 32px);
  border-left: 5px solid #4285F4;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.toast-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}
.toast-close:hover {
  color: var(--text-dark);
}
.toast-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}
.btn-google-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #dadce0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #3c4043;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60,64,67,0.15);
  transition: all 0.2s ease;
}
.btn-google-continue:hover {
  background: #f8fafd;
  border-color: #d2e3fc;
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.2);
}

/* Hero Section */
.hero-section {
  position: relative;
  background: radial-gradient(circle at 10% 20%, #eff6ff 0%, #ffffff 80%);
  padding: 70px 0 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 18px;
}
.hero-title span {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-stats {
  display: flex;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.stat-item h4 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
}
.stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-3d-card {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.hero-3d-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid var(--cyan);
  color: #38bdf8;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.teeth-visual-box {
  height: 220px;
  border-radius: 12px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(15, 23, 42, 0.8) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
}
.teeth-visual-icon {
  font-size: 3.5rem;
  color: var(--cyan);
  animation: pulseRotate 4s ease-in-out infinite;
}
@keyframes pulseRotate {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.06) rotate(3deg); }
}

/* Section Common */
.section {
  padding: 70px 0;
}
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}
.section-subtitle {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}
.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Service Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.service-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.service-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* Appointment Form Card */
.appointment-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-group {
  margin-bottom: 14px;
}
.form-group.full {
  grid-column: span 2;
}
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-dark);
  background: #fff;
  transition: all 0.2s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}
.sidebar-menu li {
  margin-bottom: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: #94a3b8;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(2, 132, 199, 0.2);
  color: #fff;
}
.sidebar-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-info h5 {
  font-size: 0.88rem;
  color: #fff;
}
.user-info p {
  font-size: 0.75rem;
  color: #94a3b8;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.top-navbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.content-body {
  padding: 32px;
  flex: 1;
}

/* Metric Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.stat-info h3 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--navy);
  margin-top: 4px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.green { background: #d1fae5; color: #10b981; }
.stat-icon.amber { background: #fef3c7; color: #f59e0b; }
.stat-icon.purple { background: #ede9fe; color: #8b5cf6; }
.stat-icon.rose { background: #ffe4e6; color: #f43f5e; }

/* Table Styles */
.table-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.table-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  background: #f8fafc;
  padding: 12px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Odontogram & Tooth Selection Chips */
.tooth-chart-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.quadrant-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.tooth-chip {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.tooth-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.tooth-chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-hover);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 650px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Print Layout for Prescription & Invoice */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar, .top-navbar, .no-print, .btn, .main-navbar, .topbar {
    display: none !important;
  }
  .dashboard-layout, .content-body {
    padding: 0 !important;
    background: #fff !important;
  }
  .print-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   DESKTOP SIDEBAR DEFAULTS (>= 1025px)
   ========================================================================== */
.sidebar {
  width: 270px;
  background: #0b192c;
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 2px 0 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 100;
}
.sidebar-close-btn,
.sidebar-backdrop,
.mobile-hamburger-btn {
  display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  body.sidebar-locked {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }
  .app-container {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    min-height: 100vh !important;
  }
  .main-content {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    min-height: 100vh !important;
    display: block !important;
  }

  /* Off-canvas Sliding Sidebar */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -320px !important;
    width: 285px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 12px 0 35px rgba(0,0,0,0.45) !important;
  }
  .sidebar.mobile-open {
    left: 0 !important;
  }

  /* Close Button in Sidebar */
  .sidebar-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: #ffffff !important;
    font-size: 1.25rem !important;
    cursor: pointer !important;
    z-index: 100 !important;
    position: relative !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: all 0.2s ease !important;
  }
  .sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
  }

  /* Backdrop Overlay */
  .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(11, 25, 44, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 999998 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.28s ease !important;
  }
  .sidebar-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Mobile Hamburger Toggle Button */
  .mobile-hamburger-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    font-size: 1.25rem;
    cursor: pointer;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  .mobile-hamburger-btn:hover, .mobile-hamburger-btn:active {
    background: #e2e8f0;
    color: #0284c7;
  }

  /* Top-Navbar */
  .top-navbar {
    padding: 12px 14px !important;
    height: auto !important;
    min-height: 58px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
  }
  .top-navbar > div:first-of-type {
    flex: 1 1 180px !important;
    min-width: 150px !important;
  }
  .top-navbar h1 {
    font-size: 1.12rem !important;
    line-height: 1.25 !important;
  }
  .top-navbar p {
    font-size: 0.74rem !important;
  }
  .top-navbar > div:last-of-type {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .top-navbar .btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 130px !important;
    padding: 9px 12px !important;
    font-size: 0.82rem !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Content Body */
  .content-body {
    padding: 14px 10px !important;
  }
}

/* ==========================================================================
   MOBILE & TABLET GRIDS, FORMS, TABLES (<= 900px)
   ========================================================================== */
@media (max-width: 900px) {
  /* Grids to Single Column */
  div[style*="grid-template-columns: 2fr 1fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr;"],
  div[style*="grid-template-columns: 2fr 1fr;"],
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Stats cards */
  .stats-grid,
  div[style*="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(210px, 1fr))"] {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  /* Odontogram & Tooth Selection Chips */
  .tooth-chart-box {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px !important;
    max-width: 100% !important;
  }
  .quadrant-row {
    min-width: 580px !important;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px !important;
  }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    border-radius: 14px !important;
    margin: 0 !important;
  }
  .modal-header {
    padding: 14px 16px !important;
  }
  .modal-body {
    padding: 16px 14px !important;
  }
  .modal-footer {
    padding: 12px 16px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .modal-footer .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Table horizontal scroll */
  .table-card,
  .table-responsive,
  div:has(> table),
  div:has(> .data-table) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  table, .data-table {
    min-width: 580px !important;
  }

  /* Forms padding */
  form[style*="padding: 24px 28px"],
  form[style*="padding: 24px"] {
    padding: 16px 12px !important;
  }

  /* Prescription View on Phone */
  .rx-page {
    padding: 20px 14px !important;
    margin: 10px auto !important;
    border-radius: 10px !important;
  }

  /* Prevent auto-zoom on mobile inputs */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   EXTRA SMALL SCREENS (<= 576px)
   ========================================================================== */
@media (max-width: 575px) {
  .stats-grid,
  div[style*="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(210px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }
  .top-navbar .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  .auth-card {
    border-radius: 14px !important;
  }
  .auth-body {
    padding: 20px 16px 24px !important;
  }
}
