@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --background: #f5fbfd;
  --surface: #ffffff;
  --surface-soft: #eafcff;
  --ink: #111111;
  --muted: #606b75;
  --line: #d9edf3;
  --brand: #0fd5fc;
  --brand-dark: #111111;
  --accent: #0fd5fc;
  --success: #1d8f5f;
  --warning: #b7791f;
  --danger: #c2413b;
  --shadow: 0 18px 50px rgba(17, 17, 17, 0.08);
  --prototype-nav-height: 53px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  background: #111111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  box-shadow: 0 0 12px rgba(15, 213, 252, 0.72), 0 0 24px rgba(15, 213, 252, 0.38);
}

.button.secondary {
  background: #fff;
  color: #111111;
  border-color: var(--line);
}

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

.button.approve {
  background: var(--brand);
  color: #111;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.84rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
  background: linear-gradient(180deg, #ffffff 0%, #f4fdff 100%);
  min-width: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #111111;
  color: #f7fbfb;
  padding: 22px 16px;
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 10px;
  color: #cbd5dd;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(15, 213, 252, 0.16);
  color: #fff;
}

.nav-link img {
  width: 20px;
  height: 20px;
}

.sidebar-logout {
  margin-top: 28px;
  cursor: pointer;
}

.main-area {
  min-width: 0;
}

/* --- Base Desktop Topbar Styles --- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 28px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0; /* Ensures text truncation works if title is very long */
}

.topbar-title-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar .muted {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-company {
  font-size: 1.35rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header-title {
  font-size: 3em;
  font-weight: 600;
}

.trial-text {
  color: #b7791f;
  background: #fff4db;
  font-weight: 800;
  border-radius: 50vh;
  padding: 5px 20px;
}

.content {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 46px;
  min-width: 0;
}

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

.page-title p,
.muted {
  color: var(--muted);
}

.page-title h1,
.card h2,
.stat-card strong {
  font-weight: 600;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
  color: #fff;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #111;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: url("/resources/images/ic-icon-small.png") center/contain no-repeat;
}

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

.location-item {
  margin-top: 30px;
}

/* Card Layout */
.card.location-item {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

/* Left Image Container */
.location-media {
  position: relative;
  width: 28%; /* Keeps proportional width to match the map preview */
  min-width: 220px;
  align-self: stretch;
}

.location-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  object-fit: cover;
}

/* Overlay badge on bottom-left of map */
.map-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: #000000;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Right Side Content */
.location-content {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header & Titles */
.location-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.location-title {
  margin: 0;
  margin-bottom: 12px;
  font-size: 1.5rem;
  font-style: bold !important;
  font-weight: 700 !important;
  color: #0f172a;
}

.location-address {
  margin: 4px 0 16px 0;
  color: var(--muted);
  font-size: 1rem;
}

.pins-badge {
  background: #e6f4ea;
  color: #1e8e3e;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Info Pills Row */
.pill-row {
  display: flex;
  gap: 12px;
  margin-top: 0px;
}

.info-pill {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px;
  border-radius: 8px;
  flex: 1;
}

/* Embed Section Header & Copy Button */
.embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: #0f172a;
  margin-top: 4px;
}

.btn-copy {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: #0f172a;
}

.btn-copy:hover {
  box-shadow: 0 0 12px #0fd5fcb8, 0 0 24px #0fd5fc61;;
}

/* Dark Code Snippet Box */
.code-box {
  background: #111111;
  border-radius: 10px;
  padding: 14px;
  padding-right: 64px;
  overflow-x: hidden;
  margin-top: 6px;
  min-width: 0; 
  max-width: 100%;
  box-sizing: border-box;
}

.code-box code {
  display: block;
  color: #e8faf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

/* Action Button Row */
.action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-primary {
  background: #0d0d0d;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 6px;
}

.stat-card,
.card,
.table-wrap,
.empty-state {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  color: #111111;
}

.stat-card .delta {
  display: block;
  margin-top: 8px;
  color: var(--success);
  font-size: 0.84rem;
  font-weight: 600;
}

.pac-wrapper { position: relative; margin: 10px; }
.pac-suggestions {
  position: absolute; top: 100%; left: 12px; right: 0; z-index: 2;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid #ddd; border-radius: 4px; max-height: 300px; overflow-y: auto;
}
.pac-item { padding: 6px 10px; cursor: pointer; }
.pac-item:hover { background: #f2f2f2; }
.pac-item-secondary { color: #777; margin-left: 6px; font-size: 0.9em; }

.card {
  padding: 20px;
  flex: 1; /* Forces each child to grow equally and share total width */
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.parent-card-container {
  display: flex;
  gap: 1rem;
  width: 100%;
  margin-top: 40px;
}

.card-stat-header {
  color: var(--muted);
  font-size: 0.9em;
  margin-bottom: 12px;
}

.card-stat-value {
  font-size: 2em;
  font-weight: 600;
}

.callout-card {
  position: relative;
}

.callout-badge {
  display: inline-block;
  margin: 0 auto;
  margin-top: 20px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(15, 213, 252, 0.3);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini-stat {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--brand);
  border-radius: 8px;
}

.mini-stat b {
  display: flex;
  align-items: center;
  background: var(--brand);
  color: #fff;
  padding: 0 16px;
  font-size: 1.3rem;
}

.mini-stat > div {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.delta {
  display: block;
  margin-top: 6px;
  color: var(--success);
  font-size: 0.82rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  min-width: 640px;
}

tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
}

.icon-btn img {
  width: 22px;
  height: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.badge.success {
  background: #e7f7ef;
  color: var(--success);
}

.badge.warning {
  background: #fff4db;
  color: var(--warning);
}

.badge.danger {
  background: #fdeaea;
  color: var(--danger);
}

.divider {
  height: 1px;
  background: var(--brand);
  margin: 20px 0;
  border: 0;
}



/* Auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 38px 16px;
  background: linear-gradient(180deg, rgba(15, 213, 252, 0.12), #fff 40%), var(--background);
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
}

.auth-card .brand-logo {
  margin: 0 auto 14px;
  width: 60px;
  height: 60px;
}

.auth-card h1 {
  margin-bottom: 20px;
  font-size: 1.7rem;
  font-weight: 600;
}

.chart-card {
  background: white;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-family: system-ui, -apple-system, sans-serif;
}

.chart-title {
  color: #333;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
  text-align: left;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 213, 252, 0.18);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 17, 17, 0.5);
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal.open {
  display: flex;
}

.modal-content {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.modal-header img {
  width: 28px;
  height: 28px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--brand);
}

.modal-body {
  display: grid;
  gap: 14px;
}

.modal-body .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 16px;
}

.job-detail-image {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-soft);
}

.job-detail-list {
  display: grid;
  gap: 10px;
}

.job-detail-list p {
  margin: 0;
  color: var(--ink);
}

.job-detail-list strong {
  color: var(--muted);
  margin-right: 6px;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: none;
  place-items: center;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
}

.loading-overlay.open {
  display: grid;
}

.loading-overlay-content {
  border-radius: 8px;
  background: #111;
  color: #fff;
  padding: 12px 22px;
  font-weight: 700;
}

/* Map scans */
.scan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}

.scan-toolbar input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  min-width: 220px;
}

.scan-toolbar input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 213, 252, 0.18);
}

#map {
  height: 620px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(15, 213, 252, 0.25);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

.spinner.disabled {
  display: none;
}

.loading-percent {
  color: var(--muted);
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.keyword-recs-container {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px 16px;
  margin-top: 18px;
}

.keyword-recs-header {
  font-weight: 700;
  margin-bottom: 6px;
}

.keyword-recs-items {
  color: var(--muted);
}

.btn2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn2:hover {
  box-shadow: 0 0 12px rgba(15, 213, 252, 0.72), 0 0 24px rgba(15, 213, 252, 0.38);
}

.btn2.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.cta {
  display: inline-flex;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

/* Admin console */
.form-status {
  display: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-status.show {
  display: block;
}

.form-status.success {
  background: #e7f7ef;
  color: var(--success);
  border: 1px solid #b8e6cf;
}

.form-status.error {
  background: #fdeaea;
  color: var(--danger);
  border: 1px solid #f4c7c5;
}

.perm-note {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.perm-note strong {
  color: var(--ink);
}

/* --- Info window (Google Maps) --- */
#infowindow-content.iw-card {
  position: relative;
  min-width: 260px;
  padding: 15px 17px 16px;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #101828;
}
.iw-card .iw-title {
  padding-right: 30px;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.iw-card .iw-address {
  margin-top: 3px;
  font-size: 13px;
  color: #475467;
}
.iw-card .iw-divider {
  height: 1px;
  margin: 12px 0 10px;
  background: #eaecf0;
}
.iw-card .iw-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.iw-card .iw-label {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #98a2b3;
}
.iw-card .iw-id {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f9fafb;
  border: 1px solid #eaecf0;
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  user-select: all;
}
.iw-card .iw-copy {
  flex: none;
  padding: 4px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.iw-card .iw-copy:hover { background: #f9fafb; border-color: #98a2b3; }
.iw-card .iw-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 11px;
  padding: 3px 9px;
  border: 1px solid #fedf89;
  border-radius: 999px;
  background: #fffaeb;
  color: #b54708;
  font-size: 11px;
  font-weight: 600;
}

/* --- Drawer elements (desktop: hidden) --- */
.hamburger-btn,
.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.6);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Mobile & Tablet Breakpoint (<= 920px)
   Single consolidated block — no duplicate topbar rules elsewhere.
   ========================================================================== */
@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr; /* Single column layout */
  }

  /* Transform Sidebar into Slide-Out Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.open {
    transform: translateX(0); /* Slide in */
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }

  /* Sidebar header spacing for mobile close button */
  .brand {
    justify-content: space-between;
  }

  .sidebar-close-btn {
    display: block;
    font-size: 1.8rem;
    color: #cbd5dd;
    line-height: 1;
    padding: 0 4px;
  }

  .sidebar-close-btn:hover {
    color: var(--brand);
  }

  /* --- Topbar: keep single row, content left-aligned --- */
  .topbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 16px;
  }

  .topbar-left {
    flex: 1 1 auto;            /* consume free space so content sits left */
    justify-content: flex-start;
    text-align: left;
  }

  .topbar-title-wrapper {
    align-items: flex-start;
  }

  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    margin-left: -6px;
    color: #111;
    flex-shrink: 0;
  }

  /* Hide subtitle on mobile to keep header clean and compact */
  .topbar .muted {
    display: none;
  }

  .topbar-company {
    font-size: 0.95rem;        /* scaled down so it fits on mobile */
    white-space: normal;
  }

  .topbar .button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;            /* prevent button from shrinking */
    margin-left: auto;         /* pin button to the right */
  }

  /* --- Page layout stacking --- */
  .page-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .content {
    width: calc(100% - 32px);
    padding: 20px 0 32px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-header-title {
    font-size: 2rem;
  }

  .parent-card-container {
    flex-direction: column; /* Stack stats cards vertically */
    gap: 16px;
    margin-top: 24px;
  }

  .modal-body .field-row {
    grid-template-columns: 1fr;
  }

  /* Chart Cards Responsiveness */
  .report-frame {
    display: flex;
    flex-direction: column;
  }

  .chart-card {
    padding: 16px;
  }

  /* --- Location cards: stack image over content --- */
  .card.location-item {
    flex-direction: column;
  }

  .location-media {
    width: 100%;
    min-width: 0;         /* release the 220px desktop floor */
    height: 230px;        /* absolute-positioned img needs a height source */
    align-self: auto;
  }

  .location-content {
    padding: 20px;
    gap: 14px;
  }

  /* Pills wrap instead of crushing the code-looking middle pill */
  .pill-row {
    flex-wrap: wrap;
  }

  .info-pill {
    flex: 1 1 100%;       /* one pill per row on narrow screens */
    text-align: center;
  }

  /* Let the View button go full width for an easier tap target */
  .action-row {
    justify-content: stretch;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }
}

/* --- Extra Small Screens (<= 480px) --- */
@media (max-width: 480px) {
  .topbar {
    flex-direction: row;
    justify-content: space-between;
  }

  .topbar .muted {
    display: none; /* Hide subtitle on very small screens to save space */
  }

  #add-job-btn {
    padding: 0 12px;
    font-size: 0.85rem;
  }
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
    gap: 18px;
}

@media (max-width: 720px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* --- Clients roster --- */
.clients-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.clients-search { flex: 1 1 260px; min-width: 0; }
.clients-search, .clients-sort {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: inherit;
    font: inherit;
}
.clients-sort { cursor: pointer; }
.clients-search:focus, .clients-sort:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 213, 252, 0.18);
}
#clients-count { margin-bottom: 12px; }

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.clients-empty {
    grid-column: 1 / -1;
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

.client-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.client-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.client-name { font-weight: 700; line-height: 1.25; }
.client-slug { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.client-meta { color: var(--muted); font-size: 0.9rem; margin-top: 10px; flex: 1; }
.client-card-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}

/* Toggle switch */
.switch { display: inline-block; line-height: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    display: block; width: 44px; height: 24px; border-radius: 999px;
    background: var(--line); position: relative; cursor: pointer;
    transition: background 0.18s ease;
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:disabled + .switch-track { opacity: 0.5; cursor: default; }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(15, 213, 252, 0.35); }


#gbp-location {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px; /* room for the caret + the space after it */
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center; /* ← distance from the right edge */
  cursor: pointer;
}





