/* ==========================================================================
   GMB Consult — Design System (main.css)
   Google Business Profile management dashboard.

   Palette sampled pixel-exact from gmbconsult.in so the app and the website
   look like one product:
     #1A73E8  primary CTA ("Get a Free GMB Audit")      -> accent
     #0B57D0  headline accent ("Google Map Pack")       -> accent hover / ink
     #34A853  the green ticks, WhatsApp button          -> success
     #FAFCFF  page background                           -> page-bg
     #F3B302 / #DA4437  from the logo                   -> attention / danger

   Type: Poppins for headings (the website's heading face), Public Sans for
   UI text - Poppins is too wide and low-x-height to read well at 13px in a
   dense table - and the mono stack for figures.

   NOTE: agar website ka heading font Poppins nahi hai, to sirf --font-head
   ki ek line badal dijiye, baaki kuch nahi.
   ========================================================================== */

:root {
  /* ---- Brand / accent (sampled from gmbconsult.in) ---- */
  --accent: #1A73E8;          /* website ka primary CTA */
  --accent-hi: #4285F4;       /* glaze: gradient ka upper stop */
  --accent-hover: #0B57D0;    /* website ka headline accent */
  --accent-active: #0842A0;
  --accent-soft: #E8F0FE;
  --accent-2: #4285F4;
  --accent-ink: #0B57D0;      /* text on a blue tint */

  /* ---- Card tints ---- */
  --tint-blue:  #E8F0FE;      --tint-blue-ink:  #0B57D0;
  --tint-green: #E6F4EA;      --tint-green-ink: #0F7A3D;
  --tint-amber: #FDF3DC;      --tint-amber-ink: #8A6206;
  --tint-slate: #EDEFF3;      --tint-slate-ink: #444C57;

  /* WhatsApp ka apna rang - kisi bhi theme me yahi rehta hai */
  --whatsapp: #25D366;

  /* Google brand accents — used sparingly for status, charts, small accents */
  --google-blue: #4285f4;
  --google-green: #34a853;
  --google-yellow: #fbbc04;
  --google-red: #ea4335;

  /* ---- Surfaces ---- */
  --page-bg: #FAFCFF;         /* website ka background */
  --surface: #ffffff;         /* card / panel background */
  --surface-2: #f1f3f4;       /* subtle recessed surface (inputs, hover) */
  --sidebar-bg: #ffffff;
  --topbar-bg: #ffffff;

  /* ---- Text ---- */
  --text-1: #202124;          /* primary text */
  --text-2: #5f6368;          /* secondary text */
  --text-3: #80868b;          /* tertiary / muted text */
  --text-on-accent: #ffffff;

  /* ---- Borders / shadows ---- */
  --border: #dadce0;
  --border-soft: #e8eaed;
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.08), 0 1px 3px rgba(60, 64, 67, 0.08);
  --shadow-md: 0 2px 6px rgba(60, 64, 67, 0.12), 0 1px 2px rgba(60, 64, 67, 0.08);
  --shadow-lg: 0 8px 24px rgba(60, 64, 67, 0.16), 0 2px 6px rgba(60, 64, 67, 0.08);

  /* ---- Status colors (text-safe tones + soft backgrounds) ---- */
  --success: #1E8E4E;
  --success-bg: #E6F4EA;
  --danger: #d93025;
  --danger-bg: #fce8e6;
  --warn: #ea8600;
  --warn-bg: #fef7e0;
  --info: #0B57D0;
  --info-bg: #E8F0FE;

  /* ---- Radii / spacing ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --sidebar-w: 248px;
  --topbar-h: 64px;

  --font-head: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono",
    Menlo, monospace;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

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

html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video {
  max-width: 100%;
  display: block;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  padding-left: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.25;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

code, pre, .mono {
  font-family: var(--font-mono);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-1);
}

/* ==========================================================================
   Layout shell
   ========================================================================== */

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}

/* Overlay used to dim/close the sidebar on mobile — desktop keeps it inert */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.5);
  z-index: 40;
}

.sidebar-overlay.open {
  display: block;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Hamburger — mobile menu trigger, hidden at desktop widths */
#hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  cursor: pointer;
  flex-shrink: 0;
}

#hamburger:hover {
  background: var(--surface-2);
}

/* ---- Nav ---- */

.nav-section {
  padding: 8px 12px;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-1);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-item svg, .nav-item .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.nav-manage {
  display: flex;
  flex-direction: column;
}

.nav-manage-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.nav-manage-toggle:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.nav-manage-caret {
  margin-left: auto;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--text-3);
}

.nav-manage.open .nav-manage-caret,
.nav-manage-toggle[aria-expanded="true"] .nav-manage-caret {
  transform: rotate(180deg);
}

.nav-manage-sub {
  display: none;
  flex-direction: column;
  padding-left: 14px;
  margin-top: 2px;
  border-left: 2px solid var(--border-soft);
  margin-left: 22px;
}

.nav-manage.open .nav-manage-sub,
.nav-manage-sub.open {
  display: flex;
}

.nav-manage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}

.nav-manage-item:hover {
  background: var(--surface-2);
  color: var(--text-1);
  text-decoration: none;
}

.nav-manage-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ---- Page body ---- */

.page-body {
  padding: 24px;
  flex: 1;
  width: 100%;
  max-width: 1200px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 4px;
}

.page-desc {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 0;
}

/* ---- User pill (topbar / sidebar footer) ---- */

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  max-width: 100%;
}

.user-pill:hover {
  background: var(--surface-2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-email {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ==========================================================================
   Mobile top bar + bottom tab bar (desktop hides these — see mobile.css)
   ========================================================================== */

#wa-topbar {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 56px;
  padding: 0 14px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

/* #wa-topbar-logo is the <a>, not the image. Sizing only the anchor left the
 * <img> inside it at its natural 240x153, which spilled out of the 56px bar and
 * covered the page heading on phones. Constrain the image itself. */
/* Phone ka hamburger. #wa-topbar khud sirf mobile par dikhta hai, isliye
   iske liye alag media query ki zarurat nahi. */
#wa-hamburger {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  margin-right: 2px;
  border: 0;
  background: none;
  color: var(--text-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
#wa-hamburger:active { background: var(--surface-2); }
#wa-hamburger svg { width: 21px; height: 21px; }

#wa-topbar-logo {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 60%;
  overflow: hidden;
}

#wa-topbar-logo img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}







.wa-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-1);
  cursor: pointer;
}

.wa-dd-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.wa-dd-sep {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 4px;
}

.wa-dd-danger {
  color: var(--danger);
}

.wa-dd-danger:hover {
  background: var(--danger-bg);
}

#wa-bottomnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  align-items: stretch;
  justify-content: space-around;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.wa-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
}

.wa-tab svg, .wa-tab .icon {
  width: 20px;
  height: 20px;
}

.wa-tab.active {
  color: var(--accent);
}

.wa-tab:hover {
  text-decoration: none;
  color: var(--accent);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
  text-decoration: none;
  user-select: none;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-1);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text-1);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b3261e;
  border-color: #b3261e;
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-1);
  text-decoration: none;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}

.card-body {
  padding: 20px;
}

/* ==========================================================================
   Stat tiles
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.15;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

.badge-green {
  background: var(--success-bg);
  color: var(--success);
}

.badge-red {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Alias kept for older call sites that ask for badge-success. */
.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-blue {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-gray {
  background: var(--surface-2);
  color: var(--text-2);
}

/* Amber, not red: "waiting on the user" is not a failure. */
.badge-amber {
  background: #fef7e0;
  color: #b06000;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

/* The dialog box itself.
 *
 * All page markup uses class="modal". This rule was originally written as
 * .modal-content only, which nothing used — so the dialog got no background,
 * no width limit and no clipping, and the page behind showed straight through
 * it with both sets of text overlapping. .modal-content is kept as an alias. */
.modal,
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;   /* sits above the overlay backdrop */
}

/* Content-heavy dialogs need more room than the 480px default — the admin
   "Edit User" form is two columns of permission checkboxes. */
.modal.modal-lg,
.modal-content.modal-lg {
  max-width: 780px;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
select.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-textarea {
  min-height: 96px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input[readonly],
.form-textarea[readonly] {
  background: var(--surface-2);
  color: var(--text-2);
  cursor: default;
}

.form-input:disabled,
.form-textarea:disabled {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}

.form-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row > .form-group {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   Tables (generic, used inside .card-body)
   ========================================================================== */

.card-body table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-1);
  vertical-align: middle;
}

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

table tbody tr:hover {
  background: var(--surface-2);
}

.card-body table {
  margin: -4px 0;
}

/* ==========================================================================
   Utility classes
   ========================================================================== */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.hidden { display: none !important; }

.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-3); }

/* ==========================================================================
   Misc app-specific
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 56px 24px;
  color: var(--text-3);
}

.empty-state svg, .empty-state .icon {
  width: 40px;
  height: 40px;
  color: var(--text-3);
  margin-bottom: 10px;
  opacity: 0.8;
}

.empty-state strong {
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
}

.empty-state p {
  font-size: 13px;
  max-width: 320px;
}

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  width: 100%;
  max-width: 420px;
  padding: 0 16px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #202124;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
  max-width: 100%;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.contact-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.kw-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

.kw-tabs .kw-tab,
.kw-tabs button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}

.kw-tabs .kw-tab.active,
.kw-tabs button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.audit-detail-field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}

.audit-detail-field:last-child {
  border-bottom: none;
}

.audit-detail-field > span:first-child,
.audit-detail-field .audit-detail-label {
  color: var(--text-2);
  font-weight: 600;
  flex-shrink: 0;
}

.audit-detail-field > span:last-child,
.audit-detail-field .audit-detail-value {
  color: var(--text-1);
  text-align: right;
}

/* ---------------------------------------------------------------------------
 * Inline alerts (see showAlert/hideAlert in app.js)
 * Hidden until JS adds .show, so the empty placeholder div takes no space.
 * ------------------------------------------------------------------------- */
.alert {
  display: none;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert.show { display: block; }
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}
.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

/* ---------------------------------------------------------------------------
 * Language switcher (English / हिंदी)
 * Plain links, so it works without JavaScript and each language has a real URL.
 * ------------------------------------------------------------------------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex: none;
}
.lang-opt {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-2);
  text-decoration: none;
  background: var(--surface);
  white-space: nowrap;
}
.lang-opt + .lang-opt { border-left: 1px solid var(--border); }
.lang-opt:hover { background: var(--surface-2); color: var(--text-1); }
.lang-opt.is-on {
  background: var(--accent, #1a73e8);
  color: #fff;
}
.lang-opt:focus-visible { outline: 2px solid var(--accent, #1a73e8); outline-offset: -2px; }


/* ==========================================================================
   Typography roles (added with the brand refresh)
   Poppins carries the headings because it is the wordmark's own face.
   Body stays on Public Sans - see the note at the top of this file.
   ========================================================================== */
h1, h2, h3, h4,
.page-title, .card-title, .stat-value, .modal-title {
  font-family: var(--font-head);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.stat-value, .mono, .kv-v { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Glazed buttons
   Sab ek hi rang ke - bhara hua ya halka. Glaze teen cheezon se banta hai:
   upar se neeche gradient, andar upar ek patli safed line (ubhaar), aur
   neeche accent ka halka shadow. Hover par sheen bayen se dayen nikalti hai.
   ========================================================================== */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-active);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.30),
              0 1px 2px rgba(8,66,160,.20),
              0 8px 18px -12px var(--accent);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-active);
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34),
              0 2px 4px rgba(8,66,160,.22),
              0 12px 24px -14px var(--accent);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 66%);
  transform: translateX(-130%);
}
.btn-primary:hover::after { transform: translateX(130%); transition: transform .65s ease; }
.btn-primary:active { transform: translateY(1px); }

/* Secondary = wahi rang, halka. Do alag rang nahi. */
.btn-secondary {
  background: var(--accent-soft);
  border-color: var(--accent-2);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
  filter: brightness(1.02);
}

/* Danger apna rang rakhta hai - delete ko green dikhana khatarnaak hoga. */
.btn-danger {
  background: linear-gradient(180deg, #E2594A, var(--danger));
  border-color: #9E2018;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 8px 18px -12px var(--danger);
}
.btn-danger:hover { background: linear-gradient(180deg, #E2594A, var(--danger)); filter: brightness(1.06); }

@media (prefers-reduced-motion: reduce) {
  .btn-primary::after { display: none; }
}

/* ==========================================================================
   Colour stat tiles
   .stat-card ab rangeen ho sakta hai: .tile-green / -blue / -amber / -slate.
   Bina kisi tile-* class ke wahi purana safed card banta hai, isliye koi
   purana page toota nahi.
   ========================================================================== */
.stat-card.tile-green { --tile: var(--tint-green); --tile-ink: var(--tint-green-ink); }
.stat-card.tile-blue  { --tile: var(--tint-blue);  --tile-ink: var(--tint-blue-ink); }
.stat-card.tile-amber { --tile: var(--tint-amber); --tile-ink: var(--tint-amber-ink); }
.stat-card.tile-slate { --tile: var(--tint-slate); --tile-ink: var(--tint-slate-ink); }
.stat-card[class*="tile-"] {
  background: var(--tile);
  border-color: color-mix(in srgb, var(--tile-ink) 20%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
.stat-card[class*="tile-"] .stat-label { color: var(--tile-ink); opacity: .78; }
.stat-card[class*="tile-"] .stat-value { color: var(--tile-ink); }
.stat-card[class*="tile-"] .stat-sub   { color: var(--tile-ink); opacity: .8; }
