@charset "UTF-8";
/* ============================================================
   site.css — GabayCore application styles.
   Theme variables, utilities, and component-specific rules.
   No styles live in HTML <style> blocks or inline style="…".
   ============================================================ */

/* ── Theme variables (RTL Hebrew SaaS palette, mirrors gabai-react) ── */
:root {
    --background: 220 23% 97%;
    --foreground: 220 26% 14%;
    --card: 0 0% 100%;
    --card-foreground: 220 26% 14%;
    --primary: 217 83% 53%;
    --primary-foreground: 0 0% 100%;
    --primary-soft: 214 95% 93%;
    --radius: 0.75rem;   /* global corner radius (rounded-sm/md/lg derive from this in index.html tailwind config) */
    --secondary: 214 95% 93%;
    --secondary-foreground: 217 83% 45%;
    --muted: 220 14% 96%;
    --muted-foreground: 220 13% 28%;
    --accent: 214 95% 93%;
    --destructive: 0 73% 51%;
    --destructive-soft: 0 93% 94%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 71% 37%;
    --success-soft: 141 79% 92%;
    --warning: 21 90% 48%;
    --warning-soft: 34 100% 92%;
    --border: 220 13% 91%;
    --input: 220 13% 91%;   /* input/field border (React token) — was missing globally, so border-input was invisible */
    --popover: 0 0% 100%;
    --popover-foreground: 220 26% 14%;
    --accent-foreground: 217 83% 45%;
    --sidebar-gradient: linear-gradient(180deg, hsl(220 70% 22%) 0%, hsl(222 75% 17%) 50%, hsl(224 80% 13%) 100%);
    --sidebar-item-active: 217 90% 60%;
    /* current gabai-react chrome tokens (AppSidebar / GlobalHeader / dashboard cards) */
    --sidebar-item-active-bg: 217 90% 60%;
    --sidebar-border-blue: 217 60% 35%;
    --sidebar-shadow: 0 4px 24px -6px rgba(15, 30, 80, 0.4);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 6px 16px rgba(0, 0, 0, 0.07);
    --shadow-elevated: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-icon: 0 4px 12px rgba(0, 0, 0, 0.05);
    --glass-bg-white: #FFFFFF;
    --glass-blur: 2px;
    --glass-border: #E5E7EB;
}

/* ── ערכת נושא כהה (GAP 4.5) — נבחרת ב-Settings→תצוגה; sgSetTheme (util.js) מוסיף .dark ל-<html> ── */
:root.dark {
    --background: 222 26% 10%;
    --foreground: 220 20% 92%;
    --card: 222 24% 14%;
    --card-foreground: 220 20% 92%;
    --primary: 217 83% 58%;
    --primary-foreground: 0 0% 100%;
    --primary-soft: 217 50% 22%;
    --secondary: 218 30% 20%;
    --secondary-foreground: 217 80% 75%;
    --muted: 222 20% 16%;
    --muted-foreground: 220 12% 65%;
    --accent: 218 30% 20%;
    --accent-foreground: 217 80% 75%;
    --destructive: 0 70% 55%;
    --destructive-soft: 0 45% 20%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 60% 45%;
    --success-soft: 142 40% 16%;
    --warning: 28 85% 55%;
    --warning-soft: 30 50% 17%;
    --border: 220 15% 24%;
    --input: 220 15% 22%;   /* input/field border (React token) — dark mode */
    --popover: 222 24% 14%;
    --popover-foreground: 220 20% 92%;
    --glass-bg-white: #1c2333;
    --glass-border: #2a3347;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 6px 16px rgba(0, 0, 0, 0.45);
    --shadow-elevated: 0 8px 20px rgba(0, 0, 0, 0.5);
}

html { font-family: 'Heebo', sans-serif; font-size: 15px; }
body { background: hsl(var(--background)); color: hsl(var(--foreground)); margin: 0; }

/* Form controls don't inherit the page font by default — force it on all of them. */
button, input, select, textarea { font-family: inherit; }

/* ── Soft card shadow (used by Tailwind 'shadow-card') ── */
.shadow-card { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }

/* ── glass-card (mirrors gabai-react index.css) — padded card with soft border+shadow.
   Used across PaymentsHub / DebtsHub / RegistrationCenter / HelpCenter tiles. ── */
.glass-card {
    border-radius: 1.25rem;
    padding: 1.75rem;
    background: var(--glass-bg-white);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.glass-card:hover { box-shadow: var(--shadow-card-hover); border-color: hsl(var(--border)); }

/* ── Dashboard icon system (mirrors gabai-react index.css: soft-tinted bg + bold colored icon) ── */
.icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    box-shadow: var(--shadow-icon);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.icon-container:hover  { transform: scale(1.04); box-shadow: var(--shadow-card-hover); }
.icon-container:active { transform: scale(0.96); }
.icon-sm { width: 2.5rem;  height: 2.5rem; }
.icon-md { width: 3.25rem; height: 3.25rem; }
.icon-lg { width: 4rem;    height: 4rem; }

.icon-green { background: hsl(var(--success-soft));     color: hsl(var(--success)); }
.icon-red   { background: hsl(var(--destructive-soft)); color: hsl(var(--destructive)); }
.icon-amber { background: hsl(var(--warning-soft));     color: hsl(var(--warning)); }
.icon-blue, .icon-cyan { background: hsl(var(--primary-soft)); color: hsl(var(--primary)); }

/* ── Glass dropdown / header (mirrors gabai-react index.css) ── */
.glass-dropdown {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    box-shadow: var(--shadow-elevated);
    border-radius: 1rem;
    overflow: hidden;
}
.glass-header {
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border) / 0.3);
    box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.08);
}

/* ===== Global: mobile sidebar drawer (app chrome) ===== */
/* ── Mobile sidebar drawer (mirrors React's MobileSidebar) ── */
/* Breakpoint matches React useIsMobile (1024px): tablets get the mobile experience too. */
.mobile-drawer-backdrop { display: none; }
.sidebar-mobile-header { display: none; } /* shown only inside the mobile drawer */
@media (max-width: 1023px) {
    /* aside.mobile-drawer (ולא .mobile-drawer) — הסלקטור חייב לנצח את w-[170px] של הדסקטופ שעל ה-<aside>;
       ה-Tailwind Play CDN מזריק את ה-<style> שלו אחרי site.css, ובאותה ספציפיות הוא היה גובר (רוחב 170 במקום 260). */
    aside.mobile-drawer {
        position: fixed;
        right: 0;
        top: 0;
        z-index: 50;
        width: 260px;                  /* React MobileSidebar: w-[260px] */
        transform: translateX(280px);  /* React: initial/exit x: 280 (נעצר 20px מעבר לרוחב) */
        /* React: transition={{ type:"spring", damping:26, stiffness:300 }} (mass 1 כברירת מחדל).
           תרגום מדויק לקפיץ: ωd=√(300-13²)=11.4455, מגיע למנוחה ב-485ms עם overshoot של 2.81%.
           ease-out הוא fallback לדפדפנים בלי linear(). */
        transition: transform 485ms ease-out;
        transition-timing-function: linear(0, 0.0198, 0.0713, 0.1438, 0.2289, 0.3202, 0.4123, 0.5017, 0.5857, 0.6626, 0.7315, 0.7918, 0.8437, 0.8874, 0.9236, 0.9528, 0.9759, 0.9937, 1.0069, 1.0163, 1.0225, 1.0262, 1.0279, 1.0281, 1.0272, 1.0255, 1.0233, 1.0208, 1.0182, 1.0156, 1.0132, 1.0109, 1.0088, 1.0069, 1.0053, 1.0039, 1.0028, 1.0018, 1.0011, 1.0005, 1);
        /* React MobileSidebar uses shadow-xl; desktop var(--sidebar-shadow) is a soft ambient shadow. */
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    }
    aside.mobile-drawer.is-open { transform: translateX(0); }
    /* React MobileSidebar layout: no big logo card, horizontal header row instead */
    .mobile-drawer .sidebar-desktop-logo { display: none !important; }
    .mobile-drawer .sidebar-mobile-header { display: flex; }
    /* React nav: py-3 px-3 (Core desktop is py-5 px-3.5) */
    .mobile-drawer #sidebarNav {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    /* React nav items: py-3 (Core desktop is py-3.5) */
    .mobile-drawer #sidebarNav > a,
    .mobile-drawer #sidebarNav > button {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    /* React profile footer: px-3 (Core desktop is px-3.5) */
    .mobile-drawer .sidebar-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0, 0, 0, 0.4);   /* React: bg-black/40 */
        backdrop-filter: blur(4px);       /* React: backdrop-blur-sm = blur(4px) */
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        /* framer-motion: opacity ללא transition מפורש → linearTween (keyframes, ease linear, 0.3s) */
        transition: opacity 300ms linear;
    }
    .mobile-drawer-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ===== Mobile-only header + bottom nav (port of React MobileGlobalHeader + MobileBottomNav) ===== */
/* Desktop-only chrome / mobile-only chrome swap at 1024px (React useIsMobile). Tablets (768-1023px)
   render the mobile experience just like React. */
/* screen ולא all: ברוחב נייר A4 (~794px) התנאי מתקיים גם בהדפסה, ואז כל הקליפה המוביילית
   (‏#mShortSheet/#mReceiptSheet/#mDebtSheet + הניווט התחתון, שיושבים מחוץ ל-#pageBody) נדפסת
   בעמוד נוסף - "מדפיס שטויות" במדבקות דיוור/כרטיסי ברכה (Trello טסט2). */
.mobile-only { display: none; }
@media screen and (max-width: 1023px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
    /* Reserve space at bottom so the fixed bottom-nav doesn't cover page content */
    main.has-mobile-nav { padding-bottom: 6rem; }
}
@media print {
    /* בהדפסה אין קליפת מערכת כלל - לא מוביילית ולא דסקטופית; רק תוכן העמוד. */
    .mobile-only, .m-sheet, .m-sheet-backdrop, #appSidebar, .glass-header, .print-hide { display: none !important; }
    main.has-mobile-nav { padding-bottom: 0 !important; }
    main { overflow: visible !important; height: auto !important; }
}

/* Mobile header (4-row stack) */
.m-header {
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border) / 0.4);
    box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.06);
}
.m-header-btn {
    width: 2.25rem; height: 2.25rem; border-radius: 0.75rem;
    background: hsl(var(--muted) / 0.6);
    border: 1px solid hsl(var(--border) / 0.5);
    display: flex; align-items: center; justify-content: center;
    color: hsl(var(--foreground)); cursor: pointer; transition: transform 0.12s ease;
}
.m-header-btn:active { transform: scale(0.95); }
.m-search-btn {
    flex: 1; height: 2.5rem; display: flex; align-items: center; gap: 0.625rem;
    padding: 0 0.875rem; border-radius: 0.75rem;
    background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border) / 0.5);
    color: hsl(var(--muted-foreground)); font-size: 13px; text-align: right; direction: rtl;
    cursor: pointer; transition: transform 0.12s ease;
}
.m-search-btn:active { transform: scale(0.99); }
.m-bell-btn {
    position: relative;
    width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
    background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border) / 0.5);
    display: flex; align-items: center; justify-content: center;
    color: hsl(var(--foreground)); cursor: pointer; transition: transform 0.12s ease;
}
.m-bell-btn:active { transform: scale(0.95); }
.m-bell-badge {
    position: absolute; top: -0.25rem; right: -0.25rem; min-width: 16px; height: 16px; padding: 0 3px;
    background: hsl(var(--destructive)); color: #fff; border-radius: 999px;
    font-size: 10px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px hsl(var(--card));
}
.m-ind-tile {
    height: 54px; border-radius: 0.75rem;
    background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border) / 0.5);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    cursor: pointer; transition: transform 0.12s ease;
}
.m-ind-tile:active { transform: scale(0.95); }
.m-ind-tile .m-ind-val { font-size: 11px; font-weight: 700; color: hsl(var(--foreground)); line-height: 1; font-variant-numeric: tabular-nums; }

/* Mobile bottom nav (fixed) */
.m-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 0 0.75rem 0.75rem;
    pointer-events: none;
}
.m-bottom-nav > .m-bn-inner {
    pointer-events: auto; position: relative;
    background: #fff; border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    height: 64px; padding: 0 0.5rem;
    display: flex; align-items: center; justify-content: space-around;
}
.m-bn-item {
    display: flex; flex: 1; height: 100%;
    flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: transparent; border: 0; cursor: pointer; padding: 0;
}
.m-bn-item .m-bn-label { font-size: 11px; font-weight: 500; color: #94a3b8; }
.m-bn-item.is-active .m-bn-label { color: #3b82f6; }
.m-bn-item.is-active svg { color: #3b82f6 !important; stroke: #3b82f6 !important; }
.m-bn-item svg { color: #94a3b8; stroke: #94a3b8; stroke-width: 2.2; }
.m-bn-spacer { width: 3.5rem; }
.m-bn-fab {
    position: absolute; left: 50%; top: -1.5rem; transform: translateX(-50%);
    width: 3.5rem; height: 3.5rem; border-radius: 999px;
    background: #3b82f6; border: 4px solid #F5F6F8;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45);
    display: flex; align-items: center; justify-content: center;
    color: #fff; cursor: pointer;
}
.m-bn-fab:active { transform: translateX(-50%) scale(0.95); }
.m-bn-fab svg { color: #fff; stroke: #fff; stroke-width: 2.8; }

/* Mobile shortcuts bottom-sheet (opens from FAB) — animations mirror React shadcn Sheet (open 500ms ease-out / close 300ms ease-in). */
.m-sheet-backdrop {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease-in;
}
.m-sheet-backdrop.is-open {
    opacity: 1; pointer-events: auto;
    transition: opacity 0.5s ease-out;
}
.m-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    background: #fff; border-radius: 1.5rem 1.5rem 0 0;
    max-height: 80vh; overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-in;
    pointer-events: none;
}
.m-sheet.is-open {
    transform: translateY(0);
    pointer-events: auto;
    transition: transform 0.5s ease-out;
}
.m-sheet-header {
    padding: 1.25rem 1.5rem 0.75rem; text-align: right; direction: rtl;
    display: flex; align-items: center; justify-content: space-between;
}
.m-sheet-title { font-size: 18px; font-weight: 700; color: #0f172a; }
.m-sheet-close {
    width: 2rem; height: 2rem; border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; background: transparent; border: 0; cursor: pointer;
}
.m-sheet-body { padding: 0 1.25rem 2rem; }
.m-sc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.625rem; }
.m-sc-tile {
    aspect-ratio: 1 / 1; border-radius: 1rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.5rem; border: 0; cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    transition: transform 0.12s ease;
}
.m-sc-tile:active { transform: scale(0.96); }
.m-sc-tile .m-sc-label { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.15; }
/* Sub-sheet (רישום חוב / הפקת קבלה options) uses a 2-col grid, larger tiles */
.m-sc-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.m-sc-tile-lg {
    border-radius: 1rem; padding: 1rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    border: 0; cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    transition: transform 0.12s ease;
}
.m-sc-tile-lg:active { transform: scale(0.96); }
.m-sc-tile-lg .m-sc-label { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.15; }
/* Palette for shortcut tiles (mirrors React MobileBottomNav bg/iconColor/text triples). */
.m-sc-emerald { background: #ecfdf5; }
.m-sc-emerald svg { color: #059669; stroke: #059669; }
.m-sc-emerald .m-sc-label { color: #047857; }
.m-sc-rose    { background: #fff1f2; }
.m-sc-rose svg { color: #f43f5e; stroke: #f43f5e; }
.m-sc-rose .m-sc-label { color: #be123c; }
.m-sc-amber   { background: #fffbeb; }
.m-sc-amber svg { color: #d97706; stroke: #d97706; }
.m-sc-amber .m-sc-label { color: #b45309; }
.m-sc-sky     { background: #f0f9ff; }
.m-sc-sky svg { color: #0284c7; stroke: #0284c7; }
.m-sc-sky .m-sc-label { color: #0369a1; }
.m-sc-violet  { background: #f5f3ff; }
.m-sc-violet svg { color: #7c3aed; stroke: #7c3aed; }
.m-sc-violet .m-sc-label { color: #6d28d9; }
.m-sc-slate   { background: #f8fafc; }
.m-sc-slate svg { color: #475569; stroke: #475569; }
.m-sc-slate .m-sc-label { color: #334155; }
.m-sc-blue    { background: #eff6ff; }
.m-sc-blue svg { color: #2563eb; stroke: #2563eb; }
.m-sc-blue .m-sc-label { color: #1d4ed8; }
.m-sc-indigo  { background: #eef2ff; }
.m-sc-indigo svg { color: #4f46e5; stroke: #4f46e5; }
.m-sc-indigo .m-sc-label { color: #4338ca; }

/* Global: cancel leopard.css blue-hover white text + dark-blue th color on every app table
   (React tables keep their own thead/hover styling). */
tbody tr:hover { color: inherit; }
th { color: inherit; }

/* Dropdown open animation (mirrors React/shadcn fade+zoom+slide) */
@keyframes menuIn { from { opacity: 0; transform: scale(.95) translateY(-.4rem); } to { opacity: 1; transform: none; } }
.bulk-menu, #exportMenu, .custom-select-list, .filter-combobox.is-open .fcc-card { animation: menuIn .14s ease-out; }

/* Sort toolbar for member search boxes (wireMemberSortBar) - mirrors React AliyotManagement popover header */
.fcc-sort { display: flex; align-items: center; gap: 0.25rem; padding: 0.5rem; border-bottom: 1px solid hsl(var(--border)); }
.fcc-sort-label { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-inline-start: 0.25rem; }
.fcc-sort-group { display: flex; align-items: center; gap: 0.25rem; }
.fcc-sort-group + .fcc-sort-group { margin-inline-start: 0.5rem; }
.fcc-sort-btn { display: inline-flex; align-items: center; justify-content: center; height: 1.5rem; width: 1.5rem;
    border: 1px solid hsl(var(--border)); border-radius: 0.25rem; background: hsl(var(--card));
    color: hsl(var(--muted-foreground)); font-size: 0.75rem; transition: background-color .15s, color .15s, border-color .15s; cursor: pointer; padding: 0; }
.fcc-sort-btn:hover { background: hsl(var(--muted)); }
.fcc-sort-btn.is-active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.fcc-sort-btn svg { height: 0.75rem; width: 0.75rem; }
.fcc-sort-name { font-size: 0.75rem; padding: 0.125rem 0.375rem; border-radius: 0.25rem; color: hsl(var(--muted-foreground)); transition: background-color .15s, color .15s, font-weight .15s; }
.fcc-sort-name.is-active { background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); font-weight: 600; }

/* SettingsPage animations - mirrors React framer-motion: sidebar slide-left, panel slide-up on tab switch, shadcn-style dialogs */
@keyframes settingsSidebarIn        { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes settingsPanelIn          { from { opacity: 0; transform: translateY(10px); }  to { opacity: 1; transform: none; } }
@keyframes settingsDialogBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes settingsDialogPanelIn    { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.sg-sidebar-anim { animation: settingsSidebarIn .25s ease-out .1s both; }
.sg-panel-anim   { animation: settingsPanelIn .25s ease-out; }
.sg-dlg-backdrop { animation: settingsDialogBackdropIn .2s ease-out; }
.sg-dlg-panel    { animation: settingsDialogPanelIn .25s cubic-bezier(.16,1,.3,1); }

/* ===== Global: shared dropdown / combobox components ===== */
/* Searchable combobox (powered by util.js autoFillSelectX).
   The helper inserts <input> + <div role="listbox"> as siblings of the <select>. */
.searchable-combobox { position: relative; }
.searchable-combobox.select-with-chevron .select-chevron {
    top: auto;
    bottom: 0.875rem;
    transform: none;
}
.searchable-combobox input[aria-hidden] {
    position: absolute;
    inset: 0;
    margin-top: 1.625rem; /* offset for the label above */
    height: 2.75rem;
    padding: 0 0.875rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--primary));
    border-radius: 0.75rem;
    color: hsl(var(--foreground));
    font-size: 0.9rem;
    text-align: right;
    direction: rtl;
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}
.searchable-combobox input[aria-hidden]:focus { outline: none; }

/* Floating dropdown box - shared chrome for the searchable-combobox + custom-select lists.
   Each adds only its own differences (overflow / padding / flex / margin) below. */
.searchable-combobox div[role="listbox"],
.custom-select-list {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    max-height: 280px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -8px rgba(15, 30, 80, 0.18);
    z-index: 30;
}
.searchable-combobox div[role="listbox"] {
    margin-top: 4px;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.searchable-combobox p[role="option"] {
    margin: 0;
    padding: 0.5rem 0.875rem;
    text-align: right;
    direction: rtl;
    font-size: 0.875rem;
    cursor: pointer;
    color: hsl(var(--foreground));
}
.searchable-combobox p[role="option"]:hover,
.searchable-combobox p[role="option"]:focus {
    background: hsl(var(--accent) / 0.5);
    color: hsl(var(--primary));
    font-weight: 600;
    outline: none;
}

/* Member filter - faithful port of the React kupa GroupedCombobox. The SELECT is the trigger (shows the
   choice; gets a blue border + ring when open). A NEUTRAL card drops below it holding a slate-50 search
   box (icon + clear-X) and the list, separated by a divider. */
.filter-combobox select { cursor: pointer; }
.filter-combobox.is-open select {                      /* React: border-primary ring-2 ring-primary/20 */
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
    outline: none;
}
.fcc-card {                                            /* popover: rounded-xl, NEUTRAL border-border/60, shadow */
    position: absolute;
    top: 100%;
    inset-inline: 0;
    margin-top: 8px;
    z-index: 40;
    display: none;
    overflow: hidden;
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 0.75rem;
    background: hsl(var(--card));
    box-shadow: 0 12px 40px -8px rgba(15, 23, 42, 0.18);
}
.filter-combobox.is-open .fcc-card { display: block; }
.fcc-search {                                          /* search row: p-2, border-b border/40 divider */
    position: relative;
    padding: 0.5rem;
    border-bottom: 1px solid hsl(var(--border) / 0.4);
}
.fcc-search input[aria-hidden] {                       /* the search box: slate-50, rounded-lg, NO border */
    position: static !important;
    display: block !important;
    width: 100%;
    height: 2.5rem;
    margin: 0;
    padding: 0 2.5rem 0 2.25rem;
    border: 1px solid hsl(var(--primary) / 0.5);   /* light-blue border around the search box, like React */
    border-radius: 0.5rem;
    background-color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    text-align: right;
    direction: rtl;
    box-shadow: none;
}
.fcc-search input[aria-hidden]:focus { outline: none; }
.fcc-card div[role="listbox"] {                        /* list: plain, lives inside the card */
    position: static !important;
    display: block !important;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.filter-combobox p[role="option"]:hover,
.filter-combobox p[role="option"]:focus {              /* React: bg-primary/10 text-primary */
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    font-weight: 400;
}
.fcc-clear {                                           /* clear-X on the LEFT of the search box */
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    height: 1.5rem;
    width: 1.5rem;
    place-items: center;
    border-radius: 9999px;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    z-index: 2;
}
.fcc-clear:hover { background: #e2e8f0; }
.fcc-clear svg { height: 0.85rem; width: 0.85rem; }

/* Scrollable dropdown overlay — opens below a native <select> whose native dropdown is suppressed. */
.scrollable-select { position: relative; }
.custom-select-list {
    margin: 4px 0 0;
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.custom-select-list .dropdown-viewport {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0;
    scrollbar-width: none;
}
.custom-select-list .dropdown-viewport::-webkit-scrollbar { display: none; }

.custom-select-list .dropdown-scroll-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0;
    background: hsl(var(--card));
    cursor: default;
    list-style: none;
    color: hsl(var(--foreground));
}
.custom-select-list .dropdown-scroll-btn[hidden] { display: none; }
.custom-select-list .dropdown-scroll-btn svg { width: 1rem; height: 1rem; }
.custom-select-list .dropdown-scroll-btn:hover {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    font-weight: normal;
}
.custom-select-list li {
    padding: 0.5rem 0.875rem 0.5rem 1.75rem;
    cursor: pointer;
    text-align: right;
    direction: rtl;
    font-size: 0.875rem;
    position: relative;
}
.custom-select-list li:hover {
    background: hsl(var(--accent) / 0.5);
    color: hsl(var(--primary));
    font-weight: 600;
}
.custom-select-list li.is-selected {
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    font-weight: 600;
}
.custom-select-list li.is-selected::before {
    content: '✓';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--primary));
    font-weight: 700;
}
.custom-select-list li[data-section46] { padding-left: 3rem; }
.custom-select-list li[data-section46]::after {
    content: '46';
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
}
.custom-select-list li[data-section46="true"]::after  { background: #d1fae5; color: #047857; }
.custom-select-list li[data-section46="false"]::after { background: #f1f5f9; color: #64748b; }

/* Payment method dropdown — icon overlay on the trigger (closed state) + icons inside list items.
   Mirrors React shadcn Select with Lucide icons + tooltip descriptions. */
.payment-method-wrap { position: relative; }

.payment-method-trigger-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.payment-method-trigger-icon svg {
    width: 100%;
    height: 100%;
}
.payment-method-trigger-icon.is-placeholder { color: hsl(var(--muted-foreground)); }
.payment-method-trigger-icon.is-selected    { color: hsl(var(--primary)); }

.select-with-chevron .payment-method-select {
    padding-right: 2.75rem;
}

/* List items: icon + label (Lucide icon in primary color, label in foreground) */
.custom-select-list .pm-li-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: hsl(var(--primary));
    flex-shrink: 0;
    margin-inline-end: 0.625rem;
}
.custom-select-list .pm-li-icon svg {
    width: 100%;
    height: 100%;
}
.custom-select-list .pm-li-label {
    flex: 1;
    text-align: right;
}
.custom-select-list li[data-value] {
    display: flex;
    align-items: center;
}

/* ===== Global: popups (overlay / popupPanel / popUpQuestion) ===== */
/* ── Popup styling (override leopard.css defaults — modern card look) ── */
.overlay {
    background-color: rgba(15, 23, 42, 0.55);   /* slate-900/55 */
    opacity: 1;
    /* leopard נתן 2, כלומר מתחת לדיאלוגים של האתר (z-50/z-60): הודעת שגיאה נראתה "מודאלית"
       אבל השדות שמאחוריה נשארו לחיצים, המשתמש תיקן את השדה וההודעה נשארה תלויה על המסך
       ונראתה כאילו היא מתלוננת על מצב שכבר תוקן. 90 = מתחת ל-popupPanel (100) ומעל הדיאלוגים. */
    z-index: 90;
}

.popupPanel {
    /* Override leopard's narrow fixed size — expand to fit content */
    width: auto;
    min-width: 22rem;
    max-width: min(90vw, 32rem);
    height: auto;
    min-height: auto;
    padding: 1.5rem 1.75rem;
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 80, 0.18), 0 10px 10px -5px rgba(15, 23, 80, 0.08);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    direction: rtl;
}

.popupPanel .popUpTitle {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

.popupPanel .popUpText {
    display: block;
    line-height: 1.6;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
}

/* Stack everything inline — override leopard's display:block on popup inputs */
.popupPanel .popUpText input {
    display: inline-block;
    width: auto;
    height: auto;
    line-height: normal;
    margin: 0.5rem 0.25rem 0;
}

/* Modern button style — base */
.buttonDes,
.popupPanel #closeButton {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    transition: all 0.12s ease;
    text-decoration: none;
    line-height: 1.3;
    vertical-align: middle;
}
.buttonDes:hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--muted-foreground) / 0.4);
}
.buttonDes:active {
    filter: brightness(0.96);
}
.buttonDes:disabled,
.buttonDes[disabled] {
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted));
    border-color: hsl(var(--border));
    cursor: not-allowed;
    opacity: 0.6;
}
.buttonDes:disabled:hover,
.buttonDes[disabled]:hover {
    background: hsl(var(--muted));
}

/* Primary close button — filled blue */
.popupPanel #closeButton {
    margin-top: 1rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}
.popupPanel #closeButton:hover {
    filter: brightness(1.07);
}

/* Success popup variant (after saving a member card) — matches the Lovable save dialog (measured):
   circle-check icon (green in a soft-green disc), text-xl/600 title, muted text-sm subtitle, rounded-xl primary button. */
.popupPanel.successPopUp { border-radius: 0.75rem; }
.popupPanel.successPopUp .imgPopUp {
    width: 3.5rem;                 /* h-14 w-14 disc */
    height: 3.5rem;
    margin: 0 auto 0.75rem;        /* gap-3 to the title */
    border-radius: 9999px;
    background-color: rgb(218, 251, 230);   /* bg-success-soft */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%231ba14c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");   /* lucide circle-check, text-success */
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.875rem;      /* h-8 w-8 icon */
}
.popupPanel.successPopUp .popUpTitle {
    font-size: 1.25rem;             /* text-xl */
    font-weight: 600;               /* font-semibold */
}
.popupPanel.successPopUp .popUpText {
    font-size: 0.875rem;            /* text-sm */
    color: hsl(var(--muted-foreground));
}
/* No subtitle text — collapse the empty span so it doesn't add a gap before the button. */
.popupPanel.successPopUp .popUpText:empty {
    display: none;
    margin: 0;
}
.popupPanel.successPopUp #closeButton {
    height: 2.5rem;                 /* h-10 */
    border-radius: 0.75rem;         /* rounded-xl */
    padding: 0 1rem;                /* px-4 */
    font-weight: 500;               /* font-medium */
    font-size: 0.875rem;            /* text-sm */
}
/* X close in the top corner (like the Lovable dialog) — injected by emSaveSuccess / buyPopupChrome. */
.popupPanel.successPopUp .successClose,
.popupPanel.buyPopup .successClose {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: hsl(var(--foreground));
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.12s ease, background-color 0.12s ease;
}
.popupPanel.successPopUp .successClose:hover,
.popupPanel.buyPopup .successClose:hover { opacity: 1; background: hsl(var(--muted)); }

/* Switch off-track — darker than --input so the white thumb stays visible (same fix as .ppn-toggle) */
.sr-switch-off { background: hsl(215 20% 78%); }

/* Question popup (popUpQuestion) — text on its own line above the buttons */
#popUpQuestiontext {
    display: block;
    line-height: 1.6;
}
/* Question popup (popUpQuestion) — style כן/לא as buttons */
#popUpQuestion input[type=button] {
    display: inline-block;
    margin: 1rem 0.35rem 0;
    padding: 0.55rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    transition: all 0.12s ease;
}
/* "כן" — filled primary; "לא" — outline */
#popUpQuestion #yesForm {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}
#popUpQuestion #yesForm:hover { filter: brightness(1.07); }
#popUpQuestion input[type=button]:not(#yesForm):hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--muted-foreground) / 0.4);
}

/* Per-dialog opt-in: swap כן/לא colors ("לא" primary, "כן" outline) — set via popUpQuestion opts.swapButtons */
#popUpQuestion.q-swap-buttons #yesForm {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}
#popUpQuestion.q-swap-buttons #yesForm:hover {
    filter: none;
    background: hsl(var(--muted));
    border-color: hsl(var(--muted-foreground) / 0.4);
}
#popUpQuestion.q-swap-buttons input[type=button]:not(#yesForm) {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}
#popUpQuestion.q-swap-buttons input[type=button]:not(#yesForm):hover {
    background: hsl(var(--primary));
    filter: brightness(1.07);
    border-color: hsl(var(--primary));
}

/* ===== Global: loading overlay + spinner ===== */
@keyframes loadingSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Generic full-screen loading overlay — used by buttonClicked() for buttons marked data-loading="1".
   Mirrors the in-receipt spinner style (React-feel: clean circular ring) but covers the whole viewport. */
/* Fade-in with a 150ms delay: if the AJAX response arrives inside that window the overlay
   is removed before it becomes visible, so fast page loads don't flash a spinner. */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.55);
    z-index: 200;
    opacity: 0;
    animation: loadingFadeIn 0.2s ease 0.15s forwards;
}
.loading-spinner {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 201;
    width: 3rem; height: 3rem;
    border: 3px solid hsl(var(--muted));
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    opacity: 0;
    animation: loadingSpin 0.8s linear infinite, loadingFadeIn 0.2s ease 0.15s forwards;
}
@keyframes loadingFadeIn { to { opacity: 1; } }


/* ##################################################################
   PAGE-SPECIFIC STYLES - each page's rules grouped in one area.
   ################################################################## */

/* ===== START: Login ===== */
/* ───── Login screen (Decision #2 — auth) ───── */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--background));
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 360px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 20px;
    box-shadow: 0 12px 40px -12px rgba(15, 30, 80, 0.25);
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.login-logo {
    align-self: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: hsl(var(--primary-soft));
    color: hsl(var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-logo i { width: 28px; height: 28px; }
.login-title {
    margin: 14px 0 2px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: hsl(var(--foreground));
}
.login-subtitle {
    margin: 0 0 22px;
    text-align: center;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}
.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.login-field span {
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}
.login-field input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    font-size: 0.9375rem;
}
.login-field input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}
/* עין להצגת הסיסמה (Trello טסט2 "דף כניסה") - אותה תבנית כמו .cp-eye בשינוי סיסמה */
.login-field .login-pw { position: relative; display: flex; }
.login-field .login-pw input { flex: 1; padding-inline-start: 40px; }
.login-eye {
    position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; padding: 6px; cursor: pointer; border-radius: 8px;
    color: hsl(var(--muted-foreground)); display: flex; align-items: center; transition: color .15s;
}
.login-eye:hover { color: hsl(var(--foreground)); }
/* מתג חייבים/יתרות בדו"ח חייבים\יתרות - צבע פעיל לכל מצב (Lovable DebtorsReport) */
.dr-mode.is-on[data-mode="debtors"] { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); border-color: hsl(var(--destructive)); }
.dr-mode.is-on[data-mode="credits"] { background: #059669; color: #fff; border-color: #059669; }
.dr-mode.is-on[data-mode="both"]    { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.dr-mode.is-on:hover { opacity: .9; }

/* חוקיות הסיסמה במסכי הכניסה/שחזור (data-password-rule) */
.login-rule {
    margin: 0 0 14px; padding: 8px 10px; border-radius: 10px; text-align: center;
    font-size: 0.8125rem; line-height: 1.5;
    background: hsl(var(--primary) / 0.07); border: 1px solid hsl(var(--primary) / 0.2);
    color: hsl(var(--foreground));
}
.login-rule:empty { display: none; }
.login-btn {
    margin-top: 6px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}
.login-btn:hover { filter: brightness(0.95); }
.login-link {
    margin-top: 14px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--primary));
    cursor: pointer;
}
.login-link:hover { text-decoration: underline; }

/* ───── 2FA — בחירת ערוץ (Choose2FA) + הזנת קוד (TestOtp) ───── */
.twofa-card { max-width: 440px; }
.twofa-info { font-size: 0.875rem; color: hsl(var(--foreground)); line-height: 1.6; }
.twofa-info h3 { margin: 10px 0 4px; font-size: 0.9375rem; font-weight: 700; }
.twofa-info ul { margin: 4px 0 8px; padding-inline-start: 18px; }
.twofa-options { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.twofa-option { display: flex; align-items: center; gap: 10px; font-size: 0.9375rem; cursor: pointer; }
.twofa-option input[type=radio] { accent-color: hsl(var(--primary)); width: 16px; height: 16px; }
.twofa-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}
.twofa-qr img { width: 160px; height: 160px; }
.twofa-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}
.twofa-timer input[type=button] {
    height: 32px;
    padding: 0 14px;
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    cursor: pointer;
}
.twofa-timer input[type=button]:disabled { opacity: 0.5; cursor: not-allowed; }
#otpTitle img { width: 1.5rem; vertical-align: middle; }
#otp { direction: ltr; text-align: center; letter-spacing: 0.2em; }

/* ===== END: Login ===== */

/* ===== START: Main / Dashboard ===== */
/* ── Dashboard shortcut pills (mirrors gabai-react premium floating-pill style) ── */
.dash-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px -1px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04), inset 0 0 0 1px rgba(255,255,255,0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dash-pill:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(15,23,42,0.12), 0 2px 4px rgba(15,23,42,0.06), inset 0 0 0 1px rgba(255,255,255,0.6); }
.dash-pill:active { transform: translateY(0); }
.dash-pill.has-badge { padding-left: 1.75rem; }
.dash-pill-badge {
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    border: 2.5px solid hsl(var(--popover));
    box-shadow: 0 6px 14px -3px rgba(59,130,246,0.45), 0 2px 4px rgba(15,23,42,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.dash-pill-badge svg { width: 1rem; height: 1rem; }
.dash-pill * { pointer-events: none; }   /* clicks always resolve to the button (App+ButtonClicked) */

/* pill color variants (soft top→bottom gradient + tinted text) */
.dp-emerald { background: linear-gradient(180deg,#ecfdf5,rgba(209,250,229,0.7)); color: #047857; }
.dp-rose    { background: linear-gradient(180deg,#fff1f2,rgba(255,228,230,0.7)); color: #be123c; }
.dp-blue    { background: linear-gradient(180deg,#eff6ff,rgba(219,234,254,0.7)); color: #1d4ed8; }
.dp-slate   { background: linear-gradient(180deg,#f8fafc,rgba(241,245,249,0.7)); color: #334155; }
.dp-indigo  { background: linear-gradient(180deg,#eef2ff,rgba(224,231,255,0.7)); color: #4338ca; }
.dp-violet  { background: linear-gradient(180deg,#f5f3ff,rgba(237,233,254,0.7)); color: #6d28d9; }
.dp-teal    { background: linear-gradient(180deg,#f0fdfa,rgba(204,251,241,0.7)); color: #0f766e; }
.dp-sky     { background: linear-gradient(180deg,#f0f9ff,rgba(224,242,254,0.7)); color: #0369a1; }
.dp-amber   { background: linear-gradient(180deg,#fffbeb,rgba(254,243,199,0.7)); color: #b45309; }
.badge-emerald { background: linear-gradient(135deg,#34d399,#14b8a6); }
.badge-sky     { background: linear-gradient(135deg,#38bdf8,#6366f1); }
.badge-slate   { background: linear-gradient(135deg,#94a3b8,#475569); }
.badge-amber   { background: linear-gradient(135deg,#fbbf24,#f97316); }

/* dashboard pill dropdown (client-side menu under a pill) */
.dash-menu-wrap { position: relative; }
.dash-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    z-index: 50;
    min-width: 220px;
    display: none;
    padding: 0.25rem 0;
}
.dash-menu.is-open { display: block; animation: receiptMenuIn 0.18s ease-out; }
.dash-menu button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    text-align: right;
    direction: rtl;
    font-size: 1rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.dash-menu button:hover { background: hsl(var(--accent) / 0.4); }
.dash-menu button svg { width: 0.875rem; height: 0.875rem; color: hsl(var(--primary)); flex-shrink: 0; }

/* receipt server-popup (#receiptMenu) now anchors to its pill wrapper instead of the old grid */
.receipt-pill-wrap { position: relative; }

/* ============================================================
   #receiptMenu — floating dropdown that appears under
   #MakeReceiptMenu trigger button. Visual matches gabai-react.
   ============================================================ */

/* The grid that contains receiptMenu becomes a positioning context. */
.grid:has(> #receiptMenu) {
    position: relative;
}

/* Hide while empty so it doesn't occupy a grid cell. */
#receiptMenu:empty { display: none; }

/* Floating card when content is present. */
#receiptMenu:not(:empty) {
    position: absolute;
    top: calc(100% + 0.75rem);   /* below the shortcuts row + small gap */
    right: 0;                    /* RTL: aligns under the trigger which sits at right edge */
    z-index: 50;
    min-width: 230px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    box-shadow:
        0 10px 40px -10px rgba(15, 30, 80, 0.18),
        0 4px 12px -3px rgba(15, 30, 80, 0.08);
    overflow: hidden;
    padding: 0.25rem 0;
    animation: receiptMenuIn 0.18s ease-out;
}

@keyframes receiptMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Each option row inside the dropdown (icon + label, like React). */
#receiptMenu input[type="button"],
#receiptMenu button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    background: transparent;
    border: none;
    color: hsl(var(--foreground));
    text-align: right;
    direction: rtl;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

#receiptMenu button svg { flex: none; opacity: 0.9; }

#receiptMenu input[type="button"]:hover,
#receiptMenu button:hover  { background: hsl(var(--accent) / 0.5); }
#receiptMenu input[type="button"]:active,
#receiptMenu button:active { background: hsl(var(--accent)); }
/* ===== END: Main / Dashboard ===== */

/* ===== START: Receipt Wizard ===== */
/* ============================================================
   Receipt wizard — multi-step form (CreateReceiptForExisting + sequels)
   Visual mirrors gabai-react (TabId: details/member/payment/misc/summary).
   ============================================================ */

.receipt-wizard {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.receipt-wizard h1 {
    font-size: 1.5rem;          /* text-2xl on mobile */
    font-weight: 700;
    text-align: right;
    margin: 0 0 1.25rem;
}

@media (min-width: 1024px) {
    .receipt-wizard h1 {
        font-size: 1.875rem;    /* lg:text-3xl on desktop */
    }
}

/* Tab strip */
.wizard-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
    margin: 0;
    padding: 0.375rem;
    list-style: none;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 1.25rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.wizard-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    color: hsl(var(--muted-foreground));
    border-radius: 1rem;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
}
.wizard-tab.is-active { cursor: default; }

.wizard-tab-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.wizard-tab:hover:not(.is-active) {
    background: hsl(210 40% 96%);
    color: hsl(var(--foreground));
}

.wizard-tab.is-active {
    background: hsl(var(--primary));
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

/* Done badge — small emerald circle with white check icon at top-left corner.
   Mirrors React: <span className="absolute left-1 top-1 ... bg-emerald-500 ..."><Check /></span>
   Hidden when tab is active (matches React's `done = completed && !active` logic). */
.wizard-tab.is-done:not(.is-active)::after {
    content: "";
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 9999px;
    background-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 0.5rem 0.5rem;
    background-position: center;
    background-repeat: no-repeat;
}

/* Mobile: tighter padding + smaller font; keep 5 columns visible (mirrors React design) */
@media (max-width: 700px) {
    .wizard-tabs { gap: 0.125rem; padding: 0.25rem; }
    .wizard-tab {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
        line-height: 1;
    }
}

.wizard-placeholder {
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted) / 0.5);
    border: 1px dashed hsl(var(--border));
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 0;
    text-align: right;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Card */
.wizard-card {
    margin-top: 1.25rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    padding: 1.75rem 1.5rem;
    animation: wizardStepIn 0.2s ease-out;
}

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

.wizard-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    text-align: right;
    margin: 1.25rem 0 0.75rem;
}

.wizard-card > .wizard-section-title:first-child {
    margin-top: 0;
}

/* Pill-style radio group (matches React's TRANSACTION_TYPES buttons) */
.type-pill-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .type-pill-grid {
        grid-template-columns: repeat(var(--visible-count, 3), 1fr);
    }
}

/* .field-invalid (set by util.js validateForm) is intentionally style-less — the visible
   error UX is the .field-error-msg text below the input, synced by wizard-validation-msg.js.
   Exception: in the shared CRUD dialog (no per-field message divs) give it a red ring. */
#crudDialog .field-invalid {
    border-color: hsl(348 83% 47%) !important;
    box-shadow: 0 0 0 2px hsl(348 83% 47% / 0.25);
}
.field-error-msg {
    color: hsl(348 83% 47%);
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.375rem 0 0;
    text-align: right;
}
.field-success-msg {
    color: hsl(142 76% 36%);   /* emerald-600 */
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.375rem 0 0;
    text-align: right;
}

.type-pill-grid input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.type-pill {
    position: relative;
    display: block;
    border: 2px solid hsl(var(--border) / 0.6);
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border-radius: 1rem;
    padding: 0.625rem 0.75rem;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    user-select: none;
}

.type-pill:hover {
    border-color: hsl(var(--primary) / 0.4);
}

.type-pill-check {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    display: none;
}

input[name="transactionType"]:checked + .type-pill .type-pill-check {
    display: block;
}

/* Color variants — exact Tailwind values mirroring React's transaction-type variants */
.type-pill-blue    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.type-pill-blue:hover    { border-color: #60a5fa; }
.type-pill-emerald { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.type-pill-emerald:hover { border-color: #34d399; }
.type-pill-purple  { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.type-pill-purple:hover  { border-color: #c084fc; }
.type-pill-yellow  { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.type-pill-yellow:hover  { border-color: #eab308; }

/* Active state — exact Tailwind values: bg-{color}-500, border-{color}-600, ring-4 ring-{color}-200, shadow-lg */
input[name="transactionType"]:checked + .type-pill-blue {
    background: #3b82f6; color: white; border-color: #2563eb;
    box-shadow: 0 0 0 4px #bfdbfe, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: scale(1.02);
}

input[name="transactionType"]:checked + .type-pill-emerald {
    background: #10b981; color: white; border-color: #059669;
    box-shadow: 0 0 0 4px #a7f3d0, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: scale(1.02);
}

input[name="transactionType"]:checked + .type-pill-purple {
    background: #a855f7; color: white; border-color: #9333ea;
    box-shadow: 0 0 0 4px #e9d5ff, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: scale(1.02);
}

input[name="transactionType"]:checked + .type-pill-yellow {
    background: #eab308; color: white; border-color: #ca8a04;
    box-shadow: 0 0 0 4px #fef08a, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: scale(1.02);
}

/* Selects + inputs */
.wizard-select,
.wizard-input {
    width: 100%;
    height: 2.75rem;
    padding: 0 0.875rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    text-align: right;
    direction: rtl;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wizard-select:focus,
.wizard-input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

/* Action buttons row */
.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid hsl(var(--border) / 0.4);
}

.wizard-actions-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-actions-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.wizard-next {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0.625rem 1.25rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: all 0.15s ease;
}

.wizard-next:hover  { background: hsl(var(--primary) / 0.9); }
.wizard-next:active { filter: brightness(0.95); }

.wizard-next-icon {
    width: 1rem;
    height: 1rem;
    transform: rotate(90deg);
}


.wizard-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    background: white;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    transition: all 0.12s ease;
}

.wizard-back:hover {
    border-color: hsl(var(--primary));
    color: hsl(var(--primary));
}

.wizard-back-icon {
    width: 1rem;
    height: 1rem;
    transform: rotate(-90deg);
}

/* "מחק נתונים" — red-outline button mirroring React's per-tab clear button */
.wizard-clear {
    padding: 0.625rem 1rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    background: #fff;
    color: hsl(var(--destructive, 0 84% 60%));
    border: 1px solid hsl(var(--destructive, 0 84% 60%) / 0.3);
    transition: all 0.12s ease;
}
.wizard-clear:hover { background: hsl(var(--destructive, 0 84% 60%) / 0.1); }

.wizard-cancel {
    background: white;
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.wizard-cancel:hover {
    border-color: hsl(var(--foreground));
    color: hsl(var(--foreground));
}

/* Mobile: keep action buttons in one row (wrap to next line if needed), matching React. */
@media (max-width: 700px) {
    .wizard-actions { gap: 0.5rem; }
    .wizard-next, .wizard-back, .wizard-clear, .wizard-cancel {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* ── Receipt wizard step 2 — member picker ── */
.member-search { margin-bottom: 0.75rem; }

.search-input-wrapper {
    position: relative;
}
.search-input-wrapper .search-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
}
.search-input-wrapper input {
    padding-right: 2.75rem;
}

.member-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
}
@media (max-width: 700px) { .member-results { grid-template-columns: 1fr; } }
.member-results:empty { display: none; }

.member-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    background: hsl(var(--card));
    border: 2px solid hsl(var(--border) / 0.6);
    border-radius: 1rem;
    transition: border-color 0.12s ease, background-color 0.12s ease;
    text-align: right;
}
.member-result-item:hover { border-color: hsl(var(--primary) / 0.4); }

.member-result-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.member-result-text  { display: flex; flex-direction: column; }
.member-result-name  { font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground)); }
.member-result-phone { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }

.member-result-empty {
    grid-column: 1 / -1;
    padding: 1.5rem 1rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    list-style: none;
}

/* Selected member card (replaces the picker once a member is chosen) */
.member-selected-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 2px solid hsl(var(--primary));
    background: hsl(var(--primary) / 0.05);
    border-radius: 1rem;
}
.member-selected-info  { display: flex; align-items: center; gap: 0.75rem; }
.member-selected-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-selected-text  { text-align: right; }
.member-selected-name  { font-size: 0.875rem; font-weight: 600; margin: 0; color: hsl(var(--foreground)); }
.member-selected-meta  { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin: 0; }

.member-replace-btn {
    background: transparent;
    border: none;
    color: hsl(var(--primary));
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.member-replace-btn:hover { text-decoration: underline; }

/* Balance row under selected member — mirrors gabai #balancePanel (red for debt, green for credit) */
.member-balance-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--muted) / 0.4);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.member-balance-label { color: hsl(var(--muted-foreground)); font-weight: 600; }
.member-balance-value { direction: ltr; }
.member-balance-value.is-credit { color: hsl(var(--success, 142 71% 35%)); }
.member-balance-value.is-debt   { color: hsl(var(--destructive, 0 84% 60%)); }

/* ── Receipt wizard step 3 — payment ── */
.amount-currency-row {
    display: flex;
    align-items: stretch;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    background: hsl(var(--card));
    height: 3.5rem;
}
.amount-currency-row:focus-within {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}
.amount-input {
    flex: 1;
    min-width: 0;       /* allow shrinking below content width so currency-select stays in view */
    border: none;
    background: transparent;
    padding: 0 1rem;
    text-align: right;
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    direction: rtl;
}
.amount-input:focus { outline: none; }
.currency-select {
    border: none;
    border-right: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.4);
    padding: 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: hsl(var(--foreground));
    width: 5.5rem;
    flex: 0 0 5.5rem;       /* don't grow, don't shrink, basis 5.5rem */
}
/* When wrapped with select-with-chevron: hide native arrow + make room for our chevron */
.select-with-chevron .currency-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-left: 2rem;
}
.amount-currency-row .select-with-chevron {
    flex: 0 0 6rem;
    display: flex;
    align-items: center;
    background: hsl(var(--muted) / 0.4);
    border-right: 1px solid hsl(var(--border));
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}
.amount-currency-row .select-with-chevron .currency-select {
    width: 100%;
    flex: 1 1 auto;
    background: transparent;
    border: none;
}
.currency-select:focus { outline: none; }

.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.quick-amount-pill {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border-radius: 9999px;
    padding: 0.25rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.quick-amount-pill:hover  { border-color: hsl(var(--primary)); }
.quick-amount-pill.is-active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}
/* Date input with Calendar icon inside (Lucide calendar at right edge in RTL) */
.date-input-wrapper {
    position: relative;
}
.date-input-wrapper .date-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
    z-index: 1;
}
.date-input-wrapper .wizard-input {
    padding-right: 2.75rem;
}

/* Charge-day pills (1/10/20 of the month) — shown for DirectDebitActive */
.charge-day-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}
.charge-day-pill {
    height: 2.75rem;
    padding: 0 1.25rem;
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.charge-day-pill:hover { background: hsl(var(--secondary) / 0.6); }
.charge-day-pill.is-active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Mobile: keep the 3 charge-day pills in one row by tightening padding + equal flex share. */
@media (max-width: 700px) {
    .charge-day-pill { padding: 0 0.625rem; flex: 1; min-width: 0; }
}

/* Receipt issue date — toggle row (reuses .check-switch from checks table) */
.receipt-date-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0.5rem;
}
.receipt-date-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

/* ============================================================
   Step 4 — שונות (Misc)
   ============================================================ */
/* Step 4 main heading: React uses text-base (1rem) here, larger than the default
   .wizard-section-title (0.875rem) used in other steps. Also no margin-bottom — the
   subtitle <p> below uses its own mt-1 for the gap, matching React. */
.misc-section-title {
    font-size: 1rem;
    margin-bottom: 0;
}
.misc-subheading {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-align: right;
}
.misc-notes-spacer { margin-top: 1rem; }

.wizard-textarea {
    width: 100%;
    min-height: 4.5rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    text-align: right;
    direction: rtl;
    resize: vertical;
    box-sizing: border-box;
}
.wizard-textarea:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.char-counter {
    margin: 0.25rem 0 0;
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
    text-align: right;
    direction: rtl;
}

.alt-name-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.alt-name-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
}
.alt-name-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.alt-name-fields { margin-top: 1rem; }
.alt-name-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 1024px) {
    .alt-name-grid { grid-template-columns: repeat(var(--visible-count, 2), 1fr); }
}

.alt-name-save-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
    margin-top: 0.75rem;
    border-top: 1px solid hsl(var(--border) / 0.4);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
}
.alt-name-save-row > span { padding-top: 0.5rem; }
.alt-name-save-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.alt-name-error {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: hsl(var(--destructive));
    text-align: right;
    font-weight: 600;
}
.alt-name-ok {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: #059669;
    text-align: right;
    font-weight: 600;
}
.alt-name-hint {
    margin: 0.25rem 0 0;
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
    text-align: right;
}

.wizard-input.is-valid {
    border-color: #10b981;
}
.wizard-input.is-valid:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.2);
}
.wizard-input.is-error {
    border-color: hsl(var(--destructive));
}
.wizard-input.is-error:focus {
    border-color: hsl(var(--destructive));
    box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.2);
}
.required-star {
    color: hsl(var(--destructive));
}

/* Section 46 tax-mode toggle buttons (React pattern: id / no_id / foreign) */
.section46-fields {
    margin-top: 1rem;
}
/* Casual receipt (מתפלל מזדמן) — free-text payer fields, two per row. */
.casual-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.tax-mode-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.tax-mode-btn {
    border: 2px solid hsl(var(--border));
    background: #fff;
    color: hsl(var(--foreground));
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}
.tax-mode-btn:hover {
    border-color: hsl(var(--primary) / 0.4);
}
.tax-mode-btn.is-active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Mobile: stack the two long-labeled tax-mode buttons in one column. */
@media (max-width: 700px) {
    .tax-mode-toggles { grid-template-columns: 1fr; }
}
/* Casual payer fields stay two-per-row down to 640px (matches React's sm:grid-cols-2). */
@media (max-width: 639px) {
    .casual-fields-grid { grid-template-columns: 1fr; }
}

/* Section 46 badge — pill below subAction dropdown (React design from IssueReceiptPermanent) */
.section46-badge {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
}
.section46-badge-approved {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}
.section46-badge-not-approved {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

/* Validation banner - matches React: flex items-start gap-3 rounded-2xl border-destructive/40 bg-destructive/5 p-4 */
.alt-name-validation {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: hsl(var(--destructive) / 0.05);
    border: 1px solid hsl(var(--destructive) / 0.4);
    border-radius: 1.25rem;
    text-align: right;
    direction: rtl;
    margin-bottom: 1rem;
}
.alt-name-validation-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    line-height: 1;
    margin-top: 0.125rem;
    color: hsl(var(--destructive));
}
.alt-name-validation-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: hsl(var(--destructive));
    margin-bottom: 0.25rem;
}
.alt-name-validation ul {
    margin: 0.25rem 0 0;
    padding-inline-start: 1.25rem;
    font-size: 0.75rem;
    color: hsl(var(--destructive));
}

/* ============================================================
   Step 5 — סיכום (Summary)
   ============================================================ */
.summary-hero {
    background: linear-gradient(to left, hsl(var(--primary)), hsl(var(--primary) / 0.85));
    color: white;
    padding: 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
    margin-bottom: 0.5rem;
    text-align: right;
}
.summary-hero-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}
.summary-hero-amount-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.75rem;            /* mt-3 in React - separates "סכום" from "קבלה להפקה" above */
    margin-bottom: 0;
}
.summary-hero-amount {
    font-size: 2.25rem;            /* text-4xl */
    font-weight: 700;
    direction: ltr;
    text-align: right;
    margin: 0;                      /* React: amount sits flush against label, no gap */
}
.summary-hero-member {
    margin-top: 0.25rem;            /* mt-1 */
    font-size: 0.875rem;            /* text-sm */
    opacity: 0.9;
}

.summary-rows {
    background: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 1.25rem;          /* rounded-2xl */
    padding: 1.25rem;                /* p-5 */
    margin-bottom: 0.5rem;
}
.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid hsl(var(--border) / 0.4);
}
.summary-row:last-child { border-bottom: none; }
.summary-label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}
.summary-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* Step 5 buttons - inline-flex with icon, matching React (rounded-xl = 1rem in Lovable's tokens).
   React step 5 sits the buttons directly after summary-rows with no separator line and a small gap
   (parent space-y-3 = 0.75rem), unlike steps 1-4 which have border-top + larger spacing. Override
   the .wizard-actions defaults here to match. */
.summary-actions {
    margin-top: 0.75rem;
    padding-top: 0;
    border-top: none;
    gap: 0.75rem;
}
.summary-actions .wizard-actions-main {
    gap: 0.75rem;
}

.summary-btn-icon {
    width: 1rem;
    height: 1rem;
}

.summary-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    padding: 0.625rem 1.25rem;
    border-radius: 1rem;                 /* rounded-xl */
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.summary-cancel:hover {
    border-color: hsl(var(--destructive));
    color: hsl(var(--destructive));
}

.summary-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: hsl(var(--primary));
    border: 2px solid hsl(var(--primary));
    padding: 0.5rem 1.25rem;
    border-radius: 1rem;                 /* rounded-xl */
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.summary-preview:hover { background: hsl(var(--primary) / 0.05); }

.summary-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 1rem;                 /* rounded-xl */
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: all 0.15s ease;
}
.summary-submit:hover { background: hsl(var(--primary) / 0.9); }

/* Disabled state (when validation blocks submission) - applied dynamically by JS via class */
.summary-preview.is-disabled,
.summary-submit.is-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Inner children of summary buttons are pointer-events: none so clicks always
   resolve to the <button> (avoids "Unknown method" when the click lands on an inner <svg>). */
.summary-cancel *,
.summary-preview *,
.summary-submit * { pointer-events: none; }

/* Validation banner - shown when section 46 ID is invalid or alt-name fields incomplete.
   Mirrors React's `flex items-start gap-2 rounded-xl border-destructive/40 bg-destructive/5 p-3 text-xs font-semibold text-destructive`. */
.summary-blocked-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid hsl(var(--destructive) / 0.4);
    background: hsl(var(--destructive) / 0.05);
    color: hsl(var(--destructive));
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
    direction: rtl;
    margin-bottom: 0.75rem;
}

/* 'פרטי חיוב בפועל' card — 2-column grid like React */
.actual-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 700px) {
    .actual-details-grid { grid-template-columns: 1fr 1fr; }
}
.previous-card-input { letter-spacing: 0.05em; }
.previous-card-input:disabled {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    cursor: not-allowed;
}
.payment-inline-checkbox {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
}
.payment-inline-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* Payment method conditional sub-sections (4-digit card, expense action, ...) */
.payment-subsection {
    margin-top: 1.5rem;
    padding: 1rem;
    background: hsl(var(--muted) / 0.4);
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 1.25rem;
}
.payment-sublabel {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
}
.payment-sublabel-hint {
    color: hsl(var(--muted-foreground));
    font-weight: 400;
    font-size: 0.6875rem;
}
.payment-sub-input { max-width: 12rem; }
/* cardLast4 input: wide letter-spacing for the 4 digits (mirrors React's tracking-widest) */
#cardLast4.payment-sub-input { letter-spacing: 0.1em; }
/* expenseActionType select: cap to 18rem on md+ (= React md:w-72); full width on mobile (= React w-full) */
@media (min-width: 768px) { #expenseActionType { max-width: 18rem; } }

/* Select wrapped with a custom Lucide ChevronDown — mirrors shadcn SelectTrigger.
   The native <select> arrow is hidden and replaced with an SVG on the visual end side. */
.select-with-chevron {
    position: relative;
}
/* expense-action specifically caps to 18rem on md+ (= React md:w-72); full width on mobile (= React w-full) */
@media (min-width: 768px) { #expenseActionWrap { max-width: 18rem; } }
.select-with-chevron .wizard-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-left: 2.5rem;
    cursor: pointer;
}
.select-with-chevron .wizard-select::-ms-expand { display: none; }
.select-with-chevron .select-chevron {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
    opacity: 0.7;
    transition: transform 0.15s ease;
}
.select-with-chevron.is-open .select-chevron {
    transform: translateY(-50%) rotate(180deg);
}
.payment-subhint {
    margin: 0.5rem 0 0;
    font-size: 0.7rem;
    color: hsl(var(--muted-foreground));
    text-align: right;
}

.payment-subtitle {
    margin: 0 0 0.875rem;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}
.bank-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 700px) {
    .bank-fields-grid { grid-template-columns: 2fr 1fr 1.5fr; }
    /* When checksCountCell is visible (Check mode), it flows to row 2 — matches React grid wrap.
       Placed in column 1 with constrained width so it stays compact (not full bank-field width). */
    .bank-fields-grid.grid-has-checks-count .checks-count-cell {
        grid-column: 1 / 2;
        max-width: 18rem;
    }
}

/* Bank details header: title on right (RTL), "ציק חו"ל" box on left.
   Mirrors React's <div className="flex items-center justify-between gap-3"> */
.bank-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.bank-details-header .payment-subtitle { margin: 0; }

/* "ציק חו"ל" toggle — boxed label (white bg + border + rounded-lg) with text + switch.
   Replaces the old flat checkbox; mirrors React's bordered label around the Switch. */
.foreign-check-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    cursor: pointer;
}
.foreign-check-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* Checks-count cell (4th column in bank-fields-grid when paymentMethod=Check) */
.checks-count-cell .checks-count-row {
    margin-bottom: 0;
    max-width: none;
}

/* Checks list block — appears below the bank-fields-grid when count >= 2.
   Mirrors React: "mt-6 space-y-2 border-t border-border/40 pt-4" */
.checks-list-block {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border) / 0.4);
}
.checks-list-block > * + * { margin-top: 0.5rem; }

/* Checks table — shown for paymentMethod=Check (gabai logic + React design) */
.checks-count-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 14rem;
}
.checks-count-input {
    text-align: right;
    flex: 1;
}
.checks-count-btn {
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    background: hsl(var(--card));
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    color: hsl(var(--primary));
    transition: background-color 0.12s ease;
}
.checks-count-btn.checks-count-plus  { color: hsl(var(--primary)); }
.checks-count-btn.checks-count-plus:hover  { background: hsl(var(--primary) / 0.05); }
.checks-count-btn.checks-count-minus { color: hsl(var(--destructive)); }
.checks-count-btn.checks-count-minus:hover { background: hsl(var(--destructive) / 0.05); }

.checks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    overflow: hidden;
}
.checks-table thead { background: #f8fafc; }  /* slate-50 — matches React bg-slate-50 */
.checks-table th {
    padding: 0.5rem 0.75rem;             /* py-2 px-3 for content columns */
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
    direction: rtl;
    color: hsl(var(--foreground));
}
.checks-table th.checks-row-num,
.checks-table th.checks-col-center {
    padding: 0.5rem;                     /* py-2 px-2 for # and פעולות */
    text-align: center;                  /* override inherited th text-align: right */
}
.checks-table td {
    padding: 0.25rem 0.5rem;             /* py-1 px-2 — input cells (h-9 input adds its own height) */
    border-top: 1px solid hsl(var(--border) / 0.5);
    vertical-align: middle;
}
.checks-table td.checks-row-num {
    padding: 0.5rem;                     /* # cell — slightly more vertical room */
}
.checks-row-num {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    width: 2.5rem;
}
/* Actions column: w-20 in React = 5rem fixed width */
.checks-col-center { text-align: center; width: 5rem; }
.checks-cell-input {
    width: 100%;
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    background: hsl(var(--card));
    font-size: 0.75rem;
    text-align: right;
    direction: rtl;
    color: hsl(var(--foreground));
}
.checks-cell-input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

/* Banner — flex row matching React: message on the right (RTL start), totals on the left. */
.checks-sum-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    direction: rtl;
}
.checks-sum-banner.is-match {
    background: hsl(151 81% 96%);       /* emerald-50 */
    color:      hsl(163 88% 20%);       /* emerald-800 */
    border-color: hsl(156 72% 67%);     /* emerald-300 */
}
.checks-sum-banner.is-mismatch {
    background: hsl(48 100% 96%);       /* amber-50 */
    color:      hsl(23 83% 31%);        /* amber-800 */
    border-color: hsl(45 97% 64%);      /* amber-300 */
}
.checks-sum-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}
.checks-sum-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    line-height: 1;
}
.checks-sum-icon svg { width: 100%; height: 100%; }
.checks-sum-totals {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
}
/* Higher-specificity override: the banner's color (emerald-800 / amber-800) bleeds onto the inner
   <strong>; force it back to foreground (near-black) to match React's `<strong className="text-foreground">`. */
.checks-sum-banner .checks-sum-totals strong {
    color: hsl(var(--foreground));
    font-weight: 700;
}

/* Override leopard.css global tbody tr:hover (blue bg) for our checks table. */
.checks-table tbody tr:hover {
    background-color: transparent;
}

/* Checks table — action buttons row above the table */
.checks-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}
.checks-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: white;
    color: hsl(var(--primary));
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.checks-action-btn:hover { background: hsl(var(--primary) / 0.05); }
.checks-action-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* Table wrapper for horizontal scroll on narrow screens */
.checks-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 1.25rem;
    background: hsl(var(--card));
}
.checks-table-wrap .checks-table {
    border: none;
    border-radius: 0;
}

/* moved above — combined with width */

/* Mobile: table -> stacked cards, one per check. Mirrors the legacy gabai pattern
   (gabai/site/Style/leopard_mobile.css) and React's sm:hidden card layout. */
@media (max-width: 700px) {
    .checks-table-wrap { overflow: visible; border: none; background: transparent; }
    .checks-table { min-width: 0; border: none; background: transparent; }
    .checks-table thead { display: none; }
    .checks-table, .checks-table tbody { display: block; }
    .checks-table tr {
        display: block;
        position: relative;
        border: 1px solid hsl(var(--border) / 0.6);
        border-radius: 0.75rem;
        background: #ffffff;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    .checks-table tbody tr:hover { background: #ffffff; }
    .checks-table td { display: block; padding: 0.25rem 0; border: none; }
    .checks-table td.checks-row-num {
        position: static; display: inline-block;
        font-size: 0.8125rem; font-weight: 700; color: hsl(var(--foreground));
        padding: 0 0 0.5rem 0;
    }
    .checks-table td.checks-row-num::before { content: 'צ׳ק #'; }
    .checks-table td.checks-col-center {
        position: absolute; top: 0.5rem; left: 0.5rem;
        display: flex; gap: 0.25rem; padding: 0;
    }
    .checks-table td:nth-of-type(2)::before { content: 'מספר צ׳ק'; }
    .checks-table td:nth-of-type(3)::before { content: 'תאריך'; }
    .checks-table td:nth-of-type(4)::before { content: 'סכום'; }
    .checks-table td:nth-of-type(2)::before,
    .checks-table td:nth-of-type(3)::before,
    .checks-table td:nth-of-type(4)::before {
        display: block;
        font-size: 0.6875rem;
        font-weight: 600;
        color: hsl(var(--muted-foreground));
        margin-bottom: 0.25rem;
    }
    .checks-cell-input { height: 2.25rem; width: 100%; }
}

.checks-cell-input:disabled {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    cursor: not-allowed;
}

/* Foreign-check toggle switch (RTL — knob starts on the right) */
.check-switch {
    position: relative;
    display: inline-block;
    width: 2rem;
    height: 1.125rem;
    cursor: pointer;
}
.check-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.check-switch-slider {
    position: absolute;
    inset: 0;
    background: hsl(var(--border));
    border-radius: 9999px;
    transition: background-color 0.18s ease;
}
.check-switch-slider::before {
    content: "";
    position: absolute;
    height: 0.875rem;
    width: 0.875rem;
    top: 0.125rem;
    right: 0.125rem;
    background: white;
    border-radius: 9999px;
    transition: transform 0.18s ease;
}
.check-switch input:checked + .check-switch-slider {
    background: hsl(var(--primary));
}
.check-switch input:checked + .check-switch-slider::before {
    transform: translateX(-0.875rem);
}

/* Per-row action buttons (duplicate, delete) */
.check-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.check-action-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    color: hsl(var(--primary));
    transition: background-color 0.12s ease;
}
.check-action-btn:hover  { background: hsl(var(--primary) / 0.06); }
.check-del-btn           { color: hsl(var(--destructive)); }
.check-del-btn:hover     { background: hsl(var(--destructive) / 0.06); }

/* Multi-year warning — rose-50/300/900 from React, with leading AlertTriangle */
.checks-multiyear-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: hsl(356 100% 97%);          /* rose-50 */
    color:      hsl(343 79% 22%);           /* rose-900 */
    border: 1px solid hsl(353 96% 76%);     /* rose-300 */
    border-radius: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
    text-align: right;
    direction: rtl;
}
.checks-multiyear-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
    font-size: 0.875rem;
    line-height: 1;
}
.checks-multiyear-title {
    font-weight: 700;
    margin-bottom: 0.125rem;
}

/* ── Wizard header row: title on right, top actions (e.g. "רישום חוב") on left ── */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;   /* actions on left (H1 moved to the shared PageHeader banner) */
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.wizard-header h1 { margin: 0; }
.wizard-top-actions {
    display: flex;
    gap: 0.5rem;
}
.top-action-link {
    background: transparent;
    color: hsl(var(--primary));
    border: 1px solid hsl(var(--primary) / 0.3);
    border-radius: 0.5rem;
    padding: 0.4rem 0.875rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.12s ease;
}
.top-action-link:hover:not(:disabled) {
    background: hsl(var(--primary-soft));
}
.top-action-link:disabled {
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
    cursor: not-allowed;
    opacity: 0.6;
}
/* ===== END: Receipt Wizard ===== */

/* ===== START: ManageReceipts ===== */
/* ── Cancelled receipt row (set via class, not inline style) ── */
.cancelled { text-decoration: line-through; }

/* ── Per-row PDF download link (added by ReceiptsTable.OnRowCreated) ── */
.row-actions { width: 1%; white-space: nowrap; }
.pdf-link {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: hsl(var(--destructive-soft));
    color: hsl(var(--destructive));
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}
.pdf-link:hover { background: #fff; border-color: hsl(var(--destructive)); }
/* ===== END: ManageReceipts ===== */

/* ===== START: ManageFunds ===== */
/* ניהול קופות (ManageFunds) — לריאקט אין hover על שורות; מבטלים את ה-hover הכחול הגלובלי
   של leopard.css ושומרים על צבע הזברה של השורה (bg-card / bg-muted/20) גם בריחוף. */
#fundsArea tbody tr:hover, #txArea tbody tr:hover { background-color: hsl(var(--card)); }
#fundsArea tbody tr.bg-muted\/20:hover, #txArea tbody tr.bg-muted\/20:hover { background-color: hsl(var(--muted) / 0.2); }
/* ===== END: ManageFunds ===== */

/* ===== START: Receipt Viewer ===== */
/* ── In-page receipt viewer (showReceipt iframe overlay) ── */
/* Receipt viewer — port of legacy gabai/site/Accounting/CreditMember.aspx CSS.
   Inner iframe loads /Pages/ShowReceipt.html which has its own toolbar (הורדה/הדפסה).
   The "סגירה" button below is part of THIS wrapper (legacy pattern). */
#receiptDiv {
    position: fixed;
    z-index: 101;
    width: 30vw;
    left: calc(50% - 15vw);
    top: 2%;
    background-color: white;
    display: flex;
    flex-direction: column;
}
#receiptDiv iframe {
    width: 100%;
    height: 45vw;
    /* על מסכים רחבים 45vw גבוה מהחלון וכפתור ה"סגירה" התחתון נדחף מחוץ למסך — מגבילים לגובה החלון
       פחות שורת הכפתור, כך שהסגירה תמיד נראית. */
    max-height: calc(98vh - 3.5rem);
    background-color: white;
    border: none;
    display: block;
}
#receiptDiv #closeReceipt {
    width: 100%;
    margin: 0;
    border: none;
    background: #323639;
    color: white;
    padding: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
}
/* Preview mode — X close pinned top-left, no bottom bar. iframe takes the full 45vw. */
#receiptDiv.preview #closeReceipt {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: white;
    color: #1a1a1a;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
#receiptDiv.preview #closeReceipt:hover {
    background: #f3f4f6;
}
@media screen and (max-width: 900px) {
    #receiptDiv {
        width: 100%;
        left: 0;
        top: 0;
        height: 100vh;
    }
    #receiptDiv iframe {
        width: 100%;
        height: calc(100% - 5.5vh);
    }
    #receiptDiv #closeReceipt {
        width: 100%;
        height: 5.5vh;
        font-size: 1.5rem;
    }
}
/* ===== END: Receipt Viewer ===== */

/* ===== Hover tooltip on icon buttons =====
   Mirrors the React shadcn/Radix <TooltipContent>: rounded-md border, bg-popover,
   px-3 py-1.5, text-sm text-popover-foreground, shadow-md — positioned above the trigger.
   Usage: add class "ui-tip" + data-tip="label" (keep aria-label for a11y). */
.ui-tip { position: relative; }
.ui-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    z-index: 50;
    white-space: nowrap;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--popover));
    color: hsl(var(--popover-foreground));
    padding: 0.375rem 0.75rem;                       /* py-1.5 px-3 */
    border-radius: calc(var(--radius) - 0.125rem);   /* rounded-md */
    font-size: 0.875rem;                             /* text-sm */
    line-height: 1.25rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
.ui-tip:hover::after,
.ui-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Hub-card tooltips (React <TooltipContent side="top" className="max-w-xs text-right">):
   the descriptions are full sentences, so allow wrapping up to max-w-xs. */
.fh-card.ui-tip::after {
    white-space: normal;
    width: max-content;
    max-width: 20rem;      /* max-w-xs */
    text-align: right;
}
/* ===== END: Hover tooltip ===== */

/* ===== "עגולים וכחולים" checkbox — replaces the native chrome with a fully-round primary-color
   toggle that shows a white ✓ when checked. Shared across DebtorsReport / MemberFinancialReport
   / any page that needs a project-consistent checkbox. ===== */
.ui-cb {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.125rem; height: 1.125rem;
    border-radius: 9999px;
    border: 2px solid hsl(var(--primary));
    background: hsl(var(--background));
    display: inline-block;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    pointer-events: auto;
    transition: background .12s, box-shadow .12s;
}
.ui-cb:hover          { box-shadow: 0 0 0 3px hsl(var(--primary) / .15); }
.ui-cb:focus-visible  { outline: none; box-shadow: 0 0 0 3px hsl(var(--primary) / .35); }
.ui-cb:checked        { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.ui-cb:checked::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: .35rem; height: .65rem;
    border: solid hsl(var(--primary-foreground));
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
    pointer-events: none;
}

/* ===== Matching custom radio (accent-color-native is unreliable across browsers) ===== */
.ui-radio {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.125rem; height: 1.125rem;
    border-radius: 9999px;
    border: 2px solid hsl(var(--primary));
    background: hsl(var(--background));
    display: inline-block;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    pointer-events: auto;
    transition: background .12s, box-shadow .12s;
}
.ui-radio:hover          { box-shadow: 0 0 0 3px hsl(var(--primary) / .15); }
.ui-radio:focus-visible  { outline: none; box-shadow: 0 0 0 3px hsl(var(--primary) / .35); }
.ui-radio:checked::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: .55rem; height: .55rem;
    border-radius: 9999px;
    background: hsl(var(--primary));
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ===== Global scrollbar (mirrors gabai-react index.css @layer base) ===== */
/* Applied to the sidebar and every overflow container (dialogs, dropdowns, etc.) so the
   thin gray thumb replaces the platform default. The .custom-select-list dropdown-viewport
   still opts out via `display:none` (see rule above). */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.4); }

/* ===== Table row height — bump py-2.5 cells to py-3 to match Lovable's minimum spacing ===== */
/* Higher specificity than Tailwind's utility (.py-2\.5) so this wins the cascade. */
table tbody td.py-2\.5,
table thead th.py-2\.5,
table tfoot td.py-2\.5 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

