/* =========================================
   Fonts & Core Settings (הגדרות ליבה)
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@200;300;400;500;600;700;800&family=Montserrat:ital,wght@0,100;1,100&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    /* הצבעים החדשים שלך */
    --main: #29b669;             /* ירוק כהה - צבע ראשי למערכת (כפתורים, כותרות, לוגו) */
    --main-dark: #68D391;        /* גוון כהה יותר לירוק עבור Hover */
    --main-light: rgba(35, 114, 39, 0.1);
    
    --sub_main: #4FD1C5;        /* ירוק בהיר - צבע משני (הכנסות, אלמנטים תומכים) */
    --sub_main-light: rgba(81, 154, 102, 0.1);
    
    --notice: #F6AD55;          /* כתום/צהוב עז - להתראות, אזהרות תקציב או הוצאות ממתינות */
    --notice-light: #f7ca92;    /* כתום בהיר - רקע להודעות אזהרה או פסי התקדמות */
    
    /* צבעי בסיס */
    --text: #2D3748;
    --text-light: #777777;
    --error: #F56565;
    --success: #68D391;         /* נשתמש בירוק הבהיר שלך גם להצלחה */
    --gray: #ECEDEF;
    --gray-light: #F8F9FA;
    --white: #fff;
    --input-bg: #F7F9FA;

    /* מחשב: תוכן רחב מאוד; השוליים מיושרים ל-top-bar */
    --app-content-max-width: 1200px;
    /* רווח אחיד מקצה עליון / תחתון (כמו bottom של .floating-nav-wrapper) */
    --app-edge-inset: 25px;
}

/* מניעת זום נוסף בשדות הקלדה (גיבוי לאייפון) */
input, select, textarea {
    font-size: 16px !important;
}

* {
    touch-action: manipulation;
    font-family: 'Assistant', sans-serif;
    font-weight: normal;
    box-sizing: border-box;
    scroll-behavior: smooth;
    letter-spacing: 0;
    margin: 0;
    padding: 0;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--gray-light);
    line-height: 1.3rem;
    font-size: 18px;
    direction: rtl; /* הבטחת כיווניות לאורך כל האתר */
}

/* כותרות בסיס (דסקטופ); במובייל מוקטנות */
h2 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
}
h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
@media (max-width: 767.98px) {
    h2 {
        font-size: 1.2rem;
    }
    h3 {
        font-size: 1.05rem;
    }
    .chart-header h3 {
        font-size: 1.05rem;
    }
    .notif-header h3 {
        font-size: 0.95rem;
    }
    .join-code-box h2 {
        font-size: 1.65rem;
    }
}

/* =========================================
   Utility Classes (מחלקות כלליות)
========================================= */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.bg-gray {
    background-color: var(--gray-light);
}
.hidden { display: none; }

/* =========================================
   Split Screen Layout (פריסת מסך חצוי)
========================================= */
.split-screen-container {
    display: flex;
    min-height: 100vh;
}

.form-side {
    flex: 1;
    background-color: var(--white);
    padding: 2rem;
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
}

.brand-side {
    flex: 1;
    background-color: var(--main);
    color: var(--white);
    padding: 2rem;
}

.brand-content {
    max-width: 450px;
}

.brand-icon { font-size: 5rem; color: var(--white); margin-bottom: 1rem; }
.brand-title { color: var(--white); font-size: 3.5rem; font-weight: 800; margin-bottom: 1rem; }
.brand-text { color: var(--white); font-size: 1.2rem; opacity: 0.9; line-height: 1.6; font-weight: 300; }

.brand-mobile {
    display: none;
    color: var(--main);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

/* =========================================
   Form Elements (אלמנטים של טפסים)
========================================= */
.page-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--text); }
.page-subtitle { font-size: 1.1rem; color: var(--text-light); margin-bottom: 2.5rem; }

.input-group { margin-bottom: 1.5rem; text-align: right; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 700; font-size: 0.9rem; }

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    right: 15px;
    color: #aaa;
    font-size: 1rem;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    font-size: 1rem;
}

.input-with-icon input:focus {
    border-color: var(--main);
    background-color: var(--white);
    box-shadow: 0 0 0 4px var(--main-light);
}

.btn-primary {
    background-color: var(--main);
    color: var(--white);
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    width: 100%;
}

@media (hover: hover) {
    .btn-primary:hover {
        background-color: var(--main-dark);
        transform: translateY(-1px);
    }
}
.btn-primary:active {
    background-color: var(--main-dark);
    transform: translateY(-1px);
}

.form-actions { margin: 1.5rem 0 2rem 0; font-size: 0.9rem; }
.form-actions a, .auth-switch a { color: var(--main); text-decoration: none; font-weight: 700; }
@media (hover: hover) {
    .form-actions a:hover, .auth-switch a:hover { text-decoration: underline; }
}
.form-actions a:active, .auth-switch a:active { text-decoration: underline; }

.auth-switch { margin-top: 2rem; font-size: 1rem; color: var(--text-light); }

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    margin-left: 8px;
    width: 18px;
    height: 18px;
    accent-color: var(--main);
}

/* =========================================
   Radio Selector (עבור דף הרשמה)
========================================= */
.radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.radio-card {
    flex: 1;
    border: 1.5px solid #ddd;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.radio-card.active {
    border-color: var(--main);
    background-color: var(--main-light);
}

/* =========================================
   Responsive (מובייל וטאבלט)
========================================= */
@media (max-width: 900px) {
    .brand-side { display: none; }
    .brand-mobile { display: block; text-align: center; }
    
    .form-side { 
        background-color: var(--gray-light); 
        padding: 1.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .form-wrapper { 
        background-color: var(--white); 
        padding: 2.5rem 2rem; 
        border-radius: 20px; 
        box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
        text-align: center; /* מרכוז טקסט כללי במובייל */
    }

    .page-title, .page-subtitle, .auth-switch {
        text-align: center;
    }

    .input-group {
        text-align: right; /* שומר על התוויות מימין */
    }
}

@media (max-width: 480px) {
    .form-wrapper { padding: 1.5rem; }
    .page-title { font-size: 1.8rem; }
}

/* --- 1. כפתורים (Buttons) --- */
.btn-primary { 
    padding: 15px; 
    font-size: 1.1rem; 
}
/* רספונסיביות של כפתורים */
@media (max-width: 900px) {
    .btn-primary { padding: 12px; font-size: 1rem; }
}

/* --- 2. כרטיסיית הרשמה (Register Card) --- */
.register-card { 
    margin: 50px; 
}
/* רספונסיביות של הכרטיסייה */
@media (max-width: 900px) {
    .register-card { margin: 20px; }
}

/* --- הודעות שגיאה (Alerts) --- */
.alert-error {
    background-color: #fff5f5;
    border: 1.5px solid var(--error);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    width: 100%;
}

.alert-error ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alert-error li {
    color: var(--error);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
}

/* רספונסיביות להודעות */
@media (max-width: 900px) {
    .alert-error {
        text-align: center;
    }
}

/* =========================================
   דפי התחברות / הרשמה — תזרים (auth-cp)
========================================= */
body.auth-cp {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--gray-light) !important;
    padding: 20px;
    overflow-x: hidden;
    font-family: "Assistant", "Segoe UI", system-ui, sans-serif;
}

body.auth-cp .gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        155deg,
        #d9dedc 0%,
        #e4ebe6 38%,
        #eef1f0 72%,
        #dfe3e1 100%
    );
}

body.auth-cp .form-container {
    width: 100%;
    max-width: 680px;
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(45, 55, 72, 0.06);
}

@media (min-width: 601px) {
    body.auth-cp .form-container {
        padding: 44px 48px;
    }
}

body.auth-cp .form-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--main), var(--sub_main));
}

body.auth-cp .logo {
    text-align: center;
    margin-bottom: 36px;
}

body.auth-cp .cp-login-logo-mark {
    margin-bottom: 14px;
}

body.auth-cp .cp-login-logo-mark svg {
    display: block;
    margin: 0 auto;
}

body.auth-cp .cp-login-brand {
    color: var(--text);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0;
}

body.auth-cp .cp-login-tagline {
    color: var(--text-light);
    font-size: 15px;
    margin-top: 8px;
    font-weight: 400;
    margin-bottom: 0;
    line-height: 1.45;
}

body.auth-cp .cp-login-alert {
    margin-bottom: 24px;
    border-radius: 12px;
}

body.auth-cp .form-group {
    margin-bottom: 24px;
    position: relative;
}

body.auth-cp .form-group label {
    display: block;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

body.auth-cp .input-with-icon {
    position: relative;
}

body.auth-cp .cp-login-input-icon {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

body.auth-cp .form-control {
    width: 100%;
    padding: 16px;
    padding-inline-start: 48px;
    background: var(--input-bg);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.auth-cp .form-control:focus {
    outline: none;
    border-color: var(--main);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--main-light);
}

body.auth-cp .form-control::placeholder {
    color: #94a3b8;
}

body.auth-cp .checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

body.auth-cp .checkbox-group-start {
    display: flex;
    align-items: center;
}

body.auth-cp .checkbox-group input {
    margin-inline-end: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--main);
}

body.auth-cp .checkbox-group label {
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

body.auth-cp .checkbox-group .forgot-link {
    color: var(--main);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

@media (hover: hover) {
    body.auth-cp .checkbox-group .forgot-link:hover {
        text-decoration: underline;
    }
}

body.auth-cp .submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--main);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.02em;
}

@media (hover: hover) {
    body.auth-cp .submit-btn:hover {
        background: var(--main-dark);
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(41, 182, 105, 0.28);
    }
}

body.auth-cp .submit-btn:active {
    transform: translateY(0);
}

body.auth-login .signup-link {
    text-align: center;
    color: var(--text-light);
    font-size: 15px;
    margin-top: 28px;
    margin-bottom: 0;
}

body.auth-login .signup-link a {
    color: var(--main);
    text-decoration: none;
    font-weight: 700;
}

@media (hover: hover) {
    body.auth-login .signup-link a:hover {
        text-decoration: underline;
    }
}

@media (max-width: 600px) {
    body.auth-cp .form-container {
        padding: 30px 24px;
        border-radius: 20px;
    }
}

/* הרשמה — שורות זוגיות, רדיו, תקנון */
body.auth-cp .cp-reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    margin-bottom: 24px;
}

body.auth-cp .cp-reg-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    body.auth-cp .cp-reg-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 24px;
    }

    body.auth-cp .cp-reg-row .form-group {
        margin-bottom: 24px;
    }

    body.auth-cp .cp-reg-row .form-group:last-child {
        margin-bottom: 0;
    }
}

body.auth-cp .cp-reg-section-label {
    display: block;
    margin: 8px 0 12px 0;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    text-align: right;
}

body.auth-cp .cp-reg-radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 480px) {
    body.auth-cp .cp-reg-radio-group {
        grid-template-columns: 1fr;
    }
}

body.auth-cp .cp-reg-radio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    background: var(--input-bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin: 0;
}

body.auth-cp .cp-reg-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

body.auth-cp .cp-reg-radio-card .cp-reg-radio-icon {
    display: flex;
    color: var(--main);
}

body.auth-cp .cp-reg-radio-card.active {
    border-color: var(--main);
    background: var(--main-light);
    box-shadow: 0 0 0 1px rgba(41, 182, 105, 0.2);
}

body.auth-cp .cp-reg-tos {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--gray-light);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

body.auth-cp .cp-reg-tos label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin: 0;
    line-height: 1.45;
    text-align: right;
}

body.auth-cp .cp-reg-tos input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--main);
    margin-top: 2px;
}

body.auth-cp .cp-reg-tos a {
    color: var(--main);
    text-decoration: underline;
}

body.auth-cp .submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

@media (hover: hover) {
    body.auth-cp .submit-btn:disabled:hover {
        background: var(--main);
        transform: none !important;
        box-shadow: none !important;
    }
}

body.auth-register .auth-switch {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 15px;
    color: var(--text-light);
}

body.auth-register .auth-switch a {
    color: var(--main);
    font-weight: 700;
    text-decoration: none;
}

@media (hover: hover) {
    body.auth-register .auth-switch a:hover {
        text-decoration: underline;
    }
}

body.auth-register .cp-tos-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

body.auth-register .cp-tos-modal-box {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

body.auth-register .cp-tos-modal-box h2 {
    margin: 0 0 12px 0;
    font-weight: 800;
    color: var(--main);
    text-align: center;
}

body.auth-register .cp-tos-modal-close {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
}

body.auth-register .cp-tos-modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    margin-bottom: 16px;
}

body.auth-register .cp-tos-modal-done {
    margin-top: auto;
}

/* איפוס סיסמה — אותו שפה ויזואלית של auth-cp */
/* בלי !important — כדי ש־jQuery (fadeIn) יוכל להציג שלבים */
body.auth-forgot .step-hidden {
    display: none;
}

body.auth-forgot .cp-forgot-alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid transparent;
}

body.auth-forgot .cp-forgot-code-input {
    letter-spacing: 0.35em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body.auth-forgot .auth-switch {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 15px;
    color: var(--text-light);
}

body.auth-forgot .auth-switch a {
    color: var(--main);
    font-weight: 700;
    text-decoration: none;
}

@media (hover: hover) {
    body.auth-forgot .auth-switch a:hover {
        text-decoration: underline;
    }
}

/* =========================================
   6. Dashboard Layout (פריסת דשבורד)
========================================= */

.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar - תפריט צד למחשב */
.sidebar {
    width: 260px;
    background-color: var(--main);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
}

.sidebar-header i {
    color: var(--white);
}

.sidebar-header span {
    color: var(--white);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px;
    flex: 1;
}

.sidebar-nav a{
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav a i {
    color: inherit;
    width: 20px;
    text-align: center;
}

@media (hover: hover) {
    .sidebar-nav a:hover {
        background-color: var(--main-dark);
        color: var(--white);
    }
}
.sidebar-nav a.active {
    background-color: var(--main-dark);
    color: var(--white);
}
.sidebar-nav a:active {
    background-color: var(--main-dark);
    color: var(--white);
}

.sidebar-nav hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 10px;
}

@media (hover: hover) {
    .logout-link:hover {
        background-color: rgba(255, 107, 91, 0.2) !important;
        color: #ff6b5b !important;
    }
}
.logout-link:active {
    background-color: rgba(255, 107, 91, 0.2) !important;
    color: #ff6b5b !important;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--gray-light);
}


.mobile-menu-btn {
    display: none; /* יופיע רק במובייל */
    font-size: 1.5rem;
    cursor: pointer;
}

.user-info {
    font-size: 1rem;
}

.user-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* יישור לשמאל ב-RTL */
    gap: 4px;
}

.user-welcome {
    font-size: 1rem;
    color: var(--text-dark);
}

.home-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--main-light); /* הירוק הבהיר מאוד */
    color: var(--main);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.home-tag i {
    font-size: 0.75rem;
}

/* התאמה למובייל - שהכל יהיה בשורה אחת אם יש מקום */
@media (max-width: 600px) {
    .user-info-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
}

.content-wrapper {
    padding: 30px;
    min-width: 0; /* מונע גלישה אופקית בתוך flex (מובייל) */
    max-width: 100%;
    box-sizing: border-box;
}

/* מחשב בלבד: רוחב אחיד — width מפורש (לא 100% בתוך flex) כדי למנוע stretch לא עקבי */
@media (min-width: 901px) {
    .main-content > .content-wrapper {
        flex: 1 1 auto;
        width: min(var(--app-content-max-width), calc(100% - 2 * var(--app-edge-inset)));
        max-width: 100%;
        margin-inline: auto;
        box-sizing: border-box;
        min-width: 0;
    }
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 25px;
}

/* Stats Grid - כרטיסיות מידע */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.stat-card label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-card .amount {
    font-size: 1.8rem;
    font-weight: 800;
}

/* צבעים ספציפיים לכרטיסיות */
.stat-card.balance { border-right-color: var(--notice); }
.stat-card.income { border-right-color: var(--success); }
.stat-card.income .amount { color: var(--success); }
.stat-card.expenses { border-right-color: var(--error); }
.stat-card.expenses .amount { color: var(--error); }

/* Floating Action Button (FAB) */
.floating-btn {
    position: fixed;
    bottom: 30px;
    left: 30px; /* בגלל ה-RTL הלחצן יהיה בשמאל */
    width: 60px;
    height: 60px;
    background-color: var(--main);
    color: var(--white);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 15px rgba(35, 114, 39, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 100;
    transition: transform 0.2s ease;
}

@media (hover: hover) {
    .floating-btn:hover {
        transform: scale(1.1);
    }
}
.floating-btn:active {
    transform: scale(1.1);
}

/* =========================================
   7. Responsive Dashboard (רספונסיביות)
========================================= */

@media (max-width: 900px) {
    .sidebar {
        display: none; /* מסתירים את תפריט הצד במובייל */
    }

    .mobile-menu-btn {
        display: block;
    }

    .content-wrapper {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr; /* כרטיסיות אחת מעל השנייה */
    }

    .stat-card{
        text-align: center;
    }
}

/* =========================================
   9. Transactions List (רשימת פעולות)
========================================= */

.transaction-item {
    background-color: var(--white);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

@media (hover: hover) {
    .transaction-item:hover {
        transform: scale(1.01);
        background-color: var(--gray-light);
    }
}
.transaction-item:active {
    transform: scale(1.01);
    background-color: var(--gray-light);
}

/* scale גורם לחריגה מהמסך במובייל */
@media (max-width: 900px) {
    @media (hover: hover) {
        .transaction-item:hover {
            transform: none;
        }
    }
    .transaction-item:active {
        transform: none;
    }
}

.transaction-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cat-icon-wrapper {
    width: 45px;
    height: 45px;
    background-color: var(--gray-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-icon-wrapper i {
    font-size: 1.1rem;
    color: var(--text-light);
}

.income .cat-icon-wrapper i { color: var(--success); }
.expense .cat-icon-wrapper i { color: var(--error); }

.details {
    display: flex;
    flex-direction: column;
}

.details .desc {
    font-weight: 700;
    font-size: 1rem;
}

.details .date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.transaction-amount {
    font-weight: 800;
    font-size: 1.1rem;
}

.income .transaction-amount { color: var(--success); }
.expense .transaction-amount { color: var(--error); }

/* כפתור טען עוד */
.btn-load-more {
    background-color: var(--white);
    border: 2px solid var(--gray);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .btn-load-more:hover {
        background-color: var(--gray-light);
        border-color: var(--main);
        color: var(--main);
    }
}
.btn-load-more:active {
    background-color: var(--gray-light);
    border-color: var(--main);
    color: var(--main);
}

/* =========================================
   10. New Top-Bar Design (עיצוב סרגל עליון חדש)
========================================= */

.top-bar {
    background-color: var(--white);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px; /* יוצר את האפקט ה"צף" מהצדדים */
    border-radius: 20px; /* פינות מעוגלות כמו בדוגמה */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-details-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.welcome-text {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 2px 0;
}

.home-name-sub {
    font-size: 0.8rem;
    color: var(--main);
    font-weight: 600;
}

/* צד שמאל - אייקונים */
.header-left {
    display: flex;
    align-items: center;
}

.action-icons {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    background-color: var(--gray-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

.icon-btn i {
    font-size: 1.1rem;
    color: var(--text);
}

@media (hover: hover) {
    .icon-btn:hover {
        background-color: var(--gray);
        transform: translateY(-2px);
    }
}
.icon-btn:active {
    background-color: var(--gray);
    transform: translateY(-2px);
}

.logout-btn-top i {
    color: var(--error);
}

.notification-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--error);
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* התאמה למובייל */
@media (max-width: 900px) {
    .top-bar {
        margin: 10px;
        padding: 10px 15px;
    }
    .user-name { font-size: 0.9rem; }
    .welcome-text, .home-name-sub { font-size: 0.7rem; }
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
        letter-spacing: 0.12em;
    }
}

/* =========================================
   עדכונים למבנה ה-Layout המקצועי
========================================= */

/* מוודא שהתוכן הראשי תופס את כל השטח ליד הסיידבר */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* מונע פריצה של אלמנטים */
    background-color: var(--gray-light);
}

/* עיצוב ה-Top Bar הצף — sticky עם top = margin כדי שהרווח מראש המסך לא נעלם בגלילה */
.top-bar {
    position: -webkit-sticky;
    position: sticky;
    top: var(--app-edge-inset);
    z-index: 50;
    flex-shrink: 0;
    background-color: var(--white);
    margin: var(--app-edge-inset) var(--app-edge-inset) 0 var(--app-edge-inset);
    padding: 12px 25px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* סידור הפרופיל בתוך ה-Top Bar */
.user-profile-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* עיגול אותיות ראשונות (תואם ui-avatars: רקע #29b669, טקסט לבן) */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--main-light);
    background-color: var(--main);
    color: #fff;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1;
    letter-spacing: 0.1em;
    user-select: none;
    font-family: 'Assistant', system-ui, sans-serif;
}

.user-details-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.welcome-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

.user-name {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.home-name-sub {
    font-size: 0.8rem;
    color: var(--main);
    font-weight: 600;
}

/* אייקונים בצד שמאל */
.action-icons {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background-color: var(--gray-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .top-bar .action-icons .icon-btn:hover {
        background-color: var(--gray);
    }
}
.top-bar .action-icons .icon-btn:active {
    background-color: var(--gray);
}

.logout-btn-top i {
    color: var(--error);
}

/* התאמה לרזולוציות שונות — אותו עיקרון: top (sticky) = מרווח מהקצה */
@media (max-width: 900px) {
    .top-bar {
        top: 10px;
        margin: 10px;
        padding: 10px 15px;
    }
}

/* =========================================
   11. Category Budget Grid (מעקב תקציב)
========================================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background-color: var(--white);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

@media (hover: hover) {
    .category-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    }
}
.category-card:active {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* מצב חריגה מהתקציב */
.category-card.over-budget {
    border-color: var(--error);
    background-color: #fff9f9;
}

.cat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cat-icon-circle {
    width: 40px;
    height: 40px;
    background-color: var(--main-light);
    color: var(--main);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.over-budget .cat-icon-circle {
    background-color: #fee2e2;
    color: var(--error);
}

.cat-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.spending-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.spent-amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.budget-total {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* פסי התקדמות */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--gray-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--main);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.over-budget .progress-bar {
    background-color: var(--error);
}

/* כפתור פירוט */
.cat-card-footer {
    margin-top: auto;
    padding-top: 10px;
}

.btn-cat-details {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: var(--gray-light);
    color: var(--text);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .btn-cat-details:hover {
        background-color: var(--gray);
        color: var(--main);
    }
}
.btn-cat-details:active {
    background-color: var(--gray);
    color: var(--main);
}

.btn-cat-details i {
    font-size: 0.75rem;
}

/* התאמה למובייל */
@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}
/* פופאפ (Modal) */
.modal {
    display: none; 
    position: fixed;
    z-index: 3000 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* החשכת רקע */
    backdrop-filter: blur(4px); /* אפקט טשטוש מודרני */
}

.modal-backdrop {
    z-index: 2900 !important;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh; /* מקסימום 80% מגובה המסך */
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px 25px;
    overflow-y: auto; /* מאפשר גלילה בתוך הפופאפ */
    flex: 1;
}

.close-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 700;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.close-modal-btn i {
    font-size: 1.1rem;
    line-height: 1;
}

@media (hover: hover) {
    .close-modal-btn:hover {
        color: var(--error);
    }
}
.close-modal-btn:active {
    color: var(--error);
}

.close-modal-btn:focus-visible {
    outline: 2px solid var(--main);
    outline-offset: 2px;
}

/* פופאפ אישור/התראה גלובלי (tazrim_dialogs.js) — עיצוב כמו global_info_modal */
.tazrim-app-dialog {
    z-index: 3200 !important;
}

.tazrim-app-dialog__content {
    max-width: 400px;
    width: 90%;
    margin: 8vh auto;
    text-align: center;
    border-radius: 20px;
    max-height: none;
}

.tazrim-app-dialog__hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 0;
    border-bottom: none;
}

.tazrim-app-dialog__close {
    position: absolute;
    left: 20px;
    top: 20px;
}

.tazrim-app-dialog__icon-wrap {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 10px;
}

.tazrim-app-dialog__icon-wrap--main {
    color: var(--main);
}

.tazrim-app-dialog__icon-wrap--notice {
    color: var(--notice);
}

.tazrim-app-dialog__icon-wrap--error {
    color: var(--error);
}

.tazrim-app-dialog__body {
    padding: 10px 30px 30px;
    text-align: center;
    background: var(--white);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: visible;
}

.tazrim-app-dialog__title {
    margin: 0 0 15px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.tazrim-app-dialog__message {
    margin: 0;
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

.tazrim-app-dialog__actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.tazrim-app-dialog__actions .tazrim-app-dialog__btn {
    margin-top: 0;
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

.tazrim-app-dialog--confirm .tazrim-app-dialog__actions .btn-primary {
    margin-top: 0;
    width: auto;
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 12px;
}

/* הודעת alert: כפתור «הבנתי» ברוחב מלא כמו בפופאפ המידע */
.tazrim-app-dialog--alert .tazrim-app-dialog__actions {
    flex-direction: column;
}

.tazrim-app-dialog--alert .tazrim-app-dialog__actions .btn-primary {
    width: 100%;
    flex: none;
}

.tazrim-app-dialog__btn--cancel {
    background: var(--gray-light);
    color: var(--text);
    border: none;
    border-radius: 12px;
}

@media (hover: hover) {
    .tazrim-app-dialog__btn--cancel:hover {
        background: #e2e8f0;
    }
}

.tazrim-app-dialog__btn--danger {
    background-color: var(--error) !important;
}

@media (hover: hover) {
    .tazrim-app-dialog__btn--danger:hover {
        filter: brightness(0.92);
        transform: translateY(-1px);
    }
}

/* התאמה לטבלה בתוך המודאל */
.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th {
    position: sticky; /* כותרת הטבלה נשארת למעלה בגלילה */
    top: 0;
    background: var(--white);
    z-index: 10;
    padding-bottom: 15px;
    text-align: right;
    border-bottom: 2px solid var(--gray-light);
}

.modal-body {
    padding: 20px 25px;
    overflow-y: auto; 
    flex: 1;
    background-color: var(--gray-light); /* הוספנו רקע אפור בהיר */
    border-bottom-left-radius: 20px; /* עיגול הפינות למטה */
    border-bottom-right-radius: 20px;
}

/* =========================================
   12. AI Advisor Section (יועץ חכם)
========================================= */
.ai-card {
    background: linear-gradient(145deg, #ffffff 0%, #fcfdfe 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(35, 114, 39, 0.06);
    border: 1px solid rgba(35, 114, 39, 0.1);
    position: relative;
    overflow: hidden;
}

/* פס עיטור עליון */
.ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--main), var(--sub_main));
}

.ai-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.ai-icon-wrapper {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--main-light), rgba(81, 154, 102, 0.2));
    color: var(--main);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ai-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

.ai-intro-text {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-ai-generate {
    background: linear-gradient(90deg, var(--main), var(--sub_main));
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
    .btn-ai-generate:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(35, 114, 39, 0.2);
    }
}
.btn-ai-generate:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(35, 114, 39, 0.2);
}

.ai-result-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--gray-light);
    padding: 20px;
    border-radius: 12px;
    border-right: 4px solid var(--sub_main);
    animation: fadeIn 0.5s ease;
}

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

/* =========================================
   13. Month Selector (בורר חודשים)
========================================= */
.month-selector {
    display: flex;
    align-items: center;
    background-color: var(--white);
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--gray);
}

.month-btn {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    transition: 0.2s ease;
}

@media (hover: hover) {
    .month-btn:hover:not(.disabled) {
        background-color: var(--gray-light);
        color: var(--main);
    }
}
.month-btn:active:not(.disabled) {
    background-color: var(--gray-light);
    color: var(--main);
}

.month-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.current-month-display {
    padding: 0 15px;
    font-weight: 700;
    color: var(--main-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.current-month-display {
    font-size: 1.2rem;
    color: var(--main);
    text-align: center;
}

@media (max-width: 600px) {
    .page-header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .current-month-display {
        font-size: 1rem;
    }
}

/* כפתור חזרה לחודש הנוכחי */
.btn-return-today {
    background-color: var(--main-light);
    color: var(--main);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .btn-return-today:hover {
        background-color: var(--main);
        color: var(--white);
        transform: translateY(-1px);
    }
}
.btn-return-today:active {
    background-color: var(--main);
    color: var(--white);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .page-header-actions > div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* =========================================
   15. Pending Transactions (פעולות עתידיות/ממתינות)
========================================= */
.transaction-item.pending-trans {
    opacity: 0.6; /* אפקט שקיפות */
    background-color: #fdfdfd;
    border-right-color: #d1d5db !important; /* פס אפור במקום ירוק/אדום */
}

.transaction-item.pending-trans .transaction-amount {
    color: #9ca3af !important; /* סכום בצבע אפור כדי לא לבלבל עם כסף אמיתי */
}

.transaction-item.pending-trans .cat-icon-wrapper {
    background-color: #f3f4f6;
}

.transaction-item.pending-trans .cat-icon-wrapper i {
    color: #9ca3af !important; /* אייקון השעון באפור */
}

/* =========================================
   14. Add Transaction UI (עיצוב פופאפ הוספה)
========================================= */

/* בורר הוצאה/הכנסה מודרני */
.modern-toggle {
    display: flex;
    background-color: var(--gray);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 25px;
}

.modern-toggle input[type="radio"] {
    display: none;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
}

/* מצבי הדלקה (Checked) */
.modern-toggle input[id="type-expense"]:checked + .expense {
    background-color: var(--error);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 107, 91, 0.3);
}

.modern-toggle input[id="type-income"]:checked + .income {
    background-color: var(--success);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(81, 154, 102, 0.3);
}

/* גריד קטגוריות (ריבועים) */
.category-grid-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
    max-height: 220px;
    overflow-y: auto; /* מאפשר גלילה אם יש הרבה קטגוריות */
    padding: 5px;
    margin-top: 10px;
}

/* Scrollbar דק לגריד הקטגוריות */
.category-grid-selector::-webkit-scrollbar {
    width: 6px;
}
.category-grid-selector::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.cat-tile {
    cursor: pointer;
    display: block;
}

.cat-tile input[type="radio"] {
    display: none;
}

.tile-content {
    background-color: var(--white);
    border: 2px solid var(--gray);
    border-radius: 15px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    text-align: center;
}

.tile-content .cat-icon {
    width: 40px;
    height: 40px;
    background-color: var(--gray-light);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.tile-content .cat-name-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

/* מצב נבחר (Checked) לריבוע הקטגוריה */
.cat-tile input[type="radio"]:checked + .tile-content {
    border-color: var(--main);
    background-color: var(--main-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(35, 114, 39, 0.15);
}

.cat-tile input[type="radio"]:checked + .tile-content .cat-icon {
    background-color: var(--main);
    color: var(--white);
}

/* דף ניהול הבית *//* === עיצוב חדש לכרטיסיות הקטגוריות === */
        .icon-option {
            width: 40px; height: 40px; border-radius: 10px; background: var(--gray);
            display: flex; align-items: center; justify-content: center; cursor: pointer;
            color: var(--text-light); transition: 0.2s; border: 2px solid transparent; font-size: 1.2rem;
        }
        .icon-option.selected {
            background: var(--main-light); color: var(--main); border-color: var(--main);
        }

        /* תיקון צבעים לבורר הוצאה/הכנסה בפופאפ קטגוריות */
        .modern-toggle input[id="cat-type-exp"]:checked + .expense {
            background-color: var(--error);
            color: var(--white);
            box-shadow: 0 4px 12px rgba(255, 107, 91, 0.3);
        }
        .modern-toggle input[id="cat-type-inc"]:checked + .income {
            background-color: var(--success);
            color: var(--white);
            box-shadow: 0 4px 12px rgba(81, 154, 102, 0.3);
        }

        .category-setting-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--white);
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid var(--gray);
    transition: all 0.2s ease;
}
@media (hover: hover) {
    .category-setting-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        transform: translateY(-2px);
        border-color: #e0e0e0;
    }
}
.category-setting-card:active {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #e0e0e0;
}
.category-setting-card.expense-cat {
    border-right: 4px solid var(--error);
}
.category-setting-card.income-cat {
    border-right: 4px solid var(--success);
}
.cat-info-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cat-icon-circle-small {
    width: 38px;
    height: 38px;
    background-color: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
}
.cat-budget-pill {
    background-color: #fff0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-budget-pill.no-budget {
    background-color: var(--gray);
    color: #888;
    font-weight: 600;
}

/* שליטה מדויקת במספר הכרטיסיות בשורה */
.categories-grid-container {
    display: grid;
    grid-template-columns: 1fr; /* מובייל: כרטיסייה 1 בשורה */
    gap: 15px;
}

@media (min-width: 768px) {
    .categories-grid-container {
        grid-template-columns: repeat(2, 1fr); /* מסכים גדולים: בדיוק 2 בשורה */
    }
}

/* עיצוב כפתור וואטסאפ */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #25D366;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    width: 100%;
}
@media (hover: hover) {
    .btn-whatsapp:hover {
        background-color: #128C7E;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
    }
}
.btn-whatsapp:active {
    background-color: #128C7E;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}
@media (min-width: 768px) {
    .btn-whatsapp {
        width: max-content; /* במחשב הכפתור לא ימתח על כל הרוחב */
    }
}

        .management-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 20px;
            margin-top: 20px;
            padding-bottom: 80px;
            min-width: 0;
            max-width: 100%;
        }
        .management-grid > .card {
            min-width: 0;
            max-width: 100%;
            box-sizing: border-box;
        }
        @media (min-width: 768px) {
            .management-grid { grid-template-columns: repeat(2, 1fr); }
            .full-width-card { grid-column: span 2; }
        }

        /* עמוד ניהול הבית — בלוק קטגוריות: מניעת גלישה אופקית במובייל */
        #manage-home-categories-panel {
            min-width: 0;
            max-width: 100%;
        }
        #manage-home-categories-panel .manage-categories-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: nowrap;
            gap: 10px;
            margin-bottom: 24px;
            min-width: 0;
        }
        #manage-home-categories-panel .manage-categories-toolbar .section-subtitle {
            flex: 1 1 12rem;
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        #manage-home-categories-panel .manage-categories-toolbar .btn-primary {
            flex-shrink: 0;
        }
        #manage-home-categories-panel .transaction-item {
            max-width: 100%;
            box-sizing: border-box;
        }
        #manage-home-categories-panel .details .date {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #manage-home-recurring-panel {
            min-width: 0;
            max-width: 100%;
        }
        #manage-home-recurring-panel .manage-categories-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: nowrap;
            gap: 10px;
            margin-bottom: 24px;
            min-width: 0;
        }
        #manage-home-recurring-panel .manage-categories-toolbar .section-subtitle {
            flex: 1 1 12rem;
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        #manage-home-recurring-panel .manage-categories-toolbar .btn-primary {
            flex-shrink: 0;
        }
        #manage-home-recurring-panel .transaction-item {
            max-width: 100%;
            box-sizing: border-box;
        }
        #manage-home-recurring-panel .details .date {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #manage-home-shopping-stores-panel {
            min-width: 0;
            max-width: 100%;
        }
        #manage-home-shopping-stores-panel .manage-categories-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: nowrap;
            gap: 10px;
            margin-bottom: 24px;
            min-width: 0;
        }
        #manage-home-shopping-stores-panel .manage-categories-toolbar .section-subtitle {
            flex: 1 1 12rem;
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        #manage-home-shopping-stores-panel .manage-categories-toolbar .btn-primary {
            flex-shrink: 0;
        }
        #manage-home-shopping-stores-panel .transaction-item {
            max-width: 100%;
            box-sizing: border-box;
        }
        #manage-home-shopping-stores-panel .details .date {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* מובייל: שורות ניהול (פעולות/קטגוריות/חנויות) ברוחב מלא כמו בכרטיס משתתפים — ללא צמצום מיותר */
        @media (max-width: 767.98px) {
            #manage-home-categories-panel,
            #manage-home-recurring-panel,
            #manage-home-shopping-stores-panel {
                width: 100%;
            }
            #manage-home-categories-panel .transaction-item,
            #manage-home-recurring-panel .transaction-item,
            #manage-home-shopping-stores-panel .transaction-item {
                width: 100%;
                max-width: none;
                box-sizing: border-box;
            }
        }

        .join-code-box {
            background-color: var(--main-light);
            border: 2px dashed var(--main);
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            margin-bottom: 20px;
        }
        .join-code-box h2 {
            font-size: 2rem;
            color: var(--main);
            letter-spacing: 5px;
            margin: 10px 0;
            user-select: all;
        }
        .cat-list-item, .recurring-list-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 15px;
            background-color: var(--gray);
            border-radius: 10px;
            margin-bottom: 10px;
        }
        .action-btns button {
            background: none;
            border: none;
            cursor: pointer;
            padding: 5px 10px;
            border-radius: 5px;
            transition: 0.2s;
        }
        .btn-edit { color: var(--main); }
        .btn-delete { color: var(--error); }
        @media (hover: hover) {
            .action-btns button:hover { background-color: white; }
        }
        .action-btns button:active { background-color: white; }

        .month-navigator { display: flex; justify-content: space-between; align-items: center; background: var(--white); padding: 15px 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); margin-bottom: 25px; }
        .month-nav-btn { background: var(--gray); color: var(--text); border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; text-decoration: none; font-weight: 600; transition: 0.2s; }
        @media (hover: hover) {
            .month-nav-btn:hover { background: var(--main-light); color: var(--main); }
        }
        .month-nav-btn:active { background: var(--main-light); color: var(--main); }
       
        
        .kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 25px; }
        @media (min-width: 900px)
        {
            .kpi-grid {
                grid-template-columns: repeat(4, 1fr);
            }
    
        }
        .kpi-card { background: var(--white); padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
        .kpi-title { font-size: 0.9rem; color: #666; font-weight: 600; display: flex; align-items: center; gap: 8px; }
        .kpi-amount { font-size: 1.6rem; font-weight: 800; color: var(--text); }
        .kpi-amount.success-text { color: var(--success); }
        .kpi-amount.error-text { color: var(--error); }
        
        .charts-container { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px; }
        @media (min-width: 992px) { .charts-container { grid-template-columns: 1fr 1fr; } }
        .chart-card { background: var(--white); padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
        .chart-header { border-bottom: 2px solid var(--gray); padding-bottom: 10px; margin-bottom: 15px; }
        .chart-header h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
        .canvas-wrapper { position: relative; height: 300px; width: 100%; display: flex; justify-content: center; }
        
        /* עיצוב מדי תקציב */
        .budget-item { margin-bottom: 18px; }
        .budget-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.95rem; font-weight: 700; color: var(--text); }
        .progress-bar-bg { width: 100%; height: 12px; background-color: var(--gray); border-radius: 6px; overflow: hidden; }
        .progress-bar-fill { height: 100%; border-radius: 6px; transition: width 0.8s ease-out; }

        /* מיכל ההתראות */
.notification-wrapper {
    position: relative;
    cursor: pointer;
}

/* הפופאפ הצף */
.notifications-dropdown {
    display: none; /* מוסתר כברירת מחדל */
    position: absolute;
    top: 50px;
    left: 0;
    width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    border: 1px solid #eee;
    text-align: right;
    overflow: hidden;
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notifications-dropdown.show {
    display: block;
}

/* כותרת הפופאפ */
.notif-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.notif-header h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--text); }
.btn-mark-read { background: none; border: none; color: var(--main); font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; }

/* גוף הפופאפ */
.notif-body { max-height: 380px; overflow-y: auto; }

.notif-item {
    display: flex;
    padding: 15px;
    gap: 12px;
    border-bottom: 1px solid #f5f5f5;
    transition: 0.2s;
    text-decoration: none;
}

@media (hover: hover) {
    .notif-item:hover { background: #f9f9f9; }
}
.notif-item:active { background: #f9f9f9; }
.notif-item.unread { background: #f0fdf4; border-right: 4px solid var(--main); }

.notif-icon-circle {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 1rem;
}

.notif-icon-circle.info { background: #e0f2fe; color: #0369a1; }
.notif-icon-circle.warning { background: #ffedd5; color: #9a3412; }
.notif-icon-circle.success { background: #dcfce7; color: #15803d; }

.notif-text p { margin: 0; font-size: 0.9rem; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 0.75rem; color: #888; margin-top: 4px; display: block; }

/* מצב ריק */
.notif-empty { padding: 40px 20px; text-align: center; color: #ccc; }
.notif-empty i { font-size: 2.5rem; margin-bottom: 10px; }
.notif-empty p { margin: 0; font-size: 0.9rem; color: #999; }

.notif-footer { padding: 12px; border-top: 1px solid #f0f0f0; text-align: center; background: #fafafa; }
.notif-footer a { font-size: 0.85rem; font-weight: 700; color: #666; text-decoration: none; }

/* התאמה למובייל */
@media (max-width: 600px) {
    .notifications-dropdown {
        position: fixed !important; /* קיבוע למסך */
        top: 70px !important;
        /* ביטול כל הגדרות הצד של הדסקטופ */
        right: auto !important; 
        left: 50% !important;
        /* מרכוז מוחלט */
        transform: translateX(-50%) !important;
        width: 92vw !important; /* רוחב כמעט מלא */
        max-width: none !important;
        margin: 0 !important;
    }

    /* מניעת קפיצות בזמן גלילה או תנועה */
    .notifications-dropdown.show {
        display: block !important;
    }

    .kpi-card {
        text-align: center;
    }

    .kpi-title {
        justify-content: center;
    }
}

/* ביטול אנימציית התזוזה ספציפית לכפתור ההתראות כדי לשמור על יציבות הפופאפ */
@media (hover: hover) {
    .notification-wrapper:hover {
        transform: none !important;
        background-color: var(--gray);
    }
}
.notification-wrapper:active {
    transform: none !important;
    background-color: var(--gray);
}

/* גם במצב שהפופאפ פתוח, נוודא שהכפתור לא זז */
.notification-wrapper.active {
    transform: none !important;
}

/* במובייל — רק כפתור ההתראות ללא תזוזה בלחיצה (האייקונים האחרים מקבלים אפקט :active רגיל) */
@media (max-width: 600px) {
    .notification-wrapper:active {
        transform: none !important;
    }
}

/* עיצוב התיאור בתוך ההתראה */
.notif-bold {
    font-weight: 800;
    color: var(--main); /* משתמש בירוק הראשי של המערכת שלך */
}

/* עיצוב אזור ה-API בניהול הבית */
.api-key-section {
    animation: fadeIn 0.4s ease-out;
}

/* תיבת התצוגה של הטוקן */
.api-token-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

@media (hover: hover) {
    .api-token-container:hover {
        border-color: var(--main);
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
}
.api-token-container:active {
    border-color: var(--main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#api-token-display {
    border: none;
    background: transparent;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    color: #475569;
    outline: none;
    letter-spacing: 0.5px;
}

/* כפתור ההעתקה */
.btn-copy-token {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    font-size: 1.1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .btn-copy-token:hover {
        color: var(--main);
    }
}
.btn-copy-token:active {
    color: var(--main);
}

/* הודעת ה"הועתק בהצלחה" */
#copy-msg {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--main);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* כפתור יצירת מפתח חדש */
#btn-generate-api {
    transition: transform 0.2s, background-color 0.2s;
    border: none;
    font-weight: 700;
}

@media (hover: hover) {
    #btn-generate-api:hover {
        background-color: #334155 !important;
        transform: translateY(-1px);
    }
}
#btn-generate-api:active {
    background-color: #334155 !important;
    transform: translateY(0);
}

/* אנימציה פשוטה לכניסה */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ניקוי עיצובים ישנים */
.card-body-padding { padding: 15px; }

.management-block {
    margin-bottom: 20px;
}

.block-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
}

/* עיצוב שורת הקוד והוואטסאפ */
.join-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.join-code-v2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--main);
    letter-spacing: 2px;
}

.btn-whatsapp-minimal {
    background: #25d366;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

@media (hover: hover) {
    .btn-whatsapp-minimal:hover { opacity: 0.9; transform: scale(1.02); }
}
.btn-whatsapp-minimal:active { opacity: 0.9; transform: scale(1.02); }

.block-help {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

/* עיצוב תיבת ה-API המודרנית */
.api-token-block-v2 {
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-wrapper-v2 {
    display: flex;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    max-width: 300px;
}

#api-token-display {
    border: none;
    background: transparent;
    padding: 10px;
    font-family: monospace;
    font-size: 0.8rem;
    flex-grow: 1;
    color: #475569;
}

.copy-btn-v2 {
    background: #e2e8f0;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    color: #475569;
    transition: 0.2s;
}

@media (hover: hover) {
    .copy-btn-v2:hover { background: var(--main); color: white; }
}
.copy-btn-v2:active { background: var(--main); color: white; }

.btn-generate-v2 {
    background: #334155;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
}

.success-text-small {
    color: var(--main);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0;
}

.btn-api-token-delete {
    width: 100%;
    margin-top: 4px;
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.2s;
}

@media (hover: hover) {
    .btn-api-token-delete:hover:not(:disabled) {
        background: #fee2e2;
    }
}
.btn-api-token-delete:active:not(:disabled) {
    background: #fee2e2;
}

.btn-api-token-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* אזור «התזרים באייפון» — עמוד החשבון (נטען ב-AJAX) */
.ios-tazrim-panel .ios-tazrim-lead {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-dark);
    margin: 0 0 18px 0;
}

.ios-tazrim-help {
    margin-bottom: 14px !important;
}

.ios-tazrim-primary-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
}

.ios-api-token-input {
    border: none;
    background: transparent;
    padding: 10px;
    font-family: monospace;
    font-size: 0.8rem;
    flex-grow: 1;
    color: #475569;
    min-width: 0;
}

.ios-shortcuts-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.ios-shortcuts-title {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ios-shortcuts-guide {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 14px 16px;
    margin-bottom: 18px;
}

.ios-shortcuts-guide-lead {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
}

.ios-shortcuts-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ios-shortcuts-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
}

.ios-shortcuts-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: var(--main);
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ios-shortcuts-step-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.ios-shortcuts-step-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-dark);
}

.ios-shortcuts-step-text {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #64748b;
}

.ios-shortcuts-links-label {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
}

.ios-shortcut-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ios-shortcut-add-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    color: var(--text-dark) !important;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: right;
}

@media (hover: hover) {
    .ios-shortcut-add-btn:hover {
        border-color: var(--main);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
        background: #fafafa;
    }
}

.ios-shortcut-add-btn:active {
    background: #f1f5f9;
}

.ios-shortcut-add-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.ios-shortcut-add-icon i {
    color: inherit;
}

.ios-shortcut-add-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.ios-shortcut-add-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.ios-shortcut-add-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.ios-shortcut-add-chevron {
    flex-shrink: 0;
    color: #cbd5e1;
    font-size: 0.75rem;
}

.ios-shortcuts-empty {
    margin: 8px 0 0 0 !important;
}

.ios-tazrim-error {
    padding: 14px;
    border-radius: 10px;
    background: #fef2f2;
    color: var(--error);
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

/* מובייל: תיבת מפתח + כפתור מחיקה ברוחב מלא */
@media (max-width: 767px) {
    .ios-tazrim-panel .api-token-block-v2,
    .ios-tazrim-panel .api-wrapper-v2 {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .ios-tazrim-panel .btn-api-token-delete {
        width: 100%;
        box-sizing: border-box;
    }
}

.ios-tazrim-loading {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-light);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.management-divider {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 25px 0;
}

/* עיצוב כללי לדף הקניות */
.shopping-header {
    margin-bottom: 20px;
}

/* עיצוב הבלוק של קטגוריה (חנות) */
.category-block {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--main);
    cursor: pointer;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
    margin-bottom: 10px;
}

.shopping-category-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-inline-start: 10px;
}

.btn-clear-category {
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--error);
    font-size: 0.95rem;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
}

@media (hover: hover) {
    .btn-clear-category:hover {
        background: rgba(245, 101, 101, 0.12);
    }
}

.btn-clear-category:active {
    transform: scale(0.94);
}

/* עריכת חנות: אותו מבנה כמו פח הניקוי, צבע ניטרלי */
.btn-edit-store {
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.95rem;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

@media (hover: hover) {
    .btn-edit-store:hover {
        background: rgba(15, 23, 42, 0.08);
        color: var(--text);
    }
}

.btn-edit-store:active {
    transform: scale(0.94);
}

/* —— דף קניות: טאבי חנויות + פאנל בודד (שוויון לאפליקציה) —— */
.shopping-tabs-bar {
    margin-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.shopping-store-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    direction: rtl;
    padding: 4px 2px 12px;
}
.shopping-tab-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    max-width: 200px;
    font-family: inherit;
}
.shopping-tab-chip i {
    color: var(--main);
    font-size: 0.95rem;
}
.shopping-tab-chip.active {
    background: var(--main);
    border-color: var(--main);
    color: #fff;
}
.shopping-tab-chip span {
    color: inherit;
}
.shopping-tab-chip.active span {
    color: #fff !important;
}
.shopping-tab-chip.active i {
    color: #fff;
}
.shopping-tab-add {
    border-style: dashed;
    border-color: var(--main);
    color: var(--main);
    background: #fff;
}
.shopping-tab-add i {
    color: var(--main) !important;
}
.shopping-panel {
    display: none;
}
.shopping-panel--active {
    display: block;
}
.shopping-panel .category-block {
    margin-bottom: 0;
}
.category-header--tabs {
    cursor: default;
}
.category-title-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    flex-direction: row;
}
.category-title-label {
    flex: 1;
    min-width: 0;
    text-align: right;
}
.shopping-page-store-modal .modal-content {
    max-width: 440px;
}
.shopping-page-store-modal__header {
    direction: rtl;
}
.shopping-page-store-modal__header h3 {
    margin: 0;
    flex: 1;
    text-align: right;
    font-size: 1.1rem;
    font-weight: 800;
}
.shopping-field-label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: right;
    color: var(--text);
}
.shopping-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--gray-light);
    font-size: 1rem;
    font-family: inherit;
    text-align: right;
}
.shopping-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}
.shopping-icon-grid button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
}
.shopping-icon-grid button.selected {
    border-color: var(--main);
    background: #f0fdf4;
    color: var(--main);
}
.shopping-modal-submit {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}
.shopping-page-store-actions-row {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.shopping-page-store-actions-row .shopping-modal-submit {
    margin-top: 0;
    width: 100%;
}
.shopping-page-store-actions-row--edit {
    flex-direction: row;
    direction: rtl;
    gap: 12px;
    align-items: stretch;
}
.shopping-page-store-actions-row--edit .shopping-modal-submit {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}
.shopping-modal-delete-btn {
    display: none;
    flex-direction: row;
    direction: rtl;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #fecaca;
    background: #fff5f5;
    color: var(--error);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.2;
}
.shopping-page-store-actions-row--edit .shopping-modal-delete-btn {
    display: inline-flex;
}
.shopping-modal-delete-btn i {
    font-size: 0.95rem;
}
@media (hover: hover) {
    .shopping-modal-delete-btn:hover {
        background: #fee2e2;
    }
}
.shopping-modal-msg {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
}

/* אשף רשימת קניות — צ'יפים וכרטיס כמו באפליקציה */
.shopping-welcome-card {
    background: white;
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.shopping-wizard-step {
    display: none;
}
.shopping-wizard-step.active {
    display: block;
    animation: shoppingWizardFade 0.4s;
}
@keyframes shoppingWizardFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.shopping-stepper-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}
.shopping-stepper-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
}
.shopping-stepper-dots .dot.active {
    background: var(--main);
    width: 25px;
    border-radius: 10px;
    transition: 0.3s;
}
.shopping-wizard-icon {
    font-size: 4rem;
    color: var(--main);
    margin-bottom: 20px;
}
.shopping-wizard-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    direction: rtl;
    margin-top: 20px;
    margin-bottom: 8px;
}
.shopping-wizard-chip-grid .store-option {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 108px;
    max-width: 200px;
    border-radius: 999px;
    padding: 10px 12px;
    border-width: 1.5px;
}
@media (max-width: 520px) {
    .shopping-wizard-chip-grid .store-option {
        flex: 1 1 calc(50% - 8px);
    }
}
.shopping-wizard-custom-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
}
.shopping-welcome-card .custom-store-input {
    flex: 1;
    padding: 12px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    text-align: right;
}
.shopping-welcome-card .custom-store-input:focus {
    border-color: var(--main);
    outline: none;
    border-style: solid;
}
.shopping-welcome-card .btn-add-custom {
    background: var(--gray);
    color: var(--text);
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
@media (hover: hover) {
    .shopping-welcome-card .btn-add-custom:hover {
        background: var(--main);
        color: white;
    }
}
.shopping-welcome-card .btn-welcome {
    background: var(--main);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    transition: 0.3s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}
@media (hover: hover) {
    .shopping-welcome-card .btn-welcome:hover {
        background: var(--main-dark);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(35, 114, 39, 0.3);
    }
}
.shopping-welcome-card .btn-welcome:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.shopping-welcome-card .store-option {
    border: 2px solid #eee;
    background: #fafafa;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-light);
}
.shopping-welcome-card .store-option i {
    font-size: 1.5rem;
}
.shopping-welcome-card .store-option span {
    font-weight: 700;
    font-size: 0.9rem;
}
.shopping-welcome-card .store-option.selected {
    border-color: var(--main);
    background: #f0fdf4;
    color: var(--main);
    box-shadow: 0 4px 10px rgba(35, 114, 39, 0.1);
    transform: translateY(-2px);
}

/* שורות הפריטים ושורת הרפאים */
.item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.item-row:last-child {
    border-bottom: none;
}

.item-checkbox {
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
}

.item-input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    width: 100%;
}

.item-qty-input {
    border: none;
    background: #f9fafb;
    border-radius: 6px;
    padding: 4px 8px;
    width: 60px;
    text-align: center;
    font-family: inherit;
    outline: none;
}

/* שורת רפאים - שקיפות חלקית */
.ghost-row {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ghost-row:focus-within {
    opacity: 1;
}


.item-row {
    transition: all 0.3s ease;
}

.pending-delete {
    opacity: 0.4;
    transform: scale(0.98);
}

.pending-delete .item-input, 
.pending-delete .item-qty-input {
    text-decoration: line-through;
    color: #aaa;
    font-size: 18px;
}

.pending-delete .item-checkbox i {
    color: var(--error) !important; /* אדום בולט לסימון מחיקה */
}

/* מניעת זום אוטומטי במובייל */
.item-input, .item-qty-input {
    font-size: 16px !important; 
}

/* === כפתור וטעינת הבינה המלאכותית === */
.btn-ai-sort {
    background: linear-gradient(135deg, #6feb8c, #48c476);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 3px 8px #6feb8c;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9rem;
}

@media (hover: hover) {
    .btn-ai-sort:hover {
        transform: scale(1.15) rotate(10deg);
        box-shadow: 0 5px 12px #6feb8c;
    }
}
.btn-ai-sort:active {
    transform: scale(0.95);
    box-shadow: 0 3px 8px #6feb8c;
}

/* שכבת הטעינה שמופעלת על בלוק הקטגוריה */
.category-block {
    position: relative; /* חובה כדי שהשכבה תשב עליו */
    overflow: hidden;
}

.ai-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.ai-overlay i {
    font-size: 2rem;
    color: #6feb8c;
    margin-bottom: 10px;
    animation: magicPulse 1.5s infinite;
}

.ai-overlay span {
    font-weight: 800;
    color: #6feb8c;
    font-size: 1.1rem;
}

@keyframes magicPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}



.fa-plus, .fa-trash-can-white{
    color: white;
}

/* הגדרת התיאור כגמיש - שיקח את מה שנשאר אבל לא ידחוף את הסכום */
.transaction-info {
    flex: 1;
    min-width: 0; /* קריטי כדי לאפשר לטקסט בפנים להתכווץ */
    display: flex;
    align-items: center;
    gap: 15px;
}

/* טיפול בטקסט ארוך בתיאור */
.details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.details .desc {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;      /* מונע מהתיאור לרדת שורה */
    overflow: hidden;         /* מסתיר חריגות */
    text-overflow: ellipsis;  /* מוסיף ... אם הטקסט ארוך מדי */
}

/* וידוא שהסכום לעולם לא נשבר (המספר והשקל תמיד ביחד) */
.transaction-amount {
    font-weight: 800;
    font-size: 1.1rem;
    white-space: nowrap;      /* מונע הפרדה בין המספר לסימן ₪ */
    flex-shrink: 0;           /* מונע מהסכום להתכווץ */
}

.transaction-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* מונע מכל הגוש של הסכום והכפתורים להימחץ */
}

/* כפתור מידע (עיגול קטן) */
.info-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    background-color: var(--sub_main-light);
    color: var(--main);
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}

@media (hover: hover) {
    .info-trigger:hover {
        color: white;
        transform: scale(1.1);
    }
}
.info-trigger:active {
    color: white;
    transform: scale(1.1);
}

.fa-check, .fa-arrow-left{
    color: white;
}

.tos-scroll-box {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    max-height: 350px;
    overflow-y: auto;
    text-align: right;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 20px;
}

.tos-scroll-box h4 { 
    color: var(--main); 
    margin-top: 20px; 
    margin-bottom: 5px; 
    font-weight: 800; 
}

.tos-scroll-box h4:first-child { 
    margin-top: 0; 
}

@media (max-width: 600px) {
    .step h1{
        line-height: 1;
        font-size: 1.5rem;
    }
    .accept-checkbox-wrapper span{
        line-height: 1.4;
        text-align: right;
    }

}

/* =========================================
   Dropdown Navigation (תפריט נפתח צדדי)
========================================= */
.nav-dropdown {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
    color: white;
}

.nav-dropdown-toggle {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    cursor: pointer;
}

.nav-chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease !important;
}

.nav-dropdown a div{
    color: white;
}

/* כשהתפריט פתוח, החץ מסתובב למטה */
.nav-dropdown.open .nav-chevron {
    transform: rotate(-90deg); 
}

.nav-submenu {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    border-radius: 10px;
}

/* גובה מקסימלי מספיק גדול להכיל את כל הפריטים */
.nav-dropdown.open .nav-submenu {
    max-height: 250px; 
    margin-top: 5px;
}

.nav-submenu a {
    padding: 12px 40px 12px 20px !important;
    font-size: 0.95rem;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    opacity: 0.85;
}

.nav-submenu a.active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    opacity: 1;
}
@media (hover: hover) {
    .nav-submenu a:hover {
        color: var(--white) !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
        opacity: 1;
    }
}
.nav-submenu a:active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    opacity: 1;
}

.nav-submenu a i {
    font-size: 0.9rem;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

/* =========================================
   Custom Select Box (בורר קטגוריות מתקדם)
========================================= */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
    margin-top: 5px;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: var(--input-bg);
    border: 1.5px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--main);
    background-color: var(--white);
    box-shadow: 0 0 0 4px var(--main-light);
}

@media (hover: hover) {
    .custom-select-trigger:hover {
        border-color: var(--main);
        background-color: var(--white);
    }
}
.custom-select-trigger:active {
    border-color: var(--main);
    background-color: var(--white);
}

.selected-cat-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

.selected-cat-info i {
    color: var(--text-light);
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

/* צובע את האייקון הנבחר בירוק */
.custom-select-wrapper.open .selected-cat-info i {
    color: var(--main);
}
@media (hover: hover) {
    .custom-select-wrapper:hover .selected-cat-info i {
        color: var(--main);
    }
}
.custom-select-trigger:active .selected-cat-info i {
    color: var(--main);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid var(--gray-light);
}

.custom-option:last-child {
    border-bottom: none;
}

@media (hover: hover) {
    .custom-option:hover {
        background-color: var(--main-light);
        color: var(--main);
    }

    .custom-option:hover i {
        color: var(--main);
    }
}
.custom-option:active {
    background-color: var(--main-light);
    color: var(--main);
}

.custom-option:active i {
    color: var(--main);
}

.custom-option i {
    color: var(--text-light);
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.custom-option span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* עיצוב פס הגלילה הפנימי של התפריט */
.custom-select-options::-webkit-scrollbar { width: 6px; }
.custom-select-options::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }

/* נעילת גלילה ברקע כשפופאפ פתוח */
body.no-scroll {
    overflow: hidden;
}

/* =========================================
   Global Floating Navigation - עיצוב מכונס ומושלם
========================================= */
.sidebar, .mobile-menu-btn, .sidebar-overlay { display: none !important; }
body {
    padding-bottom: 120px !important;
}
/* דפי התחברות/הרשמה/איפוס סיסמה — אין תפריט תחתון, בלי ריפוד תחתון מיותר */
body.page-auth {
    padding-bottom: 0 !important;
}
.main-content { margin-right: 0 !important; width: 100% !important; }

.floating-nav-wrapper {
    position: fixed;
    bottom: var(--app-edge-inset);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    z-index: 222;
    direction: rtl;
}

/* הבר הראשי */
.bottom-nav-bar {
    background: var(--white);
    height: 70px; /* מוגדל כדי להכיל תמיד טקסט ואייקון בנוחות */
    border-radius: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 0 5px; /* פדינג קטן רק בקצוות */
    display: flex;
    align-items: center;
}

.bottom-nav-bar ul {
    display: flex;
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}

.bottom-nav-bar ul li.list {
    position: relative;
    width: 70px; /* תא מדויק ורחב לכל כפתור */
    height: 70px;
    z-index: 2; /* מעל האינדיקטור */
}

/* =========================================
   עיצוב הכפתורים, האייקונים והטקסט בתפריט
========================================= */
.nav-main-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-main-link .icon {
    font-size: 1.25rem; /* הוגדל משמעותית כדי לבלוט מעל הטקסט */
    transition: transform 0.4s ease, color 0.4s ease;
    color: var(--text); /* צבע אחיד כחול/אפרפר */
    margin-bottom: 2px;
}

/* הבטחה שהאייקון של FontAwesome מקבל את הצבע שנגדיר לו */
.nav-main-link .icon i {
    color: inherit !important;
}

.nav-main-link .text {
    font-weight: 500; /* הטקסט עכשיו עדין ולא מודגש */
    font-size: 0.8rem;
    transition: color 0.4s ease;
    color: var(--text); /* תואם בדיוק לצבע האייקון */
}

/* =========================================
   מצבים פעילים (Active / Hover / Open)
========================================= */

/* כשהפריט נבחר - גם האייקון וגם הטקסט הופכים ללבן נקי ובוהק */
.list.active .nav-main-link .icon,
.list.active .nav-main-link .text {
    color: #ffffff !important;
}

/* מחווה של סיבוב האייקון כשתת-תפריט פתוח (180 מעלות) */
.list.show-submenu .nav-main-link .icon {
    transform: rotate(180deg);
    color: var(--main) !important; /* ירוק כשהוא רק פתוח */
}

/* אם הוא גם העמוד הפעיל (לבן) וגם נפתח - שומר על הלבן תוך כדי סיבוב */
.list.active.show-submenu .nav-main-link .icon {
    transform: rotate(180deg);
    color: #ffffff !important;
}

/* האינדיקטור - יושב נקי *בתוך* הבר */
.indicator {
    position: absolute;
    top: 5px; /* ממורכז אנכית בתוך ה-70px */
    right: 5px; /* מתחיל בדיוק באמצע התא הראשון (70 רוחב תא, 60 אינדיקטור -> 5px מכל צד) */
    width: 60px; 
    height: 60px;
    background: var(--main);
    border-radius: 50%;
    border: none; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 0;
}

/* המעטפת של כפתור הפלוס - קריטי למרכוז הפופאפ! */
.detached-plus-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* כפתור הפלוס */
.plus-btn-detached {
    width: 60px;
    height: 60px;
    background: var(--main);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(35, 114, 39, 0.2);
    cursor: pointer;
    transition: 0.4s ease;
}

.detached-plus-wrapper.open .plus-btn-detached {
    transform: rotate(45deg); /* הופך ל-X אלגנטי */
    background: var(--error); /* צבע אדום מסמן "סגירה" */
}

/* =========================================
   תתי תפריטים - רוחב אחיד ויישור מדויק
========================================= */
.submenu-popup-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    bottom: 85px; /* גובה אחיד לכולם כי אין יותר קפיצות */
}

.show-submenu .submenu-popup-container, .open .submenu-popup-container {
    opacity: 1;
    visibility: visible;
}

/* מנוע המרכוז שתיקנו קודם - נשאר זהה */
.submenu-popup-container.align-center { right: 50%; left: auto; transform: translateX(50%) translateY(15px); }
.show-submenu .submenu-popup-container.align-center, .open .submenu-popup-container.align-center { transform: translateX(50%) translateY(0); }
.submenu-popup-container.align-right { right: 0; left: auto; transform: translateX(0) translateY(15px); }
.show-submenu .submenu-popup-container.align-right, .open .submenu-popup-container.align-right { transform: translateX(0) translateY(0); }
.submenu-popup-container.align-left { left: 0; right: auto; transform: translateX(0) translateY(15px); }
.show-submenu .submenu-popup-container.align-left, .open .submenu-popup-container.align-left { transform: translateX(0) translateY(0); }

/* כפתורי התת-תפריט - רוחב אחיד! */
.submenu-action-btn {
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: flex-start; /* מצמיד את כל הטקסטים לימין (התחלה ב-RTL) */
    padding: 0 20px; 
    gap: 12px;
    width: 100%; /* מכריח את הכפתור למלא את כל רוחב הקונטיינר */
    min-width: 170px; /* רוחב אחיד מינימלי לכולם */
    height: 48px; 
    border-radius: 24px; 
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1.5px solid #eee;
    transition: 0.2s;
    white-space: nowrap; 
}

.submenu-action-btn i { font-size: 1.1rem; width: 20px; text-align: center; }

@media (hover: hover) {
    .submenu-action-btn:hover {
        transform: translateY(-2px);
        color: var(--main);
        border-color: var(--main);
        box-shadow: 0 10px 20px rgba(41, 182, 105, 0.15);
    }
}

.submenu-action-btn.active-page {
    background-color: var(--main-light) !important;
    border-color: var(--main) !important;
    color: var(--main) !important;
}

.submenu-action-btn.active-page i { color: var(--main) !important; }
.submenu-action-btn.expense-btn { color: var(--error); }
@media (hover: hover) {
    .submenu-action-btn.expense-btn:hover { border-color: var(--error); background: #fee2e2; }
}
.submenu-action-btn.income-btn { color: var(--main); }
@media (hover: hover) {
    .submenu-action-btn.income-btn:hover { background: #f0fdf4; border-color: var(--main); }
}

/* =========================================
   יישור אוטומטי חכם לתתי-תפריטים (Popup Alignment)
========================================= */
.submenu-popup-container.align-center { 
    right: 50%; 
    left: auto; 
    transform: translateX(50%) translateY(20px); 
}
.show-submenu .submenu-popup-container.align-center, 
.open .submenu-popup-container.align-center { 
    transform: translateX(50%) translateY(0); 
}

.submenu-popup-container.align-right { 
    right: 0; 
    left: auto; 
    transform: translateX(0) translateY(20px); 
}
.show-submenu .submenu-popup-container.align-right, 
.open .submenu-popup-container.align-right { 
    transform: translateX(0) translateY(0); 
}

.submenu-popup-container.align-left { 
    left: 0; 
    right: auto; 
    transform: translateX(0) translateY(20px); 
}
.show-submenu .submenu-popup-container.align-left, 
.open .submenu-popup-container.align-left { 
    transform: translateX(0) translateY(0); 
}

/* כפתור מחיקה - צבע אדום קבוע (כמו Hover) */
.submenu-action-btn.danger-solid-btn {
    color: var(--error) !important;
    border-color: var(--error) !important;
    background-color: #fee2e2 !important;
}

@media (hover: hover) {
    .submenu-action-btn.danger-solid-btn:hover {
        background-color: #fecaca !important;
    }
}

/* =========================================
   התאמת אפקטי Hover למסכי מגע (Mobile Active States)
========================================= */

/* מפעיל את האפקט של הלחצנים ברגע הלחיצה (Tap) */
.submenu-action-btn:active {
    transform: translateY(-2px); 
    color: var(--main);
    border-color: var(--main);
    box-shadow: 0 10px 20px rgba(41, 182, 105, 0.15);
    transition: 0.1s; /* מעבר מהיר יותר במובייל לתחושת תגובתיות */
}

/* התאמת הצבעים הייחודיים לכל כפתור בלחיצה */
.submenu-action-btn.expense-btn:active { 
    border-color: var(--error); 
    background: #fee2e2; 
    color: var(--error);
}

.submenu-action-btn.income-btn:active { 
    background: #f0fdf4; 
    border-color: var(--main); 
}

.submenu-action-btn.danger-solid-btn:active {
    background-color: #fecaca !important;
}

/* אפקט לחיצה (כיווץ קל) לכפתור הפלוס עצמו */
.plus-btn-detached:active {
    transform: scale(0.92);
    box-shadow: 0 4px 10px rgba(35, 114, 39, 0.1);
}

/* כדי שהפלוס יישאר בצורת X כשהוא פתוח ולוחצים עליו שוב */
.detached-plus-wrapper.open .plus-btn-detached:active {
    transform: scale(0.85) rotate(45deg);
}

/* אפקט לחיצה על פריטי הבר התחתון (מגע) */
.bottom-nav-bar ul li.list .nav-main-link:active .icon {
    transform: scale(0.9);
}
.bottom-nav-bar ul li.list:not(.active) .nav-main-link:active .icon,
.bottom-nav-bar ul li.list:not(.active) .nav-main-link:active .text {
    color: var(--main);
}