/* SYLO - Shared Styles (based on original design) */
:root {
  --yellow: #f5c400;
  --yellow2: #ffd83d;
  --black: #0c0c0d;
  --dark: #171719;
  --gray: #2a2a2d;
  --mid: #6f7075;
  --light: #f3f3f4;
  --white: #ffffff;
  --border: #dedee2;
  --shadow: 0 12px 35px rgba(0,0,0,.12);
  --radius: 18px;
}
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: #f6f6f7;
  color: #171719;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}
img, video, iframe {
  max-width: 100%;
  height: auto;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,12,13,.96);
  color: white;
  border-bottom: 3px solid var(--yellow);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1450px; margin: auto; padding: 13px 22px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--yellow); color: #111;
  display: grid; place-items: center; font-weight: 950; font-size: 14px;
}
.brand-title { font-weight: 900; letter-spacing: .5px; line-height: 1.05; }
.brand-title small { display: block; color: #bdbdc1; font-size: 11px; font-weight: 600; margin-top: 3px; }
.top-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
  border: 0; border-radius: 11px; padding: 11px 17px; font-weight: 800;
  transition: .2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn-yellow { background: var(--yellow); color: #111; }
.btn-dark { background: #252528; color: #fff; border: 1px solid #46464b; }
.btn-light { background: white; color: #151517; border: 1px solid var(--border); }
.btn-danger { background: #2a2a2d; color: #fff; }
.btn-block { width: 100%; }

/* Hero */
.hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(245,196,0,.28), transparent 28%),
    linear-gradient(135deg, #111 0%, #222 58%, #151515 100%);
  color: white; padding: 48px 22px 42px;
}
.hero-inner {
  max-width: 1450px; margin: auto;
  display: grid; grid-template-columns: 1.4fr .6fr;
  gap: 35px; align-items: center;
}
.hero h1 { font-size: clamp(34px, 5vw, 66px); margin: 0 0 12px; font-weight: 950; letter-spacing: -1.5px; }
.hero h1 span { color: var(--yellow); }
.hero p { color: #d4d4d7; max-width: 760px; font-size: 16px; line-height: 1.65; margin: 0 0 24px; }
.hero-logo-box {
  width: min(270px, 70vw); height: min(270px, 70vw);
  margin: auto; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: 48px; font-weight: 950; color: #111;
  box-shadow: 0 18px 30px rgba(0,0,0,.35);
}

/* Layout */
.container { max-width: 1450px; margin: auto; padding: 28px 22px 55px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 28px 0 15px; }
.section-title h2 { margin: 0; font-size: 24px; }
.section-title p { margin: 0; color: #707076; font-size: 13px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.stat {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.05); position: relative; overflow: hidden;
}
.stat:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--yellow); }
.stat .num { font-size: 32px; font-weight: 950; margin: 8px 0 2px; }
.stat .label { font-size: 12px; color: #6f7075; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; width: 100%; max-width: 100%; box-sizing: border-box; }
.card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.05);
  max-width: 100%; box-sizing: border-box;
}
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.card h3 { margin: 0 0 14px; font-size: 18px; }
.muted { color: #73747a; font-size: 13px; }
.badge {
  display: inline-flex; padding: 5px 9px; border-radius: 999px;
  background: #fff2ad; color: #6b5500; font-size: 11px; font-weight: 900;
}

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; width: 100%; max-width: 100%; box-sizing: border-box; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 900; color: #4d4d52; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  width: 100%; max-width: 100%; border: 1px solid #cfcfd3; border-radius: 10px; padding: 11px 12px;
  background: #fff; outline: none; box-sizing: border-box;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #b38c00; box-shadow: 0 0 0 3px rgba(245,196,0,.18);
}
.login-box {
  max-width: 420px; margin: 60px auto; background: #fff;
  border: 1px solid var(--border); border-radius: 22px; padding: 28px;
  box-shadow: var(--shadow); border-top: 4px solid var(--yellow);
}
.login-box h1 { margin: 0 0 8px; font-size: 24px; }
.alert {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; font-weight: 600;
}
.alert-error { background: #ffe8e8; color: #8b1a1a; border-left: 4px solid #c0392b; }
.alert-success { background: #eaffea; color: #176b17; border-left: 4px solid #27ae60; }
.alert-info { background: #fff7cc; color: #5d4b00; border-left: 4px solid var(--yellow); }

/* Admin / Member shell — FIXED sidebar; ONLY .main scrolls
   Public dashboard also uses page-fade but MUST keep page scrollbar —
   so lock overflow only when .shell (admin/member layout) is present. */
body.app-shell:has(.shell) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  max-width: 100vw;
}
/* Public site / pages without .shell — normal page scroll */
body.app-shell:not(:has(.shell)) {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100vw;
}
/* Public dashboard — always allow normal page scrollbar */
body.public-site {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-width: 100vw;
}
.shell {
  display: block;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #f5f5f6;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}
.side {
  background: #111;
  color: #fff;
  border-right: 3px solid var(--yellow);
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: fixed;
  left: 0;
  top: 0;
  width: 265px;
  max-width: 265px;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  z-index: 100;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 7px 18px; border-bottom: 1px solid #3d3d40; min-width: 0; }
.side-brand .logo {
  width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); color: #111;
  display: grid; place-items: center; font-weight: 950; flex: none;
}
.side-brand strong { font-size: 13px; line-height: 1.15; }
.side-brand small { display: block; color: #aaa; margin-top: 4px; font-size: 10px; word-break: break-word; }
.side nav { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.side nav a, .side nav button {
  border: 1px solid transparent; background: transparent; color: #d8d8dc;
  text-align: left; padding: 12px 13px; border-radius: 11px; font-weight: 800;
  display: block; width: 100%; box-sizing: border-box;
}
.side nav a:hover, .side nav a.active,
.side nav button:hover, .side nav button.active {
  background: var(--yellow); color: #111; border-color: var(--yellow);
}
.side .logout {
  margin-top: auto; background: #242427; color: #fff; border: 1px solid #454549;
  padding: 12px 13px; border-radius: 11px; font-weight: 800; text-align: left;
}
.side .logout:hover { color: var(--yellow); background: #333; }
/* Main content: only this area scrolls; sidebar stays fixed */
.main {
  margin-left: 265px;
  min-width: 0;
  width: calc(100% - 265px);
  max-width: calc(100% - 265px);
  height: 100vh;
  height: 100dvh;
  padding: 28px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.main > .card,
.main > .grid,
.main > .admin-stats,
.main > .stats,
.main > form,
.main > .alert {
  max-width: 100%;
  box-sizing: border-box;
}
.main .grid {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.main .card {
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.main-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
  max-width: 100%;
  flex-wrap: wrap;
}
.main-top h1 { margin: 0; font-size: 28px; word-break: break-word; }
.main-top p { margin: 5px 0 0; color: #707076; font-size: 13px; }

/* Admin stats */
.admin-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.admin-stats .admin-stat { min-width: 0; }
.admin-stat {
  background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
}
.admin-stat b { font-size: 25px; display: block; margin-top: 5px; }
.admin-stat span { font-size: 10px; text-transform: uppercase; font-weight: 900; color: #777; }

/* Tables — fixed area; own scrollbar when records grow (sidebar never moves) */
.data-table-wrap {
  overflow: auto;
  border: 1px solid #e5e5e7;
  border-radius: 12px;
  max-width: 100%;
  width: 100%;
  max-height: min(55vh, 480px);
  max-height: min(55dvh, 480px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow) #e8e8ea;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
}
.data-table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.data-table-wrap::-webkit-scrollbar-track {
  background: #e8e8ea;
  border-radius: 8px;
}
.data-table-wrap::-webkit-scrollbar-thumb {
  background: var(--yellow);
  border-radius: 8px;
  border: 2px solid #e8e8ea;
}
.data-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #d4a800;
}
.data-table-wrap::-webkit-scrollbar-corner {
  background: #e8e8ea;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  table-layout: auto;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5e7;
  text-align: left;
  vertical-align: middle;
}
/* Long text wraps; actions stay on one line */
.data-table th {
  background: #111;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  box-shadow: 0 1px 0 #e5e5e7;
}
.data-table td {
  white-space: normal;
  word-break: break-word;
  max-width: 320px;
}
.data-table td:last-child,
.data-table th:last-child {
  white-space: nowrap;
  max-width: none;
  width: 1%;
}
.data-table .td-actions,
.data-table td.actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  max-width: none;
}
.data-table .td-actions form,
.data-table td.actions form {
  margin: 0;
  display: inline-flex;
}
/* Cards spacing — avoid form/table stacking overlap */
.main .card + .card {
  margin-top: 16px;
}
.main .card {
  position: relative;
  z-index: 0;
  overflow: visible;
}
.status-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 950;
  text-transform: uppercase; border: 1px solid #bbb;
}
.status-chip.active { background: #eaffea; color: #176b17; border-color: #7fcf7f; }
.status-chip.pending { background: #fff4c4; color: #735900; }
.status-chip.expired { background: #f2f2f2; color: #777; }

/* Footer */
.footer {
  background: #0c0c0d; color: #cfcfd2; padding: 28px 22px; text-align: center;
  border-top: 3px solid var(--yellow);
}
.footer strong { color: var(--yellow); }

/* List items */
.list { display: grid; gap: 11px; }
.list-item { padding: 12px; border: 1px solid #e6e6e8; border-radius: 12px; background: #fafafa; }
.list-item strong { display: block; margin-bottom: 4px; }

/* ===== Responsive (base breakpoints) ===== */
@media (max-width: 1100px) {
  .stats, .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-logo-box { display: none; }
  .span-4, .span-6, .span-8 { grid-column: span 12; }
}
@media (max-width: 650px) {
  .stats, .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}

/* ===== Public dashboard refinements ===== */
.brand img.logo-img {
  width: 48px; height: 48px; object-fit: contain;
  border-radius: 50%; background: #fff;
}
.hero-badge {
  display: inline-block; background: #fff2ad; color: #6b5500;
  font-size: 11px; font-weight: 900; padding: 6px 12px; border-radius: 999px;
  margin-bottom: 14px; letter-spacing: .3px;
}
.hero-logo img {
  width: min(270px, 70vw); height: auto;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.35));
  background: #fff; border-radius: 50%;
}
.hero-logo { display: flex; justify-content: center; }

/* Modals — fixed head/body scroll, no overlap with page/sidebar */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.68);
  padding: 18px;
  align-items: center;
  justify-content: center;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.overlay.show { display: flex; }
.modal {
  width: min(720px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.4);
  border: 2px solid #222;
  position: relative;
  z-index: 1;
  margin: auto;
  flex: none;
}
.modal-sm { width: min(480px, 100%); }
.modal-head {
  padding: 19px 22px;
  background: #111;
  color: #fff;
  border-bottom: 4px solid var(--yellow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex: none;
  border-radius: 20px 20px 0 0;
}
.modal-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  word-break: break-word;
  min-width: 0;
}
.close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #444;
  background: #252528;
  color: white;
  font-size: 20px;
  cursor: pointer;
  flex: none;
}
.modal-body {
  padding: 22px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
/* Tables inside modals — own scrollbar */
.modal .data-table-wrap,
.modal-body .data-table-wrap {
  max-height: min(40vh, 320px);
  max-height: min(40dvh, 320px);
}
.modal .modal-actions {
  flex: none;
  padding: 0 22px 22px;
  margin-top: 0;
}
.center-confirm { text-align: center; padding: 20px 5px 10px; }
.confirm-mark {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%;
  background: #fff3b0; display: grid; place-items: center; font-size: 30px;
}
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.login-note {
  padding: 11px 13px; border-radius: 10px; background: #fff7cc;
  border-left: 4px solid var(--yellow); font-size: 12px; color: #5d4b00; margin-bottom: 16px;
}
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label {
  display: block; text-align: center; padding: 11px; border: 1px solid #d2d2d5;
  border-radius: 10px; font-weight: 800; background: #fafafa; cursor: pointer;
}
.choice input:checked + label { background: #111; color: var(--yellow); border-color: #111; }
.conditional { display: none; grid-column: 1 / -1; padding: 14px; border-radius: 13px; background: #f6f6f7; border: 1px dashed #c7c7cb; }
.conditional.show { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.upload-box { border: 2px dashed #c7c7cb; border-radius: 13px; padding: 15px; background: #fafafa; }
.preview { display: none; margin-top: 10px; align-items: center; gap: 10px; }
.preview.show { display: flex; }
.preview img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 2px solid var(--yellow); }

.achievement { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.achievement-icon {
  width: 38px; height: 38px; border-radius: 10px; background: #111; color: var(--yellow);
  display: grid; place-items: center; font-weight: 950; flex: none;
}
.directory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.person { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid #e6e6e8; border-radius: 13px; background: #fafafa; }
.person .avatar {
  width: 45px; height: 45px; border-radius: 50%; background: #222; color: var(--yellow);
  display: grid; place-items: center; font-weight: 950; flex: none; overflow: hidden;
}
.person .avatar img { width: 100%; height: 100%; object-fit: cover; }
.person strong { font-size: 14px; }
.person small { display: block; color: #777; font-size: 12px; margin-top: 3px; }
.perks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.perk-card { border: 1px solid #e3e3e6; border-radius: 14px; overflow: hidden; background: #fff; }
.perk-card img { max-width: 100%; max-height: 160px; width: auto; height: auto; object-fit: contain; background: transparent; }
.perk-card-body { padding: 13px; }
.perk-card-body h3 { margin: 0 0 6px; font-size: 16px; }

@media (max-width: 900px) {
  .directory, .perks-grid { grid-template-columns: 1fr 1fr; }
  .choice-row { grid-template-columns: 1fr; }
  .conditional.show { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .directory, .perks-grid { grid-template-columns: 1fr; }
  .modal-actions, .confirm-actions { flex-direction: column; }
  .modal-actions .btn, .confirm-actions .btn { width: 100%; }
}

/* Smooth page transition */
.page-fade { animation: pageIn .28s ease-out; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.main { animation: pageIn .28s ease-out; }

/* Directory official layout */
.dir-president {
  display: flex; justify-content: center; margin-bottom: 16px;
}
.dir-president .person {
  min-width: 220px; flex-direction: column; text-align: center;
  padding: 18px; border: 2px solid var(--yellow);
}
.dir-president .avatar { width: 72px; height: 72px; margin: 0 auto 10px; }
.dir-row {
  display: grid; gap: 12px; margin-bottom: 12px;
}
.dir-row.officers { grid-template-columns: repeat(5, 1fr); }
.dir-row.bod { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) {
  .dir-row.officers, .dir-row.bod { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .dir-row.officers, .dir-row.bod { grid-template-columns: 1fr; }
}

/* Gallery */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
}
.gallery-item {
  border: 1px solid #e3e3e6; border-radius: 14px; overflow: hidden; background: #fff;
  position: relative;
}
.gallery-item img, .gallery-item video {
  width: 100%; height: 180px; object-fit: cover; display: block; background: #111;
}
.gallery-item .cap { padding: 10px 12px; font-size: 13px; font-weight: 700; }
.gallery-item .cap small { display: block; color: #777; font-weight: 500; margin-top: 2px; }

/* Autosuggest */
.suggest-box {
  position: relative;
}
.suggest-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  background: #fff; border: 1px solid #e0e0e3; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12); max-height: 280px; overflow: auto;
  display: none;
}
.suggest-list.show { display: block; }
.suggest-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  cursor: pointer; border-bottom: 1px solid #f0f0f2;
}
.suggest-item:hover, .suggest-item.active { background: #fffbea; }
.suggest-item img, .suggest-item .av {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none;
  background: #111; color: var(--yellow); display: grid; place-items: center; font-weight: 900;
}

/* Side logo */
.side-brand .side-logo {
  width: 42px; height: 42px; border-radius: 50%; object-fit: contain;
  background: #fff; border: 2px solid var(--yellow); flex: none;
}

/* Clickable list rows */
.list-item.clickable {
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.list-item.clickable:hover {
  background: #fffbea;
  border-color: var(--yellow);
  box-shadow: 0 4px 14px rgba(245,196,0,.18);
}

/* Detail modal media */
.detail-media {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px;
}
.detail-media img {
  max-width: 100%; max-height: 220px; border-radius: 12px;
  border: 1px solid #e6e6e8; object-fit: contain; background: #f7f7f8;
}
.detail-media img.thumb {
  width: 120px; height: 90px; object-fit: cover; cursor: pointer;
}
.inquiry-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.online-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; margin-right: 6px; box-shadow: 0 0 0 3px rgba(34,197,94,.25);
}
.offline-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #9ca3af; margin-right: 6px;
}

/* Detail modal image carousel — fit width */
.detail-carousel { margin-top: 14px; }
.detail-carousel-stage {
  width: 100%;
  background: #f4f4f5;
  border: 1px solid #e3e3e6;
  border-radius: 14px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-carousel-stage img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}
.detail-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

/* Gallery book / slideshow */
.gallery-book { padding: 18px; }
.gallery-book-stage {
  position: relative;
  width: 100%;
  min-height: 360px;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  perspective: 1200px;
}
.gallery-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: rotateY(-18deg) scale(.96);
  transform-origin: left center;
  transition: opacity .55s ease, transform .55s ease;
  background: #111;
}
.gallery-page.active {
  opacity: 1;
  pointer-events: auto;
  transform: rotateY(0) scale(1);
  z-index: 2;
}
.gallery-page img,
.gallery-page video {
  width: 100%;
  height: min(58vh, 480px);
  object-fit: contain;
  display: block;
  background: #0a0a0a;
}
.gallery-page .cap {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.96);
  color: #171719;
  font-weight: 800;
  font-size: 14px;
}
.gallery-page .cap small {
  display: block;
  color: #666;
  font-weight: 500;
  margin-top: 3px;
}
.gallery-book-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 10px;
}

/* ========== MOBILE / RESPONSIVE (full rewrite) ========== */
html, body {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  max-width: 100vw;
  overflow-x: hidden;
}
body.app-shell {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Mobile top bar (admin + member) */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0c0c0d;
  color: #fff;
  border-bottom: 3px solid var(--yellow);
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  align-items: center;
  gap: 12px;
}
.mobile-bar .mb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.mobile-bar .mb-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--yellow);
  flex: none;
}
.mobile-bar .mb-brand strong {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-bar .mb-brand small {
  display: block;
  color: #aaa;
  font-size: 10px;
  font-weight: 600;
}
.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--yellow);
  background: #1a1a1c;
  color: var(--yellow);
  font-size: 22px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
}
.side-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
}
.side-backdrop.show { display: block; }

/* ----- Tablet / phone: drawer menu (≤900px) ----- */
@media (max-width: 900px) {
  .mobile-bar { display: flex; }

  .shell {
    grid-template-columns: 1fr !important;
  }

  .side {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw) !important;
    height: 100% !important;
    height: 100dvh !important;
    z-index: 300;
    transform: translateX(-105%);
    transition: transform .28s ease, visibility .28s ease;
    border-right: 3px solid var(--yellow) !important;
    border-bottom: 0 !important;
    padding: 16px 14px !important;
    padding-top: max(16px, env(safe-area-inset-top, 0px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background: #111;
    visibility: hidden;
    pointer-events: none;
  }
  .side.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .side nav {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    gap: 6px;
  }
  .side nav a,
  .side nav button {
    white-space: normal !important;
    padding: 14px 14px !important;
    font-size: 14px !important;
    min-height: 48px;
  }
  .side .logout {
    margin-top: 16px !important;
    min-height: 48px;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: calc(100vh - 60px);
    min-height: calc(100dvh - 60px);
    padding: 14px 12px 28px !important;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
  }
  body.app-shell {
    height: auto !important;
    overflow: auto !important;
  }
  .shell {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
  }
  .main-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }
  .main-top h1 { font-size: 22px; }

  .directory,
  .perks-grid { grid-template-columns: 1fr 1fr; }
  .choice-row { grid-template-columns: 1fr; }
  .conditional.show { grid-template-columns: 1fr; }
  .dir-row.officers,
  .dir-row.bod { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Phone (≤650px) ----- */
@media (max-width: 650px) {
  .stats,
  .admin-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .admin-stat { padding: 12px; }
  .admin-stat b { font-size: 20px; }
  .admin-stat span { font-size: 9px; letter-spacing: .3px; }

  .btn {
    min-height: 44px;
    padding: 11px 14px;
    font-size: 13px;
  }
  .btn-block { width: 100%; }

  /* Tables: own scroll (vertical + horizontal) on mobile */
  .data-table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    max-width: 100%;
    max-height: min(55vh, 420px);
    max-height: min(55dvh, 420px);
  }
  .data-table { font-size: 11px; }
  .data-table th,
  .data-table td { padding: 8px 6px; }

  /* Centered modals on mobile — no overlap */
  .overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    z-index: 2000 !important;
  }
  .modal,
  .overlay .modal,
  .overlay .modal-sm,
  .modal.modal-center {
    width: min(420px, calc(100% - 20px)) !important;
    max-width: calc(100% - 20px) !important;
    border-radius: 18px !important;
    margin: 0 auto !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .profile-photo-card .profile-photo,
  .profile-photo-card .profile-photo-placeholder {
    width: 110px !important;
    height: 110px !important;
  }
  .modal-actions,
  .confirm-actions {
    flex-direction: column;
  }
  .modal-actions .btn,
  .confirm-actions .btn { width: 100%; }

  /* Public topbar */
  .topbar-inner {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand { flex: 1; min-width: 0; }
  .brand-title {
    font-size: 11px;
    line-height: 1.2;
  }
  .brand-title small { font-size: 9px; }
  .brand img.logo-img,
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  .top-actions {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .top-actions .btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 12px;
    min-height: 42px;
  }

  /* Hero + content */
  .hero { padding: 24px 14px; }
  .hero h1 { font-size: 24px; letter-spacing: -0.5px; }
  .hero p { font-size: 14px; }
  .container { padding: 14px 12px 40px; }
  .section-title h2 { font-size: 17px; }

  /* Login */
  .login-box {
    width: min(100% - 24px, 400px) !important;
    margin: 20px auto !important;
    padding: 20px 16px !important;
    border-radius: 18px;
  }
  .login-box h1 { font-size: 20px; }

  /* Grids collapse */
  .directory,
  .perks-grid { grid-template-columns: 1fr !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .dues-layout { grid-template-columns: 1fr !important; }
  .card { padding: 14px; border-radius: 14px; }
  .list-item,
  .card { word-break: break-word; }

  .gallery-book-stage { min-height: 240px; }
  .gallery-page img,
  .gallery-page video { height: min(42vh, 300px); }

  input, select, textarea { max-width: 100%; }
}

/* ----- Small phone (≤400px) ----- */
@media (max-width: 400px) {
  .stats,
  .admin-stats { grid-template-columns: 1fr 1fr !important; }
  .dir-row.officers,
  .dir-row.bod { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 22px; }
  .brand-title { font-size: 10px; }
  .top-actions .btn {
    padding: 9px 6px;
    font-size: 11px;
  }
}

/* ----- Very small (≤360px) ----- */
@media (max-width: 360px) {
  .stats,
  .admin-stats { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 20px; }
}

/* Touch devices: larger tap targets + no iOS zoom */
@media (pointer: coarse) {
  input, select, textarea, button {
    font-size: 16px !important;
  }
  .side nav a,
  .side nav button,
  .btn,
  .list-item.clickable {
    min-height: 44px;
  }
}

/* PWA install banner */
.pwa-install {
  display: none;
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  z-index: 400;
  background: #111;
  color: #fff;
  border: 2px solid var(--yellow);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  align-items: center;
  gap: 12px;
}
.pwa-install.show { display: flex; }
.pwa-install p {
  margin: 0;
  flex: 1;
  font-size: 13px;
  font-weight: 700;
}
.pwa-install .btn { flex: none; }

/* Admin Add Member — own scrollbar inside form panel */
.form-scroll-panel {
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow) #e8e8ea;
}
.form-scroll-panel::-webkit-scrollbar {
  width: 10px;
}
.form-scroll-panel::-webkit-scrollbar-track {
  background: #e8e8ea;
  border-radius: 8px;
}
.form-scroll-panel::-webkit-scrollbar-thumb {
  background: var(--yellow);
  border-radius: 8px;
  border: 2px solid #e8e8ea;
}
.form-scroll-panel::-webkit-scrollbar-thumb:hover {
  background: #d4a800;
}
@media (max-width: 900px) {
  .form-scroll-panel {
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
  }
}

/* ===== SYLO Members: desktop table + mobile cards + tall modal ===== */
.member-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  vertical-align: middle; margin-right: 8px;
}
.members-table .col-name { max-width: 220px; white-space: normal; word-break: break-word; }
.members-table .col-id { white-space: nowrap; }
.members-table .btn-view { padding: 6px 12px; font-size: 12px; min-height: auto; }

.members-cards-mobile { display: none; }
.member-card-row { margin-bottom: 12px; }
.member-card-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.member-avatar-lg {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--yellow); flex: none; background: #fff;
}
.member-avatar-lg.placeholder {
  display: grid; place-items: center; font-weight: 900; font-size: 22px;
  color: #999; background: #f0f0f0;
}
.member-card-info { min-width: 0; flex: 1; }
.member-card-info strong {
  display: block; font-size: 15px; line-height: 1.25;
  word-break: break-word;
}
.member-id-line { margin-top: 2px; font-size: 12px; word-break: break-all; }

/* Tall member view modal — fixed head & footer */
.modal-member-view {
  width: min(520px, calc(100% - 24px)) !important;
  max-width: calc(100% - 24px) !important;
  height: min(88vh, 720px);
  max-height: 88vh;
  display: flex !important;
  flex-direction: column;
  border-radius: 18px !important;
  margin: 0 auto !important;
  overflow: hidden;
  padding: 0;
}
.modal-member-view .modal-head {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 2;
}
.modal-member-body {
  flex: 1 1 auto;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  max-height: none !important;
  padding: 18px 20px !important;
}
.modal-member-footer {
  flex: none;
  padding: 12px 16px 16px !important;
  border-top: 1px solid #e8e8ea;
  background: #fff;
  margin: 0 !important;
  justify-content: stretch !important;
}
.modal-member-footer .btn { width: 100%; min-height: 48px; }

.mv-hero { text-align: center; margin-bottom: 16px; }
.mv-photo {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--yellow); margin: 0 auto 12px; display: block; background: #fff;
}
.mv-photo.placeholder {
  display: grid; place-items: center; font-size: 36px; font-weight: 900;
  color: #999; background: #f0f0f0;
}
.mv-name { font-size: 18px; display: block; margin-bottom: 4px; word-break: break-word; }
.mv-section {
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  color: #888; margin: 14px 0 6px; letter-spacing: .4px;
}

@media (max-width: 700px) {
  .members-table-desktop { display: none !important; }
  .members-cards-mobile { display: block; }

  .modal-member-view {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    height: 90vh;
    max-height: 90dvh;
  }
  #memberViewOverlay.overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
  }
}


/* ===== Public dashboard: gallery + certs side by side ===== */
.public-media-row { align-items: stretch; }
.stat-clickable {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  border-color: var(--yellow);
}
.person-clickable {
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.person-clickable:hover {
  background: #fff8d6;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.dir-modal-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--yellow);
  background: #fff;
  margin: 0 auto;
  display: block;
}
.cert-pdf-slide {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f6f6f7;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.cert-pdf-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #111;
  color: var(--yellow);
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 18px;
  margin-bottom: 12px;
}
.active-members-list {
  max-height: min(55vh, 420px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.active-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e8e8ea;
  border-radius: 12px;
  background: #fafafa;
}
.am-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--yellow);
  background: #fff;
  flex: none;
}
.am-info {
  min-width: 0;
  flex: 1;
}
.am-info strong {
  display: block;
  font-size: 14px;
  word-break: break-word;
}
.am-info .muted {
  font-size: 12px;
}
.am-points {
  font-weight: 900;
  font-size: 13px;
  color: #111;
  background: #fff2ad;
  padding: 6px 10px;
  border-radius: 999px;
  flex: none;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .public-media-row .span-6 { grid-column: span 12; }
}
