:root {
  --yellow: #f5b70a;
  --yellow-soft: #fff6d9;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e6e6e9;
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --green: #1f9d55;
  --green-soft: #e3f6ea;
  --blue: #2f7cf6;
  --red: #c93434;
  --radius: 10px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; background: var(--bg); }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; min-height: 38px;
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary, .btn.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: #e9ab00; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn.toggle.on.visited { background: var(--green); border-color: var(--green); color: #fff; }
.btn.toggle.on.wish { background: var(--yellow-soft); border-color: var(--yellow); }
.btn.toggle.on.home { background: #eaf1fe; border-color: var(--blue); color: #1d4fb0; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.link-btn.danger, .danger { color: var(--red); }
.btn-primary-inline { font-weight: 700; }
.popup .btn-primary, .popup button.btn-primary {
  border: 0; background: var(--yellow); border-radius: 7px; padding: 7px 10px; font-weight: 700; font-size: 13px; width: 100%;
}

/* ---------- Top bar ---------- */
.topbar { min-height: 60px; display: flex; align-items: center; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; }
.flag-img { display: inline-block; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); object-fit: cover; }
.country-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 13px; font-weight: 600; margin-left: 4px; }
.country-btn:hover { background: var(--bg-soft); }
.country-btn .caret { color: var(--muted); font-size: 11px; }
.country-search { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; margin-bottom: 10px; }
.country-suggest { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.country-list { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.country-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-bottom: 1px solid var(--bg-soft); background: #fff; padding: 9px 12px; text-align: left; font-size: 15px; }
.country-row:hover { background: #fffaeb; }
.country-row.is-current { background: var(--yellow-soft); font-weight: 700; }
.country-row .cn { flex: 1; }
.country-suggest .country-row { border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.events-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.events-title-row h1 { margin: 0; }
.event-country { font-size: 20px; font-weight: 700; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; background: #fff; max-width: 100%; }
.unverified-line { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }
.unverified-note { background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px !important; color: var(--muted); }
.tag-unverified { background: #f1f1f3; color: #8a8a90; }
.link-strong { border: 0; background: none; padding: 0; font-weight: 700; text-decoration: underline; color: var(--ink) !important; font-size: 13px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--yellow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 20 L9 8 L12 13 L15 9 L21 20 Z' fill='%231d1d1f'/%3E%3C/svg%3E");
  background-size: 20px; background-position: center; background-repeat: no-repeat;
}
.tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 999px; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.locate { margin-left: auto; display: flex; gap: 6px; }
.locate input { width: 170px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.account { display: flex; }
.avatar-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px 3px 3px; font-weight: 600; font-size: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-weight: 800; }
.avatar-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.location-status { padding: 7px 16px; font-size: 13px; background: #fff8e1; border-bottom: 1px solid #f3e2a8; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.location-status.is-error { background: #fdecec; border-color: #f3c2c2; }
.location-status button { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 0; }

/* ---------- Panels ---------- */
.tab-panel { flex: 1; min-height: 0; }
#tab-map { display: flex; }
.scroll-panel { overflow-y: auto; background: var(--bg-soft); }
.page-inner { max-width: 820px; margin: 0 auto; padding: 28px 20px 60px; }
.page-inner.wide { max-width: 1100px; }
.page-head h1 { margin: 0 0 4px; font-size: 28px; }
.page-head p { margin: 0 0 18px; }

/* ---------- Sidebar ---------- */
.sidebar { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
/* Indoor / Outdoor switch at the top of the map sidebar */
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 14px 0; padding: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; }
.mode-toggle button { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: transparent; padding: 8px 6px; border-radius: 7px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.mode-toggle button svg { width: 16px; height: 16px; fill: currentColor; }
.mode-toggle button:hover { color: var(--ink); }
.mode-toggle button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.mode-toggle button[data-mode="outdoor"].is-active { color: #1f6b3a; }
.is-outdoor .gym-item:hover, .is-outdoor .gym-item.is-selected { background: #eef7f0; }
.search { padding: 14px 14px 8px; }
.search input, .admin-toolbar input[type=search] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); outline-offset: -1px; background: #fff; }
.chips { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.list-meta { padding: 4px 14px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.gym-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.gym-item { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.gym-item:hover, .gym-item.is-selected { background: #fffaeb; }
.gym-item .name { font-weight: 600; font-size: 15px; }
.gym-item .where { font-size: 13px; color: var(--muted); grid-column: 1; }
.gym-item .dist { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; font-size: 14px; white-space: nowrap; }
.gym-item .dist small { font-weight: 500; color: var(--muted); }
.flag { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 11px; font-weight: 800; margin-right: 5px; vertical-align: 1px; }
.flag.visited { background: var(--green); color: #fff; }
.flag.wish { background: var(--yellow-soft); color: #9a6a00; }
.flag.home { background: #eaf1fe; color: #1d4fb0; }
.mini-rating { color: #9a6a00; font-weight: 600; }
.empty { padding: 24px 14px; color: var(--muted); font-size: 14px; }
.add-gym-link { border: 0; border-top: 1px solid var(--line); background: var(--bg-soft); padding: 11px; font-size: 13px; font-weight: 600; color: var(--muted); }
.add-gym-link:hover { color: var(--ink); }

.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; background: var(--bg-soft); color: var(--muted); margin-right: 4px; }
.tag-bouldering { background: #fff1c7; color: #8a6400; }
.tag-roped { background: #e3efff; color: #1e5aa8; }
.tag-both { background: #e7f6ea; color: #23793a; }
.tag-unknown { background: #f1f1f3; color: #8a8a90; }
.tag-reset { background: #f3e8ff; color: #6b35a8; }
.tag-gym_info { background: #e3efff; color: #1e5aa8; }
.tag-new_gym { background: #e7f6ea; color: #23793a; }

.tag-kind-competition { background: #fde8e8; color: #a12828; }
.tag-kind-festival { background: #f3e8ff; color: #6b35a8; }
.tag-kind-other { background: var(--bg-soft); color: var(--muted); }
.event-meta { border: 0; padding: 0 0 4px; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; padding: 0; margin: -4px 0 16px; }
.visit-form .row { gap: 12px; }
.stars { color: var(--yellow); letter-spacing: 1px; }
.stars .off { color: #ddd; }

/* ---------- Map & markers ---------- */
.map-wrap { flex: 1; min-width: 0; position: relative; display: flex; }
.map { flex: 1; min-width: 0; background: #e8eef0; }
.gym-marker {
  width: 30px; height: 30px; border-radius: 8px; background: var(--yellow); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; transition: transform .12s; position: relative;
}
.gym-marker svg { width: 18px; height: 18px; fill: var(--ink); stroke: var(--ink); }
.gym-marker:hover, .gym-marker.is-selected { transform: scale(1.18); }
.gym-marker.is-selected { background: var(--ink); }
.gym-marker.is-selected svg { fill: var(--yellow); stroke: var(--yellow); }
.gym-marker.is-visited { background: var(--green); }
.gym-marker.is-visited svg { fill: none; stroke: #fff; }
.gym-marker.is-home { box-shadow: 0 0 0 3px var(--blue), 0 1px 4px rgba(0,0,0,.35); }
.gym-marker.is-wish::after { content: "★"; position: absolute; top: -9px; right: -9px; font-size: 13px; line-height: 16px; width: 16px; text-align: center; background: #fff; color: #e0a100; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
/* outdoor crags: green pins and clusters */
.crag-marker { width: 28px; height: 28px; border-radius: 50%; background: #2f8a4c; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.crag-marker svg { width: 16px; height: 16px; fill: #fff; }
.crag-marker.is-boulder { background: #8a5a2b; }
.crag-marker:hover, .crag-marker.is-selected { transform: scale(1.2); }
.crag-marker.is-selected { background: var(--ink); }
.crag-marker { position: relative; }
.crag-marker.is-visited { background: var(--green); box-shadow: 0 0 0 2px #2f8a4c, 0 1px 4px rgba(0,0,0,.35); }
.crag-marker.is-wish::after { content: "★"; position: absolute; top: -9px; right: -9px; font-size: 13px; line-height: 16px; width: 16px; text-align: center; background: #fff; color: #e0a100; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.crag-badge { width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; background: #2f8a4c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 20 L7 9 L10 13 L14 5 L22 20 Z' fill='white'/%3E%3C/svg%3E") center / 30px no-repeat; }
.crag-badge.is-boulder { background-color: #8a5a2b; }
.crag-cluster { background: #2f8a4c; color: #fff; font-weight: 800; font-size: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.crag-popup .crag-tags { margin: 2px 0 6px; }
.crag-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.crag-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.tag-style-trad { background: #e3efff; color: #1e5aa8; }
.tag-style-sport { background: #fde8e8; color: #a12828; }
.tag-style-boulder { background: #fff1c7; color: #8a6400; }
.tag-style-dws { background: #dff4f7; color: #146a78; }
.tag-rock { background: #efe9e1; color: #6b5640; text-transform: none; letter-spacing: 0; }
.gym-cluster { background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 14px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.you-marker { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,124,246,.25), 0 1px 3px rgba(0,0,0,.4); }

.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 14px 16px; min-width: 230px; font-family: inherit; }
.popup h3 { margin: 0 0 3px; font-size: 16px; }
.popup-title, .gp-title { display: flex; align-items: center; gap: 10px; }
.popup-title > div, .gp-title > div { min-width: 0; }
.gym-logo { flex: none; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; padding: 5px;
  background: #fff; border: 1px solid var(--line, #e3e3e3); border-radius: 12px; overflow: hidden; }
.gym-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.gym-logo.sm { width: 44px; height: 44px; padding: 3px; border-radius: 9px; }
.popup .food-line { font-size: 13px; margin: 7px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.food-box h3, .parking-box h3 { margin-bottom: 4px; }
.popup .where { color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.popup .dist-line, .popup .reset-line { font-size: 13px; margin: 7px 0; }
.popup .events-line { font-size: 13px; margin: 6px 0; }
.popup .actions { margin-top: 10px; }
.popup-flag { font-size: 12px; font-weight: 700; margin-top: 6px; }
.popup-flag.visited { color: var(--green); }
.popup-flag.wish { color: #9a6a00; }
.rating-inline { font-size: 12px; }
.approx-note { font-size: 12px; color: #9a6a00; }

/* ---------- Gym drawer ---------- */
.gym-panel { width: 400px; flex-shrink: 0; border-left: 1px solid var(--line); background: #fff; overflow-y: auto; }
.gp-head { padding: 18px 18px 12px; position: relative; }
.gp-head h2 { margin: 0 30px 3px 0; font-size: 21px; line-height: 1.2; }
.gp-close { position: absolute; top: 12px; right: 12px; border: 0; background: var(--bg-soft); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; }
.gp-tags { margin-top: 8px; font-size: 13px; }
.gp-personal { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.gp-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 12px; position: sticky; top: 0; background: #fff; z-index: 2; }
.gp-tabs button { border: 0; background: none; padding: 10px 8px; margin-right: 6px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; }
.gp-tabs button.is-active { color: var(--ink); border-bottom-color: var(--yellow); }
.gp-body { padding: 4px 18px 30px; }
.gp-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.gp-section:last-child { border-bottom: 0; }
.gp-section h3 { margin: 0 0 8px; font-size: 15px; }
.gp-section p { margin: 0 0 8px; font-size: 14px; }
.link-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.reset-box { background: #faf7ff; margin: 12px -18px; padding: 14px 18px; border: 0; }
.reset-box.unknown { background: var(--bg-soft); }
.reset-info { font-weight: 600; font-size: 15px !important; }
.gp-event { font-size: 14px; margin: 4px 0; }
.gp-foot { font-size: 13px; color: var(--muted); }

/* planner */
.plan-event-banner { background: var(--yellow-soft); border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.plan-form { display: grid; grid-template-columns: 1fr 1fr 80px; gap: 8px; margin: 14px 0 4px; }
.plan-form label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.plan-form input { padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; color: var(--ink); width: 100%; }
.travel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.travel-opt { text-decoration: none; border: 1px solid var(--line); border-radius: 9px; padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.travel-opt span { font-size: 20px; }
.travel-opt:hover, .stay-opt:hover { border-color: var(--yellow); background: #fffaeb; }
.stay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stay-opt { text-decoration: none; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: flex; flex-direction: column; font-size: 14px; }
.stay-opt span { font-size: 12px; color: var(--muted); }
.station-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.station-list li { padding: 4px 0; }
.checklist { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.checklist li { margin: 4px 0; }

/* reviews */
.review-form { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
.review-form h3 { margin: 0 0 6px; font-size: 15px; }
.review-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 8px; resize: vertical; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input span { font-size: 28px; color: #d6d6d6; cursor: pointer; line-height: 1; }
.star-input label:has(input:checked) span, .star-input label:has(input:checked) ~ label span,
.star-input label:hover span, .star-input label:hover ~ label span { color: var(--yellow); }
.star-input input:focus-visible + span { outline: 2px solid var(--ink); border-radius: 4px; }
.review { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.review p { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }

/* ---------- Events ---------- */
.page-inner .chips { padding: 0 0 18px; }
.month-heading { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }
.event-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start; margin-bottom: 10px; }
.event-date { background: var(--yellow); border-radius: 8px; text-align: center; padding: 6px 0; font-weight: 800; line-height: 1.1; }
.event-date .d { font-size: 22px; display: block; }
.event-date .m { font-size: 12px; text-transform: uppercase; display: block; }
.event-date.tbc { background: var(--bg-soft); color: var(--muted); font-size: 12px; padding: 14px 0; }
.event-card h3 { margin: 0 0 3px; font-size: 17px; }
.gym-link { font-size: 14px; color: var(--ink); font-weight: 600; background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.event-card p { margin: 6px 0 0; font-size: 14px; color: #444; }
.event-card .right { text-align: right; font-size: 13px; white-space: nowrap; }
.event-card .right strong { font-size: 15px; display: block; }
.event-card .right .btn { margin-top: 8px; }
.event-card .right a { display: inline-block; margin-top: 8px; font-weight: 600; }

/* ---------- Cards / profile ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.me-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.stat-n { font-size: 26px; font-weight: 800; }
.stat-l { font-size: 13px; color: var(--muted); }
.progress { height: 8px; background: #e9e9ec; border-radius: 4px; overflow: hidden; margin-bottom: 18px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.simple-list { list-style: none; padding: 0; margin: 0 0 10px; }
.simple-list li { padding: 7px 0; border-bottom: 1px solid var(--bg-soft); font-size: 14px; }
.status { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; margin-right: 6px; }
.status-pending { background: #fff1c7; color: #8a6400; }
.status-approved { background: var(--green-soft); color: #23793a; }
.status-rejected { background: #fdecec; color: var(--red); }

/* ---------- Admin ---------- */
.admin-nav { padding: 0 0 16px !important; }
.admin-toolbar { margin-bottom: 12px; flex-wrap: nowrap; }
.nowrap { white-space: nowrap; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.admin-table th, .admin-table td, .diff th, .diff td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th, .diff th { background: var(--bg-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.admin-table tr.is-hidden td { opacity: .55; }
.sub-card blockquote { margin: 8px 0; padding: 8px 12px; background: var(--bg-soft); border-left: 3px solid var(--yellow); border-radius: 4px; font-size: 14px; }
.sub-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; margin: 8px 0; }
.sub-form input, .sub-form textarea, .sub-form select, .diff input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; width: 100%; font-weight: 400; }
.diff { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.empty-state { text-align: center; padding: 40px; font-size: 16px; }

/* ---------- Modal & forms ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 24px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.modal.wide { width: min(640px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(20,20,25,.45); }
dialog.modal h2 { margin: 0 0 6px; font-size: 21px; }
dialog.modal p { margin: 0 0 14px; }
.modal-x { position: absolute; top: 12px; right: 12px; border: 0; background: var(--bg-soft); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; }
dialog form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
dialog form input:not([type=checkbox]):not([type=radio]), dialog form select, dialog form textarea, select.full {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-weight: 400; width: 100%; background: #fff;
}
dialog form label.check, .sub-form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form .row { flex-wrap: nowrap; margin-bottom: 12px; }
dialog form .grid-form .row > input, .grid-form .row > input { flex: 1; width: auto; }
.grid-form.compact label { margin: 4px 0; }
.form-msg { font-size: 13px; min-height: 1em; margin: 8px 0 0 !important; color: var(--red); }
.form-msg.ok { color: var(--green); }
.day-picks { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.day-picks legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.day-picks label { margin: 0 !important; }
.day-picks input { position: absolute; opacity: 0; }
.day-picks span { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-weight: 600; cursor: pointer; }
.day-picks input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.day-picks input:focus-visible + span { outline: 2px solid var(--yellow); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 9999; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .gym-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 1000; box-shadow: -6px 0 20px rgba(0,0,0,.15); }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .locate { margin-left: 0; order: 5; width: 100%; }
  .locate input { flex: 1; width: auto; }
  .account { margin-left: auto; }
  .avatar-name { display: none; }
  .country-btn .country-name { display: none; }
  .tabs { overflow-x: auto; max-width: 100%; }
  #tab-map { flex-direction: column-reverse; }
  .sidebar { width: 100%; height: 42%; border-right: 0; border-top: 1px solid var(--line); }
  .gym-panel { width: 100%; }
  .event-card { grid-template-columns: 56px 1fr; }
  .event-card .right { grid-column: 2; text-align: left; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .grid-form { grid-template-columns: 1fr; }
}
