﻿/* =====================================================
   ROOT / THEME
   ===================================================== */

:root {
    --brand: #0d6efd;
    --brand-600: #0b5ed7;
    --brand-700: #0a58ca;
    --app-bg: #f6f7fb;
    --card-bg: #ffffff;
    --border: rgba(0,0,0,.08);
    --text: #1f2937;
    --muted: #6b7280;
    --font: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --yam-topbar-h: 56px;
    --yam-footer-h: 60px;
}

/* =====================================================
   BASE
   ===================================================== */

html, body {
    height: 100%;
    margin: 0;
    direction: rtl;
    overflow: hidden;
    font-family: var(--font);
    background: var(--app-bg);
    color: var(--text);
}

a {
    color: var(--brand);
}

    a:hover {
        color: var(--brand-700);
    }

/* =====================================================
   FOOTER
   ===================================================== */

footer,
.footer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--yam-footer-h);
    z-index: 1040;
    background: #fff;
    border-top: 1px solid var(--border);
}

/* =====================================================
   APP SHELL
   ===================================================== */

.yam-shell {
    display: flex;
    height: calc(100vh - var(--yam-topbar-h) - var(--yam-footer-h));
    overflow: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */

.yam-sidebar {
    flex: 0 0 280px;
    background: #fff;
    border-left: 1px solid var(--border);
}

.yam-sidebar-inner {
    height: 100%;
    padding: 16px;
    overflow-y: auto;
}

.yam-sidebar-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
}

.yam-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #222;
}

    .yam-nav-link:hover {
        background: rgba(13,110,253,.08);
    }

    .yam-nav-link.active {
        background: rgba(13,110,253,.15);
        font-weight: 700;
    }

/* Sidebar collapse */

@media (min-width: 992px) {
    body.sidebar-collapsed .yam-sidebar {
        width: 72px;
        flex-basis: 72px;
    }

    body.sidebar-collapsed .yam-nav-text,
    body.sidebar-collapsed .yam-sidebar-user-text,
    body.sidebar-collapsed .yam-brand-full {
        display: none !important;
    }

    body.sidebar-collapsed .yam-brand-mini {
        display: inline-flex !important;
    }
}

/* =====================================================
   MAIN AREA (ONLY SCROLL)
   ===================================================== */

.yam-main {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */

.yam-page-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.yam-page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.yam-page-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

/* ===== Page title with icon ===== */
.yam-page-title-withicon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.yam-page-title-icon {
    font-size: 1.1em;
    opacity: .9;
}


/* =====================================================
   CARDS / TABLES
   ===================================================== */

.card,
.yam-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.yam-main .yam-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.yam-main .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.yam-main table {
    margin-bottom: 0;
}

/* =====================================================
   UTILITIES
   ===================================================== */

.container,
.container-fluid {
    max-width: 100%;
    padding-bottom: 0 !important;
}

* {
    max-width: 100%;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--brand-600);
        border-color: var(--brand-600);
    }

/* =====================================================
   LOGIN / ACCOUNT (UNCHANGED BEHAVIOR)
   ===================================================== */

.account-body {
    background: var(--app-bg);
}

.account-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
}
/* =====================================================
   FINAL SCROLL MODEL – TABLE BODY ONLY
   ===================================================== */

/* 1. אין גלילה ב-main */
.yam-main {
    overflow: hidden !important;
}

/* 2. כותרת עמוד קבועה */
.yam-page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
}

/* 3. card תופס את כל הגובה שנותר */
.yam-main .yam-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 4. אזור הטבלה – זה אזור הגלילה היחיד */
.yam-main .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 5. קיבוע כותרות הטבלה */
.yam-main thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
}

/* 6. תחתית הטבלה (pagination / summary) */
.yam-table-footer,
.table-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.08);
}

/* 7. ביטול גלילה כללית נוספת */
html, body {
    overflow: hidden;
}
/* =====================================================
   FIX: ENABLE TABLE BODY SCROLL
   ===================================================== */

/* 1. Main לא גולל */
.yam-main {
    overflow: hidden !important;
}

    /* 2. Card הוא Flex Container */
    .yam-main .yam-card {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0; /* קריטי */
    }

        /* 3. Header של ה-card (אם קיים) */
        .yam-main .yam-card > .card-header {
            flex: 0 0 auto;
        }

    /* 4. אזור הטבלה – זה אזור הגלילה */
    .yam-main .table-responsive {
        flex: 1 1 auto;
        min-height: 0; /* קריטי */
        overflow-y: auto; /* עכשיו הגלילה עובדת */
        overflow-x: hidden;
    }

/* 5. Footer של הטבלה (Pagination / Summary) */
.yam-table-footer,
.table-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 5;
    border-top: 1px solid rgba(0,0,0,.08);
}

/* 6. Sticky table header */
.yam-main thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f8fafc;
}
:root {
    --yam-footer-h: 44px; /* תשנה אם צריך (40–56) */
}

/* אם יש לך footer גלובלי */
footer,
.yam-footer,
.app-footer {
    height: var(--yam-footer-h);
    line-height: var(--yam-footer-h);
}

/* חשוב: שלא יכנסו תכנים מתחת לפוטר */
body {
    padding-bottom: var(--yam-footer-h);
}
/* ===== User avatar (letter) – restore & fix ===== */
.yam-user-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.yam-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    /* צבע לפי Hue דינמי */
    background: hsl(var(--av-h, 210) 70% 45%);
    /* הגנה מ־overrides */
    visibility: visible !important;
    opacity: 1 !important;
}

/* מונע מחיצה ע"י כללים כלליים */
.navbar .dropdown-toggle,
.yam-topbar .dropdown-toggle {
    line-height: normal;
    overflow: visible;
}

/* אם היה כלל שמסתיר span/avatar */
.yam-avatar,
.yam-user-btn .yam-avatar {
    display: inline-flex !important;
}

