:root {
  --bg: #f6f8fa;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #4b5563;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-soft: rgba(9,105,218,0.12);
  --radius-lg: 12px;
  --radius-full: 999px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  background-color: lightblue;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--bg-alt);
  border-bottom: 1px solid #d0d7de;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #d0d7de;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title {
  font-size: 1rem;
  font-weight: 600;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--muted);
}

nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  font-size: 0.8rem;
  color: #000000;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.16s ease-out, color 0.16s ease-out;
}

nav a:hover {
  background-color: #e5e7eb;
  color: #000000;
}

nav a.nav-book {
  background: #0064e0;
  color: #dfe2e5 !important;
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}

nav a.nav-book:hover {
  opacity: 0.88;
  background: #0064e0;
}

nav a.nav-admin {
  background-color: rgba(9, 105, 218, 0.15);
  color: #0969da;
}

nav a.nav-admin:hover {
  background-color: rgba(9, 105, 218, 0.25);
  color: #0550ae;
}

/* Profile icon button — matches nav a sizing */
a.nav-user-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 6px;
  color: #000000;
  text-decoration: none;
  transition: background-color 0.16s ease-out, color 0.16s ease-out;
}

a.nav-user-icon:hover {
  background-color: #e5e7eb;
  color: #000000;
}

/* Sign out button — matches nav a sizing */
a.nav-user-signout {
  font-size: 0.8rem;
  color: #000000;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.16s ease-out, color 0.16s ease-out;
}

a.nav-user-signout:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

a.nav-login-btn {
  background: #0064e0;
  color: #dfe2e5 !important;
  border-radius: 999px;
  padding: 5px 16px;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

a.nav-login-btn:hover {
  background: #0055c0;
  opacity: 0.92;
}

a.nav-google-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  transition: box-shadow 0.15s;
  padding: 0;
}

a.nav-google-signin:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  background: #fff;
}


nav a.nav-whatsapp {
  display: inline-flex;
  align-items: center;
  padding: 6px;
}

nav a.nav-whatsapp:hover {
  background-color: rgba(37, 211, 102, 0.15);
}

.hero-shell {
  border-bottom: 1px solid #d0d7de;
  background: radial-gradient(circle at top, rgba(9,105,218,0.12), transparent 60%);
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 24px;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr);
  gap: 24px;
}

main {
  flex: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 840px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  border-radius: var(--radius-lg);
  background-color: var(--card);
  border: 1px solid var(--border);
  padding: 18px 18px 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background-color: #f9fafb;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #16a34a 0, #15803d 50%, #0f172a 100%);
}

h1 {
  font-size: clamp(2rem, 2.5vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  color: #374151;
  background-color: #f9fafb;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.btn-primary,
.btn-ghost {
  font-size: 0.86rem;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.16s ease-out, color 0.16s ease-out, border-color 0.16s ease-out, transform 0.1s ease-out;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  border-color: #0753ad;
}

.btn-primary:hover {
  background-color: #0753ad;
  border-color: #064488;
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: #ffffff;
  border-color: #d0d7de;
  color: #111827;
}

.btn-ghost:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.long-term-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff8ed 0%, #fff4e0 100%);
  border: 1px solid #fcd27a;
  border-radius: 10px;
  margin-bottom: 20px;
}

.long-term-text {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.83rem;
  color: #4a3000;
  line-height: 1.5;
}

.long-term-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.long-term-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0064e0;
  text-decoration: none;
  padding-left: 26px;
  transition: color 0.15s;
}

.long-term-link:hover {
  color: #0040a0;
  text-decoration: underline;
}

.services-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 4px;
  padding: 16px 18px;
  background: #f0f5ff;
  border-radius: 12px;
  border: 1px solid #d6e4ff;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.service-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.service-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.service-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
  margin-top: 1px;
}

.btn-connect {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
  white-space: nowrap;
  border: none;
}

.btn-connect:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.btn-connect-email {
  background: #0064e0;
  color: #ffffff;
}

.btn-connect-email:hover {
  background: #0055c0;
  color: #ffffff;
}

.btn-connect-whatsapp {
  background: #25D366;
  color: #ffffff;
}

.btn-connect-whatsapp:hover {
  background: #1ebe5a;
  color: #ffffff;
}

.btn-icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background: radial-gradient(circle at 30% 0, #ffffff 0, #0969da 50%, #0753ad 100%);
}

.aside-card {
  padding: 16px 16px 14px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.section-caption {
  font-size: 0.78rem;
  color: var(--muted);
}

.projects-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.project {
  position: relative;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #ffffff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.project-indicator {
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #2f81f7, #a371f7);
}

.project-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background-color: #f6f8fa;
  border: 1px solid #d0d7de;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.project-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-main {
  flex: 1;
  min-width: 0;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.project-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.project-meta {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.project-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.footer-note {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

footer {
  border-top: 1px solid #d0d7de;
  padding: 14px 16px 18px;
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--muted);
  background-color: #f9fafb;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
}

.footer-links a:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD MOBILE RESPONSIVE
   Applies to all /dashboard/* pages
   ═══════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ── */
.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none; background: none;
  cursor: pointer; border-radius: 8px;
  color: #374151; flex-shrink: 0;
  transition: background .14s;
}
.topbar-hamburger:hover { background: #f1f5f9; }
.topbar-hamburger svg { width: 20px; height: 20px; }

/* ── Sidebar overlay backdrop ── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 299;
  opacity: 0;
  transition: opacity .22s;
}
.sidebar-backdrop.open { opacity: 1; }

/* ── Mobile bottom nav bar ── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}
.mbn-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; flex: 1;
  text-decoration: none;
  background: none; border: none;
  color: #64748b;
  font-size: 0.6rem; font-weight: 600;
  padding: 6px 4px;
  border-radius: 10px;
  transition: color .14s;
  min-width: 0; cursor: pointer;
}
.mbn-item:hover { color: #1877f2; }
.mbn-item.active { color: #1877f2; }
.mbn-item .mbn-icon { font-size: 1.2rem; line-height: 1; }
.mbn-item .mbn-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }

@media (max-width: 700px) {
  /* Show hamburger, hide topbar links */
  .topbar-hamburger { display: flex; }
  .topbar > a[href*="plan"].topbar-link,
  .topbar > a[href*="site"].topbar-link { display: none; }

  /* Hide My Site, Upgrade, and AI credits badge on mobile — too cramped */
  #dashCreditsBadge { display: none !important; }
  .topbar a[title="Open your public page"] { display: none !important; }
  .topbar a[title="Upgrade your plan"]     { display: none !important; }

  /* Show mobile bottom nav */
  .mobile-bottom-nav { display: flex; }

  /* Show backdrop when sidebar open */
  .sidebar-backdrop { display: block; pointer-events: none; }
  .sidebar-backdrop.open { pointer-events: auto; }

  /* Show more drawer */
  .mobile-more-drawer { display: block; }

  /* Sidebar becomes a slide-in overlay */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.4,0,.2,1);
    z-index: 150 !important;
    width: 260px !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    display: flex !important;
  }

  /* Main content: no sidebar offset, add bottom padding for bottom nav */
  .main {
    margin-left: 0 !important;
    padding: 20px 16px 80px !important;
  }

  /* Topbar: tighter on mobile */
  .topbar { padding: 0 14px; gap: 10px; }

  /* Hide topbar name on small screens */
  #topbar-av-name { display: none !important; }

  /* Upgrade button: shorter text */
  .topbar-upgrade-btn span.upgrade-full { display: none; }
  .topbar-upgrade-btn span.upgrade-short { display: inline; }

  /* Cards / grids: full width on mobile */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .plan-grid  { grid-template-columns: repeat(2, 1fr) !important; }

  /* Tables: horizontal scroll */
  .table-wrap, table { overflow-x: auto; display: block; width: 100%; }
  table { min-width: 480px; }

  /* Lead/booking cards already flex — just ensure padding */
  .lead-row, .booking-row { padding: 12px 14px; }

  /* Form fields */
  .form-row { flex-direction: column !important; }
  input, select, textarea { font-size: 16px !important; } /* prevents iOS zoom */

  /* Page title */
  .welcome-row h2 { font-size: 1.15rem; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .mbn-item .mbn-label { display: none; }
  .mbn-item { gap: 0; }
  .mbn-item .mbn-icon { font-size: 1.35rem; }
}

/* Pagie support bubble: lift above mobile bottom nav */
@media (max-width: 700px) {
  #pd-bubble  { bottom: 72px !important; right: 16px !important; }
  #pd-window  { bottom: 136px !important; right: 16px !important; }
}

