:root {
  --blue: #2E9BD6;
  --blue-dark: #1F7CAE;
  --lime: #D6DE23;
  --lime-dark: #b9c00f;
  --bg: #F7F9FA;
  --text: #253238;
  --card-bg: #FFFFFF;
  --border: #E3E8EA;
  --danger: #d9534f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('../valley.jpg') center center / cover no-repeat fixed;
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
}
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--blue);
  color: white;
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-title {
  color: white;
  font-weight: 800;
  font-size: 1.3rem;
}
.brand-tagline {
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.brand .accent { color: var(--lime); }
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nav a { color: white; font-weight: 600; }
.credits-pill {
  background: var(--lime);
  color: #333;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.flash.info { background: #e6f4fb; color: var(--blue-dark); }
.flash.error { background: #fbe6e6; color: var(--danger); }
.flash.success { background: #eef8e0; color: #5a7d1c; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}

.btn {
  display: inline-block;
  background: var(--blue);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn.lime { background: var(--lime); color: #333; }
.btn.lime:hover { background: var(--lime-dark); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

form label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
textarea { min-height: 100px; resize: vertical; }

.auth-box {
  max-width: 400px;
  margin: 40px auto;
}
.auth-box h1 { text-align: center; color: var(--blue-dark); }

.grid-annonces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.annonce-card { padding: 0; overflow: hidden; }
.annonce-card img.thumb {
  width: 100%; height: 160px; object-fit: cover; display: block;
  background: var(--border);
}
.annonce-card .body { padding: 14px; }
.annonce-card h3 { margin: 0 0 6px; }
.annonce-price {
  color: var(--blue-dark);
  font-weight: 800;
}
.annonce-status {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
}
.annonce-status.active { background: #eef8e0; color: #5a7d1c; }
.annonce-status.completed { background: #eee; color: #777; }
.annonce-status.cancelled { background: #fbe6e6; color: var(--danger); }

.photo-gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-gallery img { width: 160px; height: 120px; object-fit: cover; border-radius: 8px; }

.chat-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 360px;
  overflow-y: auto;
  padding: 14px;
  background: #fafcfd;
  margin-bottom: 12px;
}
.msg { margin-bottom: 10px; max-width: 75%; padding: 8px 12px; border-radius: 10px; }
.msg.mine { background: var(--blue); color: white; margin-left: auto; }
.msg.theirs { background: #eef1f2; }
.msg small { display: block; opacity: 0.7; font-size: 0.7rem; margin-top: 2px; }

.approval-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px;
  background: #fffceb;
  border: 1px dashed var(--lime-dark);
  border-radius: 10px;
  margin-bottom: 14px;
}
.approval-status { font-weight: 700; }
.approval-status.yes { color: #5a7d1c; }
.approval-status.no { color: #999; }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem;
}
table.admin-table th { background: #f0f4f5; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type=number] { width: 100px; }

.site-footer {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  padding: 20px;
}

.helper-text { color: #777; font-size: 0.85rem; }

.help-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 84px;
  height: 84px;
  border-radius: 16px;
  background: white;
  border: 2px solid var(--lime);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
}
.help-fab:hover { background: #fbfde8; }
.help-fab-icon { font-size: 2.4rem; line-height: 1; }
.help-fab-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: center;
  line-height: 1.1;
}

.help-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 35, 0.55);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.help-modal-overlay.open { display: flex; }
.help-modal {
  background: white;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  padding: 30px 32px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.help-modal h2 { margin-top: 0; color: var(--blue-dark); }
.help-modal h3 { color: var(--blue-dark); margin-bottom: 4px; }
.help-modal p { margin-top: 4px; line-height: 1.5; }
.help-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
}
.help-modal-close:hover { color: var(--danger); }
