/* =========================================================
   LIFTED HANDS TEMIDAYO — Design System
   Mobile-first. Breakpoints: 560 (large phone) · 768 (tablet)
   · 1024 (laptop) · 1280 (large desktop)
   NOTE: token names (--color-green / --color-gold) are kept so every
   template keeps working; --color-green = brand blue, --color-gold = amber.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #F8FAFF;
  --color-surface: #FFFFFF;
  --color-surface-sage: #E8EEFC;
  --color-ink: #0F1B3D;
  --color-ink-soft: #4A5578;
  --color-green: #2347B8;
  --color-green-deep: #172F85;
  --color-gold: #F08A24;
  --color-gold-soft: #FDE7CC;
  --color-border: #D9E0F2;
  --color-danger: #C0392B;
  --on-primary: #FFFFFF;
  --on-gold: #2B1700;
  --header-bg: rgba(248, 250, 255, 0.88);

  --shadow-card: 0 1px 2px rgba(15, 27, 61, 0.06), 0 8px 24px rgba(15, 27, 61, 0.06);
  --shadow-lift: 0 6px 14px rgba(15, 27, 61, 0.08), 0 18px 36px rgba(15, 27, 61, 0.10);

  --font-display: 'Sora', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --content-width: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
  --color-bg: #0A1022;
  --color-surface: #121A33;
  --color-surface-sage: #18234A;
  --color-ink: #EEF1FB;
  --color-ink-soft: #A9B4D6;
  --color-green: #7C9BFF;
  --color-green-deep: #A5BAFF;
  --color-gold: #FFA64D;
  --color-gold-soft: #3A2A14;
  --color-border: #232E55;
  --on-primary: #0A1022;
  --header-bg: rgba(10, 16, 34, 0.88);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 6px 14px rgba(0, 0, 0, 0.4), 0 18px 36px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0A1022;
    --color-surface: #121A33;
    --color-surface-sage: #18234A;
    --color-ink: #EEF1FB;
    --color-ink-soft: #A9B4D6;
    --color-green: #7C9BFF;
    --color-green-deep: #A5BAFF;
    --color-gold: #FFA64D;
    --color-gold-soft: #3A2A14;
    --color-border: #232E55;
    --on-primary: #0A1022;
    --header-bg: rgba(10, 16, 34, 0.88);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 6px 14px rgba(0, 0, 0, 0.4), 0 18px 36px rgba(0, 0, 0, 0.45);
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 12px);
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
  padding-bottom: var(--safe-bottom);
  transition: background 0.2s ease, color 0.2s ease;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--color-ink);
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.2rem); }
h3 { font-size: clamp(1.08rem, 1rem + 0.5vw, 1.3rem); }
p { margin: 0 0 1em; max-width: 68ch; color: var(--color-ink-soft); overflow-wrap: break-word; }
a { color: var(--color-green-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--color-gold); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
img, video, svg { max-width: 100%; }
img { display: block; height: auto; }

.container { max-width: var(--content-width); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--color-border);
  padding-top: var(--safe-top);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1rem; letter-spacing: -0.01em; color: var(--color-ink);
}
.brand:hover { text-decoration: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__mark { width: 36px; height: 36px; flex-shrink: 0; }

.main-nav { display: none; gap: 4px; }
.main-nav a {
  color: var(--color-ink-soft); font-size: 0.93rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--color-green-deep); background: var(--color-surface-sage); text-decoration: none;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.mobile-nav-toggle .icon-close { display: none; }
.mobile-nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.mobile-nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (min-width: 1024px) { :root { --header-h: 72px; } }
@media (min-width: 1100px) {
  .main-nav { display: flex; }
  .icon-btn.mobile-nav-toggle { display: none; }
  .brand { flex-shrink: 0; }
}
@media (min-width: 1100px) and (max-width: 1279px) {
  .main-nav a { padding: 8px 11px; font-size: 0.9rem; }
}
@media (max-width: 639px) {
  :root { --header-h: 60px; }
  .header-actions .btn--ghost { display: none; }
  .header-actions .btn { padding: 8px 14px; font-size: 0.88rem; min-height: 40px; }
  .header-actions .icon-btn { width: 40px; height: 40px; }
  .brand { font-size: 0.95rem; }
  .brand__mark { width: 32px; height: 32px; }
}
@media (max-width: 479px) {
  .brand span { white-space: normal; overflow: visible; line-height: 1.12; font-size: 0.92rem; }
}
@media (max-width: 379px) {
  #installApp, #themeToggle { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  border: 1.5px solid transparent; cursor: pointer; text-align: center;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary { background: var(--color-green); color: var(--on-primary); box-shadow: 0 1px 2px rgba(15,27,61,.12); }
.btn--primary:hover { background: var(--color-green-deep); color: #fff; box-shadow: 0 6px 16px rgba(35,71,184,.30); }
:root[data-theme="dark"] .btn--primary:hover { color: var(--on-primary); }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-border); }
.btn--ghost:hover { background: var(--color-surface-sage); }
.btn--gold { background: var(--color-gold); color: var(--on-gold); }
.btn--gold:hover { box-shadow: 0 6px 16px rgba(240,138,36,.35); }
.btn--danger { background: transparent; color: var(--color-danger); border-color: var(--color-danger); }

.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: transparent;
  border: 1.5px solid var(--color-border); color: var(--color-ink);
  cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--color-surface-sage); text-decoration: none; }
.notif-dot {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-gold); border: 2px solid var(--color-bg);
}

/* ---- Mobile / tablet nav sheet (sits BELOW the header so the toggle stays tappable) ---- */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 50;
  top: calc(var(--header-h) + var(--safe-top));
  background: var(--color-bg);
  padding: 12px var(--gutter) calc(24px + var(--safe-bottom));
  overflow-y: auto; overscroll-behavior: contain;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a:not(.btn) {
  display: flex; align-items: center; min-height: 56px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  color: var(--color-ink); border-bottom: 1px solid var(--color-border);
}
.mobile-nav a:not(.btn):hover { color: var(--color-green-deep); text-decoration: none; }
.mobile-nav__actions { display: grid; gap: 12px; margin-top: 24px; }
@media (min-width: 768px) {
  .mobile-nav { left: auto; width: min(380px, 100%); border-left: 1px solid var(--color-border); box-shadow: var(--shadow-lift); }
}
@media (min-width: 1100px) { .mobile-nav { display: none !important; } }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(32px, 7vw, 88px) 0 clamp(40px, 8vw, 96px);
  background:
    radial-gradient(900px 420px at 85% -10%, var(--color-surface-sage), transparent 70%),
    radial-gradient(600px 300px at 0% 100%, var(--color-gold-soft), transparent 70%),
    var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%);
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.hero .container { position: relative; }
.hero__grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.05fr 0.95fr; } }
.hero__eyebrow {
  display: inline-block; margin-bottom: 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--color-gold-soft); color: var(--color-ink);
  font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
@media (max-width: 559px) { .hero__actions .btn { flex: 1 1 100%; } }
.hero__visual {
  aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--color-surface-sage); box-shadow: var(--shadow-lift);
  border: 1px solid var(--color-border);
}
@media (min-width: 560px) and (max-width: 899px) { .hero__visual { aspect-ratio: 16 / 9; } }
@media (min-width: 900px) { .hero__visual { aspect-ratio: 5 / 4; } }
.hero__visual img { width: 100%; height: 100%; object-fit: cover; }
.unity-motif { width: 100%; height: 100%; }

.trust-strip {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--color-border);
}
.trust-strip span { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--color-ink-soft); font-weight: 600; }
.trust-strip svg { color: var(--color-green); flex-shrink: 0; }

/* ---- Sections ---- */
.section { padding: clamp(40px, 7vw, 80px) 0; }
.section--muted { background: var(--color-surface-sage); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 16px; margin-bottom: clamp(20px, 4vw, 32px);
  padding-bottom: 16px; border-bottom: 1px solid var(--color-border); position: relative;
}
.section__head::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 3px;
  border-radius: 3px; background: var(--color-gold);
}
.section__head h2 { margin: 0; }
.section__link { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* ---- Announcements ---- */
.bulletin-list { display: flex; flex-direction: column; gap: 2px; }
.bulletin-item {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 8px 18px; align-items: start;
  padding: 18px 4px; border-bottom: 1px solid var(--color-border);
}
.bulletin-item__bar { align-self: stretch; background: var(--color-gold); border-radius: 3px; }
.bulletin-item__bar--urgent { background: var(--color-danger); }
.bulletin-item h3 { margin-bottom: 4px; }
.bulletin-item__meta { color: var(--color-ink-soft); font-size: 0.85rem; }
.bulletin-item__date { text-align: right; color: var(--color-ink-soft); font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 559px) {
  .bulletin-item { grid-template-columns: 4px 1fr; }
  .bulletin-item__date { grid-column: 2; text-align: left; white-space: normal; }
}

/* ---- Events ---- */
.event-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.event-card {
  display: flex; gap: 16px; min-width: 0;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-card);
}
.event-card > div:last-child { min-width: 0; }
.event-card__date {
  flex-shrink: 0; width: 60px; text-align: center; align-self: flex-start;
  background: var(--color-green); color: var(--on-primary);
  border-radius: 14px; padding: 9px 0; font-family: var(--font-display);
}
.event-card__date .day { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1; }
.event-card__date .month { display: block; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; margin-top: 3px; }

/* ---- Cards ---- */
.card-grid { display: grid; gap: clamp(16px, 3vw, 26px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.content-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); min-width: 0;
}
.content-card__image { aspect-ratio: 16 / 10; background: var(--color-surface-sage); overflow: hidden; }
.content-card__image img { width: 100%; height: 100%; object-fit: cover; }
.content-card__body { padding: 18px 20px 22px; }
.content-card, .event-card { transition: transform 0.16s ease, box-shadow 0.16s ease; }
@media (hover: hover) {
  .content-card:hover, .event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
}

/* ---- Value cards / CTA ---- */
.value-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.value-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 26px 22px; box-shadow: var(--shadow-card);
}
.value-card__icon {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 14px;
  background: var(--color-surface-sage); color: var(--color-green-deep);
  display: flex; align-items: center; justify-content: center;
}
.value-card h3 { margin-bottom: 6px; font-size: 1.1rem; }
.value-card p { margin: 0; font-size: 0.93rem; }
.cta-band {
  background: linear-gradient(135deg, var(--color-green-deep), var(--color-green));
  color: #fff; border-radius: var(--radius-lg);
  padding: clamp(26px, 5vw, 44px);
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
:root[data-theme="dark"] .cta-band { background: linear-gradient(135deg, #1B2B63, #2A428F); }
.cta-band h2 { color: #fff; margin-bottom: 4px; }
.cta-band p { color: rgba(255,255,255,0.82); margin: 0; }
@media (max-width: 559px) { .cta-band .btn { width: 100%; } }

/* ---- Gallery ---- */
.gallery-grid { column-count: 2; column-gap: 12px; }
@media (min-width: 768px) { .gallery-grid { column-count: 3; column-gap: 16px; } }
@media (min-width: 1280px) { .gallery-grid { column-count: 4; } }
.gallery-grid img, .gallery-grid figure {
  break-inside: avoid; margin: 0 0 12px; border-radius: var(--radius-sm); overflow: hidden; width: 100%;
}

.empty-state {
  text-align: center; padding: clamp(32px, 6vw, 56px) 20px;
  border: 1.5px dashed var(--color-border); border-radius: var(--radius-md); color: var(--color-ink-soft);
}
.empty-state h3 { margin-bottom: 6px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border); background: var(--color-surface-sage);
  padding: clamp(32px, 6vw, 56px) 0 max(24px, var(--safe-bottom)); margin-top: 40px;
}
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; } }
.footer-grid h4 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-ink-soft); margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--color-ink); margin-bottom: 4px; padding: 5px 0; font-size: 0.94rem; overflow-wrap: anywhere; }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- Forms (16px inputs stop iOS zoom-on-focus) ---- */
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: 46px; padding: 11px 14px; font: inherit; font-size: 16px;
  color: var(--color-ink); background: var(--color-surface);
  border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
}
.field textarea { min-height: 120px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--color-green); box-shadow: 0 0 0 3px rgba(35,71,184,.18);
}
.input { width: auto; min-width: 220px; }
@media (max-width: 559px) { .input { width: 100%; min-width: 0; } }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.field .hint { font-size: 0.8rem; color: var(--color-ink-soft); margin: 4px 0 0; }
.form-card {
  max-width: 480px; margin: 0 auto; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: clamp(20px, 5vw, 34px); box-shadow: var(--shadow-card);
}
.form-wide { max-width: 720px; }
.check { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 44px; }
.check input { width: 22px; height: 22px; min-height: 0; flex-shrink: 0; accent-color: var(--color-green); }

.faq { border-bottom: 1px solid var(--color-border); padding: 4px 0; }
.faq summary { cursor: pointer; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; padding: 14px 0; min-height: 48px; }
.faq[open] summary { color: var(--color-green-deep); }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(6, 10, 24, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 80vh; max-height: 80dvh; max-width: 100%; border-radius: 10px; }
.lightbox p { color: #e8ecf8; margin-top: 12px; text-align: center; }
.lightbox .icon-btn { position: absolute; top: calc(12px + var(--safe-top)); right: 12px; color: #fff; border-color: rgba(255,255,255,.45); font-size: 1.4rem; }

/* ---- Tables / badges / stats ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; vertical-align: middle; }
.table th { color: var(--color-ink-soft); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.scroll-x .table { min-width: 560px; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--color-surface-sage); color: var(--color-green-deep); }
.badge--draft { background: var(--color-gold-soft); color: var(--color-ink); }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin-bottom: 28px; }
.stat { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-card); }
.stat strong { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1; margin-bottom: 4px; }
.stat span { color: var(--color-ink-soft); font-size: 0.85rem; }
.notif-item { padding: 14px 4px; border-bottom: 1px solid var(--color-border); }
.notif-item--unread { border-left: 4px solid var(--color-gold); padding-left: 14px; }

/* =========================================================
   APP SHELL — Admin & Member areas
   Drawer under 1024px (phones + tablets), fixed sidebar on laptop
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--color-bg); }
.app-sidebar {
  width: 272px; flex-shrink: 0; background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  padding: calc(18px + var(--safe-top)) 14px calc(18px + var(--safe-bottom)); z-index: 70;
}
.app-sidebar__brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--color-ink);
}
.app-sidebar__brand:hover { text-decoration: none; }
.app-sidebar__brand svg { flex-shrink: 0; }
.app-sidebar__section-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-ink-soft); padding: 16px 10px 6px;
}
.app-sidebar__section-label:first-of-type { padding-top: 4px; }
.app-sidebar__link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 12px;
  border-radius: 12px; color: var(--color-ink); font-weight: 600; font-size: 0.92rem; line-height: 1.3;
}
.app-sidebar__link svg { flex-shrink: 0; opacity: 0.75; }
.app-sidebar__link:hover { background: var(--color-surface-sage); text-decoration: none; }
.app-sidebar__link.is-active { background: var(--color-green); color: var(--on-primary); }
.app-sidebar__link.is-active svg { opacity: 1; }
.app-sidebar__link .badge-count {
  margin-left: auto; background: var(--color-gold); color: var(--on-gold);
  font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px;
}
.app-sidebar__link.is-active .badge-count { background: rgba(255,255,255,0.92); }
.app-sidebar__bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--color-border); }
.app-sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(8, 14, 34, 0.55); z-index: 65; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--safe-top)) clamp(16px, 3vw, 32px) 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  position: sticky; top: 0; z-index: 30;
}
.app-header__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-header__title { min-width: 0; }
.app-header__title h1 { margin: 0; font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header__title p { margin: 2px 0 0; color: var(--color-ink-soft); font-size: 0.85rem; }
.app-header__right { flex-shrink: 0; }
.icon-btn.app-sidebar-toggle { display: none; }
.app-user-chip { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.app-user-chip__avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--color-green); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: var(--font-display); font-size: 0.95rem; flex-shrink: 0;
}
.app-user-chip__name { font-size: 0.85rem; font-weight: 700; line-height: 1.2; }
.app-user-chip__role { font-size: 0.75rem; color: var(--color-ink-soft); }
.app-content { padding: clamp(16px, 3vw, 32px); flex: 1; max-width: 1200px; width: 100%; min-width: 0; }

@media (max-width: 1023px) {
  .app-sidebar {
    position: fixed; inset: 0 auto 0 0; transform: translateX(-100%);
    transition: transform 0.22s ease; width: 86vw; max-width: 310px; box-shadow: var(--shadow-lift);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-sidebar-scrim.is-open { display: block; }
  .icon-btn.app-sidebar-toggle { display: inline-flex; }
  .app-user-chip__name, .app-user-chip__role { display: none; }
}
@media (max-width: 559px) {
  .app-header__title p { display: none; }
  .app-header__right { gap: 8px !important; }
  .app-header__right .btn { padding: 8px 14px; font-size: 0.85rem; min-height: 40px; }
  .app-header__right .icon-btn { width: 40px; height: 40px; }
}

/* ---- Admin tables become stacked rows on phones (actions always visible) ---- */
@media (max-width: 639px) {
  .scroll-x .table { min-width: 0; display: block; }
  .scroll-x .table thead { display: none; }
  .scroll-x .table tbody { display: block; }
  .scroll-x .table tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 14px 2px; border-bottom: 1px solid var(--color-border);
  }
  .scroll-x .table td { display: block; border: 0; padding: 0; }
  .scroll-x .table td:first-child { flex: 1 1 100%; font-weight: 700; font-size: 1rem; }
  .scroll-x .table td:last-child { flex: 1 1 100%; margin-top: 4px; }
}
