:root {
  --rc-blue: #0F5257; --rc-blue-dark: #093A3E; --rc-gold: #FF8066; --rc-bg: #F4F6F9;
  --rc-text: #1D2636; --rc-muted: #6B7689; --sidebar-w: 248px; --sidebar-mini: 76px; --tabbar-h: 64px;
  --bs-primary: #0F5257; --bs-primary-rgb: 15, 82, 87; --bs-link-color: #0F5257; --bs-link-color-rgb: 15, 82, 87;
}
body { background: var(--rc-bg); color: var(--rc-text); -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; }

.btn-primary { --bs-btn-bg: var(--rc-blue); --bs-btn-border-color: var(--rc-blue); --bs-btn-hover-bg: var(--rc-blue-dark); --bs-btn-hover-border-color: var(--rc-blue-dark); --bs-btn-active-bg: var(--rc-blue-dark); --bs-btn-disabled-bg: var(--rc-blue); --bs-btn-disabled-border-color: var(--rc-blue); }
.btn-outline-primary { --bs-btn-color: var(--rc-blue); --bs-btn-border-color: var(--rc-blue); --bs-btn-hover-bg: var(--rc-blue); --bs-btn-hover-border-color: var(--rc-blue); --bs-btn-active-bg: var(--rc-blue); }
.btn-gold { --bs-btn-bg: var(--rc-gold); --bs-btn-border-color: var(--rc-gold); --bs-btn-hover-bg: #F0664B; --bs-btn-hover-border-color: #F0664B; --bs-btn-color: #1D2636; --bs-btn-hover-color: #1D2636; font-weight: 600; }
.btn { border-radius: .65rem; }
.form-control, .form-select { border-radius: .6rem; }

/* ---------- Shell ---------- */
.sidebar { background: linear-gradient(180deg, var(--rc-blue) 0%, var(--rc-blue-dark) 100%); color: #fff; --bs-offcanvas-width: 280px; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem .9rem; }
.brand-link { display: block; color: #fff; }
.brand-link:hover { color: #fff; }
.brand-full { display: block; width: 132px; height: auto; }
.brand-wheel { display: none; }
.brand-text { display: block; margin-top: .35rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.topbar-logo { flex: 0 0 auto; line-height: 0; }
.auth-logo { max-width: 100%; height: auto; }
.hero-logo { display: block; width: 170px; height: auto; }
.print-only { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem .65rem 1.5rem; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: .85rem; padding: .65rem .85rem; border-radius: .7rem; color: rgba(255,255,255,.82); white-space: nowrap; }
.sidebar-nav a i { font-size: 1.15rem; width: 1.3rem; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav a.active { background: #fff; color: var(--rc-blue); font-weight: 600; box-shadow: inset 4px 0 0 var(--rc-gold); }

@media (min-width: 768px) {
  .sidebar.offcanvas-md { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); display: flex; flex-direction: column; background: linear-gradient(180deg, var(--rc-blue), var(--rc-blue-dark)) !important; transition: width .18s; z-index: 1030; }
  .app-main { margin-left: var(--sidebar-w); transition: margin .18s; }
  .sidebar-collapsed .sidebar.offcanvas-md { width: var(--sidebar-mini); }
  .sidebar-collapsed .app-main { margin-left: var(--sidebar-mini); }
  .sidebar-collapsed .sidebar-nav span, .sidebar-collapsed .brand-text, .sidebar-collapsed .brand-full { display: none; }
  .sidebar-collapsed .brand-wheel { display: block; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .sidebar-nav a { justify-content: center; padding-inline: 0; }
}

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; padding-top: calc(.65rem + env(safe-area-inset-top)); background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid #E4E8EF; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.1rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span { display: block; font-size: .75rem; color: var(--rc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.year-switch select { width: auto; font-weight: 600; border-color: var(--rc-gold); }
.btn-icon { font-size: 1.3rem; padding: .1rem .4rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; padding: 0; background: var(--rc-blue); color: #fff; font-weight: 700; }
.avatar:hover, .avatar:focus { background: var(--rc-blue-dark); color: #fff; }
.content { padding: 1rem; max-width: 1400px; }

.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 1030; display: flex; background: #fff; border-top: 1px solid #E4E8EF; box-shadow: 0 -4px 16px rgba(16,36,74,.07); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--rc-muted); font-size: .7rem; }
.bottom-nav i { font-size: 1.3rem; }
.bottom-nav .active { color: var(--rc-blue); font-weight: 700; }
.bottom-nav .active i { background: rgba(255,128,102,.22); border-radius: 999px; padding: 0 1rem; }
@media (max-width: 767.98px) { .content { padding-bottom: calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom)); } }

/* ---------- Components ---------- */
.card { border: 0; border-radius: 1rem; box-shadow: 0 1px 3px rgba(16,36,74,.08); }
.card-header { background: transparent; border-bottom: 1px solid #EEF1F5; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .85rem 1rem; }
.kpi .card-body { padding: .9rem 1rem; position: relative; border-left: 4px solid var(--rc-blue); border-radius: 1rem; }
.kpi-gold .card-body { border-color: var(--rc-gold); } .kpi-green .card-body { border-color: #198754; } .kpi-red .card-body { border-color: #DC3545; }
.kpi-icon { position: absolute; right: .8rem; top: .6rem; font-size: 1.4rem; color: #C3CCDB; }
.kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rc-muted); padding-right: 1.6rem; }
.kpi-value { font-size: clamp(1.15rem, 4vw, 1.6rem); font-weight: 750; overflow-wrap: anywhere; }
.kpi-sub { font-size: .75rem; color: var(--rc-muted); }

@media (max-width: 575.98px) {
  /* Three-across cards are too narrow for an icon beside the label. */
  .col-4 > .kpi .kpi-icon { display: none; }
  .col-4 > .kpi .card-body { padding: .7rem .55rem; }
  .col-4 > .kpi .kpi-label { padding-right: 0; font-size: .66rem; letter-spacing: 0; }
  .fc .fc-toolbar { gap: .4rem; }
  .fc .fc-toolbar-title { font-size: 1rem; text-align: center; }
  .fc .fc-button { padding: .25rem .5rem; font-size: .8rem; }
}

.badge-soft { font-weight: 600; }
.badge-soft-success { background: #DFF3E7; color: #11663D; } .badge-soft-warning { background: #FDF0D3; color: #8A5A00; }
.badge-soft-danger { background: #FBE1E4; color: #A11D2D; } .badge-soft-primary { background: #DCECEC; color: var(--rc-blue); }
.badge-soft-info { background: #DDF3F8; color: #0B6477; } .badge-soft-secondary { background: #E9ECF1; color: #4B5567; }

.table { margin: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; color: var(--rc-muted); letter-spacing: .03em; }
/* Phones: tables marked .stack become cards, one row each. Screen only: paper is narrow too. */
@media screen and (max-width: 767.98px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: block; padding: .6rem .35rem; border-bottom: 1px solid #E9ECF1; }
  .table.stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .18rem .6rem !important; text-align: right !important; }
  .table.stack td::before { content: attr(data-label); color: var(--rc-muted); font-size: .8rem; text-align: left; }
  .table.stack td:first-child { display: block; text-align: left !important; font-weight: 600; }
  .table.stack td:first-child::before, .table.stack td[data-label=""]::before { content: none; }
  .table.stack td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
}

.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid #EEF1F5; }
.list-row:last-child { border-bottom: 0; }
.list-row > .grow { flex: 1; min-width: 0; }
.date-chip { width: 48px; flex: 0 0 48px; text-align: center; border-radius: .65rem; background: #DCECEC; color: var(--rc-blue); line-height: 1.05; padding: .35rem 0; }
.date-chip b { display: block; font-size: 1.15rem; } .date-chip small { text-transform: uppercase; font-size: .65rem; }
.empty { text-align: center; color: var(--rc-muted); padding: 2rem 1rem; } .empty i { font-size: 2rem; } .empty p { margin: .4rem 0 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.chart-box { position: relative; height: 260px; }
.nav-pills { flex-wrap: nowrap; overflow-x: auto; } .nav-pills .nav-link { white-space: nowrap; } .nav-pills .nav-link.active { background: var(--rc-blue); }
.area-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .35rem; }

.drawer { --bs-offcanvas-width: 460px; }
@media (max-width: 767.98px) {
  .offcanvas.drawer.offcanvas-end { top: auto; left: 0; width: 100%; height: 88dvh; border-radius: 1.25rem 1.25rem 0 0; border: 0; transform: translateY(100%); }
  .offcanvas.drawer.offcanvas-end.showing, .offcanvas.drawer.offcanvas-end.show:not(.hiding) { transform: none; }
}

/* One-tap attendance */
.attend { cursor: pointer; user-select: none; }
.attend input { width: 3em !important; height: 1.6em; }

.roadmap-month { border-top: 4px solid var(--rc-gold); }
.project-tile { display: block; border: 1px solid #E9ECF1; border-left-width: 4px; border-radius: .6rem; padding: .5rem .65rem; margin-bottom: .5rem; color: var(--rc-text); background: #fff; }
.thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .6rem; }
.minutes-body h1, .minutes-body h2, .minutes-body h3, .minutes-body h4 { font-size: 1.05rem; }
#editor { min-height: 220px; background: #fff; }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, var(--rc-blue), var(--rc-blue-dark)); }
.auth .card { width: min(400px, 100%); }
.dossier-head { background: var(--rc-blue); color: #fff; border-bottom: 5px solid var(--rc-gold); border-radius: 1rem; padding: 1.25rem 1.5rem; }

@media print {
  @page { size: A4; margin: 12mm; }
  .sidebar, .topbar, .bottom-nav, .no-print, .alert, .offcanvas, .offcanvas-backdrop { display: none !important; }
  .print-only { display: block !important; }
  .print-head { display: flex !important; gap: 16px; align-items: center; border-bottom: 3px solid var(--rc-gold); padding-bottom: 10px; margin-bottom: 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head img { width: 160px; height: auto; }
  .print-head strong, .print-head span { display: block; }
  .print-head h2 { font-size: 15px; color: var(--rc-blue); margin: 4px 0 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .col-print-12 { width: 100% !important; }
  .app-main { margin: 0 !important; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11px; }
  .card { box-shadow: none; border: 1px solid #D5DAE3; break-inside: avoid; }
  .dossier-head, .badge, .kpi .card-body, .area-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .col-lg-3 { width: 25% !important; } .col-lg-6 { width: 50% !important; }
  .chart-box { height: auto; }
  /* Charts are drawn at screen size; scale them to the printed column. */
  .chart-box canvas { width: 100% !important; height: auto !important; max-height: 220px; object-fit: contain; }
  .table > :not(caption) > * > * { padding: .25rem .4rem; }
}

/* ---------- SaaS: banners, gate, landing page ---------- */
.trial-banner{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;justify-content:space-between;background:#FFF0EC;border:1px solid #FF8066;border-left-width:5px;border-radius:.6rem;padding:.55rem .9rem;margin-bottom:1rem;font-size:.92rem}
.trial-banner.urgent{background:#FFE0D8;border-color:#E8553B}
.support-bar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between;background:#7A1F1F;color:#fff;padding:.4rem 1rem;font-size:.9rem}
.support-bar form{margin:0}
.gate-top{display:flex;align-items:center;gap:1rem;background:#fff;border-bottom:3px solid #FF8066;padding:.7rem 1rem}
.gate-main{max-width:1000px;padding-top:1.25rem;padding-bottom:2rem}
.year-choice{display:flex;gap:.7rem;align-items:flex-start;border:1px solid #D5DBE5;border-radius:.6rem;padding:.65rem .8rem;margin-bottom:.5rem;cursor:pointer}
.year-choice:has(input:checked){border-color:#0F5257;background:#EEF7F7}
.year-choice input{flex:0 0 auto;margin-top:.3rem}
.price-value{font-size:2.4rem;font-weight:700;color:#0F5257;line-height:1.1}
.price-value small{display:block;font-size:.9rem;font-weight:400;color:#5B6678}
.auth-wide{max-width:640px !important}
.hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}

body.landing{background:#fff;scroll-behavior:smooth}
.landing-nav{position:sticky;top:0;z-index:20;background:#fff;border-bottom:3px solid #FF8066;padding:.55rem 0}
.landing-nav img{max-width:100%;height:auto}
.landing-product{font-weight:700;color:#0F5257;line-height:1.1;font-size:.95rem}
.landing-nav .nav-text{color:#0F5257;text-decoration:none;font-weight:600;margin-right:.6rem}
@media (max-width:420px){.landing-product{display:none}}
.landing-hero{background:linear-gradient(135deg,#0F5257 0%,#093A3E 100%);color:#fff;padding:3rem 0 3.5rem}
.landing-hero h1{font-size:clamp(1.8rem,4.6vw,3rem);font-weight:800;line-height:1.15}
.hero-card{background:#fff;color:#1C2433;border-radius:1rem;border-top:6px solid #FF8066;padding:1.4rem;box-shadow:0 18px 40px rgba(0,0,0,.25)}
.hero-point{display:flex;gap:.7rem;align-items:center;padding:.55rem 0;border-bottom:1px solid #EDF0F5;font-weight:600}
.hero-point:last-child{border-bottom:0}
.hero-point i{color:#0F5257;font-size:1.2rem}
.feature-card{border-top:4px solid #FF8066}
.feature-icon{display:inline-grid;place-items:center;width:46px;height:46px;border-radius:.7rem;background:#E4F0F0;color:#0F5257;font-size:1.4rem;margin-bottom:.7rem}
.landing-pricing{background:#F4F6F9}
.price-card{max-width:460px;background:#fff;border-radius:1rem;border-top:6px solid #0F5257;padding:1.8rem;text-align:center;box-shadow:0 10px 30px rgba(15,82,87,.12)}
.price-tag{display:inline-block;background:#FF8066;color:#1C2433;font-weight:700;border-radius:2rem;padding:.2rem .9rem;font-size:.85rem;margin-bottom:.8rem}
.landing-footer{background:#093A3E;color:#D5E9E9;padding:2rem 0;text-align:center}
.landing-footer a{color:#FFB4A3}
.price-points{max-width:640px}
.legal{max-width:820px;line-height:1.65}
.legal h1{font-size:clamp(1.6rem,4vw,2.2rem);font-weight:800;color:#0F5257}
.legal h2{font-size:1.15rem;font-weight:700;margin-top:1.6rem;color:#0F5257}
.legal li{margin-bottom:.35rem}
.legal .card h2{margin-top:0}
.legal a{text-decoration:underline;overflow-wrap:anywhere}
.legal a.btn{text-decoration:none}
.quote{border:1px dashed #0F5257;border-radius:.6rem;padding:.6rem .8rem;background:#EEF7F7}
.quote strong{font-size:1.4rem;color:#0F5257}
#bandTable tr.chosen td{background:#FFE3DC}

/* ---------- Engagement: menu groups, card studios, RSVP, directories ---------- */
.nav-group{padding:.9rem .85rem .25rem;font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#FFB4A3;white-space:nowrap}
.sidebar-collapsed .nav-group{border-top:1px solid rgba(255,255,255,.2);margin:.35rem .5rem;padding:0}
.sidebar-collapsed .nav-group span{display:none}
.card-canvas{display:block;width:100%;height:auto;border-radius:.8rem;box-shadow:0 10px 28px rgba(16,36,74,.18);background:#fff}
.id-canvas{max-width:400px;margin:0 auto;border-radius:1.2rem}
.studio-preview{position:sticky;top:76px}
.studio-preview .card-canvas{max-width:540px;margin:0 auto}
@media (max-width:991.98px){.studio-preview{position:static}}
#printSheet{display:none}
.min-w-0{min-width:0}
.wish-today{border:2px solid #FF8066 !important}
.party-today{background:#FFF4F1}
.meeting-item{border-bottom:1px solid #EDF0F5}
.meeting-item>.list-row{border-bottom:0}
.meeting-extra{padding:0 .9rem .75rem}
.rsvp-meals{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.45rem}
.rsvp-meal{display:flex;flex-direction:column;font-size:.72rem;color:#5B6678;flex:1 1 120px;max-width:190px}
.rsvp-buttons{display:flex;flex-wrap:wrap;gap:.4rem}
.rsvp-buttons .btn{flex:1 1 90px;min-height:40px}
.rsvp-line{color:#0F5257}
.headcount{display:grid;grid-template-columns:repeat(auto-fit,minmax(86px,1fr));gap:.5rem}
.head-stat{background:#EFF6F6;border-radius:.6rem;padding:.45rem;text-align:center}
.head-stat b{display:block;font-size:1.4rem;color:#0F5257;line-height:1.2}
.head-stat small{font-size:.72rem;color:#5B6678}
.head-stat[data-stat="total"]{background:#FFE3DC}
.chips{display:flex;flex-wrap:wrap;gap:.4rem}
.chip{border:1px solid #D5DBE5;background:#fff;border-radius:2rem;padding:.4rem .85rem;font-weight:700;color:#0F5257;min-height:40px}
.chip b{font-weight:600;font-size:.75rem;color:#5B6678;margin-left:.2rem}
.chip.active{background:#0F5257;color:#fff;border-color:#0F5257}
.chip.active b{color:#FFB4A3}
.blood-badge{flex:0 0 56px;height:56px;border-radius:50%;background:#B3202A;color:#fff;display:grid;place-items:center;font-weight:800;font-size:1.05rem}
.rotarian-offer{background:#FFF0EC;border-left:4px solid #FF8066;border-radius:.4rem;padding:.45rem .65rem;font-size:.9rem;overflow-wrap:anywhere}
.member-photo{width:130px;height:130px;object-fit:cover;border-radius:50%;border:4px solid #FF8066}
.form-section{margin:.4rem 0 0;padding-top:.6rem;border-top:1px solid #E4E8EF;color:#0F5257;font-weight:700}
@media print{
  body.printing-sheet .app-main > :not(main), body.printing-sheet main > :not(#printSheet), body.printing-sheet .sidebar, body.printing-sheet .bottom-nav, body.printing-sheet .offcanvas{display:none !important}
  body.printing-sheet #printSheet{display:block !important;text-align:center}
  body.printing-sheet #printSheet img{max-width:100%;max-height:255mm;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* Long menu labels wrap instead of widening the menu. */
.sidebar-nav{overflow-x:hidden}
.sidebar-nav a{white-space:normal;line-height:1.3;flex-shrink:0}
.sidebar-nav a i{flex-shrink:0}
/* On phones a long page title takes two lines in place of the club name, instead of being cut off. */
@media (max-width:575.98px){
  .topbar-title h1{white-space:normal;font-size:.95rem;line-height:1.15;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
  .topbar-title span{display:none}
  .year-switch select{font-size:.8rem;padding-left:.45rem;padding-right:1.6rem;background-position:right .4rem center}
}

/* ---------- /control/ super-admin ---------- */
.control-nav{background:#06282B;color:#fff;padding:.6rem 1rem;display:flex;flex-wrap:wrap;gap:.4rem 1rem;align-items:center;border-bottom:3px solid #FF8066}
.control-nav a{color:#C4DEDF;text-decoration:none;font-weight:600;padding:.25rem .1rem}
.control-nav a.active{color:#fff;border-bottom:2px solid #FF8066}
.control-nav form{margin:0}
.control-main{padding:1.1rem 1rem 3rem;max-width:1280px;margin:0 auto}
.control-main .table td,.control-main .table th{vertical-align:middle}
