:root {
    --bg: #f4f6f5;
    --surface: #ffffff;
    --border: #e2e6e4;
    --text: #1c2622;
    --text-muted: #6b7570;
    --primary: #2f7a52;
    --primary-dark: #235f3f;
    --primary-soft: #e8f3ec;
    --danger: #c94b4b;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(20, 30, 25, 0.06), 0 1px 2px rgba(20, 30, 25, 0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    direction: rtl;
    font-family: -apple-system, "Segoe UI", "Heebo", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.topbar nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-inline-start: 18px;
    font-size: 0.92rem;
}

.topbar nav a:hover, .topbar nav a.active { color: var(--primary-dark); font-weight: 600; }

.container {
    max-width: 1080px;
    margin: 32px auto;
    padding: 0 20px;
}

/* נוסף 11.10.2026 לפי משוב מפורש: דפים עם טבלה רחבה (הרבה עמודות) - למשל דיווח נוכחות -
   לא אמורים להיות כלואים ברוחב 1080px הרגיל; מתפרש כל רוחב החלון הזמין. */
.container-wide {
    max-width: none;
}

/* נוסף 11.10.2026 לפי משוב מפורש: "הכותרות יהיו קשיחות שניתן לראות אותן גם כשגוללים" -
   thead נשאר דבוק למעלה בתוך אזור גלילה מוגבל-גובה (שעוטף את הטבלה), לא נעלם כשגוללים
   לשורות למטה. background מוצק הכרחי - בלעדיו שורות שגוללות מתחת ה-thead היו נראות "דרכו". */
.table-scroll {
    overflow: auto;
    max-height: 72vh;
}
/* תוקן 11.10.2026 לפי משוב מפורש ("הכיתוב בורח ממסגרת הלבנה"): table{width:100%} הגלובלי
   (למטה) כפה על הטבלה להידחס לרוחב הקונטיינר גם כש-table-layout:auto לא מצליח לכבד את זה
   (הרבה עמודות + inputs ברוחב קבוע שלא יכולים להצטמצם) - מה שגרם לתאים/טקסט לחרוג פיזית
   מעבר לגבול ה-card. max-content+min-width:100% נותן לטבלה את הרוחב הטבעי שהיא צריכה (לא
   פחות מ-100%, יכול להיות יותר) - table-scroll (overflow:auto) סופג את ההפרש בגלילה פנימית
   מוכלת, בלי לחרוג מחוץ ל-card. */
.table-scroll table {
    width: max-content;
    min-width: 100%;
}
.table-scroll table thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
/* נוסף 11.10.2026 לפי משוב מפורש: עדיין יש גלילה אופקית למרות ש"הבריחה" מה-card נפתרה - כי
   width:max-content נתן לכל עמודה את מלוא הרוחב הדרוש להציג את הכותרת שלה בשורה אחת (ללא
   שבירה). max-width על הכותרות מאלץ שבירת מילים ("מילה מעל מילה") - מצמצם את הרוחב הדרוש
   לעמודה במקום להרחיב אותה, כך שיותר עמודות נכנסות למסך בלי גלילה. גם padding/font מוקטנים
   (רק כאן - לא בטבלאות אחרות באתר) וקו מפריד דק בין כל שתי עמודות שכנות, לקריאות.
*/
.table-scroll th, .table-scroll td {
    padding: 5px 6px;
    font-size: 0.78rem;
    border-inline-start: 1px solid var(--border);
}
.table-scroll th:first-child, .table-scroll td:first-child {
    border-inline-start: none;
}
.table-scroll thead th {
    max-width: 78px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
    vertical-align: bottom;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 16px; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 20px; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.82rem; text-transform: none; }
tbody tr:hover { background: var(--primary-soft); }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-fixed { background: var(--primary-soft); color: var(--primary-dark); }
.badge-guest { background: #eef1f0; color: var(--text-muted); }
.badge-retired { background: #f7e8e8; color: var(--danger); }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    text-align: center;
}

.login-card h1 { margin-bottom: 24px; color: var(--primary-dark); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg);
    box-sizing: border-box;
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
/* מרווח ברירת מחדל לכל label של שדה טופס (לא מודבק לשדה הקודם) - תוויות צ'קבוקס עם style מפורש (font-weight:normal
   וכו') גוברות על זה כי inline style תמיד גובר על הכלל הזה */
label { display: block; font-weight: 600; margin-top: 10px; margin-bottom: 4px; }

button, .btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
button:hover, .btn:hover { background: var(--primary-dark); }

.error {
    background: #fdecec;
    color: var(--danger);
    border: 1px solid #f3c9c9;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.empty { color: var(--text-muted); text-align: center; padding: 30px; }

.nav-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    margin-inline-start: 4px;
    vertical-align: middle;
}
