/* ── SHC Credit Footer ── */
.shc-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 0 8px;
    margin-top: 20px;
}

.login-screen {
    position: relative;
}

/* ═══ Entity Picker & Super-Admin Landing ════════════════════════════ */

.ep-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(140deg, #dfe6ef 0%, #edf2f8 50%, #d6e0ec 100%);
    padding: 20px 20px 60px;
    position: relative;
    flex-direction: column;
}

.ep-container {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    border: 1px solid #dbe6ff;
    box-shadow: 0 24px 64px rgba(47,79,127,0.16);
    padding: 40px 36px 28px;
    width: 100%;
    max-width: 480px;
}

.sa-landing-container {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    border: 1px solid #dbe6ff;
    box-shadow: 0 24px 64px rgba(47,79,127,0.16);
    padding: 40px 36px 28px;
    width: 100%;
    max-width: 580px;
}

.ep-header {
    text-align: center;
    margin-bottom: 24px;
}

.ep-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f4f7f, #4a6fa5);
    color: white;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 6px 20px rgba(47,79,127,0.28);
}

.sa-avatar-gold {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    box-shadow: 0 6px 20px rgba(217,119,6,0.3) !important;
}

.sa-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 99px;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ep-greeting {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.ep-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ── Entity list (shared by picker & SA landing) ── */
.ep-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(48vh, 344px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-bottom: 14px;
    padding-inline: 2px;
}

/* שתי עמודות במסך הסופר אדמין. הרוחב הפנוי בקונטיינר הוא 508px, ולכן
   minmax גדול מ-250px היה מקריס את הגריד לעמודה אחת בלי שאיש ישים לב. */
.sa-entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
    max-height: min(42vh, 300px);
}

/* ── Entity card ── */
.entity-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #e8edf5;
    background: #fff;
    cursor: pointer;
    text-align: right;
    width: 100%;
    transition: var(--card-accent-transition);
}

.entity-card:hover {
    border-color: var(--card-accent-soft);
}

.entity-card:focus-visible {
    outline: none;
    border-color: var(--card-accent);
    box-shadow: var(--card-accent-hover);
}

/* סדר הפריטים בכרטיס: [אווטאר][שם][חץ]. ב-RTL האווטאר יוצא בימין,
   בדיוק כמו בכרטיס הניהול הכללי. */
.entity-card-body {
    flex: 1;
    min-width: 0;
}

.entity-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.entity-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}

.entity-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* החץ שקוף כמעט לגמרי במנוחה — הוא נועד לומר "אפשר להיכנס", לא למשוך עין. */
.entity-card-chevron {
    display: flex;
    align-items: center;
    color: #94a3b8;
    opacity: 0.45;
    flex-shrink: 0;
    transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.entity-card:hover .entity-card-chevron,
.entity-card:focus-visible .entity-card-chevron {
    opacity: 1;
    color: var(--card-accent);
    transform: translateX(-3px);
}

/* וריאנט הגריד: אותה שורה, בקנה מידה קטן יותר. הגרסה הקודמת סידרה
   את התוכן בעמודה עם min-height קבוע, וייצרה כרטיס גבוה שרובו ריק. */
.sa-entity-grid .entity-card {
    gap: 10px;
    padding: 11px 12px;
}

.sa-entity-grid .entity-card-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
    border-radius: 9px;
}

.sa-entity-grid .entity-card-name {
    font-size: 13.5px;
    margin-bottom: 0;
}

.sa-entity-grid .entity-card-badge {
    margin-top: 4px;
}

/* ── Super-admin global mode card ── */
.sa-global-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 2px solid #2f4f7f;
    background: linear-gradient(135deg, #f5f8ff, #eef2ff);
    cursor: pointer;
    text-align: right;
    width: 100%;
    margin-bottom: 4px;
    transition: var(--card-accent-transition);
}

.sa-global-card:hover,
.sa-global-card:focus-visible {
    outline: none;
    border-color: var(--card-accent);
}

.sa-global-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f4f7f, #4a6fa5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.sa-global-card-body { flex: 1; text-align: right; }

.sa-global-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.sa-global-card-desc {
    font-size: 12px;
    color: #64748b;
}

.sa-global-card-arrow {
    color: #5a6779;
    transition: transform 0.16s, color 0.16s;
}

.sa-global-card:hover .sa-global-card-arrow {
    transform: translateX(-3px);
    color: #2f4f7f;
}

.sa-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
    color: #5a6779;
    font-size: 12px;
    font-weight: 500;
}

.sa-divider::before,
.sa-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Sign-out button for picker/landing ── */
.ep-signout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px;
    border: none;
    background: none;
    color: #5a6779;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.14s, background 0.14s;
    margin-top: 4px;
}

.ep-signout-btn:hover,
.ep-signout-btn:focus-visible {
    color: #dc2626;
    background: #fef2f2;
    outline: none;
}

.ep-signout-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
}

/* ── מסך צר: הקופסה נושמת, ולא נדחסת מרווחים של דסקטופ ── */
@media (max-width: 640px) {
    .ep-screen {
        padding: 14px 12px 64px;
        align-items: flex-start;
    }

    .ep-container,
    .sa-landing-container {
        padding: 26px 16px 18px;
        border-radius: 16px;
    }

    .ep-user-avatar {
        width: 52px;
        height: 52px;
        font-size: 21px;
        margin-bottom: 12px;
    }

    .ep-greeting { font-size: 18px; }

    .ep-list,
    .sa-entity-grid { max-height: min(52vh, 320px); }

    .sa-global-card { padding: 15px 16px; gap: 12px; }

    .sa-global-card-icon {
        width: 44px;
        height: 44px;
        border-radius: 11px;
    }
}

/* ═══ Sidebar Entity Chip ════════════════════════════════════════════ */
.sidebar-entity-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}

.sidebar-entity-chip:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.25);
}

.sec-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sec-body {
    flex: 1;
    min-width: 0;
}

.sec-label {
    display: block;
    font-size: 9.5px;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 1px;
}

.sec-name {
    display: block;
    font-size: 12.5px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sec-switch-icon {
    color: rgba(255,255,255,0.38);
    flex-shrink: 0;
    transition: color 0.15s;
}

.sidebar-entity-chip:hover .sec-switch-icon {
    color: rgba(255,255,255,0.75);
}

.login-shc-footer {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shc-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 100px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #5a6779;
    transition: color 0.2s, transform 0.2s;
    direction: ltr;
}

.shc-footer-btn:hover {
    color: #64748b;
    transform: translateY(-1px);
}

.shc-footer-logo {
    height: 24px;
    width: 24px;
    object-fit: contain;
    opacity: 0.6;
    filter: drop-shadow(0 2px 6px rgba(47, 79, 127, 0.2));
    transition: transform 0.3s, opacity 0.2s;
}

.shc-footer-btn:hover .shc-footer-logo {
    transform: scale(1.12);
    opacity: 0.9;
}

/* ── SHC Modal ── */
.shc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(14px);
    padding: 20px;
}

.shc-modal-overlay.active {
    display: flex;
}

.shc-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(28px);
}

.shc-modal-close {
    position: absolute;
    left: 16px;
    top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 1;
}

.shc-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.shc-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.2), transparent 60%);
    padding: 28px 28px 20px;
    text-align: center;
}

.shc-modal-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px rgba(30, 41, 59, 0.25);
    outline: 1px solid rgba(255, 255, 255, 0.15);
    margin: 0 auto 16px;
}

.shc-modal-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(59, 130, 246, 0.22));
    transform: scale(1.3);
}

.shc-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
    margin: 0;
}

.shc-modal-tagline {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #5a6779;
}

.shc-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 28px;
    text-align: center;
}

.shc-email-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    padding: 14px 18px;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 0.3px;
    color: #fff;
    margin-bottom: 16px;
}

.shc-email-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.shc-email-copy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.shc-email-copy-btn svg,
.shc-btn-send svg,
.shc-btn-copy svg {
    width: 16px;
    height: 16px;
}

.shc-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 340px;
}

.shc-btn-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.25);
    transition: transform 0.2s, filter 0.2s;
}

.shc-btn-send:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.shc-btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.shc-btn-copy:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

/* ── SHC Toast ── */
.shc-toast {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.96);
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(16px);
    white-space: nowrap;
}

.shc-toast.active {
    display: flex;
    animation: shcFadeUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.shc-toast svg {
    width: 15px;
    height: 15px;
}

@keyframes shcFadeUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

