:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #627084;
  --line: #d8dee8;
  --panel: #ffffff;
  --page: #f5f7fa;
  --accent: #0e7c7b;
  --accent-2: #e4572e;
  --gold: #f2b705;
  --green: #278c5f;
  --shadow: 0 16px 36px rgba(24, 32, 42, .09);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 22px 16px 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page);
  color: var(--ink);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 150px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: #0e2430;
}

.brand strong, .brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #edf1f5;
  border-radius: 8px;
}

.tab, button, .ghost, .whatsapp, .social {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.tab {
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(280px, 620px);
  justify-content: center;
  gap: 18px;
}

.auth-form {
  width: 100%;
}

.auth-form p {
  margin: 0;
  min-height: 20px;
  color: var(--accent-2);
}

.location-consent {
  display: grid;
  gap: 7px;
}

.location-consent span {
  color: var(--muted);
  font-size: 12px;
}

.view { display: none; }
.view.active { display: block; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px 140px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

label span, label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.primary {
  min-height: 42px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.user-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.activity-panel {
  margin-bottom: 18px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.activity-head h2 {
  margin: 0;
  font-size: 16px;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}

.activity-item strong {
  color: var(--ink);
}

.discovery-feeds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.event-feeds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.feed-column {
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feed-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.feed-head h2 {
  margin: 0;
  font-size: 17px;
}

.feed-head span {
  color: var(--muted);
  font-size: 11px;
}

.feed-list {
  display: grid;
  gap: 8px;
}

.feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.feed-item > strong {
  color: var(--accent);
}

.feed-item span {
  display: grid;
  min-width: 0;
}

.feed-item b,
.feed-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item small {
  color: var(--muted);
}

.feed-item em {
  max-width: 110px;
  overflow: hidden;
  color: var(--accent-2);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-strip div {
  display: grid;
  min-width: 92px;
  gap: 2px;
}

.user-strip strong {
  font-size: 22px;
  color: var(--accent);
}

.user-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
}

.filters, form, .message-preview, .admin-table, .social-login-panel, .account-summary, .member-dashboard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  align-self: start;
  padding: 16px;
}

.filters h2, form h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: var(--ink);
  font-weight: 600;
}

.filters input {
  width: auto;
  min-height: auto;
}

.quick-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.ghost {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 12px;
  background: white;
  color: var(--accent);
  border-color: var(--line);
  font-weight: 700;
}

.results {
  display: grid;
  gap: 16px;
}

.map-panel {
  height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8f4ef;
  position: relative;
}

.map-toolbar {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(211, 222, 233, .9);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(17, 24, 39, .08);
}

.map-toolbar strong {
  display: block;
  font-size: 14px;
}

.map-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.map-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
}

.map-center {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent-2);
  color: white;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 0 8px rgba(228, 87, 46, .16);
}

.map-radius {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(68%, 520px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(14, 124, 123, .45);
  border-radius: 999px;
  background: rgba(14, 124, 123, .04);
}

.map-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(90deg, rgba(14, 124, 123, .12) 1px, transparent 1px),
    linear-gradient(rgba(14, 124, 123, .12) 1px, transparent 1px),
    linear-gradient(135deg, #e8f4ef, #f8fbfd 45%, #fff7df);
  background-size: 42px 42px, 42px 42px, auto;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  font-family: inherit;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.map-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 3px solid white;
  background: var(--accent);
  color: white;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
}

.map-marker.event {
  background: #5f5aa2;
}

.map-marker.user {
  background: var(--accent-2);
}

.map-popup {
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.map-popup strong {
  font-size: 14px;
}

.map-popup span {
  color: var(--muted);
  font-size: 12px;
}

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 28px minmax(72px, auto);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  max-width: 190px;
  min-height: 42px;
  padding: 6px 10px 6px 7px;
  border-radius: 999px 8px 8px 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.pin strong {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
}

.pin span,
.pin em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.pin.event strong { background: #5f5aa2; }
.pin.business strong { background: var(--accent); }

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

.portal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.portal-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 124px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.portal-card strong {
  color: var(--accent);
  font-size: 20px;
}

.portal-card span {
  color: var(--muted);
  line-height: 1.45;
}

.primary-portal-card {
  background: linear-gradient(135deg, #0d7774, #108785);
}

.primary-portal-card strong,
.primary-portal-card span {
  color: white;
}

.portal-listings {
  margin-bottom: 22px;
}

.business-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  overflow: hidden;
  min-height: 188px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.photo {
  background: var(--photo, linear-gradient(135deg, #0e7c7b, #f2b705));
  position: relative;
}

.photo::after {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 12px;
  color: white;
  font-weight: 800;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .32);
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, .52);
}

.detail-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  background: white;
}

.detail-media {
  min-height: 320px;
  background: var(--photo, linear-gradient(135deg, #0e7c7b, #f2b705));
  position: relative;
}

.detail-media::after {
  content: attr(data-label);
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  color: white;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.detail-body {
  display: grid;
  gap: 12px;
  padding: 26px;
}

.detail-meta {
  color: var(--muted);
}

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

.detail-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

.modal-open {
  overflow: hidden;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.meta, .description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.distance {
  align-self: start;
  padding: 5px 8px;
  border-radius: 7px;
  background: #e9f6f3;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

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

.badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.flash {
  background: #fff0e9;
  color: var(--accent-2);
}

.badge.event {
  background: #f0effa;
  color: #5f5aa2;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.whatsapp, .social, .favorite-button, .checkin-button, .share-button, .comment-button {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.whatsapp {
  background: var(--green);
  color: white;
}

.social {
  border-color: var(--line);
  color: var(--ink);
}

.favorite-button, .checkin-button, .share-button, .comment-button {
  background: white;
  border-color: var(--line);
  color: var(--accent);
}

.favorite-button.saved {
  background: #fff7df;
  border-color: rgba(242, 183, 5, .45);
  color: #8a6500;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head h1 {
  margin-bottom: 4px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.form-grid form:last-child {
  grid-column: 1 / -1;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
}

.social-login-panel,
.account-summary {
  padding: 16px;
}

.social-login-buttons {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.social-login {
  min-height: 44px;
  background: white;
  border-color: var(--line);
  color: var(--ink);
  font-weight: 800;
}

.social-login.google { border-left: 4px solid #4285f4; }
.social-login.facebook { border-left: 4px solid #1877f2; }
.social-login.instagram { border-left: 4px solid #d62976; }
.social-login.tiktok { border-left: 4px solid #111827; }
.social-login.wechat { border-left: 4px solid #07c160; }
.social-login.rednote { border-left: 4px solid #ff2442; }
.social-login.reddit { border-left: 4px solid #ff4500; }
.social-login.provider-ready { border-color: #15966a; background: #f0fff8; }

.social-register-panel {
  max-width: 760px;
  margin: 16px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: white;
}

.social-provider-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#currentUserCard {
  white-space: pre-line;
}

.member-dashboard {
  grid-column: 1 / -1;
  padding: 16px;
}

.business-owner-entry,
.owner-owned-section,
.owner-requests-section {
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
}

.business-owner-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 0;
}

.business-owner-entry h3,
.business-owner-entry p {
  margin: 0;
}

.business-owner-entry p {
  margin-top: 6px;
  color: var(--muted);
}

.owner-page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
}

.owner-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.owner-summary article {
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
  display: grid;
  gap: 5px;
}

.owner-summary strong {
  color: var(--teal);
  font-size: 28px;
}

.owner-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
  align-items: start;
}

.owner-form-grid form {
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
}

.owner-form-grid form p {
  color: var(--muted);
}

.owner-request-table .table-head,
.owner-request-table .table-row {
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
}

.owner-admin-table .table-head,
.owner-admin-table .table-row {
  grid-template-columns: 1.4fr 1.5fr .8fr .8fr 1fr 2.2fr;
}

.owner-message-table .table-head,
.owner-message-table .table-row {
  grid-template-columns: 1.2fr 1fr 1.2fr 2fr 1fr 1fr;
}

.owner-message-table .table-row span,
.comments-table .table-row span {
  white-space: pre-line;
}

.target-customer-fields {
  border: 1px solid var(--line);
  padding: 14px;
  margin: 4px 0 12px;
}

.target-customer-fields legend {
  padding: 0 7px;
  font-weight: 800;
  color: var(--teal);
}

.comment-thread {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.comment-thread-head,
.public-comment-head,
.public-reply-head,
.comment-controls {
  display: flex;
  align-items: center;
}

.comment-thread-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.comment-count,
.public-comment time,
.public-reply time {
  color: var(--muted);
  font-size: 12px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.public-comment {
  border: 1px solid var(--line);
  padding: 14px;
  background: #fff;
}

.public-comment-head {
  gap: 10px;
}

.public-comment-head > div,
.public-reply-head {
  display: grid;
  gap: 2px;
}

.public-comment > p,
.public-reply p {
  margin: 9px 0;
  line-height: 1.5;
  white-space: pre-line;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.comment-controls {
  justify-content: flex-start;
}

.comment-reply-toggle {
  padding: 0;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.comment-report-button {
  min-height: auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #a23b2a;
  font-size: 12px;
  font-weight: 700;
}

.comment-controls {
  gap: 14px;
}

.public-replies {
  display: none;
  margin: 12px 0 0 18px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.public-replies.expanded {
  display: grid;
  gap: 10px;
}

.public-reply {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #f7fafb;
  border: 1px solid var(--line);
}

.public-reply.owner-reply {
  background: #effaf7;
  border-color: #a7d9ca;
}

.public-reply.owner-reply strong::after {
  content: " Verified owner";
  margin-left: 6px;
  color: var(--teal);
  font-size: 11px;
}

.inline-reply-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  margin: 10px 0 0 32px;
}

.inline-reply-form textarea {
  min-height: 70px;
}

.inline-reply-form span {
  grid-column: 1 / -1;
  color: var(--muted);
}

.comment-form {
  border: 0;
  padding: 0;
  background: transparent;
}

.comment-form textarea {
  min-height: 85px;
}

@media (max-width: 720px) {
  .inline-reply-form {
    grid-template-columns: 1fr;
    margin-left: 12px;
  }
}

@media (max-width: 1050px) {
  .owner-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .owner-page {
    padding: 14px;
  }

  .owner-summary {
    grid-template-columns: 1fr;
  }

  .business-owner-entry {
    align-items: stretch;
    flex-direction: column;
  }
}

.member-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.member-dashboard-head h2,
.member-columns h3 {
  margin: 0;
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 180px));
  gap: 12px;
  margin-bottom: 16px;
}

.member-stats article {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.member-stats strong {
  color: var(--accent);
  font-size: 24px;
}

.member-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.member-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.member-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.member-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.member-row strong {
  color: var(--accent);
}

.saved-shop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.saved-shop-row > div:first-child {
  display: grid;
  gap: 4px;
}

.saved-shop-row span {
  color: var(--muted);
  font-size: 12px;
}

.saved-shop-actions {
  display: flex;
  gap: 7px;
}

.saved-shop-actions a {
  min-height: 34px;
  padding: 0 10px;
}

.referral-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.event-reminders {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(228, 87, 46, .3);
  border-radius: 8px;
  background: #fff8f4;
}

.referral-panel h3,
.referral-panel p {
  margin-bottom: 0;
}

.referral-panel p {
  color: var(--muted);
  font-size: 13px;
}

.referral-code-row {
  display: grid;
  grid-template-columns: minmax(160px, .5fr) minmax(260px, 1.5fr);
  gap: 12px;
}

.referral-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-discover-link {
  display: grid;
  place-items: center;
  width: max-content;
  min-height: 42px;
  margin-top: 18px;
  padding: 0 16px;
  text-decoration: none;
  border-radius: 7px;
}

form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.message-preview {
  margin-top: 18px;
  padding: 16px;
  color: var(--muted);
  white-space: pre-wrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-login {
  max-width: 420px;
}

.admin-login p {
  margin: 0;
  min-height: 18px;
  color: var(--accent-2);
  font-size: 13px;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.danger-soft {
  color: #d13f1f;
  border-color: #ffb8a8;
}

.hidden {
  display: none !important;
}

.admin-grid article {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.reward-settings {
  margin-bottom: 18px;
}

.reward-ledger {
  margin-bottom: 18px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reward-settings p {
  margin: 0;
  min-height: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.admin-grid span {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
}

.admin-table {
  overflow: hidden;
}

.analytics-table {
  margin-bottom: 18px;
}

.analytics-table .table-head,
.analytics-table .table-row {
  grid-template-columns: 1.5fr .6fr .7fr .7fr .7fr .7fr;
}

.table-head, .table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.queue-table .table-head,
.queue-table .table-row {
  grid-template-columns: 1.3fr .8fr .8fr 1fr auto;
}

.user-table {
  margin-top: 18px;
}

.user-table .table-head,
.user-table .table-row {
  grid-template-columns: 1fr 1.2fr .9fr .9fr .7fr 1fr auto;
}

.junction-admin .user-table {
  overflow-x: auto;
}

.junction-admin .user-table .table-head,
.junction-admin .user-table .table-row {
  grid-template-columns: 150px 210px 130px 90px 80px 90px 150px 90px 150px auto;
  min-width: 1320px;
}

.comments-table {
  margin-top: 18px;
}

.comments-table .table-head,
.comments-table .table-row {
  grid-template-columns: .8fr 1fr 1.2fr 2fr 1fr;
}

.report-table .table-head,
.report-table .table-row {
  grid-template-columns: 2fr 1.2fr 1.3fr .7fr 1fr 2fr;
}

.report-table .table-row span {
  white-space: pre-line;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.table-head {
  background: #edf1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

#adminRows .table-row {
  border-top: 1px solid var(--line);
}

.table-row button {
  min-height: 34px;
  padding: 0 12px;
  background: white;
  border-color: var(--line);
}

.queue-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.queue-actions .approve-button {
  color: var(--green);
  border-color: rgba(39, 140, 95, .35);
}

.queue-actions .view-button {
  color: var(--teal);
  border-color: rgba(14, 124, 123, .35);
}

.queue-actions .reject-button,
.queue-actions .delete-button {
  color: var(--accent-2);
  border-color: rgba(228, 87, 46, .35);
}

.socials a.disabled {
  color: var(--muted);
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 920px) {
  .topbar, .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar, .layout, .form-grid, .account-grid, .admin-grid, .reward-grid, .member-columns, .member-stats, .referral-code-row, .discovery-feeds, .event-feeds, .portal-actions {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    grid-template-columns: 1fr;
  }

  .detail-media {
    min-height: 190px;
  }

  .saved-shop-row {
    grid-template-columns: 1fr;
  }

  .split-fields {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main {
    padding: 14px;
  }

  .tabs {
    overflow-x: auto;
  }

  .business-card {
    grid-template-columns: 1fr;
  }

  .detail-modal {
    padding: 10px;
  }

  .detail-body {
    padding: 18px;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .photo {
    min-height: 136px;
  }

  .status-row, .card-top, .user-strip {
    flex-direction: column;
  }

  .user-strip {
    align-items: stretch;
  }
}
