/* AdNeed — Dashboard (/dashboard/*) layout styles.
   Tokens/buttons/inputs come from adneed.css; this file is dashboard
   layout + a few dashboard-only components (topbar, business card,
   WhatsApp template box, usage bars, toggle switches). Mobile-first —
   business owners run this from a phone far more than a desktop. */

body.dashboard-body { background: var(--bg); }
img { max-width: 100%; display: block; }

/* Safety net: nothing on a dashboard page is meant to be wider than the
   viewport (an over-long chip/link/word is meant to WRAP, not push the
   page sideways) — this catches any such case at the html/body level
   instead of relying on every single element getting its own wrapping
   rule exactly right. */
html, body.dashboard-body { overflow-x: hidden; }

.dash-container { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------------------------------------------------------------- Topbar */
.dash-topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,250,250,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; margin-bottom: 14px;
}
.dash-topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dash-topbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy-900); min-width: 0; }
.dash-topbar-brand img { height: 28px; width: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.dash-topbar-brand span { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-topbar-actions { display: flex; align-items: center; gap: 10px; }
.dash-topbar-link { font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; background: none; border: none; cursor: pointer; font-family: 'Manrope', sans-serif; padding: 0; }
.dash-topbar-link:hover { color: var(--navy-900); }

/* AdCredits pill — a small gold coin icon + balance, shown in the header
   once someone's signed in so the balance is never more than a glance
   away. Links to /account/ (credits live there) same as the avatar next
   to it. Starts hidden (see dashboard/index.html) until auth state is known. */
.topbar-credits {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
  background: #FDF3DF; border: 1px solid #F0DBA0; border-radius: 999px;
  padding: 5px 10px 5px 6px; flex-shrink: 0;
}
.topbar-coin { width: 16px; height: 16px; flex-shrink: 0; display: block; }
.topbar-credits span {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 12.5px; color: #8A4B0A; white-space: nowrap;
}

/* Avatar — the business logo if there is one, otherwise the business
   name's initials on a rounded-square tile (a la "Praja Saree" -> "PS"),
   falling back further to "?" until we know anything at all. */
.topbar-avatar {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 9px; overflow: hidden; text-decoration: none;
  background: var(--grad); color: #fff; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 12.5px;
  letter-spacing: .3px;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Small round icon-only back button — a distinct element from the brand,
   so the AdNeed wordmark never gets swapped out / crowded by "← Back" text
   (that collision was the old .dash-topbar-back pattern's problem). */
.topbar-back-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%; color: var(--navy-900);
  text-decoration: none; transition: background .15s ease;
}
.topbar-back-btn:hover { background: rgba(15,27,46,.06); }
.topbar-back-btn svg { display: block; }

/* ------------------------------------------------------- Hamburger + drawer */
.topbar-menu-btn {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; width: 36px; height: 36px; background: none; border: none; cursor: pointer;
  padding: 0; border-radius: 8px; transition: background .15s ease; flex-shrink: 0;
}
.topbar-menu-btn:hover { background: rgba(15,27,46,.06); }
.topbar-menu-btn span {
  display: block; width: 20px; height: 2px; background: var(--navy-900); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.topbar-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.topbar-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topbar-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,27,46,.45); opacity: 0; pointer-events: none;
  transition: opacity .2s ease; z-index: 200;
}
.topbar-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.topbar-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 62%; min-width: 260px; max-width: 340px;
  background: var(--surface); box-shadow: -8px 0 24px rgba(15,27,46,.15);
  transform: translateX(100%); transition: transform .25s ease; z-index: 201;
  display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0);
}
.topbar-drawer.open { transform: translateX(0); }
.topbar-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.topbar-drawer-head span {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 13px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
}
.topbar-drawer-close {
  background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1;
  color: var(--text-muted); padding: 4px; border-radius: 6px;
}
.topbar-drawer-close:hover { background: var(--bg); color: var(--navy-900); }
.topbar-drawer-link {
  display: block; width: 100%; text-align: left; padding: 14px 20px; border: none; background: none;
  font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 15px; color: var(--text);
  text-decoration: none; cursor: pointer; transition: background .15s ease;
}
.topbar-drawer-link:hover { background: var(--bg); }
.topbar-drawer-link.is-current { color: var(--orange-500); background: rgba(232,73,29,.06); }
.topbar-drawer-logout { color: var(--error); border-top: 1px solid var(--border); margin-top: auto; }

body.drawer-open { overflow: hidden; }


/* ---------------------------------------------------------------- Cards */
.dash-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15,27,46,.06), 0 8px 24px rgba(15,27,46,.04);
  padding: 16px; margin-bottom: 14px;
}
.dash-card .section-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.dash-welcome { margin: 10px 2px 16px; }
.dash-welcome h1 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.dash-welcome p { color: var(--text-muted); font-size: 13.5px; margin: 0; }

.summary-grid { display: flex; flex-direction: column; gap: 0; }
.summary-card__business { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.summary-card__avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; overflow: hidden;
  background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 18px;
}
.summary-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.summary-card__name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; margin: 0; }
.summary-card__tagline { color: var(--text-muted); font-size: 12.5px; margin: 2px 0 0; }
.summary-card__empty { color: var(--text-muted); font-size: 13.5px; margin: 0 0 12px; }
.summary-card__action { width: 100%; justify-content: center; }

.credits-figure { font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 800; margin: 4px 0 6px; }
.credits-figure span { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.credits-note { color: var(--text-muted); font-size: 12px; line-height: 1.5; margin: 0; }

/* ---------------------------------------------------------------- Stats / usage (reserved for future AdCredits history) */
.stats-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 72px; }
.stat b { font-family: 'Sora', sans-serif; font-size: 22px; display: block; }
.stat span { font-size: 11px; color: var(--text-muted); }
.usage-row { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.usage-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.usage-label span:last-child { color: var(--text-muted); font-weight: 500; }
.usage-bar { height: 8px; border-radius: 5px; background: var(--border); overflow: hidden; }
.usage-fill { height: 100%; background: var(--grad); border-radius: 5px; transition: width .3s ease; }

/* ---------------------------------------------------------------- Tools grid ("Your tools")
   Scoped under .dash-container so this file can't leak .tag/.tool-grid
   styling onto other pages (e.g. /tools/qr-maker) that also link this
   stylesheet but define their own .tag on a different (dark) theme. */
.dash-container .section-heading { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 800; margin: 22px 2px 4px; }
.dash-container .section-lead { color: var(--text-muted); font-size: 12.5px; margin: 0 2px 12px; }
.dash-container .tool-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; }
.dash-container .tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.dash-container .tool-card h3 { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; margin: 0; }
.dash-container .tool-card p { color: var(--text-muted); font-size: 12px; margin: 0 0 4px; line-height: 1.4; }
.dash-container .tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted); background: var(--bg); border-radius: 999px; padding: 3px 8px; }
.dash-container .tag--live { color: #fff; background: var(--success, #1a9e63); }

/* ---------------------------------------------------------------- Form section title (business profile) */
.form-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--orange-500); font-weight: 700; margin-bottom: 14px; }
