/* Deinrim CommunityOS — mobile-first UI on top of Bootstrap 5 */
:root {
  --brand: #0d6efd;
  --brand-rgb: 13, 110, 253;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --bottomnav-h: 62px;
  --surface: #ffffff;
  --bg: #f4f6fa;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 85%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--brand) 75%, #000); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .15); }
.form-label { font-weight: 500; font-size: .9rem; margin-bottom: .3rem; }
.form-text { font-size: .8rem; }
.required::after { content: " *"; color: #dc3545; }

/* ---------- Shell ---------- */
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; }
.topbar .org-name { font-weight: 600; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .nav-link { color: #374151; border-radius: 8px; padding: .55rem .75rem; display: flex; align-items: center; gap: .7rem; font-size: .93rem; }
.sidebar .nav-link i { font-size: 1.1rem; width: 1.2rem; text-align: center; color: #6b7280; }
.sidebar .nav-link:hover { background: #f3f4f6; }
.sidebar .nav-link.active { background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--brand); }
.sidebar .nav-section { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar .badge { margin-left: auto; }
@media (min-width: 992px) {
  .sidebar-desktop { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; overflow-y: auto; padding: .75rem; }
  .main { margin-left: var(--sidebar-w); }
  .bottom-nav { display: none !important; }
}
@media (max-width: 991.98px) {
  .sidebar-desktop { display: none; }
  .main { padding-bottom: calc(var(--bottomnav-h) + 12px); }
}
.main { min-height: calc(100vh - var(--topbar-h)); }
.content { padding: 1rem; max-width: 1280px; }
@media (min-width: 768px) { .content { padding: 1.5rem 2rem; } }

/* Mobile bottom navigation */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottomnav-h); background: var(--surface); border-top: 1px solid var(--line); z-index: 1030; display: flex; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; color: #6b7280; text-decoration: none; border: 0; background: none; gap: 2px; }
.bottom-nav i { font-size: 1.25rem; }
.bottom-nav .active { color: var(--brand); }
.bottom-nav .fab { width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: #fff; margin-top: -18px; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .4); display: flex; align-items: center; justify-content: center; flex: 0 0 48px; }
.bottom-nav .fab i { font-size: 1.5rem; color: #fff; }

/* ---------- Components ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.card { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; padding: .85rem 1rem; }
.stat { padding: 1rem; display: flex; flex-direction: row; align-items: center; gap: .85rem; height: 100%; text-decoration: none; color: inherit; }
.stat .icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat .val { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { font-size: .8rem; color: var(--muted); }
a.card:hover { border-color: rgba(var(--brand-rgb), .4); }
.tint-blue { background: #e7f0ff; color: #1d4ed8; } .tint-green { background: #e7f8ee; color: #15803d; } .tint-amber { background: #fff4e0; color: #b45309; }
.tint-red { background: #fde8e8; color: #b91c1c; } .tint-purple { background: #f1eafe; color: #6d28d9; } .tint-gray { background: #f1f2f4; color: #4b5563; } .tint-teal { background: #e0f5f3; color: #0f766e; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: rgba(var(--brand-rgb), .12); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; flex-shrink: 0; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; }
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table-hover tbody tr { cursor: default; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.5rem; color: #cbd5e1; display: block; margin-bottom: .5rem; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .45rem 1rem; font-size: .93rem; }
.kv dt { color: var(--muted); font-weight: 400; }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .5rem; } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; margin-bottom: 1rem; }
.nav-tabs-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-scroll .nav-link { white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.checklist li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.progress-thin { height: 6px; }
.stepper { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .25rem; }
.stepper a { flex: 1 0 auto; min-width: 88px; text-decoration: none; font-size: .75rem; color: var(--muted); text-align: center; }
.stepper .dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; margin: 0 auto .25rem; font-weight: 600; background: #fff; }
.stepper .done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .current .dot { border-color: var(--brand); color: var(--brand); }
.stepper .current { color: var(--ink); font-weight: 600; }
.support-banner { background: #7c2d12; color: #fff; font-size: .88rem; }
.announce-banner { background: #1e3a8a; color: #fff; font-size: .88rem; }
.member-card-list .item { display: flex; gap: .75rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.member-card-list .item:last-child { border-bottom: 0; }
.member-card-list .item:active { background: #f3f4f6; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: .75rem 1rem; margin: 1rem -1rem -1rem; border-radius: 0 0 12px 12px; z-index: 5; }
@media (max-width: 991.98px) { .sticky-actions { bottom: var(--bottomnav-h); } }
.perm-grid td, .perm-grid th { text-align: center; vertical-align: middle; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 1.5rem; text-align: center; background: #fafbfc; }
.btn { border-radius: 8px; }
.btn-touch { min-height: 44px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 60%); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 720px; }
.public-hero { background: var(--brand); color: #fff; padding: 2.5rem 0; }
.bulk-bar { display: none; }
.bulk-bar.show { display: flex; }
.chart-box { position: relative; height: 240px; }
.small-muted { font-size: .8rem; color: var(--muted); }
.skip-link { position: absolute; left: -999px; } .skip-link:focus { left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem; }

/* ---------- Membership card ---------- */
.mcard { width: 86mm; height: 54mm; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid #d1d5db; position: relative; font-family: Arial, sans-serif; color: #111; display: inline-block; margin: 4mm; page-break-inside: avoid; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.mcard .band { height: 13mm; display: flex; align-items: center; gap: 2.5mm; padding: 0 3mm; color: #fff; }
.mcard .band img { height: 9mm; width: 9mm; object-fit: contain; background: #fff; border-radius: 2mm; }
.mcard .band .t { font-size: 3.2mm; font-weight: 700; line-height: 1.1; }
.mcard .band .s { font-size: 2.2mm; opacity: .9; }
.mcard .body { display: flex; padding: 2.5mm 3mm; gap: 3mm; }
.mcard .photo { width: 18mm; height: 22mm; object-fit: cover; border-radius: 1.5mm; background: #eef2f7; display: flex; align-items: center; justify-content: center; font-size: 5mm; color: #94a3b8; }
.mcard .info { flex: 1; font-size: 2.6mm; line-height: 1.45; min-width: 0; }
.mcard .info .n { font-size: 3.4mm; font-weight: 700; margin-bottom: .8mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .qr { width: 20mm; height: 20mm; }
.mcard .foot { position: absolute; bottom: 0; left: 0; right: 0; font-size: 2mm; color: #6b7280; padding: 1mm 3mm; border-top: 1px solid #eef0f3; display: flex; justify-content: space-between; }

@media print {
  .no-print, .topbar, .sidebar, .bottom-nav, .btn { display: none !important; }
  body { background: #fff; }
  .main { margin: 0 !important; padding: 0 !important; }
  .card { border: 0; box-shadow: none; }
  .mcard { box-shadow: none; }
}

/* ===================== v0.3 "Institutional Suite" shell ===================== */
:root { --sb-bg: #070d1a; --sb-bg2: #0b1324; --sb-ink: #c3cbd8; --sb-muted: #5f6b80; --sb-accent: #10b981; --sidebar-w: 260px; }
.sidebar-dark { background: var(--sb-bg); color: var(--sb-ink); border-right: 1px solid #111b2e; display: flex; flex-direction: column; }
@media (min-width: 992px) {
  .sidebar-dark.sidebar-desktop { position: fixed; top: 0; bottom: 0; left: 0; padding: 0; width: var(--sidebar-w); z-index: 1040; overflow: hidden; }
  .has-sidebar .topbar { margin-left: var(--sidebar-w); }
}
.offcanvas.sidebar-dark { width: 280px; }
.sb-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid #111b2e; }
.sb-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--sb-accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-title { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.1; }
.sb-sub { color: var(--sb-muted); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-top: 2px; }
.sb-scroll { flex: 1; overflow-y: auto; padding: .4rem .7rem 1rem; scrollbar-width: thin; scrollbar-color: #26324a transparent; }
.sb-section { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-muted); font-weight: 700; padding: 1.1rem .65rem .45rem; }
.sidebar-dark .nav-link { color: var(--sb-ink); border-radius: 10px; padding: .55rem .7rem; display: flex; align-items: center; gap: .75rem; font-size: .9rem; border: 1px solid transparent; margin-bottom: 2px; }
.sidebar-dark .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #8793a8; }
.sidebar-dark .nav-link:hover { background: #0f1a2e; color: #fff; }
.sidebar-dark .nav-link.active { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .35); color: #34d399; font-weight: 600; }
.sidebar-dark .nav-link.active i { color: #34d399; }
.sidebar-dark .nav-link.is-soon { color: #8a95a8; }
.sb-soon { margin-left: auto; font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; border: 1px solid #26324a; border-radius: 6px; padding: 1px 6px; }
.sb-tag { font-size: .62rem; font-weight: 800; color: #34d399; background: rgba(16, 185, 129, .14); border: 1px solid rgba(16, 185, 129, .4); border-radius: 6px; padding: 0 5px; }
.sb-tag + .sb-soon { margin-left: .35rem; }
.sb-tenant { margin: .7rem; padding: .85rem; border-radius: 12px; background: var(--sb-bg2); border: 1px solid #16223a; }
.sb-tenant-label { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sb-muted); font-weight: 700; }
.sb-tenant-name { color: #fff; font-weight: 700; font-size: .9rem; margin-top: .2rem; }
.sb-tenant-type { color: #8793a8; font-size: .75rem; }
.sb-switch { background: #16223a; color: #e2e8f0; border: 0; border-radius: 8px; padding: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sb-switch:hover { background: #1d2c4a; }
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); }

/* ---------- Organization profile ---------- */
.op-hero { border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.op-cover { position: relative; height: 230px; background: linear-gradient(135deg, var(--brand), #0f172a); background-size: cover; background-position: center; }
@media (min-width: 768px) { .op-cover { height: 270px; } }
.op-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.45) 100%); }
.op-chip { position: absolute; z-index: 2; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .35rem .8rem; }
.op-type { top: 16px; left: 16px; background: #e11d48; color: #fff; letter-spacing: .04em; text-transform: uppercase; }
.op-actions { position: absolute; z-index: 2; top: 14px; right: 14px; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.op-pill { background: rgba(15, 23, 42, .78); color: #fff; border: 0; border-radius: 10px; padding: .4rem .75rem; font-size: .78rem; font-weight: 600; }
.op-pill code { color: #fff; }
.op-body { position: relative; padding: 0 1.25rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.op-logo { width: 116px; height: 116px; border-radius: 18px; border: 5px solid #fff; background: #fff; margin-top: -58px; z-index: 3; box-shadow: 0 6px 18px rgba(0,0,0,.18); object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 800; color: var(--brand); }
.op-name { font-size: 1.7rem; font-weight: 800; line-height: 1.15; margin: .6rem 0 .25rem; color: #0f172a; }
.op-meta { color: var(--muted); font-size: .9rem; display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; }
.op-meta a { color: #e11d48; font-weight: 600; text-decoration: none; }
.op-btns { margin-left: auto; display: flex; gap: .6rem; flex-wrap: wrap; padding-bottom: .2rem; }
.btn-theme { background: #059669; color: #fff; font-weight: 600; border-radius: 10px; }
.btn-theme:hover { background: #047857; color: #fff; }
.btn-ink { background: #0f172a; color: #fff; font-weight: 600; border-radius: 10px; }
.btn-ink:hover { background: #1e293b; color: #fff; }
.comp-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .95rem 1rem; display: flex; gap: .8rem; align-items: center; height: 100%; }
.comp-card i { font-size: 1.6rem; }
.comp-card .k { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.comp-card .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .92rem; color: #0f172a; word-break: break-all; }
.comp-card .v.empty { font-family: inherit; font-weight: 500; color: #94a3b8; font-size: .85rem; }
.op-card { border-radius: 18px; }
.op-card h2 { font-size: 1.05rem; font-weight: 700; }
.op-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; font-weight: 700; }

/* ---------- Coming soon ---------- */
.soon-hero { border-radius: 20px; background: radial-gradient(circle at 85% 10%, rgba(16,185,129,.18), transparent 45%), #0b1324; color: #e2e8f0; padding: 2rem; }
.soon-hero .ic { width: 56px; height: 56px; border-radius: 14px; background: rgba(16,185,129,.16); color: #34d399; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
@media (min-width: 992px) { .has-sidebar .support-banner, .has-sidebar .announce-banner { margin-left: var(--sidebar-w); } }
.min-w-0 { min-width: 0; }
.sb-scroll { overflow-x: hidden; }
.sidebar-dark .nav-link > span.text-truncate { flex: 1 1 auto; min-width: 0; }
.sidebar-dark .nav-link { width: 100%; }
.sidebar-dark .nav { flex-wrap: nowrap; }
@media (max-width: 991.98px) { .sidebar-dark.sidebar-desktop { display: none !important; } }
.sidebar-dark .nav-link .sb-soon-ic { margin-left: auto; font-size: .72rem; width: auto; color: #4b5870; flex-shrink: 0; }
.sb-tag { flex-shrink: 0; margin-left: auto; }
.sb-tag + .sb-soon-ic { margin-left: .35rem; }
@media (max-width: 575.98px) { .op-type { top: auto; bottom: 14px; } .op-name { font-size: 1.35rem; } }

/* ---------- Receipts ---------- */
.receipt { position: relative; max-width: 820px; margin: auto; }
.receipt-head { display: flex; gap: 1rem; align-items: flex-start; border-bottom: 2px solid var(--brand); padding-bottom: .8rem; margin-bottom: .6rem; }
.receipt-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; }
.receipt-org { font-size: 1.25rem; font-weight: 800; color: var(--brand); }
.receipt-title { font-weight: 800; letter-spacing: .06em; }
.receipt-table th { width: 34%; font-weight: 500; color: var(--muted); }
.receipt-80g { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: .6rem .8rem; font-size: .88rem; }
.receipt-stamp { position: absolute; top: 40%; left: 20%; font-size: 4rem; font-weight: 900; color: rgba(220, 38, 38, .2); transform: rotate(-18deg); pointer-events: none; }
.sig-line { border-top: 1px solid #111; width: 180px; margin-bottom: .2rem; margin-top: 2.5rem; }
@media print { .sidebar-dark, .topbar, .no-print, .page-head .btn, footer { display: none !important; } .has-sidebar main, .has-sidebar .main { margin: 0 !important; } .card { border: 0 !important; } }

/* ---------- Modules ---------- */
.ev-card { border-radius: 14px; overflow: hidden; }
.ev-date { width: 58px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--brand-soft, #ecfdf5); color: var(--brand); padding: .35rem 0; line-height: 1.1; }
.ev-date .d { font-size: 1.35rem; font-weight: 800; }
.ev-date .m { font-size: .7rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.ev-photo { height: 160px; object-fit: cover; width: 100%; }
.checkin-input { font-size: 1.6rem; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.notice-body { line-height: 1.6; }
.notice-body p:last-child { margin-bottom: 0; }
.priority-urgent { border-left: 4px solid #dc2626 !important; }
.priority-important { border-left: 4px solid #f59e0b !important; }
.chat-bubble { border-radius: 12px; padding: .6rem .8rem; background: #f1f5f9; }
.chat-bubble.staff { background: #ecfdf5; }
.chat-bubble.internal { background: #fff7ed; border: 1px dashed #fdba74; }
.conf-banner { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; border-radius: 10px; padding: .5rem .8rem; font-size: .85rem; }
.att-grid label { min-width: 130px; }
.ai-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 2rem; text-align: center; background: #fafafa; }
@media (max-width: 575.98px) { .stat .val { font-size: 1.05rem; } .stat .icon { width: 36px; height: 36px; font-size: 1rem; } .stat { gap: .6rem; padding: .75rem; } .stat > div { min-width: 0; } .stat .val { overflow-wrap: anywhere; } }

/* ---------- Live demo ---------- */
.demo-banner { background: #fef3c7; color: #78350f; font-size: .85rem; }
.demo-card { border: 2px dashed #f59e0b; background: #fffbeb; }

/* v1.2 collapsible sidebar submenus */
.sidebar-dark .sb-parent .sb-chev { margin-left: auto; font-size: .7rem; width: auto; transition: transform .2s; }
.sidebar-dark .sb-parent.collapsed .sb-chev { transform: rotate(-90deg); }
.sidebar-dark .sb-parent.open { color: #fff; }
.sidebar-dark .sb-submenu { margin: 0 0 4px 1.55rem; border-left: 1px solid #26324a; padding-left: .35rem; }
.sidebar-dark .sb-submenu .nav-link { font-size: .84rem; padding: .38rem .6rem; }
/* Sports booking grid */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.slot { border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 8px; font-size: .78rem; line-height: 1.25; background: #fff; text-align: left; width: 100%; min-height: 54px; }
.slot .t { font-weight: 700; font-size: .82rem; }
.slot.free { border-color: #a7f3d0; background: #ecfdf5; cursor: pointer; }
.slot.free:hover { background: #d1fae5; }
.slot.booked { background: #eff6ff; border-color: #bfdbfe; }
.slot.booked.checked_in, .slot.booked.completed { background: #f0fdf4; border-color: #86efac; }
.slot.blocked { background: repeating-linear-gradient(45deg, #f9fafb, #f9fafb 6px, #f3f4f6 6px, #f3f4f6 12px); color: #6b7280; }
.slot.past { opacity: .55; }
.slot .who { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.checkin-result { font-size: 1.15rem; border-radius: 12px; padding: 1rem 1.25rem; }
.pass-card { max-width: 360px; border-radius: 16px; overflow: hidden; border: 1px solid #e5e7eb; background: #fff; }
.pass-card .hd { background: linear-gradient(135deg, #0f766e, #10b981); color: #fff; padding: 14px 16px; }
.att-toggle .btn { min-width: 44px; }
.sp-item.sp-on, .sp-item:has(input[type=checkbox]:checked) { border-color: #10b981 !important; background: #f0fdf4; }
.sport-badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; margin: 1px 2px 1px 0; white-space: nowrap; }
.sport-badge.lead { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }

/* v1.4 mobile app-style home (dashboard on phones) */
.m-home { margin: -1rem -1rem 1rem; }
.m-hero { position: relative; min-height: 210px; display: flex; align-items: flex-end; background-color: var(--org, #0f766e); background-image: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, .25), transparent 55%), linear-gradient(135deg, var(--org, #0f766e), color-mix(in srgb, var(--org, #0f766e) 55%, #000)); background-size: cover; background-position: center; color: #fff; overflow: hidden; }
.m-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 0%, rgba(0, 0, 0, .15) 45%, rgba(0, 0, 0, .65) 100%); }
.m-hero:not(.has-cover)::after { background: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.3px) 0 0 / 18px 18px; }
.m-hero-in { position: relative; z-index: 1; width: 100%; text-align: center; padding: 1.4rem 1rem 1.2rem; }
.m-logo { width: 78px; height: 78px; border-radius: 50%; margin: 0 auto .6rem; background: #fff; border: 3px solid rgba(255, 255, 255, .95); box-shadow: 0 6px 20px rgba(0, 0, 0, .3); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.m-logo img { width: 100%; height: 100%; object-fit: cover; }
.m-logo span { font-weight: 800; font-size: 1.6rem; color: var(--org, #0f766e); }
.m-name { font-size: 1.45rem; font-weight: 800; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.m-sub { font-size: .85rem; opacity: .92; margin-top: .2rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.m-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; padding: 1rem; margin-top: -.6rem; position: relative; z-index: 2; background: var(--bg, #f4f6fa); border-radius: 18px 18px 0 0; }
.m-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; min-height: 96px; padding: .8rem .5rem; background: #fff; border-radius: 16px; border: 1px solid #edf0f5; box-shadow: 0 2px 8px rgba(15, 23, 42, .05); text-decoration: none; color: #1f2937; font-weight: 600; font-size: .9rem; text-align: center; transition: transform .12s; }
.m-tile:active { transform: scale(.97); }
.m-ic { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.m-badge { position: absolute; top: 8px; right: 10px; min-width: 20px; height: 20px; border-radius: 10px; background: #dc2626; color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.m-glance { padding: .2rem 1rem 0; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted, #6b7280); }
@media (min-width: 400px) { .m-tiles { grid-template-columns: repeat(3, 1fr); } }
