/* ---------- Design tokens ---------- */
:root {
  --bg-0: #f5f6fa;
  --bg-1: #ffffff;
  --bg-2: #f0f2f7;
  --bg-3: #e9edf5;
  --ink-1: #0b1020;
  --ink-2: #394055;
  --ink-3: #6b7280;
  --ink-4: #9aa3b2;
  --line: #e6e9f0;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #06b6d4;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #10b981;
  --info: #3b82f6;
  --card-radius: 18px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 4px 6px -1px rgba(16,24,40,.08), 0 10px 15px -3px rgba(16,24,40,.08);
  --shadow-lg: 0 10px 30px -10px rgba(16,24,40,.18), 0 24px 48px -16px rgba(16,24,40,.18);
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --grad-pay: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #4c1d95 100%);
  --grad-hero: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #ecfeff 100%);
  --grad-card: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  --font-body: 'Inter', 'Heebo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-0: #05060d;
  --bg-1: #0e1122;
  --bg-2: #151a2e;
  --bg-3: #1d2340;
  --ink-1: #f2f4fa;
  --ink-2: #c8cddb;
  --ink-3: #8e94a8;
  --ink-4: #656b80;
  --line: #252c47;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 6px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
  --grad-hero: linear-gradient(135deg, #10132a 0%, #15102e 50%, #0a1a28 100%);
  --grad-card: linear-gradient(180deg, #131736 0%, #0f1430 100%);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  color: var(--ink-1);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(99,102,241,.18), transparent 50%),
    radial-gradient(1000px 500px at 110% 10%, rgba(6,182,212,.16), transparent 50%),
    radial-gradient(800px 500px at 50% 120%, rgba(236,72,153,.14), transparent 50%),
    var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .85; }

/* ---------- Stage ---------- */
.stage {
  display: grid;
  grid-template-columns: 1fr minmax(380px, 440px);
  gap: 48px;
  max-width: 1280px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 32px;
  align-items: center;
}
.stage-copy { max-width: 560px; }
.brand-row { display: flex; gap: 16px; align-items: center; }
.brand-row h1 {
  font-size: 42px; font-weight: 900; margin: 0;
  letter-spacing: -0.02em;
  background: var(--grad-brand);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}
.brand-row .sub { color: var(--ink-3); font-size: 14px; font-weight: 500; }
.logo-tile {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--grad-brand); color: white;
  display: grid; place-items: center;
  box-shadow: var(--shadow-md);
}
.logo-tile svg { width: 28px; height: 28px; }

.tagline { font-size: 20px; line-height: 1.55; color: var(--ink-2); margin: 24px 0 12px; max-width: 460px; }
.marquee { margin-bottom: 28px; }

.features {
  list-style: none; padding: 0; margin: 0 0 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.features li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.features li span { font-size: 22px; }
.features li b { display: block; font-size: 14px; }
.features li small { color: var(--ink-3); font-size: 12px; }

.seed-hint {
  background: var(--grad-card);
  border: 1px solid var(--line);
  padding: 18px 20px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.hint-title { font-weight: 700; margin-bottom: 10px; font-size: 14px; }
.seed-hint ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.seed-hint li { display: flex; justify-content: space-between; font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.seed-hint li:hover { background: var(--bg-2); }
.seed-hint code {
  background: var(--bg-2);
  padding: 3px 8px; border-radius: 6px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.muted { color: var(--ink-3); }
.small { font-size: 12px; }

.stage-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.stage-actions .btn-ghost {
  border: 1px solid var(--line);
  background: var(--bg-1);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  width: auto;
}

/* ---------- Phone frame ---------- */
.phone-wrap { display: grid; place-items: center; }
.phone { width: 390px; position: relative; transform: translateZ(0); }
.phone-frame {
  background: #0b0d14;
  border-radius: 56px;
  padding: 14px;
  box-shadow:
    0 0 0 2px #1a1d2a,
    0 0 0 4px #2a2d3a,
    0 50px 100px -30px rgba(0,0,0,.6),
    inset 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
}
.phone-side-btn {
  position: absolute;
  background: #1a1d2a;
  border-radius: 2px;
}
.phone-side-btn.left  { left: -2px; top: 120px; width: 3px; height: 30px; }
.phone-side-btn.left2 { left: -2px; top: 160px; width: 3px; height: 52px; }
.phone-side-btn.right { right: -2px; top: 150px; width: 3px; height: 72px; }

.phone-notch {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 32px;
  background: #000;
  border-radius: 24px;
  z-index: 10;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 812px;
  border-radius: 44px;
  overflow: hidden;
  overflow-y: auto;
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
}
.phone-screen::-webkit-scrollbar { width: 0; display: none; }

.stage.fullscreen { grid-template-columns: 1fr; padding: 0; max-width: 100%; }
.stage.fullscreen .stage-copy { display: none; }
.stage.fullscreen .phone { width: 100vw; }
.stage.fullscreen .phone-frame { border-radius: 0; padding: 0; box-shadow: none; background: var(--bg-0); }
.stage.fullscreen .phone-notch, .stage.fullscreen .phone-side-btn { display: none; }
.stage.fullscreen .phone-screen { height: 100vh; border-radius: 0; }

/* ---------- Status bar ---------- */
.status-bar {
  flex: 0 0 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-1);
}
.sb-time { letter-spacing: -0.02em; }
.sb-right { display: flex; align-items: center; gap: 5px; }
.sb-right svg { width: 16px; height: 11px; color: var(--ink-1); }
.sb-right svg:last-child { width: 24px; height: 12px; }

/* ---------- App scroll area ---------- */
.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 8px 0 86px;
}
.app-scroll::-webkit-scrollbar { width: 0; display: none; }

.view { display: block; padding: 0 20px; animation: fadeUp .3s ease; }
.view.hidden { display: none !important; }
.hidden { display: none !important; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Headers ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 16px;
  gap: 12px;
  position: sticky; top: 0;
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-0) 70%, transparent 100%);
  z-index: 5;
}
.app-header h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.app-header .spacer { width: 40px; }
.greet-hi { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.greet-name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-1);
  cursor: pointer;
  position: relative;
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .pill {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  border: 2px solid var(--bg-0);
}
.icon-btn .pill[data-n="0"] { display: none; }

/* ---------- LOGIN ---------- */
.login-hero { text-align: center; padding: 18px 0 12px; }
.login-logo {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: var(--grad-brand);
  margin: 0 auto 16px;
  display: grid; place-items: center;
  color: white;
  box-shadow: 0 20px 40px -15px rgba(99,102,241,.6);
  animation: float 3.5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login-logo svg { width: 44px; height: 44px; }
.login-title {
  font-size: 28px; font-weight: 900;
  margin: 0;
  background: var(--grad-brand);
  background-clip: text; -webkit-background-clip: text; color: transparent;
  letter-spacing: -0.02em;
}
.login-sub { margin-top: 6px; }

.login-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 20px;
  margin-top: 14px;
  box-shadow: var(--shadow-md);
}
.login-card label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 8px;
}

.phone-input {
  display: flex; align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  height: 54px;
}
.phone-input .cc {
  font-weight: 700;
  color: var(--ink-1);
  padding-right: 10px;
  margin-right: 10px;
  border-right: 1px solid var(--line);
}
.phone-input input {
  flex: 1;
  border: none; outline: none;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
}

.otp-input {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 4px 0 10px;
  width: 100%;
  max-width: 100%;
  direction: ltr;
}
.otp-input input {
  width: 100%;
  min-width: 0;
  height: 52px;
  aspect-ratio: 1 / 1.2;
  max-height: 56px;
  padding: 0;
  text-align: center;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  outline: none;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
  box-sizing: border-box;
}
.otp-input input:focus {
  border-color: var(--brand);
  background: var(--surface, var(--bg-2));
  box-shadow: 0 0 0 3px rgba(99,102,241,.22);
  transform: translateY(-1px);
}
.otp-input input:not(:placeholder-shown) {
  border-color: rgba(99,102,241,.45);
}
.otp-hint { text-align: center; margin-top: 4px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: var(--grad-brand);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 8px 20px -8px rgba(99,102,241,.6);
}
.btn-primary:active { transform: scale(.98); }
.btn-primary.btn-lg { padding: 16px 18px; font-size: 16px; margin-top: 14px; }
.btn-primary.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; border-radius: 10px; }
.btn-primary svg { width: 18px; height: 18px; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  background: transparent;
  color: var(--ink-2);
  border: none;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  margin-top: 8px;
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-ghost.btn-lg { padding: 14px; }

.error {
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.3);
  padding: 10px 14px;
  border-radius: 12px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}

.login-trust { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-1);
  color: var(--ink-1);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.btn-google:hover { background: var(--bg-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.text-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  color: var(--ink-1);
  font-family: inherit;
}
.text-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}
.modal label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }

/* ---------- HOME ---------- */
.building-card {
  background: var(--grad-brand);
  border-radius: 22px;
  padding: 18px 20px;
  color: white;
  box-shadow: 0 20px 40px -20px rgba(99,102,241,.6);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.building-card::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.building-card::after {
  content: '';
  position: absolute;
  right: -60px; bottom: -60px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.bc-top { display: flex; gap: 14px; align-items: center; position: relative; }
.bc-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px;
}
.bc-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.bc-addr { font-size: 13px; opacity: .85; }
.bc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.2);
  position: relative;
}
.bc-stats > div { text-align: center; }
.bc-stats b { display: block; font-size: 20px; font-weight: 800; }
.bc-stats small { font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }

.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 22px 0 12px;
}
.section-head h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.section-head a { font-size: 13px; font-weight: 600; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qa {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  color: var(--ink-1);
}
.qa::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .12;
  transform: translate(30%, -30%);
}
.qa:active { transform: scale(.97); }
.qa span { font-size: 26px; }
.qa b { font-size: 13px; font-weight: 700; color: var(--ink-1); }
.qa-1::before { background: var(--warn); }
.qa-2::before { background: var(--brand); }
.qa-3::before { background: var(--ok); }
.qa-4::before { background: var(--brand-3); }

.balance-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.bal-label { color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bal-amount { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; margin: 4px 0; }
.bal-meta { font-size: 13px; color: var(--ink-3); }
.bal-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin: 14px 0 10px;
}
.bal-bar > div {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 3px;
  transition: width .6s ease;
}
.bal-foot { display: flex; justify-content: space-between; font-size: 13px; }
.bal-foot b { font-weight: 700; }

/* ---------- Lists ---------- */
.list { display: grid; gap: 12px; }
.list.grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }

.list-item {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s;
}
.list-item:active { transform: scale(.985); }
.item-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.item-title { font-weight: 700; font-size: 14.5px; color: var(--ink-1); flex: 1; }
.item-body { color: var(--ink-2); font-size: 13px; margin-top: 6px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--ink-3); font-size: 11.5px; margin-top: 10px; }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
  background: var(--bg-1);
  border: 1px dashed var(--line);
  border-radius: 16px;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--ink-2);
  text-transform: capitalize;
  letter-spacing: .02em;
}
.badge.status-new, .badge.cat-general { background: rgba(59,130,246,.15); color: #2563eb; }
.badge.cat-maintenance { background: rgba(245,158,11,.15); color: #b45309; }
.badge.cat-urgent { background: rgba(239,68,68,.15); color: #b91c1c; }
.badge.cat-event { background: rgba(16,185,129,.15); color: #047857; }
.badge.status-open { background: rgba(59,130,246,.15); color: #2563eb; }
.badge.status-in_progress { background: rgba(245,158,11,.15); color: #b45309; }
.badge.status-resolved { background: rgba(16,185,129,.15); color: #047857; }
.badge.status-pending { background: rgba(245,158,11,.15); color: #b45309; }
.badge.status-paid { background: rgba(16,185,129,.15); color: #047857; }
.badge.status-overdue { background: rgba(239,68,68,.15); color: #b91c1c; }
.badge.prio-low { background: rgba(107,114,128,.15); color: #4b5563; }
.badge.prio-normal { background: rgba(59,130,246,.15); color: #2563eb; }
.badge.prio-high { background: rgba(245,158,11,.2); color: #b45309; }
.badge.prio-urgent { background: rgba(239,68,68,.2); color: #b91c1c; }
.badge.role-vaad_admin { background: rgba(139,92,246,.18); color: #6d28d9; }
.badge.role-vaad_member { background: rgba(99,102,241,.15); color: #4338ca; }
.badge.role-resident { background: rgba(107,114,128,.12); color: #4b5563; }
.badge.role-treasurer { background: rgba(16,185,129,.15); color: #047857; }

/* ---------- Chips ---------- */
.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  margin: 0 -20px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.chip.active {
  background: var(--ink-1);
  color: var(--bg-1);
  border-color: var(--ink-1);
}

/* ---------- Sheets ---------- */
.sheet {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.sheet-title { font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.sheet input, .sheet select, .sheet textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
  color: var(--ink-1);
}
.sheet input:focus, .sheet select:focus, .sheet textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}
.sheet textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.sheet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 6px; }
.sheet-actions .btn-primary, .sheet-actions .btn-ghost { width: auto; flex: 1; margin: 0; }

.ann-item { position: relative; }
.ann-item.pinned { border-left: 3px solid var(--warn); }

.inline-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px 2px;
  font-size: 13px;
  font-weight: 600;
}

.poll-toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, rgba(139,92,246,.08) 100%);
  border: 1.5px dashed var(--brand);
  border-radius: 14px;
  margin: 4px 0 10px;
  cursor: pointer;
  text-align: start;
  transition: all .15s;
  color: var(--ink-1);
  font-family: inherit;
}
.poll-toggle-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.poll-toggle-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,.2) 0%, rgba(139,92,246,.2) 100%);
  border-style: solid;
  border-width: 2px;
}
.poll-toggle-check {
  width: 28px; height: 28px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--bg-1);
  position: relative;
}
.poll-toggle-check input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.poll-toggle-check svg { width: 18px; height: 18px; color: var(--brand); opacity: 0; transition: opacity .15s; }
.poll-toggle-btn.active .poll-toggle-check { background: var(--brand); }
.poll-toggle-btn.active .poll-toggle-check svg { color: white; opacity: 1; }
.poll-toggle-label b { display: block; font-size: 14px; font-weight: 800; }
.poll-toggle-label small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.poll-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
}
.poll-fields #poll-options-wrap { display: flex; flex-direction: column; gap: 8px; }
.poll-fields .btn-ghost { width: auto; align-self: flex-start; padding: 6px 12px; font-size: 12px; margin: 2px 0; }

/* Poll card inside announcement / standalone */
.poll-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.poll-q {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.poll-q .poll-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99,102,241,.15);
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  position: relative;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  transition: border-color .15s, transform .1s;
}
.poll-option:active { transform: scale(.99); }
.poll-option:hover { border-color: var(--brand); }
.poll-option .po-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(99,102,241,.16), rgba(99,102,241,.06));
  width: 0%;
  transition: width .6s ease;
  pointer-events: none;
}
.poll-option .po-text { position: relative; z-index: 1; }
.poll-option .po-pct { position: relative; z-index: 1; color: var(--ink-3); font-weight: 800; font-variant-numeric: tabular-nums; }
.poll-option.mine {
  border-color: var(--brand);
  background: linear-gradient(90deg, rgba(99,102,241,.08), transparent);
}
.poll-option.mine .po-text::before { content: "✓ "; color: var(--brand); font-weight: 900; }
.poll-voted .poll-option { cursor: default; }
.poll-meta {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.poll-closed { opacity: .7; }
.poll-closed .poll-option { cursor: not-allowed; }

/* ---------- Super admin ---------- */
.admin-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%);
  color: white;
  border-radius: 20px;
  margin-bottom: 18px;
  box-shadow: 0 20px 40px -20px rgba(245,158,11,.5);
  position: relative;
  overflow: hidden;
}
.admin-hero::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
}
.admin-hero-icon {
  width: 54px; height: 54px;
  background: rgba(255,255,255,.25);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 28px;
  flex-shrink: 0;
  position: relative;
}
.admin-hero-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; position: relative; }
.admin-hero-sub { font-size: 12px; opacity: .92; position: relative; }

.sheet-divider {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 10px 0 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.admin-building {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.admin-building-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.admin-building-name { font-weight: 800; font-size: 15px; }
.admin-building-addr { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.admin-building-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 12px;
}
.admin-building-stats > div { text-align: center; }
.admin-building-stats b { display: block; font-size: 15px; font-weight: 800; }
.admin-building-stats small { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.admin-building-code {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(99,102,241,.12);
  color: var(--brand);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: .02em;
}

/* Onboarding success */
.onboard-hero {
  text-align: center;
  padding: 30px 20px 16px;
}
.onboard-confetti {
  font-size: 64px;
  animation: bounce 1.2s ease-in-out infinite;
  display: inline-block;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.onboard-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
  background: var(--grad-brand);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}
.onboard-sub { color: var(--ink-3); font-size: 14px; margin: 0; }
.onboard-card {
  margin: 18px 16px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.onboard-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.onboard-row:last-child { border-bottom: none; }
.onboard-row small { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.onboard-row b { font-weight: 800; font-size: 14px; }

/* Switch user list */
.switch-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.switch-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.switch-user:hover { border-color: var(--brand); }
.switch-user .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  color: white;
  font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.switch-user-meta { flex: 1; min-width: 0; }
.switch-user-name { font-weight: 700; font-size: 13.5px; }
.switch-user-sub { font-size: 11.5px; color: var(--ink-3); font-family: ui-monospace, Menlo, monospace; }

/* Reusable empty CTA for fresh buildings */
.empty-cta {
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-1);
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--ink-3);
}
.empty-cta .emo { font-size: 42px; display: block; margin-bottom: 10px; }
.empty-cta h4 { margin: 0 0 6px; font-size: 15px; color: var(--ink-1); }
.empty-cta p { margin: 0 0 14px; font-size: 13px; }
.empty-cta .btn-primary { width: auto; display: inline-flex; }

/* ---------- Modal overlay ---------- */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,16,32,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .2s;
}
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.7); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-1);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 340px;
  padding: 24px 20px 20px;
  position: relative;
  max-height: 90%;
  overflow-y: auto;
  animation: popUp .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popUp { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.modal-close {
  position: absolute;
  top: 10px; inset-inline-end: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 16px;
  font-weight: 800;
}
.modal-close:hover { background: var(--bg-2); color: var(--ink-1); }

.invite-hero { text-align: center; padding: 6px 0 12px; }
.invite-icon {
  width: 64px; height: 64px;
  margin: 0 auto 10px;
  border-radius: 18px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  font-size: 30px;
  box-shadow: 0 15px 30px -15px rgba(99,102,241,.6);
}
.invite-hero h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }

.invite-code-box {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.12));
  border: 1.5px dashed var(--brand);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
  text-align: center;
}
.invite-code-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.invite-code {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .12em;
  font-family: ui-monospace, Menlo, monospace;
  color: var(--brand);
}

.invite-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.invite-actions button { flex: 1; margin: 0; }

.invite-steps {
  background: var(--bg-2);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  display: flex; flex-direction: column; gap: 8px;
}
.invite-step { display: flex; gap: 10px; }
.invite-step b { color: var(--brand); font-weight: 800; flex-shrink: 0; }

/* ---------- Announcement detail ---------- */
.ann-detail-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ann-detail-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(6,182,212,.15));
  display: grid; place-items: center;
  font-size: 26px;
  flex-shrink: 0;
}
.ann-detail-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  line-height: 1.35;
  color: var(--ink-1);
}
.ann-detail-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.ann-detail-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-1);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ann-detail-poll {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- Management view ---------- */
.mgmt-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.mgmt-tab {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s;
}
.mgmt-tab.active {
  background: var(--bg-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}
.mgmt-panel { display: block; }
.mgmt-panel.hidden { display: none; }
.mgmt-panel > .btn-primary { margin-bottom: 14px; width: auto; }

/* Rule/Expense/Maintenance list items */
.rule-item, .exp-item, .mt-item {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.rule-head, .exp-head, .mt-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.rule-name, .exp-title, .mt-title {
  font-weight: 700;
  font-size: 14px;
}
.rule-amount, .exp-amount {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.rule-freq, .mt-freq {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(99,102,241,.14);
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.rule-meta, .exp-meta, .mt-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 11.5px;
  margin-top: 8px;
}
.rule-actions, .mt-actions {
  display: flex; gap: 6px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.rule-actions button, .mt-actions button {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--ink-1);
  font-weight: 700;
  cursor: pointer;
}
.rule-actions .apply { background: var(--brand); color: white; border-color: var(--brand); }
.rule-actions .del, .mt-actions .del { color: var(--danger); }
.mt-actions .done { background: var(--ok); color: white; border-color: var(--ok); }

.mt-next-due {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-2);
}
.mt-next-due.soon { background: rgba(245,158,11,.18); color: #b45309; }
.mt-next-due.overdue { background: rgba(239,68,68,.18); color: #b91c1c; }

.exp-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.exp-summary > div {
  padding: 12px 14px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.exp-summary small { display: block; color: var(--ink-3); font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.exp-summary b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.file-upload-label {
  display: block;
  text-align: center;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.file-upload-label:hover { border-color: var(--brand); }
.receipt-preview {
  margin-bottom: 10px;
  padding: 8px;
  background: var(--bg-2);
  border-radius: 12px;
  text-align: center;
}
.receipt-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
}
.exp-receipt-thumb {
  display: inline-block;
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--bg-2);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

/* ---------- Audience picker ---------- */
.audience-section {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-2);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.audience-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--ink-1);
}
.audience-mode-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.aud-mode {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg-1);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.aud-mode.active {
  border-color: var(--brand);
  background: rgba(99,102,241,.12);
  color: var(--brand);
}
.aud-picker { margin-top: 8px; }
.aud-hint { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.aud-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.aud-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--bg-1);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.aud-chip.selected {
  border-color: var(--brand);
  background: rgba(99,102,241,.18);
  color: var(--brand);
}
.aud-res-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aud-res-list::-webkit-scrollbar { width: 3px; }
.aud-res-list::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 2px; }
.aud-res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .1s;
}
.aud-res-row:hover { background: var(--bg-1); }
.aud-res-row .aud-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: grid; place-items: center;
  transition: all .15s;
}
.aud-res-row.selected .aud-check {
  background: var(--brand);
  border-color: var(--brand);
}
.aud-res-row.selected .aud-check::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.aud-res-info { flex: 1; }
.aud-res-info b { display: block; font-size: 13px; font-weight: 700; }
.aud-res-info small { color: var(--ink-3); font-size: 11px; }
.aud-summary {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
}

/* ---------- Onboarding tour ---------- */
/* Spotlight tour — carves a hole in a dimmed layer so the user can see
   the actual tab / feature being explained, with a coach-mark card
   pointing at it. */
.tour-overlay {
  position: absolute;
  inset: 0;
  z-index: 150;
  animation: fadeIn .22s ease;
  pointer-events: none;
}
.tour-overlay.hidden { display: none; }
.tour-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}
.tour-mask rect[id="tour-spot"] {
  transition: x .35s cubic-bezier(.25,.8,.3,1), y .35s cubic-bezier(.25,.8,.3,1),
              width .35s cubic-bezier(.25,.8,.3,1), height .35s cubic-bezier(.25,.8,.3,1);
}
.tour-mask rect[id="tour-spot-ring"] {
  transition: x .35s cubic-bezier(.25,.8,.3,1), y .35s cubic-bezier(.25,.8,.3,1),
              width .35s cubic-bezier(.25,.8,.3,1), height .35s cubic-bezier(.25,.8,.3,1),
              opacity .35s;
  filter: drop-shadow(0 0 14px rgba(165,180,252,.6));
  animation: tourRingPulse 2s ease-in-out infinite;
}
@keyframes tourRingPulse {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}

.tour-card {
  position: absolute;
  width: calc(100% - 32px);
  max-width: 320px;
  inset-inline-start: 16px;
  background: var(--surface, var(--bg-1));
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow: 0 24px 50px -18px rgba(15,23,42,.45), 0 10px 26px -12px rgba(99,102,241,.45);
  text-align: start;
  pointer-events: auto;
  transition: top .35s cubic-bezier(.25,.8,.3,1), bottom .35s cubic-bezier(.25,.8,.3,1), transform .35s cubic-bezier(.25,.8,.3,1);
  animation: tourCardIn .4s cubic-bezier(.34,1.4,.64,1);
}
.tour-card.tour-card-centered {
  top: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 300px;
}
[dir="rtl"] .tour-card.tour-card-centered { transform: translate(50%, -50%); }

@keyframes tourCardIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
[dir="rtl"] .tour-card:not(.tour-card-centered) { inset-inline-start: auto; inset-inline-end: 16px; }

.tour-arrow {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--surface, var(--bg-1));
  border-inline-start: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
  z-index: -1;
  display: none;
}
.tour-card[data-arrow="up"] .tour-arrow { display: block; top: -10px; inset-inline-start: 32px; }
.tour-card[data-arrow="down"] .tour-arrow { display: block; bottom: -10px; inset-inline-start: 32px; transform: rotate(-135deg); }

.tour-step-indicator {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}
.tour-card.tour-card-centered .tour-step-indicator { justify-content: center; }
.tour-step-indicator span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg-3);
  transition: all .3s;
}
.tour-step-indicator span.active {
  background: var(--brand);
  width: 22px;
  border-radius: 4px;
}
.tour-icon {
  font-size: 38px;
  margin-bottom: 6px;
  display: inline-block;
  animation: tourBounce 1.8s ease-in-out infinite;
  line-height: 1;
}
.tour-card.tour-card-centered .tour-icon {
  font-size: 56px;
  margin-bottom: 10px;
  display: block;
}
@keyframes tourBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.tour-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink-1);
  line-height: 1.3;
}
.tour-card.tour-card-centered .tour-title { font-size: 20px; margin-bottom: 10px; }
.tour-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.tour-card.tour-card-centered .tour-body { font-size: 14px; margin-bottom: 20px; }

.tour-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tour-actions button {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform .12s;
}
.tour-actions .btn-ghost {
  background: var(--bg-2);
  color: var(--ink-3);
}
.tour-actions .btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(99,102,241,.55);
}
.tour-actions .btn-primary:hover { transform: translateY(-1px); }

.tour-step-count {
  position: absolute;
  top: 10px; inset-inline-end: 14px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-4);
  letter-spacing: .04em;
}

/* Pulse the actual target tab so it feels alive while explained */
.tour-target-highlight {
  position: relative;
  z-index: 151;
  animation: tourTargetPulse 1.6s ease-in-out infinite;
}
@keyframes tourTargetPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---------- Payments card ---------- */
/* ---------- Finance tabs ---------- */
.fin-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.fin-tab {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.fin-tab.active {
  background: var(--bg-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}
.fin-panel { display: block; }
.fin-panel.hidden { display: none; }

/* Financial health hero */
.fin-hero {
  background: var(--grad-pay);
  border-radius: 22px;
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}
.fin-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.fin-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.fin-hero-label {
  font-size: 12px;
  font-weight: 600;
  opacity: .85;
  margin-bottom: 4px;
}
.fin-hero-amount {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.fin-hero-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.fin-hero-badge.positive { background: rgba(16,185,129,.3); }
.fin-hero-badge.negative { background: rgba(239,68,68,.3); }
.fin-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.18);
  padding-top: 14px;
}
.fin-hero-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fin-hero-grid small {
  font-size: 11px;
  opacity: .75;
}
.fin-hero-grid b {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.clr-ok { color: #6ee7b7 !important; }
.clr-danger { color: #fca5a5 !important; }
.clr-warn { color: #fde68a !important; }

.trend-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.trend-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-inline-end: 4px; }

/* Collection bar */
.fin-collection-bar {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.fcb-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.fcb-stats .ok { color: var(--ok); }
.fcb-stats .warn { color: var(--warn); }
.fcb-stats .danger { color: var(--danger); }
.fcb-progress {
  height: 10px;
  background: var(--bg-3);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}
.fcb-fill-paid { background: var(--ok); transition: width .6s ease; }
.fcb-fill-pending { background: var(--warn); transition: width .6s ease; }

/* My status card (resident view) */
.my-pay-card {
  background: var(--grad-card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.my-pay-card.all-paid { border-color: var(--ok); background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(6,182,212,.08)); }
.my-pay-card.has-pending { border-color: var(--warn); background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(239,68,68,.08)); }
.my-pay-status { font-size: 13px; font-weight: 600; }
.my-pay-amount { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.my-pay-status-icon { font-size: 32px; }

.pay-card {
  background: var(--grad-pay);
  border-radius: 22px;
  padding: 22px 22px 18px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 30px 60px -25px rgba(76, 29, 149, .6);
}
.pay-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 120%, rgba(168,85,247,.5), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(6,182,212,.4), transparent 50%);
  pointer-events: none;
}
.pay-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.pay-chip {
  font-size: 11px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  text-transform: uppercase; letter-spacing: .06em;
}
.pay-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #ffd56b, #ff8a00);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.pay-amount {
  font-size: 40px; font-weight: 900;
  letter-spacing: -0.02em;
  margin: 24px 0 16px;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.pay-foot {
  display: flex; justify-content: space-between; align-items: center;
  position: relative;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.pay-foot small { display: block; font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
.pay-foot b { font-size: 14px; font-weight: 700; }
.pay-card .btn-primary {
  background: white;
  color: #0b1020;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
[data-theme="dark"] .pay-card .btn-primary {
  background: #ffffff;
  color: #0b1020;
}

.payment-item .amount { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Payments dashboard ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .08;
  pointer-events: none;
}
.kpi-ok::before { background: var(--ok); }
.kpi-warn::before { background: var(--warn); }
.kpi-info::before { background: var(--info); }
.kpi-danger::before { background: var(--danger); }
.kpi-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--bg-2);
}
.kpi-ok .kpi-icon { background: rgba(16,185,129,.15); color: var(--ok); }
.kpi-warn .kpi-icon { background: rgba(245,158,11,.15); color: var(--warn); }
.kpi-info .kpi-icon { background: rgba(59,130,246,.15); color: var(--info); }
.kpi-danger .kpi-icon { background: rgba(239,68,68,.15); color: var(--danger); }
.kpi-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-lbl { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }

.dash-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.dash-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.dash-head h3 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }

.ring-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ring { flex-shrink: 0; }
[data-theme="dark"] .ring text { fill: var(--ink-1); }
.ring-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ring-legend > div { display: flex; align-items: center; gap: 8px; }
.ring-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ring-legend b { margin-inline-start: auto; font-weight: 800; font-variant-numeric: tabular-nums; }

.methods-bars { display: flex; flex-direction: column; gap: 12px; }
.method-row { }
.method-row .mr-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px;
  font-size: 12.5px;
}
.method-row .mr-top b { font-weight: 700; }
.method-row .mr-top span { color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 700; }
.method-row .mr-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 5px;
  overflow: hidden;
}
.method-row .mr-bar > div {
  height: 100%;
  border-radius: 5px;
  transition: width .6s ease;
}
.m-color-1 { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.m-color-2 { background: linear-gradient(90deg, #10b981, #06b6d4); }
.m-color-3 { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.m-color-4 { background: linear-gradient(90deg, #ec4899, #8b5cf6); }
.m-color-5 { background: linear-gradient(90deg, #0ea5e9, #6366f1); }

.debtors-list { display: flex; flex-direction: column; gap: 8px; }
.debtor {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.debtor .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  color: white;
  font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.debtor-meta { flex: 1; min-width: 0; }
.debtor-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.debtor-sub { font-size: 11.5px; color: var(--ink-3); }
.debtor-amt { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--danger); }

.dash-details {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 4px 14px;
  box-shadow: var(--shadow-sm);
}
.dash-details summary {
  padding: 14px 4px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  outline: none;
}
.dash-details summary::-webkit-details-marker { display: none; }
.dash-details summary::before { content: "▸ "; display: inline-block; transition: transform .2s; margin-inline-end: 4px; }
.dash-details[open] summary::before { transform: rotate(90deg); }
.dash-details .chips { padding: 4px 0 14px; margin: 0; }
.dash-details .list { padding-bottom: 8px; }

/* ---------- Residents ---------- */
.resident-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.resident-card .avatar {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: white;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.02em;
}
.resident-card .res-name { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.resident-card .res-apt { font-size: 11.5px; color: var(--ink-3); margin-bottom: 8px; }

/* ---------- Profile ---------- */
.profile-card { text-align: center; padding: 10px 0 24px; }
.avatar.big {
  width: 92px; height: 92px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: white;
  display: grid; place-items: center;
  font-size: 36px; font-weight: 800;
  box-shadow: 0 20px 40px -20px rgba(99,102,241,.6);
}
.profile-name { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.profile-sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.profile-badges { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.profile-badges .badge { font-size: 12px; padding: 5px 12px; }

.settings-group {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sg-title {
  padding: 14px 18px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sg-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border-left: none; border-right: none; border-bottom: none;
  width: 100%;
  color: var(--ink-1);
}
.sg-row:first-of-type { border-top: none; }
.sg-row.static { cursor: default; }
.sg-row.static b { font-weight: 700; color: var(--ink-2); font-size: 13px; }
.sg-row.link svg { width: 18px; height: 18px; color: var(--ink-4); }
.sg-row.link.danger { color: var(--danger); }
.sg-row:hover:not(.static) { background: var(--bg-2); }

/* Segmented control (language picker) */
.seg {
  display: inline-flex;
  background: var(--bg-3);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.seg button.active {
  background: var(--bg-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}

.switch {
  appearance: none;
  width: 46px; height: 28px;
  background: var(--bg-3);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 22px; height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }

.build-stamp { text-align: center; padding: 16px 0; }

/* ---------- Search ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  height: 46px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.search input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 8px 8px 22px;
  z-index: 20;
}
[data-theme="dark"] .tabbar { background: rgba(14,17,34,.82); }
.tab {
  flex: 1;
  background: transparent;
  border: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px;
  color: var(--ink-4);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  transition: color .15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--brand); }
.tab:active { transform: scale(.94); }

/* Tab badge for pending counts */
.tab-label-wrap { position: relative; display: inline-flex; align-items: center; }
.tab-badge {
  position: absolute;
  top: -10px; inset-inline-end: -14px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 999px;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.5);
}

/* Vaad-only elements are hidden by default; revealed when body has .is-vaad */
.vaad-only { display: none !important; }
body.is-vaad .vaad-only { display: flex !important; }

/* Management approvals */
.mgmt-tab-badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  margin-inline-start: 6px;
  background: #ef4444; color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
}
.approvals-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
}
.approvals-empty-ic { font-size: 42px; margin-bottom: 10px; }
.approvals-empty-title { font-size: 17px; font-weight: 800; color: var(--ink-1); margin-bottom: 6px; }
.approvals-empty-sub { font-size: 13px; line-height: 1.5; }
.approval-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px -4px rgba(15,23,42,.08);
}
.approval-card.saving { opacity: .5; pointer-events: none; }
.approval-head {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 10px;
}
.approval-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 16px;
}
.approval-info { flex: 1; min-width: 0; }
.approval-info b { display: block; font-size: 14.5px; color: var(--ink-1); }
.approval-info small { color: var(--ink-3); font-size: 12px; }
.approval-time { font-size: 11px; color: var(--ink-4); font-weight: 600; }
.approval-edit {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.approval-edit input, .approval-edit select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 13px;
}
.approval-actions {
  display: flex; gap: 8px;
}
.approval-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.approval-actions .btn-approve {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(16,185,129,.55);
}
.approval-actions .btn-approve:hover { transform: translateY(-1px); }
.approval-actions .btn-reject {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239,68,68,.35);
}
.approval-actions .btn-reject:hover { background: rgba(239,68,68,.08); }

/* ==== Vaad setup checklist (empty-building onboarding) ==== */
.setup-checklist {
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(139, 92, 246, .14));
  border: 1px solid rgba(99, 102, 241, .24);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0 18px;
}
.setup-checklist.hidden { display: none; }
body.is-vaad .setup-checklist.vaad-only { display: block; }
.setup-checklist.vaad-only.hidden { display: none !important; }
.setup-head { margin-bottom: 10px; }
.setup-head-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 3px;
}
.setup-head-top b {
  font-size: 15.5px; font-weight: 900;
  color: var(--ink-1);
  letter-spacing: -.01em;
}
.setup-head small {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}
.setup-dismiss {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, .06);
  color: var(--ink-3);
  cursor: pointer;
  font-size: 11px;
  display: grid; place-items: center;
}
.setup-progress {
  height: 5px;
  background: rgba(99, 102, 241, .14);
  border-radius: 3px;
  overflow: hidden;
}
.setup-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .4s ease;
}
.setup-step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
  padding: 10px 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-top: 1px solid rgba(99, 102, 241, .12);
  transition: transform .15s;
}
.setup-step:hover { transform: translateX(-2px); }
[dir="rtl"] .setup-step:hover { transform: translateX(2px); }
.setup-step-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand);
  color: var(--brand);
  font-weight: 900;
  font-size: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .2s;
}
.setup-step.done .setup-step-check {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.setup-step.done .setup-step-check::before { content: '✓'; }
.setup-step.done .setup-step-check span { display: none; }
.setup-step-body { flex: 1; min-width: 0; }
.setup-step-body b {
  display: block;
  font-size: 13.5px;
  color: var(--ink-1);
  font-weight: 800;
  line-height: 1.25;
}
.setup-step-body small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
}
.setup-step.done .setup-step-body b { text-decoration: line-through; color: var(--ink-3); }
.setup-arrow {
  width: 18px; height: 18px;
  color: var(--ink-4);
  flex-shrink: 0;
}
[dir="rtl"] .setup-arrow { transform: rotate(180deg); }

/* Invite share link */
.invite-link-box {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-2);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.invite-link-box code {
  font-family: 'Monaco', 'Menlo', monospace;
  color: var(--brand);
  font-weight: 700;
  word-break: break-all;
}

/* Bulk-invite inside the invite sheet */
.bulk-invite-wrap { margin-top: 14px; }
.bulk-invite-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink-1);
  padding: 8px 4px;
  border-top: 1px solid var(--line);
  outline: none;
  user-select: none;
  font-size: 13.5px;
}
.bulk-invite-details summary::-webkit-details-marker { display: none; }
.bulk-invite-details p { margin: 8px 0; line-height: 1.5; }
.bulk-invite-details textarea {
  width: 100%;
  margin: 6px 0 10px;
  padding: 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink-1);
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12.5px;
  resize: vertical;
  min-height: 110px;
  box-sizing: border-box;
}
.bulk-invite-details .btn-primary {
  width: 100%;
}
.bulk-invite-results {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 12px;
  line-height: 1.5;
}
.bulk-invite-results.hidden { display: none; }
.bulk-invite-results .bir-ok { color: #059669; font-weight: 700; }
.bulk-invite-results .bir-fail { color: #dc2626; font-weight: 700; }

/* Invite-code auto-gen button row on the create-building form */
.invite-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.invite-code-row input {
  flex: 1;
  text-transform: uppercase;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  letter-spacing: .08em;
  font-weight: 700;
}
.invite-code-row .btn-ghost {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

/* Self-serve "start a new building" entry on login */
.start-building-row {
  margin-top: 14px;
  text-align: center;
}
.btn-link-big {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  background: rgba(99, 102, 241, .08);
  border: 1px dashed rgba(99, 102, 241, .4);
  border-radius: 12px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn-link-big:hover { background: rgba(99, 102, 241, .14); transform: translateY(-1px); }
.btn-link-big small {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
}

/* Join-new-user banner (inside the step-join login screen) */
.join-banner {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(139, 92, 246, .14));
  border: 1px solid rgba(99, 102, 241, .22);
  border-radius: 14px;
  margin-bottom: 14px;
}
.join-banner-ic {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}
.join-banner b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-1);
  margin-bottom: 2px;
  line-height: 1.3;
}
.join-banner small {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* Bell unread badge */
.bell-badge {
  position: absolute;
  top: -2px; inset-inline-end: -2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface, #fff);
  pointer-events: none;
}
.notif-item.unread {
  background: linear-gradient(135deg, rgba(99, 102, 241, .05), rgba(99, 102, 241, .1));
}
.notif-item.unread .n-title::after {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  margin-inline-start: 6px;
  vertical-align: middle;
}

/* ==== Debtors card (vaad payments panel) ==== */
.debtors-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, .08), rgba(239, 68, 68, .16));
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 22px -14px rgba(239, 68, 68, .45);
}
.debtors-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.debtors-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b91c1c;
  font-size: 14.5px;
  font-weight: 800;
}
.debtors-ic { font-size: 20px; }
.debtors-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, .14);
  color: #b91c1c;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s;
}
.debtors-toggle:hover { background: rgba(239, 68, 68, .22); }
.debtors-toggle svg { width: 14px; height: 14px; transition: transform .2s; }
.debtors-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.debtors-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.debtors-list.hidden { display: none; }
.debtor-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, .18);
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.debtor-row:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -6px rgba(15, 23, 42, .15); }
.debtor-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 12px;
}
.debtor-main b {
  display: block;
  font-size: 13px;
  color: var(--ink-1);
  font-weight: 700;
  line-height: 1.2;
}
.debtor-main small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
}
.debtor-age {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .15);
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.debtor-age.age-1m { background: rgba(245, 158, 11, .22); color: #b45309; }
.debtor-age.age-2m { background: rgba(239, 68, 68, .22); color: #b91c1c; }
.debtor-age.age-3m { background: rgba(220, 38, 38, .3); color: #7f1d1d; }
.debtor-amount {
  font-size: 14px;
  font-weight: 900;
  color: #b91c1c;
  font-variant-numeric: tabular-nums;
}

/* ==== Analytics (charts under payments panel) ==== */
.analytics-toggle-wrap { margin-bottom: 12px; }
.analytics-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.analytics-toggle:hover { border-color: var(--brand); }
.analytics-toggle svg { width: 16px; height: 16px; transition: transform .2s; color: var(--ink-3); }
.analytics-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.analytics-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.analytics-panel.hidden { display: none; }
.analytics-ytd {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.analytics-ytd > div {
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(99, 102, 241, .16));
  border: 1px solid rgba(99, 102, 241, .25);
  border-radius: 10px;
}
.analytics-ytd small {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: .03em;
  margin-bottom: 3px;
}
.analytics-ytd b {
  display: block;
  font-size: 17px;
  font-weight: 900;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.analytics-chart {
  margin-bottom: 16px;
}
.analytics-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.analytics-chart-head b {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-1);
}
.analytics-legend {
  display: inline-flex;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
}
.analytics-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.analytics-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.an-months-chart {
  width: 100%;
  height: 160px;
  overflow: visible;
}
.an-months-chart .bar-due { fill: #c7d2fe; }
.an-months-chart .bar-collected { fill: #6366f1; transition: opacity .15s; }
.an-months-chart .bar-collected:hover { opacity: .85; }
.an-months-chart .month-label {
  font-size: 9px;
  fill: var(--ink-4);
  font-weight: 700;
}
.an-months-chart .bar-value {
  font-size: 9px;
  fill: var(--ink-3);
  font-weight: 700;
  text-anchor: middle;
}
.analytics-methods > b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-1);
  margin-bottom: 10px;
}
.analytics-methods-body {
  display: flex;
  align-items: center;
  gap: 14px;
}
.an-donut {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
.an-donut-hole { fill: var(--surface); }
.an-donut-label {
  font-size: 14px;
  font-weight: 900;
  fill: var(--ink-1);
  text-anchor: middle;
  dominant-baseline: central;
}
.an-methods-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
}
.an-methods-legend .lm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.an-methods-legend .lm-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.an-methods-legend .lm-swatch {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.an-methods-legend .lm-amount {
  font-weight: 800;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

/* ==== Month selector + group toggle ==== */
.pay-adm-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pay-adm-filter-row .pay-adm-chips { flex: 1; min-width: 0; }
.pay-month-select {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-1);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 130px;
}
.pay-month-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.16); }
.pay-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 2px;
}
.pay-group-toggle input { accent-color: var(--brand); width: 16px; height: 16px; }

/* Month section headers in grouped view */
.pay-adm-month-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 8px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.pay-adm-month-header:first-child { margin-top: 0; }
.pay-adm-month-header .mh-counts {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}
.pay-adm-month-header .mh-total {
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

/* ==== Aging pill on payment cards ==== */
.pay-aging-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, .2);
  color: #b45309;
  margin-inline-start: 6px;
}
.pay-aging-pill.age-1m { background: rgba(245, 158, 11, .2); color: #b45309; }
.pay-aging-pill.age-2m { background: rgba(239, 68, 68, .2); color: #b91c1c; }
.pay-aging-pill.age-3m { background: rgba(220, 38, 38, .3); color: #7f1d1d; }

/* ==== Vaad-wide payments management ==== */
.pay-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.pay-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.pay-stat small {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 4px;
}
.pay-stat b {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink-1);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.pay-stat-sub {
  display: block;
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 600;
  margin-top: 2px;
}
.pay-stat-paid {
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(16,185,129,.18));
  border-color: rgba(16,185,129,.3);
}
.pay-stat-paid b { color: #059669; }
.pay-stat-pending {
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.18));
  border-color: rgba(245,158,11,.3);
}
.pay-stat-pending b { color: #b45309; }
.pay-stat-overdue {
  background: linear-gradient(135deg, rgba(239,68,68,.08), rgba(239,68,68,.2));
  border-color: rgba(239,68,68,.35);
}
.pay-stat-overdue b { color: #dc2626; }

.pay-adm-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background: var(--surface-bg, var(--bg-1, #fafbfd));
  z-index: 5;
  padding: 4px 0;
}
.pay-search-wrap {
  position: relative;
}
.pay-search-ic {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  inset-inline-start: 10px;
  width: 16px; height: 16px;
  color: var(--ink-4);
  pointer-events: none;
}
#pay-adm-search {
  width: 100%;
  padding: 11px 36px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  box-sizing: border-box;
}
#pay-adm-search:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.16);
}
.pay-search-clear {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  inset-inline-end: 8px;
  width: 22px; height: 22px;
  border: none;
  background: var(--bg-2);
  border-radius: 50%;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 11px;
  display: grid; place-items: center;
}
.pay-adm-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pay-adm-chips::-webkit-scrollbar { display: none; }
.pay-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.pay-chip.active {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px -6px rgba(99,102,241,.5);
}

.pay-adm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px -4px rgba(15,23,42,.06);
  transition: box-shadow .15s, transform .15s;
  position: relative;
  overflow: hidden;
}
.pay-adm-card.saving { opacity: .5; pointer-events: none; }
.pay-adm-card::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: transparent;
}
.pay-adm-card.status-pending::before { background: #f59e0b; }
.pay-adm-card.status-overdue::before { background: #ef4444; }
.pay-adm-card.status-paid::before { background: #10b981; }
.pay-adm-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.pay-adm-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.pay-adm-info {
  flex: 1; min-width: 0;
}
.pay-adm-info b {
  display: block;
  font-size: 14px;
  color: var(--ink-1);
  line-height: 1.25;
}
.pay-adm-info small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  margin-top: 2px;
}
.pay-adm-amount {
  text-align: end;
  flex-shrink: 0;
}
.pay-adm-amount b {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: var(--ink-1);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.pay-adm-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 3px;
}
.pay-adm-status.pending { background: rgba(245,158,11,.18); color: #b45309; }
.pay-adm-status.overdue { background: rgba(239,68,68,.2); color: #dc2626; }
.pay-adm-status.paid { background: rgba(16,185,129,.18); color: #059669; }
.pay-adm-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 10px;
  padding-inline-start: 46px;
}
.pay-adm-meta .dot { opacity: .5; margin: 0 6px; }
.pay-adm-actions {
  display: flex;
  gap: 6px;
}
.pay-adm-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
  background: var(--bg-2);
  color: var(--ink-2);
  transition: transform .12s, background .15s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pay-adm-actions button:hover { transform: translateY(-1px); }
.pay-adm-actions .btn-mark-paid {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(16,185,129,.5);
}
.pay-adm-actions .btn-revert {
  background: rgba(245,158,11,.14);
  color: #b45309;
}
.pay-adm-actions .btn-delete {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239,68,68,.3);
  flex: 0 0 40px;
}
.pay-adm-actions .btn-delete:hover { background: rgba(239,68,68,.08); }
.pay-adm-actions .btn-edit {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
  flex: 0 0 40px;
}

/* Mark-paid / edit modals — full-overlay backdrop + centered card.
   Positioned absolute inside the phone container so they correctly fill
   the app area on both desktop mockup and real mobile viewport. */
.pay-modal {
  position: absolute;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: payModalIn .2s ease;
}
@keyframes payModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pay-modal.hidden { display: none; }
.pay-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 32, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.pay-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 88%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 22px 22px 28px;
  box-shadow: 0 -24px 60px -14px rgba(15, 23, 42, .45);
  animation: payModalUp .32s cubic-bezier(.2, .9, .3, 1);
  scrollbar-width: thin;
}
.pay-modal-card::before {
  content: '';
  display: block;
  width: 42px;
  height: 4px;
  border-radius: 3px;
  background: var(--line-strong, rgba(148, 163, 184, .5));
  margin: -10px auto 16px;
}
@keyframes payModalUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.pay-modal-title {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.01em;
  color: var(--ink-1);
  margin-bottom: 14px;
}
.pay-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, transform .15s;
  z-index: 2;
}
.pay-modal-close:hover { background: var(--bg-3, var(--line)); transform: scale(1.06); }
.pay-modal-card input,
.pay-modal-card select,
.pay-modal-card textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-1);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  margin-bottom: 6px;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pay-modal-card input:focus,
.pay-modal-card select:focus,
.pay-modal-card textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}
.pay-modal-card textarea {
  resize: vertical;
  min-height: 64px;
}
.pay-modal-card .row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}
.pay-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.pay-modal-actions button {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
}
.pay-modal-actions .btn-ghost {
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1.5px solid var(--line);
}
.pay-modal-actions .btn-ghost:hover { background: var(--bg-3, var(--line)); }
.pay-modal-actions .btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(99, 102, 241, .55);
}
.pay-modal-actions .btn-primary:hover { transform: translateY(-1px); }
.pay-modal-actions .btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

@media (min-width: 600px) {
  .pay-modal {
    align-items: center;
  }
  .pay-modal-card {
    border-radius: 22px;
    max-height: 86%;
    padding: 26px 24px 24px;
  }
  .pay-modal-card::before { display: none; }
}
.pay-paid-target {
  background: var(--bg-2);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-1);
  border-inline-start: 3px solid var(--brand);
}
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 10px 0 6px;
}
.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}
.pay-method {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.pay-method.active {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px -4px rgba(99,102,241,.5);
}

/* ==== Maintenance: schedule-next picker ==== */
.mt-sched-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.mt-sched-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.mt-sched-opt:has(input:checked) {
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(139, 92, 246, .14));
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.mt-sched-opt input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.mt-sched-body {
  flex: 1;
  min-width: 0;
}
.mt-sched-body b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-1);
  line-height: 1.3;
  margin-bottom: 2px;
}
.mt-sched-body small {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}
.mt-sched-body input[type="date"] {
  margin-top: 6px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-1);
  box-sizing: border-box;
}

/* ==== Resident detail view ==== */
.rd-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(139, 92, 246, .12));
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 0 0 14px;
}
.rd-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 900;
  font-size: 26px;
  box-shadow: 0 10px 22px -8px rgba(99, 102, 241, .55);
  flex-shrink: 0;
}
.rd-ident { flex: 1; min-width: 0; }
.rd-ident h3 {
  margin: 0 0 3px;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink-1);
  letter-spacing: -.02em;
}
.rd-ident-line {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 600;
}
.rd-role {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .14);
  color: var(--brand);
}
.rd-role.hidden { display: none; }
.rd-contact {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
  direction: ltr;
  text-align: start;
}
.rd-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.rd-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 6px;
  text-align: center;
  overflow: hidden;
}
.rd-stat small {
  display: block;
  font-size: 9.5px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 3px;
}
.rd-stat b {
  display: block;
  font-size: 14.5px;
  font-weight: 900;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}
.rd-stat-paid { background: linear-gradient(135deg, rgba(16, 185, 129, .1), rgba(16, 185, 129, .2)); border-color: rgba(16, 185, 129, .3); }
.rd-stat-paid b { color: #059669; }
.rd-stat-pending { background: linear-gradient(135deg, rgba(245, 158, 11, .1), rgba(245, 158, 11, .2)); border-color: rgba(245, 158, 11, .3); }
.rd-stat-pending b { color: #b45309; }
.rd-stat-overdue { background: linear-gradient(135deg, rgba(239, 68, 68, .1), rgba(239, 68, 68, .22)); border-color: rgba(239, 68, 68, .35); }
.rd-stat-overdue b { color: #dc2626; }
.rd-stat-tickets { background: linear-gradient(135deg, rgba(99, 102, 241, .1), rgba(99, 102, 241, .2)); border-color: rgba(99, 102, 241, .3); }
.rd-stat-tickets b { color: var(--brand); }

.rd-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.rd-tab {
  flex: 1;
  padding: 11px 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rd-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.rd-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
}
.rd-tab.active .rd-tab-badge { background: var(--brand); color: #fff; }
.rd-panel.hidden { display: none; }

.rd-pay-item, .rd-tix-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  margin-bottom: 8px;
  box-shadow: 0 2px 5px -3px rgba(15, 23, 42, .06);
  position: relative;
  overflow: hidden;
}
.rd-pay-item::before, .rd-tix-item::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--line);
}
.rd-pay-item.paid::before { background: #10b981; }
.rd-pay-item.pending::before { background: #f59e0b; }
.rd-pay-item.overdue::before { background: #ef4444; }
.rd-tix-item.open::before { background: #f59e0b; }
.rd-tix-item.in_progress::before { background: #3b82f6; }
.rd-tix-item.resolved::before, .rd-tix-item.closed::before { background: #10b981; }

.rd-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
  padding-inline-start: 8px;
}
.rd-row b {
  font-size: 14px;
  color: var(--ink-1);
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.rd-row .rd-amount {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.rd-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  padding-inline-start: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.rd-meta .dot { opacity: .5; }
.rd-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 999px;
}
.rd-pill.paid { background: rgba(16, 185, 129, .18); color: #059669; }
.rd-pill.pending { background: rgba(245, 158, 11, .2); color: #b45309; }
.rd-pill.overdue { background: rgba(239, 68, 68, .2); color: #dc2626; }
.rd-pill.open { background: rgba(245, 158, 11, .2); color: #b45309; }
.rd-pill.in_progress { background: rgba(59, 130, 246, .18); color: #2563eb; }
.rd-pill.resolved, .rd-pill.closed { background: rgba(16, 185, 129, .18); color: #059669; }
.rd-pill.urgent { background: rgba(239, 68, 68, .22); color: #dc2626; }
.rd-pill.high { background: rgba(245, 158, 11, .22); color: #b45309; }
.rd-pill.medium { background: rgba(99, 102, 241, .14); color: var(--brand); }
.rd-pill.low { background: var(--bg-2); color: var(--ink-3); }

.rd-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
}
.rd-empty-ic { font-size: 40px; margin-bottom: 10px; }
.rd-empty-title { font-size: 15px; font-weight: 800; color: var(--ink-2); }

/* Clickable resident card on the list */
.resident-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.resident-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(15, 23, 42, .15); }

/* Pending-approval screen */
.pending-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 44px 24px 80px;
  text-align: center;
}
.pending-ic {
  font-size: 54px;
  margin-bottom: 14px;
  animation: pendPulse 2.4s ease-in-out infinite;
}
@keyframes pendPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.pending-title {
  font-size: 24px; font-weight: 900;
  color: var(--ink-1);
  margin-bottom: 8px;
}
.pending-sub {
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-3);
  max-width: 340px;
  margin-bottom: 22px;
}
.pending-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: 0 4px 18px -8px rgba(15,23,42,.1);
}
.pending-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.pending-row:last-child { border-bottom: none; }
.pending-row span { color: var(--ink-3); }
.pending-row b { color: var(--ink-1); font-weight: 700; }
.pending-wrap .btn-ghost {
  width: 100%; max-width: 340px;
  margin-bottom: 8px;
}
.btn-link {
  background: transparent; border: none;
  color: var(--ink-3);
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
  text-decoration: underline;
}

.home-indicator {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  width: 134px; height: 5px;
  background: var(--ink-1);
  border-radius: 3px;
  opacity: .6;
  pointer-events: none;
  z-index: 25;
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  bottom: 96px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink-1);
  color: var(--bg-1);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  animation: popIn .3s;
}
@keyframes popIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Ticket detail ---------- */
.td-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; padding-top: 4px; }
.td-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.td-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.td-card h4 { margin: 0 0 8px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.td-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-1); }
.td-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.td-meta-grid > div small { color: var(--ink-3); font-size: 11px; display: block; text-transform: uppercase; letter-spacing: .04em; }
.td-meta-grid > div b { font-size: 14px; }
.td-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.td-actions button {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  color: var(--ink-1);
}
.td-actions .active { background: var(--brand); color: white; border-color: var(--brand); }

.h-spacer { height: 20px; }

.ptr {
  position: sticky; top: 0;
  text-align: center;
  height: 40px;
  line-height: 40px;
  font-size: 20px;
  color: var(--brand);
  font-weight: 800;
  z-index: 4;
}

/* ---------- Chart card ---------- */
.chart-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 14px 10px;
  box-shadow: var(--shadow-sm);
}
.chart-card svg { width: 100%; height: 140px; display: block; }

.insights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.insight {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.insight-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--grad-brand);
  color: white;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.insight b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.insight small { color: var(--ink-3); font-size: 11px; }
.chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Notifications panel ---------- */
.notif-panel {
  position: absolute;
  top: 64px; right: 12px; left: 12px;
  max-height: 60%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 40;
  overflow: hidden;
  animation: slideDown .25s ease;
  display: flex; flex-direction: column;
}
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-head b { font-size: 15px; }
.notif-head .icon-btn { width: 32px; height: 32px; border: none; font-size: 16px; }
.notif-list { padding: 8px; overflow-y: auto; }
.notif-list::-webkit-scrollbar { width: 0; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-2); }
.notif-item .dot {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px;
}
.notif-item .dot.urgent { background: rgba(239,68,68,.15); }
.notif-item .dot.info { background: rgba(99,102,241,.15); }
.notif-item .dot.ok { background: rgba(16,185,129,.15); }
.notif-item .n-title { font-weight: 700; font-size: 13.5px; color: var(--ink-1); }
.notif-item .n-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Animated counter */
@keyframes countUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.count-anim { animation: countUp .5s ease both; }

/* Skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: skelPulse 1.4s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes skelPulse { 0% { background-position: 0% 0; } 100% { background-position: -200% 0; } }
.skel-card { height: 80px; margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; padding: 20px 12px; gap: 24px; }
  .stage-copy { display: none; }
  .phone { width: 100%; max-width: 420px; }
  .phone-frame { border-radius: 36px; padding: 10px; }
  .phone-screen { height: calc(100vh - 24px); min-height: 720px; border-radius: 28px; }
  body { background: var(--bg-0); }
}

@media (max-width: 420px) {
  .phone { max-width: 100%; }
  .phone-frame { border-radius: 0; padding: 0; background: transparent; box-shadow: none; }
  .phone-screen { height: 100vh; border-radius: 0; }
  .phone-notch, .phone-side-btn { display: none; }
}

/* RTL: global when html[dir=rtl] */
html[dir="rtl"] body { font-family: 'Heebo', 'Inter', system-ui, sans-serif; }
html[dir="rtl"] .phone-input { direction: ltr; }
html[dir="rtl"] .phone-input input { text-align: left; }
html[dir="rtl"] .otp-input input { direction: ltr; }
html[dir="rtl"] .greet-name,
html[dir="rtl"] .bc-name,
html[dir="rtl"] .login-title,
html[dir="rtl"] .sb-time,
html[dir="rtl"] .pay-amount,
html[dir="rtl"] .bal-amount,
html[dir="rtl"] .insight b,
html[dir="rtl"] .amount { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .sb-right { flex-direction: row-reverse; }
html[dir="rtl"] .sheet .row2 { direction: rtl; }
html[dir="rtl"] code { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* Production mode: hide anything marked as demo-only. Toggled at runtime
   by index.html via document.body.classList.toggle('demo-mode', demoMode). */
body:not(.demo-mode) .demo-only { display: none !important; }

/* ============================================================
   v2 production features
   ============================================================ */
.doc-item, .cont-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.doc-icon, .cont-icon {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--bg-2);
}
.doc-body, .cont-body { flex: 1; min-width: 0; }
.doc-title, .cont-title {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 2px;
  word-break: break-word;
}
.doc-meta, .cont-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 11.5px;
}
.doc-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand);
  font-weight: 700;
  font-size: 10.5px;
}
.doc-actions, .cont-actions {
  display: flex;
  gap: 4px;
  align-self: center;
}
.doc-act, .cont-act {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 14px;
}
.doc-act:hover, .cont-act:hover { background: var(--bg-3); }
.doc-act.danger:hover, .cont-act.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: var(--danger);
}
.cont-rating {
  display: inline-flex;
  gap: 1px;
  font-size: 11px;
  color: #f59e0b;
}

.audit-explain {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.06));
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.audit-explain-icon { font-size: 28px; }
.audit-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.audit-bullet {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px;
  background: var(--bg-2);
  color: var(--ink-2);
}
.audit-bullet.create { background: rgba(16, 185, 129, 0.14); color: #059669; }
.audit-bullet.delete { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.audit-bullet.update { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.audit-bullet.apply { background: rgba(99, 102, 241, 0.14); color: var(--brand); }
.audit-body b { font-weight: 700; font-size: 13.5px; display: block; margin-bottom: 2px; }
.audit-meta { font-size: 11px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.audit-time { font-size: 11px; color: var(--ink-4); white-space: nowrap; font-variant-numeric: tabular-nums; }

.emergency-modal { max-width: 320px; }
.emerg-hero { text-align: center; margin-bottom: 18px; }
.emerg-icon {
  width: 72px; height: 72px;
  margin: 0 auto 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  display: grid; place-items: center;
  font-size: 36px;
  box-shadow: 0 14px 34px -14px rgba(239, 68, 68, 0.5);
  animation: emergPulse 1.5s ease-in-out infinite;
}
@keyframes emergPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.emerg-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  color: var(--ink-1);
  text-decoration: none;
  transition: all 0.15s;
}
.emerg-btn:hover { transform: translateX(-3px); box-shadow: var(--shadow-sm); }
.emerg-btn.primary {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
}
.emerg-btn-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.emerg-btn:not(.primary) .emerg-btn-icon { background: var(--bg-1); }
.emerg-btn b { display: block; font-size: 14.5px; font-weight: 700; }
.emerg-btn small { font-size: 12px; opacity: 0.85; font-variant-numeric: tabular-nums; }

.sos-fab {
  position: absolute;
  inset-inline-end: 14px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  font-size: 22px;
  box-shadow: 0 12px 28px -10px rgba(239, 68, 68, 0.6);
  cursor: pointer;
  z-index: 50;
  display: grid;
  place-items: center;
  animation: sosFloat 2.5s ease-in-out infinite;
}
@keyframes sosFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.sos-fab.hidden { display: none; }

.skel {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-line.w80 { width: 80%; }
.skel-line.w60 { width: 60%; }
.skel-line.w40 { width: 40%; }
.skel-card {
  padding: 14px;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 10px;
}

.success-burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 999;
}
.success-burst .check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: #10b981;
  display: grid;
  place-items: center;
  color: white;
  font-size: 44px;
  font-weight: 900;
  box-shadow: 0 22px 50px -10px rgba(16, 185, 129, 0.55);
  animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes successPop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(10deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.ptr-indicator {
  position: absolute;
  top: 40px;
  inset-inline: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.ptr-indicator.visible { opacity: 1; }
.ptr-spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-1);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  font-size: 15px;
}
.ptr-spinner.loading svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.legal-body {
  padding: 4px 2px 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.legal-body h3 {
  font-size: 15px;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--ink-1);
  font-weight: 800;
  letter-spacing: -0.005em;
}
.legal-body p { margin-bottom: 10px; }
.legal-body ul,
.legal-body ol {
  margin: 8px 0 10px 20px;
  padding-inline-start: 20px;
}
.legal-body ul li,
.legal-body ol li { margin-bottom: 5px; }
.legal-body b { color: var(--ink-1); font-weight: 700; }
.legal-body a {
  color: var(--brand);
  text-decoration: underline;
  word-break: break-all;
}

/* Legal document meta block (version + effective date + print) */
.legal-meta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(6, 182, 212, 0.05));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.legal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.legal-meta-row > span:first-child {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.legal-meta-sub {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.legal-print {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.legal-print:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Big orange disclaimer note at the top */
.legal-disclaimer {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.07));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
  line-height: 1.6;
}
.legal-disclaimer b {
  display: block;
  color: #b45309;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
[data-theme="dark"] .legal-disclaimer b { color: #fbbf24; }
.legal-disclaimer p {
  margin: 0;
  color: var(--ink-2);
}

/* Retention table */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 12.5px;
}
.legal-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}
.legal-table td:first-child {
  background: var(--bg-2);
  width: 38%;
}
.legal-table b { color: var(--ink-1); }

/* Footer meta */
.legal-footer-meta {
  margin-top: 20px;
  padding-top: 10px;
}
.legal-footer-meta hr {
  border: none;
  border-top: 1px solid var(--line);
  margin-bottom: 8px;
}

/* Print styles — clean, text-only when user hits Print */
@media print {
  body * { visibility: hidden; }
  #view-legal, #view-legal * { visibility: visible; }
  #view-legal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px 30px;
    background: white;
    color: black;
  }
  .app-header, .legal-print, .legal-disclaimer, .tabbar, .sos-fab { display: none !important; }
  .legal-body { font-size: 11pt; line-height: 1.55; color: #000; }
  .legal-body h3 { font-size: 13pt; color: #000; page-break-after: avoid; }
  .legal-body a { color: #000; text-decoration: none; }
  .legal-body a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
  .legal-table td { border: 1px solid #999; }
  .legal-meta { border: 1px solid #ccc; background: none; }
}

.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
}
.install-banner.hidden { display: none; }
.install-banner .ib-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}
.install-banner .ib-text { flex: 1; font-size: 13px; }
.install-banner .ib-text b { display: block; font-weight: 700; margin-bottom: 2px; }
.install-banner button {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.offline-bar {
  position: absolute;
  bottom: 80px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #78350f;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.offline-bar.visible { opacity: 1; pointer-events: auto; }
html[dir="rtl"] .offline-bar { transform: translateX(50%); }

.ticket-attachment {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.ticket-attachment img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: cover;
}

.payment-item .pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.payment-item .pdf-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  margin: 10px 2px 0;
  line-height: 1.5;
}
.legal-consent input { margin-top: 2px; flex-shrink: 0; }
.legal-consent a { color: var(--brand); text-decoration: none; font-weight: 600; }

.danger-zone {
  margin-top: 20px;
  padding: 14px;
  border: 1px dashed var(--danger);
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.04);
}
.danger-zone h4 {
  font-size: 13px;
  color: var(--danger);
  font-weight: 800;
  margin-bottom: 8px;
}
.danger-zone .row { display: flex; gap: 8px; }
.danger-zone button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
}
.danger-zone button.delete {
  border-color: var(--danger);
  color: var(--danger);
}
.danger-zone button.delete:hover { background: var(--danger); color: white; }
