:root {
  --navy: #1a2b4c;
  --navy-2: #2a4170;
  --gold: #f5873a;
  --orange: #f5873a;
  --orange-2: #e8742a;
  --bg: #f1f4f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7785;
  --line: #e1e6ed;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --bad: #c53030;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Jost", "Century Gothic", "Futura", "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: var(--navy-2); }
h1, h2, h3 { margin: 0 0 12px; color: var(--navy); }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 16px; border-bottom: 3px solid var(--gold); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; flex: 1; min-width: 0; }
.topbar .brand img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand small { display: block; font-weight: 400; opacity: .8; font-size: 12px; }
.topbar .user { font-size: 13px; opacity: .9; text-align: right; }
.topbar button { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; }
.menu-btn { display: none; font-size: 20px; padding: 4px 10px !important; }
.layout { display: flex; min-height: calc(100vh - 60px); }
nav.side { width: 220px; background: #fff; border-right: 1px solid var(--line); padding: 12px 8px; flex-shrink: 0; }
nav.side a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); margin-bottom: 2px; }
nav.side a:hover { background: var(--bg); color: var(--orange-2); }
nav.side a.active { background: #fff1e6; color: var(--orange-2); font-weight: 600; box-shadow: inset 3px 0 0 var(--orange); }
nav.side .sep { height: 1px; background: var(--line); margin: 8px 4px; }
main { flex: 1; padding: 20px; min-width: 0; max-width: 1200px; }
@media (max-width: 800px) {
  .menu-btn { display: inline-block; }
  nav.side { position: fixed; top: 60px; left: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 12px rgba(0,0,0,.15); overflow-y: auto; }
  nav.side.open { transform: none; }
  main { padding: 14px; }
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px; }
  .stat .label { font-size: 10.5px; }
  .stat .value { font-size: 16px; }
  .topbar .user .name { display: none; }
}

/* Components */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h1 { flex: 1; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat .value { font-size: 21px; font-weight: 700; color: var(--navy); margin-top: 4px; }
.stat.gold { border-left-color: var(--gold); } .stat.red { border-left-color: var(--bad); } .stat.green { border-left-color: var(--ok); }

button, .btn { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
button:hover, .btn:hover { filter: brightness(.97); }
button.primary, .btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 4px 12px rgba(245,135,58,.25); }
button.primary:hover, .btn.primary:hover { background: var(--orange-2); border-color: var(--orange-2); filter: none; }
button.navy, .btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
button.gold, .btn.gold { background: var(--navy); border-color: var(--navy); color: #fff; }
button.danger, .btn.danger { background: #fff; border-color: var(--bad); color: var(--bad); }
button.wa, .btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
button.sm, .btn.sm { padding: 4px 9px; font-size: 13px; }
button:disabled { opacity: .55; cursor: not-allowed; }

form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); font-size: 14px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 10px; border: 1px solid #cdd5df; border-radius: 8px; background: #fff; color: var(--text); }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: transparent; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters > div { min-width: 140px; }
.radio-group { display: flex; gap: 16px; padding: 8px 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f7f9fc; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
tr.void td { color: #999; text-decoration: line-through; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f7f9fc; }
tfoot td { font-weight: 700; background: #f7f9fc; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #e8edf4; color: var(--navy); }
.badge.green { background: #e3f5ea; color: var(--ok); } .badge.red { background: #fde8e8; color: var(--bad); }
.badge.gold { background: #fff1e6; color: #c2570f; } .badge.grey { background: #eee; color: #666; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

.profile { display: flex; gap: 18px; flex-wrap: wrap; }
.profile .photo { width: 120px; height: 145px; border-radius: 8px; border: 2px solid var(--navy); background: #eef1f5 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.profile .info { flex: 1; min-width: 240px; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: none; border-radius: 8px 8px 0 0; background: transparent; padding: 9px 14px; color: var(--muted); }
.tabs button.active { background: transparent; color: var(--orange-2); font-weight: 600; box-shadow: inset 0 -3px 0 var(--orange); }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; width: 100%; justify-content: center; }
.chart .bar { width: 42%; max-width: 18px; border-radius: 3px 3px 0 0; background: var(--navy); min-height: 1px; }
.chart .bar.exp { background: var(--gold); }
.chart .lbl { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, rgba(26,45,85,.55) 0%, rgba(18,33,63,.42) 50%, rgba(12,24,48,.62) 100%), url('/images/login-bg.jpg') center 62% / cover no-repeat #12213f; }
@media (min-width: 900px) { .auth-wrap { background-attachment: fixed; } }
.auth-card { backdrop-filter: blur(2px); }
.auth-card { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 440px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.auth-card.wide { max-width: 640px; }
.auth-card .logo { text-align: center; margin-bottom: 14px; }
.auth-card .logo img { max-width: 80px; max-height: 80px; }
.auth-card h1 { text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: -6px 0 18px; }
.auth-card button.primary { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }

/* Modal & toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(15,25,40,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 20px; position: relative; }
.modal .close { position: absolute; top: 10px; right: 10px; border: none; font-size: 20px; padding: 2px 8px; }
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); border-left: 4px solid var(--orange); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 340px; }
.toast.err { background: var(--bad); }
.receipt-box { border: 2px dashed var(--navy); border-radius: 10px; padding: 14px; margin: 10px 0 14px; }
.receipt-box .amt { font-size: 26px; font-weight: 800; color: var(--navy); }
.cred { background: #fff1e6; border: 1px solid var(--gold); border-radius: 8px; padding: 12px; font-family: Consolas, monospace; font-size: 15px; }
.idcard-preview { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.2); }

/* ================= Public homepage ================= */
.home { --orange: #f5873a; --orange-2: #e8742a; --ink: #14213d; font-family: "Jost", "Century Gothic", "Futura", "Segoe UI", system-ui, sans-serif; color: #2d3748; background: #fff; }
.home a { cursor: pointer; }
.home-wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.home h1, .home h2, .home h3 { color: var(--ink); font-family: inherit; }
.home .kicker { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #6b7785; margin-bottom: 10px; }
.home .center { text-align: center; }
.home-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--orange); color: #fff !important; text-decoration: none; padding: 12px 26px; border-radius: 3px; font-weight: 500; font-size: 15px; box-shadow: 0 6px 18px rgba(245,135,58,.3); transition: background .2s, transform .2s; }
.home-btn:hover { background: var(--orange-2); transform: translateY(-1px); }
.home-btn.sm { padding: 8px 16px; font-size: 13px; }

.home-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; transition: background .25s, box-shadow .25s; border-bottom: 1px solid rgba(255,255,255,.08); }
.home-nav.solid { background: rgba(18,32,60,.97); box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 76px; }
.home-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 19px; letter-spacing: .03em; text-decoration: none; }
.home-brand img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
.brand-mark { width: 28px; height: 28px; border: 2px solid var(--orange); color: var(--orange); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.home-links { display: flex; gap: 26px; margin-left: auto; }
.home-links a { color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; opacity: .92; }
.home-links a:hover, .home-links a.on { color: var(--orange); opacity: 1; }
.home-nav .home-btn { margin-left: 18px; padding: 10px 22px; }
.home-burger { display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); font-size: 20px; padding: 4px 10px; }

.home-hero { color: #fff; padding: 190px 0 170px; background:
  radial-gradient(circle at 18% 30%, rgba(120,160,230,.28), transparent 32%),
  radial-gradient(circle at 70% 20%, rgba(150,180,255,.22), transparent 28%),
  radial-gradient(circle at 85% 75%, rgba(90,130,210,.25), transparent 35%),
  radial-gradient(circle at 40% 85%, rgba(245,135,58,.10), transparent 30%),
  linear-gradient(160deg, #1a2d55 0%, #12213f 55%, #0c1830 100%);
  background-size: cover; background-position: center; position: relative; }
.home-hero .hero-kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; }
.home-hero h1 { color: #fff; font-size: 56px; line-height: 1.12; font-weight: 600; margin: 0 0 22px; max-width: 640px; }
.home-hero p { max-width: 480px; font-size: 15.5px; line-height: 1.75; opacity: .9; margin: 0 0 34px; }

.float-card { position: relative; z-index: 2; margin: -90px auto 0; max-width: 760px; background: #fff; border-radius: 8px; box-shadow: 0 20px 50px rgba(20,33,61,.16); display: flex; gap: 34px; padding: 22px 30px 22px 22px; align-items: center; }
.float-img { width: 160px; height: 112px; flex-shrink: 0; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #f5873a, #c2410c 60%, #1a2d55); }
.float-img img { max-width: 80px; max-height: 80px; background: #fff; border-radius: 50%; padding: 6px; }
.float-body h2 { margin: 0 0 6px; font-size: 25px; font-weight: 600; }
.float-sub { margin: 0 0 16px; color: #6b7785; font-size: 14px; }
.float-actions { display: flex; align-items: center; gap: 26px; }
.text-link { color: #4a5568; font-size: 14px; text-decoration: none; }
.text-link:hover { color: var(--orange); }

.home-services { background: linear-gradient(180deg, #fff 0%, #f1f4f9 100%); padding: 110px 0 110px; margin-top: -40px; }
.services-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 70px; align-items: center; }
.services-intro h2 { font-size: 30px; font-weight: 600; line-height: 1.25; margin: 0 0 18px; }
.services-intro p { line-height: 1.8; color: #5a6676; margin: 0 0 18px; font-size: 15px; }
.services-intro .meeting { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-weight: 500; }
.services-intro .meeting svg { color: var(--orange); flex-shrink: 0; margin-top: 3px; }
.services-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px 30px; }
.service-icon { width: 38px; height: 38px; border: 1.6px solid var(--ink); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--ink); margin-bottom: 16px; }
.service h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.service p { margin: 0; font-size: 14px; line-height: 1.7; color: #7a8594; }

.home-news { padding: 100px 0; }
.home-news h2 { font-size: 32px; font-weight: 500; margin: 0 0 14px; }
.news-sub { max-width: 460px; margin: 0 auto 46px; color: #5a6676; line-height: 1.7; font-size: 15px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.news-card .news-img { height: 200px; border-radius: 2px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); margin-bottom: 16px; }
.news-card .news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-img.v0 { background: linear-gradient(135deg, #1a2d55, #3b5b9a); }
.news-img.v1 { background: linear-gradient(135deg, #3a3a3a, #8a8a8a); }
.news-img.v2 { background: linear-gradient(135deg, #2f6b3c, #8cbf6a); }
.news-img.v1 img { filter: grayscale(1); }
.news-tag { color: var(--orange); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.news-card h3 { font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.news-date { font-size: 12px; color: #8a94a3; margin-bottom: 10px; }
.news-card p { font-size: 14px; color: #5a6676; line-height: 1.65; margin: 0 0 14px; }
.news-more { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink) !important; text-decoration: none; }
.news-more:hover { color: var(--orange) !important; }
.news-empty { grid-column: 1 / -1; text-align: center; color: #8a94a3; padding: 30px; border: 1px dashed #d5dbe3; border-radius: 6px; }

.home-features { background: #f1f4f9; padding: 60px 0; }
.features-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.features-row > div { display: flex; flex-direction: column; gap: 8px; color: #5a6676; font-size: 14px; line-height: 1.6; }
.features-row svg { color: var(--orange); }
.features-row strong { color: var(--ink); font-size: 16px; }

.home-footer { background: #12213f; color: #c5cede; padding: 64px 0 0; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr; gap: 40px; padding-bottom: 44px; }
.footer-brand { color: #fff; font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.home-footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.home-footer p { margin: 0 0 8px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 24px; font-size: 13px; opacity: .7; }

@media (max-width: 900px) {
  .home-links { position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; gap: 0; background: #12213f; display: none; padding: 8px 0; }
  .home-links.open { display: flex; }
  .home-links a { padding: 12px 24px; }
  .home-burger { display: inline-block; margin-left: auto; }
  .home-nav .home-btn { display: none; }
  .home-nav { background: rgba(18,32,60,.97); }
  .home-hero { padding: 140px 0 140px; }
  .home-hero h1 { font-size: 38px; }
  .float-card { flex-direction: column; align-items: flex-start; gap: 18px; margin: -80px 16px 0; }
  .float-img { width: 100%; height: 120px; }
  .services-grid, .footer-grid { grid-template-columns: 1fr; gap: 44px; }
  .services-list { grid-template-columns: 1fr 1fr; gap: 34px 22px; }
  .news-grid, .features-row { grid-template-columns: 1fr; }
}

/* ================= Chat ================= */
.nav-badge { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 8px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 150px); min-height: 460px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; background: #fafbfd; }
.chat-new { padding: 10px; border-bottom: 1px solid var(--line); }
.thread { display: flex; width: 100%; align-items: center; gap: 10px; padding: 12px; border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; }
.thread:hover { background: #f1f4f9; filter: none; }
.thread.on { background: #fff1e6; box-shadow: inset 3px 0 0 var(--orange); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.avatar.group { background: var(--orange); font-size: 18px; }
.avatar.enq { background: #2f855a; font-size: 18px; }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-title { font-weight: 600; color: var(--navy); }
.t-last { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { background: var(--orange); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 2px 7px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head > div { flex: 1; min-width: 0; }
.chat-back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; background: #f1f4f9; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { margin: auto; color: var(--muted); text-align: center; padding: 30px; }
.msg { max-width: 72%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg-from { font-size: 12px; font-weight: 600; color: var(--navy); margin: 0 0 3px 4px; }
.bubble { display: inline-block; text-align: left; background: #fff; border: 1px solid var(--line); padding: 9px 13px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.msg.mine .bubble { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 14px 14px 4px 14px; }
.msg-meta { font-size: 11px; color: var(--muted); margin: 3px 6px 0; }
.msg-meta a { color: var(--bad); cursor: pointer; }
.chat-send { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-send textarea { min-height: 42px; max-height: 140px; resize: none; }
.enquiry { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 8px; padding: 12px; }
.enquiry.done { border-left-color: var(--ok); opacity: .75; }
@media (max-width: 800px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 130px); }
  .chat .chat-pane { display: none; }
  .chat.open-pane .chat-list { display: none; }
  .chat.open-pane .chat-pane { display: flex; }
  .chat-back { display: inline-flex; }
  .msg { max-width: 88%; }
}

/* Homepage chat bubble */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: flex; align-items: center; gap: 8px; background: var(--orange); color: #fff; border: none; border-radius: 30px; padding: 13px 20px; font: inherit; font-weight: 600; box-shadow: 0 8px 24px rgba(245,135,58,.45); }
.chat-fab:hover { background: var(--orange-2); filter: none; }
.chat-widget { position: fixed; right: 22px; bottom: 90px; z-index: 46; width: 340px; max-width: calc(100vw - 32px); background: #fff; border-radius: 12px; box-shadow: 0 16px 50px rgba(20,33,61,.3); overflow: hidden; font-family: inherit; }
.chat-widget[hidden] { display: none; }
.cw-head { background: #12213f; color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--orange); }
.cw-head small { display: block; opacity: .75; font-size: 12px; }
.cw-head button { background: transparent; border: none; color: #fff; font-size: 22px; padding: 0 4px; }
.cw-body { padding: 16px; background: #f1f4f9; }
.cw-bubble { background: #fff; border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin-bottom: 12px; border: 1px solid var(--line); }
#cw-form { display: flex; flex-direction: column; gap: 8px; }
#cw-form .home-btn { justify-content: center; border: none; cursor: pointer; font-family: inherit; }
.cw-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cw-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.cw-note a { color: var(--orange-2); }
@media (max-width: 900px) { .chat-fab span { display: none; } .chat-fab { padding: 14px; } }

/* Roles & permissions grid */
.perm-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.perm-table th, .perm-table td { padding: 7px 10px; }
.perm-table thead th { position: sticky; top: 0; z-index: 2; background: #f7f9fc; }
.perm-table th.perm-role { text-align: center; text-transform: none; font-size: 13px; color: var(--navy); min-width: 110px; vertical-align: top; }
.perm-table th.perm-role button { margin-top: 4px; }
.perm-table td:first-child { min-width: 260px; }
.perm-cell, .perm-na { text-align: center; }
.perm-cell input { width: 18px; height: 18px; accent-color: var(--orange); cursor: pointer; }
.perm-cell input:disabled { cursor: not-allowed; }
.perm-na { color: #c3cad4; }
.perm-group td { background: var(--navy); color: #fff; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* Dashboard collection status */
.collection { border-top: 4px solid var(--orange); }
.coll-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.coll-head h2 { margin: 0; }
.coll-head input[type=month] { width: auto; padding: 6px 8px; }
.coll-stats { margin-bottom: 14px; }
.coll-stats .stat .small { margin-top: 4px; font-size: 12px; }
.progress { height: 8px; background: #fde3cf; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--orange); border-radius: 6px; }
.split-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: #e9edf3; }
.split-bar span { display: block; height: 100%; }
.split-bar .full, .split-item.full i { background: var(--ok); }
.split-bar .partial, .split-item.partial i { background: var(--orange); }
.split-bar .none, .split-item.none i { background: var(--bad); }
.split-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.split-item { gap: 6px; font-size: 14px; }
.split-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.split-item.on { border-color: var(--navy); background: #eef2f8; }
.coll-list { margin-top: 12px; }
.coll-list summary { cursor: pointer; color: var(--navy-2); font-weight: 600; padding: 6px 0; }

/* Frosted-glass sign-in card (login, first-time setup, new password) */
.auth-card {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 60px rgba(5, 12, 30, .45);
  color: #fff;
}
.auth-card h1, .auth-card h2, .auth-card h3 { color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.auth-card .sub, .auth-card .muted, .auth-card p { color: rgba(255, 255, 255, .85); }
.auth-card label { color: rgba(255, 255, 255, .92); }
.auth-card a { color: #fff; }
.auth-card a:hover { color: var(--orange); }
.auth-card input, .auth-card select, .auth-card textarea {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
}
.auth-card input::placeholder, .auth-card textarea::placeholder { color: rgba(255, 255, 255, .65); }
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus { background: rgba(255, 255, 255, .24); outline: 2px solid var(--orange); border-color: transparent; }
.auth-card select option { color: #1f2933; }
/* Keep browser autofill readable on the glass */
.auth-card input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 40px rgba(30, 50, 90, .9) inset; caret-color: #fff; }
/* Browsers without blur support get a darker solid glass so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .auth-card { background: rgba(18, 33, 63, .82); }
}

/* Homepage hero photo framing: keep the crucifix and altar in view */
.home-hero { background-position: center 22%; }
@media (min-width: 1200px) { .home-hero { background-position: 70% 22%; } }
@media (max-width: 900px) {
  .home-hero { background-position: center 15%; }
}

/* ================= Programme & Catholic Liturgical Calendar ================= */
:root {
  --lit-holy: #c53030; --lit-solemnity: #c9a227; --lit-principal: #9c6b10; --lit-sunday: #1a2b4c; --lit-feast: #7b3fa0;
  --lit-memorial: #2b6cb0; --lit-optional: #63b3ed; --lit-commem: #a0aec0; --lit-season: #2f855a; --lit-local: #f5873a;
}
.c-holy_day { --c: var(--lit-holy); } .c-solemnity { --c: var(--lit-solemnity); } .c-principal { --c: var(--lit-principal); }
.c-sunday { --c: var(--lit-sunday); } .c-feast { --c: var(--lit-feast); } .c-memorial { --c: var(--lit-memorial); }
.c-optional { --c: var(--lit-optional); } .c-commemoration { --c: var(--lit-commem); } .c-season { --c: var(--lit-season); }
.c-local, .c-mass, .c-meeting, .c-event, .c-other { --c: var(--lit-local); }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--c, #999); vertical-align: middle; margin-right: 5px; }

.cal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-title { font-size: 17px; color: var(--navy); margin-left: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 12px; text-decoration: none; color: var(--text); font-size: 14px; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: none; }
.seg a.on { background: var(--navy); color: #fff; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 12px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { background: #f7f9fc; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 108px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.other { background: #fafbfd; }
.cal-cell.other .cal-day { color: #b0b8c4; }
.cal-cell.today { background: #fff6ef; }
.cal-day { font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none; align-self: flex-start; padding: 1px 6px; border-radius: 10px; }
.cal-cell.today .cal-day { background: var(--orange); color: #fff; }
.cal-more { font-size: 11px; color: var(--muted); }
.ev-chip { display: block; width: 100%; text-align: left; border: none; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, white); color: #1f2933;
  font-size: 11.5px; padding: 2px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.ev-chip:hover { filter: brightness(.96); }
.ev-chip.ev-season { background: transparent; font-style: italic; color: var(--lit-season); }
.loc-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; background: var(--navy); color: #fff; border-radius: 3px; padding: 0 3px; margin-left: 3px; vertical-align: 1px; }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-col { border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 220px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.week-col.today { border-color: var(--orange); background: #fffaf5; }
.week-head { text-decoration: none; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.week-head b { color: var(--navy); font-size: 16px; }
.week-col .ev-chip { white-space: normal; font-size: 12.5px; padding: 4px 6px; }

.agenda-day { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.agenda-day.today .agenda-date b { color: var(--orange); }
.agenda-date { width: 56px; flex-shrink: 0; text-align: center; display: flex; flex-direction: column; }
.agenda-date b { font-size: 24px; color: var(--navy); line-height: 1; }
.agenda-date span { font-size: 12px; color: var(--muted); }
.agenda-items { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.agenda-item { border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 8%, white); padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.agenda-item:hover { background: color-mix(in srgb, var(--c) 15%, white); }
.ai-title { font-weight: 600; color: var(--navy); }
.ev-head { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c); }
table.readings td { padding: 5px 8px; }

.up-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.up-date { width: 46px; flex-shrink: 0; text-align: center; border-left: 4px solid var(--c); padding-left: 4px; display: flex; flex-direction: column; }
.up-date b { font-size: 20px; color: var(--navy); line-height: 1; }
.up-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; }

.lit-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-left: 5px solid var(--lit-season); }
.lit-status.off { border-left-color: var(--muted); }
.holy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }

/* Homepage events */
.home-events { padding: 90px 0 20px; }
.home-events h2 { font-size: 32px; font-weight: 500; margin: 0 0 14px; }
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.event-card { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid #e3e8ef; border-top: 4px solid var(--c); border-radius: 6px; padding: 18px; box-shadow: 0 6px 20px rgba(20,33,61,.06); }
.ec-date { text-align: center; min-width: 52px; display: flex; flex-direction: column; }
.ec-date b { font-size: 30px; color: var(--ink); line-height: 1; }
.ec-date span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); font-weight: 600; }
.ec-cat { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c); margin-bottom: 4px; }
.event-card h3 { font-size: 17px; margin: 0 0 6px; }
.ec-meta { font-size: 13px; color: #6b7785; }

@media (max-width: 900px) {
  .events-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .week-col { min-height: 0; }
  .cal-cell { min-height: 74px; }
  .cal-cell .ev-chip { font-size: 0; height: 6px; padding: 0; border-left-width: 0; background: var(--c); }
  .cal-cell .ev-chip .loc-tag { display: none; }
  .cal-dow { font-size: 10px; padding: 4px 2px; text-align: center; }
}

/* Online meetings */
.meet-fs { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; margin: 6px 0 0; }
.meet-fs legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
.meet-logo { display: inline-block; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: #64748b; position: relative; }
.meet-logo::after { content: ''; position: absolute; inset: 9px 7px; border-radius: 3px; background: #fff; }
.meet-logo.google_meet { background: linear-gradient(135deg, #00897b 0 50%, #1e88e5 50% 75%, #fbc02d 75%); }
.meet-logo.zoom { background: #2d8cff; }
.join-box { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #cfe0f5; background: #f3f8ff; border-radius: 10px; margin: 10px 0; flex-wrap: wrap; }
.meet-status { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.meet-row { display: flex; align-items: center; gap: 10px; }
.on-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; background: #2d8cff; color: #fff; border-radius: 3px; padding: 0 3px; margin-left: 3px; vertical-align: 1px; }
.ec-join { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--orange-2) !important; text-decoration: none; }
.ec-join:hover { text-decoration: underline; }

/* About Us decorative photo */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-bottom: 80px; }
.about-photo { position: relative; margin: 0 18px 18px 0; z-index: 0; }
.about-photo::before { content: ''; position: absolute; top: 22px; left: 22px; right: -22px; bottom: -22px; border: 3px solid var(--orange); border-radius: 6px; z-index: -1; }
.about-photo::after { content: ''; position: absolute; top: -18px; left: -18px; width: 90px; height: 90px; z-index: -1;
  background-image: radial-gradient(var(--ink) 1.6px, transparent 1.6px); background-size: 12px 12px; opacity: .25; }
.about-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 18px 40px rgba(20,33,61,.22); }
.about-badge { position: absolute; left: -20px; bottom: 28px; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff;
  padding: 14px 20px; border-radius: 6px; box-shadow: 0 12px 30px rgba(20,33,61,.35); border-left: 4px solid var(--orange); }
.about-badge b { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.about-badge small { display: block; font-size: 12px; opacity: .75; }
.ab-cross { font-size: 26px; color: var(--orange); line-height: 1; }
.services-full { grid-template-columns: repeat(3, 1fr); gap: 40px 50px; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; margin-bottom: 56px; }
  .about-photo { margin: 0 22px 22px 0; }
  .about-badge { left: 10px; bottom: 14px; padding: 10px 14px; }
  .services-full { grid-template-columns: 1fr 1fr; }
}
.lit-alert { border-left: 5px solid var(--bad); background: #fff5f5; }
.lit-alert.off { border-left-color: var(--muted); background: #f7f9fc; }
.lit-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lit-switch button { white-space: nowrap; flex-shrink: 0; }

/* Service cards (About Us) */
.services-full { gap: 28px; }
.service-card { background: #fff; border: 1px solid #e3e8ef; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px rgba(20,33,61,.06); transition: transform .2s, box-shadow .2s; }
.service-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20,33,61,.12); }
.service-media { position: relative; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 25% 25%, rgba(120,160,230,.25), transparent 45%), linear-gradient(150deg, #1a2d55, #12213f); color: rgba(255,255,255,.85); }
.service-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.service-media.has-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,27,52,0) 55%, rgba(14,27,52,.45)); }
.service-card .service-icon { position: absolute; left: 18px; bottom: -19px; z-index: 2; margin: 0; background: #fff; border: none; color: var(--orange);
  width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 4px 12px rgba(20,33,61,.18); }
.service-body { padding: 30px 20px 22px; }

/* ---------- Homepage & Logo: About Us cards manager ---------- */
.svc-admin { display: grid; gap: 10px; }
.svc-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.svc-item.off { opacity: .6; }
.svc-thumb { width: 120px; height: 80px; border-radius: 8px; overflow: hidden; background: #1a2b4c; color: #f5873a; display: flex; align-items: center; justify-content: center; }
.svc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-info strong { color: #1a2b4c; }
.svc-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 420px; }
.svc-actions button.danger { color: #b42318; }
.svc-icons { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.svc-icon-opt { margin: 0; cursor: pointer; }
.svc-icon-opt input { position: absolute; opacity: 0; pointer-events: none; }
.svc-icon-opt span { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 50%; color: #1a2b4c; }
.svc-icon-opt input:checked + span { border-color: #f5873a; color: #f5873a; background: #fff4ec; }
@media (max-width: 720px) {
  .svc-item { grid-template-columns: 90px 1fr; }
  .svc-thumb { width: 90px; height: 64px; }
  .svc-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}

/* ---------- Order of Mass & Daily Readings ---------- */
.mass-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 7px 14px; margin: 0; color: #1a2b4c; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: #1a2b4c; color: #fff; }
.mass-jump { display: flex; gap: 8px; overflow-x: auto; position: sticky; top: 56px; z-index: 5; background: var(--bg, #f5f7fb); padding: 8px 0; margin-bottom: 8px; }
.mass-jump a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: #1a2b4c; cursor: pointer; font-size: 13px; }
.mass-jump a:hover { border-color: #f5873a; color: #f5873a; }
.mass-doc { font-size: calc(16px * var(--mass-size, 1)); line-height: 1.6; }
.mass-sec > h2 { color: #f5873a; text-transform: uppercase; letter-spacing: .06em; font-size: .85em; margin: 22px 0 10px; border-bottom: 2px solid #f5873a; padding-bottom: 4px; }
.mass-part { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.mass-part header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mass-part h3 { margin: 0; color: #1a2b4c; font-size: 1.05em; }
.posture { font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.posture.p-stand { background: #e7f0ff; color: #1a4fa0; }
.posture.p-sit { background: #eef5e9; color: #2e6b2e; }
.posture.p-kneel { background: #fff1e6; color: #b5541b; }
.mass-note { color: #7a8394; font-style: italic; margin: 6px 0 4px; font-size: .9em; }
.ml-line { display: grid; grid-template-columns: 4.6em 1fr; gap: 8px; margin: 4px 0; }
.ml-cont { margin-top: -2px; }
.ml-who { font-size: .78em; text-transform: uppercase; letter-spacing: .04em; color: #7a8394; padding-top: .2em; }
.ml-line.who-all span { font-weight: 600; color: #1a2b4c; }
.ml-line.who-all .ml-who { color: #f5873a; }
.ml-rubric { color: #b42318; font-style: italic; font-size: .88em; margin: 6px 0 2px; }
.mass-both { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mass-lang-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #f5873a; font-weight: 700; margin: 6px 0 2px; }
.mass-missing { color: #9aa3b2; font-size: .85em; font-style: italic; }
.mass-src { color: #9aa3b2; font-size: 12px; margin: 6px 0 0; }
.mass-edit-row { display: flex; gap: 6px; margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.mass-edit-row .danger { color: #b42318; }
.rd-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rd-nav input { width: auto; margin: 0; }
.rd-nav button { margin: 0; }
.rd-date { color: #1a2b4c; margin: 10px 0; }
.rd-cel-head { display: flex; gap: 12px; align-items: center; }
.vest { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #bbb; flex: none; }
.rd-refs { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 0; }
.rd-refs dt { color: #7a8394; font-size: 13px; }
.rd-refs dd { margin: 0; font-weight: 600; color: #1a2b4c; }
.rd-mass { margin-top: 10px; }
.rd-mass-name { font-weight: 600; color: #f5873a; text-transform: capitalize; }
.rd-text { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
@media (max-width: 720px) {
  .mass-both { grid-template-columns: 1fr; gap: 6px; }
  .ml-line { grid-template-columns: 3.8em 1fr; }
}

/* Daily readings: in-app Bible text */
.rd-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.rd-tabs button { margin: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.rd-tabs button.on { background: #1a2b4c; color: #fff; border-color: #1a2b4c; }
.rd-cel-head { margin: 4px 0 8px; }
.rd-reading { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; }
.rd-reading header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.rd-reading h3 { margin: 0; color: #f5873a; text-transform: uppercase; letter-spacing: .05em; font-size: .85em; }
.rd-ref { color: #1a2b4c; font-weight: 700; }
.rd-prose { margin: 0; text-align: justify; }
.rd-pv { margin: 0 0 4px; padding-left: 1.2em; text-indent: -1.2em; }
.vn { color: #f5873a; font-size: .65em; font-weight: 700; margin-right: 3px; }
.rd-resp { margin: 10px 0 0; color: #1a2b4c; font-size: .9em; }
.rd-resp b { color: #f5873a; }
.rd-parish { background: #fff8f2; border: 1px solid #f5d2b5; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.rd-loading { animation: rdpulse 1.2s ease-in-out infinite; }
@keyframes rdpulse { 50% { opacity: .4; } }

.scc-add-link { display: inline-block; margin-top: 6px; color: #f5873a; cursor: pointer; font-weight: 600; }
.scc-add-link:hover { text-decoration: underline; }

/* ---------- Pay my fees (members) & approving member payments ---------- */
.pay-balance { font-size: 1.1em; margin-bottom: 10px; }
.pay-items { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pay-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; margin: 0; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 400; color: inherit; }
.pay-item:last-child { border-bottom: 0; }
.pay-item input { width: auto; margin: 0; }
.pay-total { text-align: right; margin: 8px 0 4px; font-size: 1.1em; color: #1a2b4c; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 10px; }
.pay-acc { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; cursor: pointer; font-weight: 400; color: inherit; flex-wrap: wrap; }
.pay-acc > input { width: auto; margin-top: 4px; }
.pay-acc.on { border-color: #f5873a; background: #fff8f2; }
.pay-acc.off { opacity: .6; }
.pay-acc-body { flex: 1; min-width: 180px; }
.pay-acc-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #f5873a; font-weight: 700; }
.pay-acc-provider { font-weight: 700; color: #1a2b4c; }
.pay-acc-number { font-size: 1.3em; font-weight: 700; letter-spacing: .03em; color: #1a2b4c; }
.proof-preview { max-width: 220px; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; }
.proof-full { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 10px; border-radius: 8px; }
.pay-slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pay-slip { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.pay-slip-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pay-slip-amt { font-size: 1.3em; font-weight: 700; color: #1a2b4c; margin: 4px 0; }
.pay-code { font-size: 2em; font-weight: 800; letter-spacing: .08em; color: #f5873a; margin: 6px 0; }
.badge.amber { background: #fff1e0; color: #b5541b; }
.pr-list { display: grid; gap: 12px; }
.pr-card { display: grid; grid-template-columns: 180px 1fr; gap: 16px; margin: 0; }
.pr-proof img { width: 180px; max-height: 240px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.pr-noproof { width: 180px; height: 120px; border-radius: 8px; background: #f2f4f8; color: #7a8394; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; }
.pr-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pr-amt { font-size: 1.4em; font-weight: 700; color: #1a2b4c; }
@media (max-width: 640px) { .pr-card { grid-template-columns: 1fr; } .pr-proof img, .pr-noproof { width: 100%; } }

/* ---------- Contributions & months ---------- */
.contrib-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.contrib-sum > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.contrib-sum > div > span { display: block; font-size: 12px; color: #7a8394; text-transform: uppercase; letter-spacing: .04em; }
.contrib-sum b { display: block; font-size: 1.25em; color: #1a2b4c; margin: 2px 0; }
.contrib-sum small { color: #7a8394; }
.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mg { border-radius: 10px; padding: 8px 10px; border: 1px solid var(--line); background: #fff; min-height: 64px; }
.mg-m { font-weight: 700; color: #1a2b4c; }
.mg-s { font-size: 12px; }
.mg-a, .mg-c { font-size: 11px; color: #7a8394; }
.mg.m-paid { background: #e9f7ef; border-color: #a8dcbc; } .mg.m-paid .mg-s { color: #1e7a45; font-weight: 600; }
.mg.m-part { background: #fff6e5; border-color: #f2cf8f; } .mg.m-part .mg-s { color: #a8640b; font-weight: 600; }
.mg.m-owed { background: #fdecec; border-color: #f1b4b4; } .mg.m-owed .mg-s { color: #b42318; font-weight: 600; }
.mg.m-upcoming .mg-s, .mg.m-before .mg-s, .mg.m-none .mg-s { color: #9aa3b2; }
@media (max-width: 720px) { .month-grid { grid-template-columns: repeat(3, 1fr); } }
.ann-item { padding: 8px 0; border-bottom: 1px solid var(--line); } .ann-item:last-child { border-bottom: 0; }

/* ---------- Directory & online ---------- */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 10px; }
.dir-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.dir-photo { position: relative; width: 52px; height: 52px; border-radius: 50%; background: #1a2b4c; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.dir-photo img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.dir-photo .dot-online { position: absolute; right: 0; bottom: 2px; border: 2px solid #fff; width: 13px; height: 13px; }
.dot-online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; margin-right: 5px; vertical-align: middle; }
.online-chip { display: inline-block; background: #f2f4f8; border-radius: 999px; padding: 2px 10px; margin: 2px; }

/* ---------- Top bar: online & notifications ---------- */
.tb-online { color: #cfd8e3; font-size: 13px; margin-right: 8px; white-space: nowrap; text-decoration: none; }
.tb-online:hover { color: #fff; }
.bell-wrap { position: relative; margin-right: 8px; }
.bell { background: transparent; border: 0; color: #fff; font-size: 18px; padding: 4px 8px; margin: 0; position: relative; cursor: pointer; }
.bell-count { position: absolute; top: -2px; right: -2px; background: #f5873a; color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; font-weight: 700; }
.bell-menu { position: absolute; right: 0; top: 38px; width: 340px; max-height: 70vh; overflow: auto; background: #fff; color: #1a2b4c; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); z-index: 50; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.bell-item span { display: block; font-size: 13px; color: #4a5568; }
.bell-item small { color: #9aa3b2; }
.bell-item.unread { background: #fff8f2; border-left: 3px solid #f5873a; }
@media (max-width: 640px) { .tb-online { display: none; } .bell-menu { width: 290px; right: -60px; } }

.pay-online { border-color: #22c55e; } .pay-online.on { background: #effcf3; border-color: #16a34a; }
.phone-pulse { font-size: 46px; animation: rdpulse 1.2s ease-in-out infinite; }

/* ---------- Register for Membership (public) & applications ---------- */
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.home-btn.ghost-btn { background: transparent; border: 2px solid rgba(255,255,255,.85); color: #fff; }
.home-btn.ghost-btn:hover { background: rgba(255,255,255,.12); }
.home-footer .home-btn.ghost-btn, .float-card .home-btn.ghost-btn { border-color: #f5873a; color: #f5873a; }
.nav-join { margin-right: 8px; padding: 9px 16px; }
@media (max-width: 860px) { .nav-join { display: none; } }
.join-page { min-height: 100vh; background: linear-gradient(180deg, #1a2b4c 0, #1a2b4c 260px, #f3f5f9 260px); }
.join-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; max-width: 980px; margin: 0 auto; }
.join-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.join-brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; object-fit: contain; }
.join-brand small { display: block; font-weight: 400; opacity: .8; font-size: 12px; }
.join-wrap { max-width: 980px; margin: 0 auto; padding: 10px 20px 40px; }
.join-intro { color: #fff; margin-bottom: 18px; }
.join-intro h1 { color: #fff; margin: 4px 0 8px; }
.join-intro .kicker { color: #f5873a; }
.join-intro .muted { color: #cfd8e3 !important; }
.join-card h3 { color: #f5873a; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; margin: 18px 0 8px; }
.join-card h3:first-child { margin-top: 0; }
.join-decl { display: block; background: #fff8f2; border: 1px solid #f5d2b5; border-radius: 8px; padding: 10px 12px; font-weight: 400; line-height: 1.5; }
.join-done { text-align: center; }
.app-card .app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.app-kv { grid-template-columns: 140px 1fr; margin-bottom: 12px; }

.app-card dl.app-kv { margin-bottom: 14px; } .app-card .actions { margin-top: 12px; }

/* Leader's own fees on the dashboard */
.my-fees-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.my-fees-row h2 { margin: 0 0 4px; }
.my-fees-grid { margin-top: 12px; }
.my-fees-grid h3, #my-fees-card > h3 { margin: 6px 0 8px; }
.where-pay { border: 1px solid var(--line, #e3e7ee); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.danger-zone { border: 1px solid #e8b4b4; }
.danger-zone h2 { color: #b42318; }
