/* Sreevensai Health Village – shared styles. Mobile first, big touch targets. */
:root {
  --green-900: #0f3d2e;
  --green-800: #145a40;
  --green-700: #187a52;
  --green-600: #1f9463;
  --green-100: #e3f4ea;
  --green-50: #f2faf5;
  --gold-600: #c98a0b;
  --gold-500: #e9a514;
  --gold-100: #fdf1d6;
  --blue-600: #2563a8;
  --blue-100: #e3edf9;
  --red-600: #c2362b;
  --red-100: #fbe6e4;
  --wa: #1fa855;
  --wa-dark: #178a45;
  --ink: #18231e;
  --ink-2: #4a5a52;
  --ink-3: #7b8a83;
  --line: #dde6e0;
  --bg: #f5f8f4;
  --card: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 61, 46, .06), 0 8px 24px rgba(15, 61, 46, .07);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--green-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green-900); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(140deg, var(--green-700), var(--green-900));
  display: grid; place-items: center; color: #fff;
}
.brand-name { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.brand-sub { font-size: .75rem; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 600; padding: 10px 14px; border-radius: 10px;
}
.nav a:hover { background: var(--green-50); color: var(--green-800); }
.header-actions { margin-left: auto; display: flex; gap: 8px; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .header-actions { margin-left: 8px; }
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 14px;
  text-decoration: none; transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: 0 4px 14px rgba(24, 122, 82, .28); }
.btn-primary:hover { background: var(--green-800); }
.btn-gold { background: var(--gold-500); color: #3b2a00; box-shadow: 0 4px 14px rgba(233, 165, 20, .3); }
.btn-gold:hover { background: #d99608; }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 4px 14px rgba(31, 168, 85, .3); }
.btn-wa:hover { background: var(--wa-dark); }
.btn-blue { background: var(--blue-600); color: #fff; }
.btn-blue:hover { background: #1d4f88; }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #a42b22; }
.btn-ghost { background: transparent; color: var(--green-800); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--green-600); background: var(--green-50); }
.btn-light { background: #fff; color: var(--green-900); }
.btn-sm { min-height: 38px; padding: 7px 14px; border-radius: 10px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: 14px 28px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(233, 165, 20, .28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31, 148, 99, .55), transparent 60%),
    linear-gradient(160deg, var(--green-800), var(--green-900));
}
.hero .wrap { padding-top: 56px; padding-bottom: 64px; display: grid; gap: 28px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px;
  background: rgba(255, 255, 255, .12); font-weight: 700; font-size: .85rem; width: fit-content;
}
.hero p.lead { font-size: 1.12rem; color: rgba(255, 255, 255, .86); max-width: 640px; }
.hero-address { display: flex; gap: 10px; align-items: flex-start; color: rgba(255, 255, 255, .85); font-size: .95rem; }
.hero-address svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; }
.hero-stat { background: rgba(255, 255, 255, .1); border-radius: 16px; padding: 14px; }
.hero-stat b { display: block; font-size: 1.5rem; }
.hero-stat span { font-size: .8rem; color: rgba(255, 255, 255, .78); }
@media (min-width: 900px) { .hero .wrap { padding-top: 88px; padding-bottom: 96px; } }

/* ---------- Sections & cards ---------- */
.section { padding: 56px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head p { margin: 0; color: var(--ink-2); }
.eyebrow { color: var(--gold-600); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: 6px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card-lg { padding: 28px; }
@media (min-width: 700px) { .card-lg { padding: 36px; } }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Gallery ---------- */
.event-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .15s ease; }
.event-card:hover { transform: translateY(-3px); }
.event-cover { aspect-ratio: 4/3; background: var(--green-100); position: relative; overflow: hidden; }
.event-cover img, .event-cover video { width: 100%; height: 100%; object-fit: cover; }
.event-count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff;
  font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 99px;
}
.event-body { padding: 16px 18px 20px; }
.event-date { color: var(--gold-600); font-weight: 700; font-size: .82rem; }
.event-body p { color: var(--ink-2); font-size: .93rem; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-grid .tile { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--green-100); position: relative; cursor: pointer; border: 0; padding: 0; }
.media-grid .tile img, .media-grid .tile video { width: 100%; height: 100%; object-fit: cover; }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .25); }
.play-badge svg { width: 44px; height: 44px; }
.placeholder-art { width: 100%; height: 100%; display: grid; place-items: center; color: var(--green-600); }
.placeholder-art svg { width: 56px; height: 56px; opacity: .6; }

/* ---------- Documents ---------- */
.doc-item { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.doc-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-100); color: var(--blue-600); display: grid; place-items: center; flex: none; }
.doc-icon svg { width: 24px; height: 24px; }
.doc-item .doc-text { flex: 1; min-width: 0; }
.doc-item .doc-text b { display: block; overflow: hidden; text-overflow: ellipsis; }
.doc-item .doc-text span { color: var(--ink-3); font-size: .85rem; }

/* ---------- Contact ---------- */
.contact-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.contact-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.contact-icon svg { width: 26px; height: 26px; }
.ci-wa { background: #dff5e7; color: var(--wa); }
.ci-mail { background: var(--blue-100); color: var(--blue-600); }
.ci-phone { background: var(--gold-100); color: var(--gold-600); }
.ci-map { background: var(--green-100); color: var(--green-700); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.field label, .field .label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 5px; }
.field .req { color: var(--red-600); }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  min-height: 50px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(31, 148, 99, .14); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red-600); }
input[readonly] { background: var(--green-50); }
.phone-input { display: grid; grid-template-columns: 118px 1fr; gap: 8px; }
.file-drop {
  border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 20px; text-align: center;
  background: var(--green-50); cursor: pointer; display: block; color: var(--ink-2);
}
.file-drop:hover { border-color: var(--green-600); }
.file-drop input { display: none; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list li { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.file-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list button { border: 0; background: none; color: var(--red-600); cursor: pointer; font-weight: 700; padding: 4px 8px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Fee box */
.fee-box { border: 2px solid var(--green-100); background: var(--green-50); border-radius: var(--radius); padding: 18px; }
.fee-box .fee-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .fee-box .fee-grid { grid-template-columns: 1fr 1fr 1fr; } }
.fee-total { background: var(--green-700); color: #fff; border-radius: var(--radius-sm); padding: 12px 14px; }
.fee-total small { display: block; opacity: .85; font-weight: 600; }
.fee-total b { font-size: 1.4rem; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 58px; height: 32px; border-radius: 99px; background: #cbd5cf; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--green-600); }
.switch input:checked + .track::after { transform: translateX(26px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(31, 148, 99, .25); }

/* Segmented control / tabs */
.segmented { display: inline-flex; background: var(--green-50); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; width: 100%; }
.segmented button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 700; padding: 12px; border-radius: 10px; cursor: pointer; color: var(--ink-2); min-height: 46px; }
.segmented button.active { background: #fff; color: var(--green-800); box-shadow: var(--shadow); }

/* ---------- Badges, alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .78rem; padding: 4px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.badge-paid { background: var(--green-100); color: var(--green-800); }
.badge-due { background: var(--red-100); color: var(--red-600); }
.badge-new { background: var(--gold-100); color: #8a5c00; }
.badge-info { background: var(--blue-100); color: var(--blue-600); }
.badge-muted { background: #eef1ef; color: var(--ink-3); }
.alert { border-radius: var(--radius-sm); padding: 14px 16px; font-weight: 600; }
.alert-success { background: var(--green-100); color: var(--green-900); }
.alert-error { background: var(--red-100); color: #7a1d16; }
.alert-info { background: var(--blue-100); color: #163d68; }
.alert-warn { background: var(--gold-100); color: #6b4700; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg { width: 48px; height: 48px; margin: 0 auto 8px; opacity: .5; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: var(--green-50); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); white-space: nowrap; position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tbody tr:hover { background: #fafcfa; }
.amount-pos { color: var(--green-700); font-weight: 700; }
.amount-neg { color: var(--red-600); font-weight: 700; }

/* Mobile card-style rows */
@media (max-width: 760px) {
  table.data.responsive thead { display: none; }
  table.data.responsive, table.data.responsive tbody, table.data.responsive tr, table.data.responsive td { display: block; width: 100%; }
  table.data.responsive tr { border-bottom: 1px solid var(--line); padding: 10px 6px; }
  table.data.responsive td { border: 0; padding: 5px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.data.responsive td::before { content: attr(data-label); font-weight: 700; color: var(--ink-3); font-size: .8rem; text-transform: uppercase; text-align: left; }
  table.data.responsive td.actions { justify-content: flex-end; }
  table.data.responsive td.actions::before { content: none; }
}

/* ---------- Stat tiles ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat { border-radius: var(--radius); padding: 20px; color: #fff; position: relative; overflow: hidden; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.stat .stat-label { font-weight: 700; opacity: .9; font-size: .9rem; }
.stat .stat-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .stat-foot { font-size: .82rem; opacity: .85; }
.stat-green { background: linear-gradient(140deg, var(--green-600), var(--green-800)); }
.stat-gold { background: linear-gradient(140deg, #f0b23a, #c98a0b); color: #2e2000; }
.stat-red { background: linear-gradient(140deg, #e05a4f, #a92e25); }
.stat-blue { background: linear-gradient(140deg, #3b7fc7, #1f4f86); }

/* ---------- App shell (admin / member) ---------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.sidebar {
  background: var(--green-900); color: #fff; padding: 12px; position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 10px;
}
.sidebar .brand { color: #fff; padding: 6px 4px; }
.sidebar .brand-sub { color: rgba(255,255,255,.6); }
.side-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.side-nav::-webkit-scrollbar { display: none; }
.side-nav button {
  border: 0; background: rgba(255,255,255,.08); color: rgba(255,255,255,.88); font: inherit; font-weight: 700;
  padding: 11px 14px; border-radius: 12px; cursor: pointer; display: flex; gap: 10px; align-items: center;
  white-space: nowrap; min-height: 46px; text-align: left;
}
.side-nav button svg { width: 20px; height: 20px; flex: none; }
.side-nav button:hover { background: rgba(255,255,255,.14); }
.side-nav button.active { background: var(--gold-500); color: #2e2000; }
.side-foot { display: none; }
.main { padding: 20px 16px 80px; min-width: 0; }
.page-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0; }
@media (min-width: 1000px) {
  .app { grid-template-columns: 280px 1fr; }
  .sidebar { height: 100vh; padding: 20px 16px; }
  .side-nav { flex-direction: column; overflow: visible; }
  .side-nav button { background: transparent; width: 100%; }
  .side-foot { display: block; margin-top: auto; }
  .main { padding: 32px 36px 80px; }
  .mobile-only { display: none !important; }
}

.toolbar { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 760px) { .toolbar { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 30, 22, .55); }
.modal-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 22px 22px 0 0; padding: 22px 18px 28px;
  animation: slideUp .22s ease;
}
@media (min-width: 760px) {
  .modal-panel { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(760px, 94vw); border-radius: 22px; padding: 30px; animation: none; }
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.icon-btn { border: 0; background: var(--green-50); width: 44px; height: 44px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); margin-left: auto; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }

/* Lightbox */
.lightbox .modal-panel { background: #0b1712; color: #fff; }
.lightbox-media { display: grid; place-items: center; min-height: 40vh; }
.lightbox-media img, .lightbox-media video { max-height: 72vh; border-radius: 12px; margin: 0 auto; }
.lightbox .icon-btn { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 200; left: 16px; right: 16px; bottom: 16px; display: grid; gap: 10px; pointer-events: none; }
@media (min-width: 760px) { .toasts { left: auto; width: 380px; } }
.toast { pointer-events: auto; background: var(--green-900); color: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 600; animation: slideUp .2s ease; }
.toast.error { background: var(--red-600); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.8); padding: 40px 0 28px; }
.site-footer a { color: #fff; }
.site-footer .grid { gap: 24px; }

/* Spinner */
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--line); border-top-color: var(--green-700); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 30px; }

/* Plot cards (member) */
.plot-card { border-top: 6px solid var(--green-600); }
.plot-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.plot-no { width: 64px; height: 64px; border-radius: 16px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; flex: none; }
.kv { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .kv { grid-template-columns: repeat(3, 1fr); } }
.kv div { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.kv span { display: block; font-size: .78rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kv b { font-size: 1.1rem; }

@media print { .sidebar, .site-header, .toolbar, .btn { display: none !important; } }

/* Icons default to 20px; contexts above override */
.hero-tag svg { width: 18px; height: 18px; }
.file-list svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.brand-mark svg { width: 24px; height: 24px; }
.field label.switch { display: inline-flex; margin: 0; font-size: 1rem; }
.switch .track { display: inline-block; }
