:root {
  --bg-start: #fef6ea;
  --bg-end: #d9efe4;
  --ink: #112b2a;
  --muted: #44615f;
  --surface: #ffffffee;
  --accent: #0a7f63;
  --accent-2: #dd5d2a;
  --warning: #b1381d;
  --shadow: 0 18px 40px rgba(17, 43, 42, 0.12);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background: linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 0.6rem 0.8rem;
  background: #fff;
  color: #000;
  border-radius: 0 0 8px 8px;
}

.skip-link:focus {
  left: 0.6rem;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 10%, #ffffff88, transparent 32%),
    radial-gradient(circle at 90% 0%, #f9a06f44, transparent 26%),
    radial-gradient(circle at 80% 80%, #58b99f3d, transparent 30%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: #003F21;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #225d4b;
}

.topbar h1 {
  margin: 0;
  font: 700 1.6rem/1 "Space Grotesk", sans-serif;
  letter-spacing: 0.02em;
}

.topbar p {
  margin: 0.4rem 0 0;
  color: #d6ebe3;
}

.brand-copy {
  max-width: 460px;
}

.lang-select {
  width: auto;
  min-width: 72px;
  background: #f2f7f5;
  border: 1px solid #bdd5cb;
}

.layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  padding: 1rem;
}

.main-tabs {
  padding: 1rem;
}

.tab-page {
  width: 100%;
}

.panel {
  border: 1px solid #dce8e2;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-panel {
  display: flex;
  flex-direction: column;
  min-height: 80vh;
}

.side-panel {
  padding: 0.9rem;
  max-height: 80vh;
  overflow: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem;
}

.panel-header h2,
.side-panel h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.panel-header.stacked {
  flex-direction: column;
  align-items: stretch;
}

#map {
  width: 100%;
  flex: 1;
  min-height: 420px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0.6rem 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-right: 0.3rem;
}

.dot.certifie {
  background: #0a7f63;
}

.dot.annonce {
  background: #dd5d2a;
}

.dot.nonverifie {
  background: #777;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #0f6f9c);
  font-weight: 600;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #0f6f9c;
  outline-offset: 2px;
}

.btn-light {
  color: var(--ink);
  background: #f4f6f5;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-info {
  border: 1px solid #c9d8d0;
  background: #f9fbfa;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  max-width: 260px;
  word-break: break-word;
}

.address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
}

.filters > * {
  min-width: 0;
}

.field-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

#open-contribute-btn {
  margin-top: 0;
}

#contribute-section {
  margin-top: 0.7rem;
}

#add-place-section {
  margin-top: 0.7rem;
}

select,
input,
textarea {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid #c9d8d0;
  font: inherit;
  background: #fff;
}

.form-grid {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.coord-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
}

.place-card,
.review-card {
  border: 1px solid #dae7e0;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: #fff;
}

.place-card h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.place-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 1px solid #dae7e0;
}

.place-meta {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.place-rating {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.place-rating-stars {
  letter-spacing: 0.06em;
  line-height: 1;
}

.star {
  color: #bcc9c4;
}

.star.filled {
  color: #f6b800;
}

.star.half {
  color: #f0c85a;
}

.place-rating-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #2149b6;
}

.place-rating-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.inline-reviews {
  margin-top: 0.65rem;
  border-top: 1px dashed #c9d9d0;
  padding-top: 0.65rem;
}

.inline-review-wrap h5 {
  margin: 0 0 0.45rem;
  font-family: "Space Grotesk", sans-serif;
}

.inline-review-list {
  display: grid;
  gap: 0.4rem;
  max-height: 260px;
  overflow: auto;
  margin-bottom: 0.5rem;
}

.review-inline-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.star-input {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.star-btn {
  border: none;
  background: transparent;
  color: #bcc9c4;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.05rem;
}

.star-btn.is-active {
  color: #f6b800;
}

.place-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.4rem 0;
}

.badge {
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  color: #fff;
}

.badge.type {
  background: #2149b6;
}

.badge.certifie {
  background: #0a7f63;
}

.badge.annonce {
  background: #dd5d2a;
}

.badge.non_verifie {
  background: #666;
}

.place-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.product-tag {
  font-size: 0.76rem;
  border: 1px solid #c9d8d0;
  background: #f8fcfa;
  color: #315856;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

#admin-section h4 {
  margin: 0.8rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.action-navbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.site-tabs {
  position: sticky;
  top: 84px;
  z-index: 8;
  flex-wrap: wrap;
}

.site-tab-btn.active {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #0f6f9c);
}

.home-panel {
  max-width: 920px;
  margin: 0 auto;
}

.admin-navbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #dce8e2;
}

.admin-nav-btn.active {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #0f6f9c);
}

.admin-view {
  margin-top: 0.2rem;
}

.contact-widget-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 25;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #0f6f9c);
  box-shadow: 0 16px 32px rgba(17, 43, 42, 0.2);
  font: 700 0.95rem/1 "Space Grotesk", sans-serif;
  cursor: pointer;
}

.contact-shell {
  position: fixed;
  right: 1rem;
  bottom: 5.4rem;
  z-index: 24;
  width: min(420px, calc(100vw - 1.5rem));
  height: min(720px, calc(100vh - 7rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #dce8e2;
  border-radius: 22px;
  background: #fffffffa;
  box-shadow: 0 24px 60px rgba(17, 43, 42, 0.18);
  overflow: hidden;
}

.contact-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eef3f0;
  background: linear-gradient(180deg, #ffffff, #f7fbf9);
}

.contact-shell-header h3,
.contact-list-header h4,
.contact-compose-card h4,
.contact-chat-header h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.contact-layout {
  display: grid;
  gap: 0.8rem;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  padding: 0.8rem;
}

.contact-compose-card,
.contact-list-card,
.contact-chat-panel {
  border: 1px solid #dae7e0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 43, 42, 0.06);
}

.contact-compose-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
}

.contact-list-card {
  overflow: hidden;
  min-height: 0;
}

.contact-list-header {
  padding: 0.9rem 0.9rem 0.7rem;
  border-bottom: 1px solid #eef3f0;
}

.contact-thread-list {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  max-height: 180px;
  overflow: auto;
}

.contact-thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid #dae7e0;
  border-radius: 14px;
  background: #fdfefe;
  padding: 0.8rem;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.contact-thread-item:hover {
  transform: translateY(-1px);
  border-color: #bfd5cb;
}

.contact-thread-item.active {
  border-color: #0a7f63;
  background: linear-gradient(180deg, #f7fffb, #eef7f3);
}

.contact-thread-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.contact-thread-subject {
  margin: 0;
  font: 600 0.98rem/1.2 "Space Grotesk", sans-serif;
}

.contact-thread-preview {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.contact-thread-meta {
  margin-top: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.contact-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  min-height: 0;
}

.contact-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eef3f0;
}

.contact-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #eef7f3;
  color: #0a7f63;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.contact-status-badge.closed {
  background: #f8ece8;
  color: #b1381d;
}

.contact-messages {
  margin: 0;
  border: 0;
  border-radius: 0;
  min-height: 0;
  max-height: none;
  background:
    radial-gradient(circle at top left, #f7fcf9, transparent 28%),
    linear-gradient(180deg, #fbfdfc, #f3f8f5);
}

.contact-empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  text-align: center;
  color: var(--muted);
}

.contact-empty-state p {
  margin: 0.35rem 0 0;
}

.contact-reply-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  padding: 1rem;
  border-top: 1px solid #eef3f0;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.contact-reply-bar textarea {
  min-height: 52px;
  max-height: 140px;
  resize: vertical;
}

#admin-section a {
  color: #0f6f9c;
}

.hidden {
  display: none !important;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 340px;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  color: #fff;
  background: #2f3432;
  box-shadow: var(--shadow);
}

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

.chat-box {
  border: 1px solid #d7e4dd;
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem;
  min-height: 140px;
  max-height: 280px;
  overflow: auto;
  margin-bottom: 0.6rem;
}

.chat-message {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.contact-messages .chat-message {
  max-width: 78%;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  margin-bottom: 0.7rem;
}

.contact-messages .chat-message.user {
  margin-left: auto;
  border-bottom-right-radius: 6px;
}

.contact-messages .chat-message.admin {
  margin-right: auto;
  border-bottom-left-radius: 6px;
}

.chat-message-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  opacity: 0.75;
}

.chat-message.user {
  background: #eef7f3;
  border: 1px solid #cfe3d9;
}

.chat-message.admin {
  background: #f4f6fb;
  border: 1px solid #d9dfef;
}

@media (max-width: 980px) {
  .site-tabs {
    top: 76px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 0;
  }

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

  .main-tabs {
    padding: 0.7rem;
  }

  .contact-shell {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 4.8rem;
    width: auto;
    height: min(78vh, 680px);
  }

  .contact-chat-panel {
    min-height: 460px;
  }

  .contact-reply-bar {
    grid-template-columns: 1fr;
  }

  .side-panel,
  .map-panel {
    max-height: none;
    min-height: 55vh;
  }

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

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

}
