/* ==========================================================
   GroupHive — stylesheet
   Layout: mobile first, container maxes out at 1140px
   ========================================================== */

:root {
  --green:        #25d366;
  --green-dark:   #1da851;
  --teal:         #128c7e;
  --teal-deep:    #075e54;

  --ink:          #10241f;
  --body:         #47575a;
  --muted:        #7b8b8e;

  --bg:           #f4f7f6;
  --surface:      #ffffff;
  --line:         #e3eae8;

  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 1px 2px rgba(16, 36, 31, .05), 0 6px 20px rgba(16, 36, 31, .06);
  --shadow-lg:    0 8px 34px rgba(16, 36, 31, .13);

  --wrap:         1140px;
  --font:         system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--bg);
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}

/* Off-screen until focused. Uses logical properties so RTL hides it on the
   correct side — `left: -9999px` under dir="rtl" creates 9999px of horizontal
   scroll instead of hiding anything. */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--teal); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { inset-inline-start: 0; top: 0; }

/* Honeypot wrapper — same problem, same fix. */
.hp-field {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(18, 140, 126, .45);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.site-header {
  background: linear-gradient(135deg, var(--teal-deep), var(--teal));
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(7, 94, 84, .22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--green); display: inline-flex; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 38px;
  padding: 0 9px;
  background: rgba(255, 255, 255, .12);
  border: 0; border-radius: 9px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: #fff; border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--teal-deep);
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 6px 0 12px;
}
.site-nav.is-open { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0 16px; }
.site-nav a {
  display: block;
  padding: 11px 4px;
  color: rgba(255, 255, 255, .9);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-nav a:hover, .site-nav a.is-active { color: #fff; text-decoration: none; }
.site-nav .nav-cta a {
  margin-top: 10px;
  background: var(--green);
  color: #06251c;
  text-align: center;
  border-radius: 9px;
  border-bottom: 0;
  padding: 11px 16px;
}

.header-search { background: rgba(0, 0, 0, .12); padding: 10px 0; }

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 10px;
  padding: 4px 4px 4px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.search-icon { color: var(--muted); flex: none; }
.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 10px 2px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
}
.search-form input:focus { outline: none; }
.search-form button {
  flex: none;
  border: 0;
  background: var(--green);
  color: #06251c;
  font-weight: 700;
  font-family: inherit;
  font-size: .9rem;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.search-form button:hover { background: var(--green-dark); color: #fff; }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 12px;
  text-align: center;
}
.hero h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.hero p {
  color: var(--muted);
  margin: 0 auto;
  max-width: 60ch;
  font-size: .88rem;
  line-height: 1.45;
}

.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.hero-stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--body);
}
.hero-stat b { color: var(--ink); }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: .93rem;
  font-weight: 700;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--green); color: #06251c; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }

.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-deep); }

.btn-outline {
  background: var(--surface);
  color: var(--teal);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--teal); background: #f0f8f6; }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-sm { padding: 7px 13px; font-size: .82rem; }

.add-cta { text-align: center; margin: 12px 0 2px; }
.hero .add-cta .btn { padding: 10px 22px; font-size: .92rem; }

/* ---------------------------------------------------------
   Filter bar
   --------------------------------------------------------- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.filter-grid select,
.filter-grid input {
  width: 100%;
  font-family: inherit;
  font-size: .9rem;
  color: var(--ink);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237b8b8e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { flex: 1; }

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 22px 0 12px;
}
.result-head h2 { margin: 0; font-size: 1.15rem; }
.result-count { color: var(--muted); font-size: .87rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e7f6ef; color: var(--teal-deep);
  border: 1px solid #cdeade;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .82rem; font-weight: 600;
}
.chip a { color: inherit; opacity: .65; font-weight: 700; }
.chip a:hover { opacity: 1; text-decoration: none; }

/* ---------------------------------------------------------
   Group cards
   --------------------------------------------------------- */
.group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.group-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.group-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #cfe6df;
}

.card-top { display: flex; gap: 12px; align-items: flex-start; }

.card-avatar {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}

.card-title {
  margin: 0 0 3px;
  font-size: 1.02rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--teal); text-decoration: none; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
}
.card-meta .cat-link {
  color: var(--teal);
  font-weight: 600;
}
.card-meta .dot { opacity: .5; }

.card-desc {
  margin: 11px 0 0;
  font-size: .89rem;
  color: var(--body);
  overflow-wrap: anywhere;
}

/* Display pictures fetched from WhatsApp.
   overflow:hidden clips the blur, which otherwise bleeds past the rounded
   corners; the slight scale hides the transparent fringe blur leaves. */
.card-avatar.has-dp,
.detail-avatar.has-dp {
  overflow: hidden;
  background: var(--bg);
  padding: 0;
}
.card-avatar.has-dp img,
.detail-avatar.has-dp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  display: block;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}
.type-channel {
  background: #e7f1fb;
  border: 1px solid #c5ddf5;
  color: #14557f;
}
h1 .type-badge { font-size: .6em; margin-inline-start: 6px; }

.read-more {
  display: inline-block;
  margin-top: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--teal);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.card-foot .btn { flex: 1 1 auto; }

.share-mini { display: flex; gap: 6px; flex: none; }
.share-mini a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.share-mini a:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

.empty-state {
  background: var(--surface);
  border: 1px dashed #cfdcd8;
  border-radius: var(--radius);
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state h3 { color: var(--ink); }

/* ---------------------------------------------------------
   Category grid
   --------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
.cat-card:hover { transform: translateY(-2px); border-color: var(--green); text-decoration: none; }
.cat-emoji { font-size: 1.4rem; flex: none; line-height: 1; }
.cat-name { font-weight: 600; color: var(--ink); font-size: .9rem; line-height: 1.25; }
.cat-count { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------
   Single group page
   --------------------------------------------------------- */
.breadcrumb {
  font-size: .82rem;
  color: var(--muted);
  margin: 16px 0 10px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--teal); }

.group-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}
.detail-head { display: flex; gap: 14px; align-items: flex-start; }
.detail-avatar {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.7rem;
}
.detail-head h1 { font-size: 1.35rem; margin-bottom: 6px; overflow-wrap: anywhere; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}
.fact-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fact-value { font-weight: 600; color: var(--ink); font-size: .9rem; }

.detail-desc { white-space: pre-line; overflow-wrap: anywhere; }

.join-box {
  background: linear-gradient(135deg, #e9f9f0, #f4fbf8);
  border: 1px solid #c9ebda;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-top: 20px;
}
.join-box p { font-size: .87rem; color: var(--body); margin-bottom: 14px; }

.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: .84rem; font-weight: 600;
  color: #fff;
}
.share-btn:hover { text-decoration: none; filter: brightness(1.08); }
.share-wa { background: #25d366; color: #06251c; }
.share-tg { background: #229ed9; }
.share-tw { background: #1a1a1a; }
.share-fb { background: #1877f2; }
.share-copy { background: var(--muted); border: 0; font-family: inherit; cursor: pointer; }

.report-link { text-align: center; margin-top: 18px; font-size: .8rem; }
.report-link a { color: var(--muted); }

.related { margin-top: 34px; }

/* ---------------------------------------------------------
   Forms / pages
   --------------------------------------------------------- */
.page-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  margin: 18px 0 30px;
}

.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: .88rem;
  margin-bottom: 6px;
}
.form-field .req { color: #dc2626; }
.form-field .hint { font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 5px; }

.form-field input[type=text],
.form-field input[type=url],
.form-field input[type=email],
.form-field input[type=password],
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: .93rem;
  color: var(--ink);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--green);
  background: #fff;
}
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: #dc2626; background: #fef4f4; }
.field-error { color: #dc2626; font-size: .8rem; margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }

.char-count { font-size: .75rem; color: var(--muted); text-align: right; margin-top: 4px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  margin: 16px 0;
  font-size: .89rem;
  border: 1px solid;
}
.alert-success { background: #eafaf0; border-color: #b7e8ca; color: #14663a; }
.alert-error   { background: #fdeeee; border-color: #f4c2c2; color: #9b1c1c; }
.alert-info    { background: #eaf4fb; border-color: #bcdcf2; color: #14557f; }

.prose h2 { margin-top: 1.6em; font-size: 1.15rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }
.prose .updated { color: var(--muted); font-size: .82rem; }

/* ---------------------------------------------------------
   Pagination
   --------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 10px;
}
.page-link {
  min-width: 40px;
  padding: 9px 12px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--body);
  font-size: .88rem;
  font-weight: 600;
}
.page-link:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.page-link.is-current { background: var(--teal); border-color: var(--teal); color: #fff; }
.page-gap { padding: 9px 4px; color: var(--muted); }

/* ---------------------------------------------------------
   Ads
   --------------------------------------------------------- */
.ad-slot { margin: 18px 0; text-align: center; min-height: 90px; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer {
  background: var(--teal-deep);
  color: rgba(255, 255, 255, .78);
  margin-top: 46px;
  font-size: .88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 34px 16px 26px;
}
.footer-brand { font-weight: 800; font-size: 1.1rem; color: #fff; margin-bottom: 8px; }
.footer-about { color: rgba(255, 255, 255, .68); font-size: .85rem; }
.footer-col h4 { color: #fff; font-size: .92rem; margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255, 255, 255, .78); }
.footer-col a:hover { color: var(--green); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 14px 0;
}
.footer-bottom p {
  margin: 0;
  font-size: .78rem;
  color: rgba(255, 255, 255, .55);
  text-align: center;
}

/* Floating WhatsApp channel button — bottom-left so it never
   collides with the back-to-top button on the right. */
.wa-float {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 54px;
  padding: 0 12px;
  border-radius: 27px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 22px rgba(37, 211, 102, .45);
  overflow: hidden;
  transition: gap .22s ease, padding .22s ease, background .15s ease;
}
.wa-float:hover { background: var(--green-dark); text-decoration: none; }

.wa-float-label {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  font-size: .88rem;
  font-weight: 700;
  transition: max-width .22s ease, opacity .18s ease;
}
.wa-float:hover .wa-float-label,
.wa-float:focus-visible .wa-float-label {
  max-width: 230px;
  opacity: 1;
  margin-left: 9px;
  padding-right: 4px;
}

/* Gentle pulse to draw the eye, once the page settles */
.wa-float::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .6);
  animation: wa-pulse 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.to-top {
  position: fixed;
  right: 16px; bottom: 16px;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 40;
}
.to-top:hover { background: var(--teal-deep); }

/* ---------------------------------------------------------
   Admin
   --------------------------------------------------------- */
.admin-body { background: #eef2f4; }
.admin-bar {
  background: var(--ink);
  color: #fff;
  padding: 12px 0;
}
.admin-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-bar a { color: rgba(255, 255, 255, .8); font-weight: 600; font-size: .88rem; }
.admin-bar a:hover { color: #fff; text-decoration: none; }
.admin-bar .admin-links { display: flex; gap: 16px; flex-wrap: wrap; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
}
.stat-box .n { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-box .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 720px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: #f7faf9; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.badge-pending  { background: #fff4e0; color: #92620a; }
.badge-approved { background: #e6f7ee; color: #14663a; }
.badge-rejected { background: #fdeaea; color: #9b1c1c; }

.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 12px; }
.admin-tabs a {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--body);
}
.admin-tabs a.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.admin-tabs a:hover { text-decoration: none; }

/* Toggle switch (admin settings) */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 0;
}
.toggle-row .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.switch { flex: none; display: inline-block; cursor: pointer; }
.switch input {
  position: absolute;
  opacity: 0;
  width: 46px; height: 26px;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  display: block;
  width: 46px; height: 26px;
  background: #cbd5d3;
  border-radius: 999px;
  transition: background .18s ease;
  position: relative;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(18, 140, 126, .45);
  outline-offset: 2px;
}

.login-wrap {
  max-width: 380px;
  margin: 8vh auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------
   Breakpoints
   --------------------------------------------------------- */
@media (min-width: 600px) {
  .group-grid  { grid-template-columns: repeat(2, 1fr); }
  .cat-grid    { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row    { grid-template-columns: 1fr 1fr; }
  .detail-facts{ grid-template-columns: repeat(4, 1fr); }
  .stat-row    { grid-template-columns: repeat(4, 1fr); }
  .hero h1     { font-size: 1.5rem; }
  .group-detail, .page-card { padding: 28px; }
}

@media (min-width: 900px) {
  .group-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid   { grid-template-columns: repeat(4, 1fr); }
  .filter-grid{ grid-template-columns: repeat(3, 1fr) auto; align-items: center; }
  .filter-actions { display: flex; }
  .footer-grid{ grid-template-columns: 2fr 1fr 1fr 1fr; }

  .nav-toggle { display: none; }

  .site-nav {
    display: block;
    position: static;
    background: none;
    border: 0;
    padding: 0;
  }
  .site-nav ul { display: flex; align-items: center; gap: 4px; padding: 0; }
  .site-nav a {
    padding: 8px 13px;
    border-bottom: 0;
    border-radius: 8px;
    font-size: .92rem;
  }
  .site-nav a:hover { background: rgba(255, 255, 255, .12); }
  .site-nav a.is-active { background: rgba(255, 255, 255, .18); }
  .site-nav .nav-cta a { margin-top: 0; margin-left: 8px; }

  .hero { padding: 22px 0 18px; }
  .hero h1 { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------
   Language switcher
   --------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-lang select {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  max-width: 100%;
}
/* Native dropdown lists render on a white sheet, so options need dark text */
.nav-lang select option { color: #10241f; background: #fff; }

@media (max-width: 899px) {
  .nav-lang { padding: 10px 0 4px; }
  .nav-lang select { width: 100%; }
}

/* ---------------------------------------------------------
   Right-to-left (Arabic)

   The layout is mostly logical properties and flex, so RTL needs
   only the handful of rules that still use physical directions.
   --------------------------------------------------------- */
.rtl .card-meta,
.rtl .hero-stats,
.rtl .breadcrumb { direction: rtl; }

.rtl .search-form { padding: 4px 12px 4px 4px; }

.rtl .filter-grid select,
.rtl .filter-grid input {
  background-position: left 12px center;
  padding-right: 12px;
  padding-left: 32px;
}

.rtl .prose ul { padding-left: 0; padding-right: 1.2em; }

/* Corner-anchored floating controls swap sides */
.rtl .wa-float { left: auto; right: 16px; }
.rtl .to-top   { right: auto; left: 16px; }

.rtl .skip-link { border-radius: 0 0 0 8px; }

.rtl .switch input:checked + .switch-track .switch-thumb {
  transform: translateX(-20px);
}
.rtl .switch-thumb { left: auto; right: 3px; }

/* Arabic renders small at the Latin base size */
.rtl body,
body.rtl { font-size: 17px; }
