/* ========================================
מצפן נט / بوصلة نت - Modern Design System 2026
Professional Educational Platform - ENHANCED EDITION
RTL Hebrew & Arabic | Modern Teal & Indigo Palette
======================================== */

/* Google Fonts - Cairo for Arabic headings, Noto Sans Arabic for Arabic body, Rubik for Hebrew */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Noto+Sans+Arabic:wght@300;400;500;600;700;800;900&family=Rubik:wght@300;400;500;600;700;800;900&display=swap');

/* ============ DESIGN TOKENS ============ */
:root {
    /* Primary Palette - Enhanced Teal Gradient */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --primary-bg: #f0fdfa;
    --primary-hover: #0d9488;
    --primary-gradient: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #7c3aed 100%);
    --primary-gradient-subtle: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    
    /* Secondary Palette - Deep Indigo */
    --secondary: #1e1b4b;
    --secondary-dark: #0f0a2e;
    --secondary-light: #312e81;
    
    /* Accent - Warm Orange */
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-bg: #fff7ed;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --success-light: #059669;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --warning-light: #d97706;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --danger-light: #dc2626;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    --info-light: #2563eb;
    
    /* Neutral Grays - Enhanced Modern Scale */
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-2xl: 24px;
    --border-radius-full: 9999px;
    
    /* Shadows - Enhanced Soft Shadows with Depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.14);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.18);
    --shadow-2xl: 0 25px 60px rgba(0, 0, 0, 0.22);
    --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.25);
    --shadow-glow-lg: 0 0 60px rgba(13, 148, 136, 0.35);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    
    /* Transitions - Smooth & Natural */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Typography */
    --font-family-hebrew: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-arabic: 'Noto Sans Arabic', 'Cairo', sans-serif;
    --font-family-headings: 'Cairo', 'Rubik', sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-hebrew);
    direction: rtl;
    text-align: right;
    color: var(--gray-700);
    background-color: var(--gray-50);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Apply Arabic font for Arabic content */
[lang="ar"], .arabic-text {
    font-family: var(--font-family-arabic);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--gray-800);
    font-weight: 700;
    line-height: 1.3;
    font-family: var(--font-family-headings);
}

/* Apply Arabic headings font for Arabic content */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6,
.arabic-text h1, .arabic-text h2, .arabic-text h3, .arabic-text h4, .arabic-text h5, .arabic-text h6 {
    font-family: 'Cairo', var(--font-family-headings);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============ CUSTOM SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

/* ============================================================
LOGIN PAGE - ENHANCED DESIGN
============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 35%, var(--primary) 65%, var(--primary-light) 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(13, 148, 136, 0.15) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatCircle 15s ease-in-out infinite;
    filter: blur(20px);
}

.login-wrapper::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, rgba(13, 148, 136, 0.25) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatCircle 18s ease-in-out infinite reverse;
    filter: blur(25px);
}

.login-wrapper .decorative-blob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: blobPulse 20s ease-in-out infinite;
    filter: blur(30px);
}

@keyframes blobPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(180deg); opacity: 0.8; }
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -20px) scale(1.05); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-2xl), 0 0 80px rgba(13, 148, 136, 0.15);
    padding: 56px 48px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: loginCardEnter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginCardEnter {
    from { opacity: 0; transform: translateY(40px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    width: 104px;
    height: 104px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    font-size: 52px;
    box-shadow: var(--shadow-glow-lg), 0 20px 40px -10px rgba(13, 148, 136, 0.6);
    position: relative;
    animation: logoPulse 3s ease-in-out infinite;
    transition: var(--transition-spring);
}

.login-logo::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: var(--primary-gradient);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    filter: blur(15px);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

@keyframes logoPulse {
    0%, 100% { box-shadow: var(--shadow-glow-lg), 0 20px 40px -10px rgba(13, 148, 136, 0.6); transform: scale(1); }
    50% { box-shadow: 0 25px 50px -8px rgba(13, 148, 136, 0.75), var(--shadow-glow-lg); transform: scale(1.05); }
}

.login-card h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--secondary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .subtitle {
    color: var(--gray-500);
    margin-bottom: 40px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

/* ============ FORM ELEMENTS - ENHANCED ============ */
.form-group {
    margin-bottom: 22px;
    text-align: right;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    letter-spacing: -0.1px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    font-size: 15px;
    font-family: var(--font-family-hebrew);
    direction: rtl;
    transition: var(--transition-spring);
    background: white;
    color: var(--gray-700);
    line-height: 1.5;
    box-shadow: var(--shadow-xs);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.15), var(--shadow-md);
    transform: translateY(-1px);
}

.form-input:hover:not(:focus) {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.form-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.form-input-sm {
    padding: 9px 14px;
    font-size: 13.5px;
    border-radius: var(--border-radius);
}

.form-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    font-size: 15px;
    font-family: var(--font-family-hebrew);
    direction: rtl;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat left 14px center;
    cursor: pointer;
    transition: var(--transition-spring);
    appearance: none;
    -webkit-appearance: none;
    padding-left: 36px;
    box-shadow: var(--shadow-xs);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.15), var(--shadow-md);
    transform: translateY(-1px);
}

.form-select:hover:not(:focus) {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.form-textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    font-size: 15px;
    font-family: var(--font-family-hebrew);
    direction: rtl;
    resize: vertical;
    min-height: 110px;
    transition: var(--transition-spring);
    line-height: 1.7;
    box-shadow: var(--shadow-xs);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.15), var(--shadow-md);
    transform: translateY(-1px);
}

.form-textarea:hover:not(:focus) {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

/* ============ BUTTONS - ENHANCED ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: var(--border-radius-lg);
    font-size: 15.5px;
    font-weight: 600;
    font-family: var(--font-family-hebrew);
    cursor: pointer;
    border: none;
    transition: var(--transition-spring);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: var(--transition);
}

.btn:hover:not(:disabled)::before {
    opacity: 1;
}

.btn:active:not(:disabled) {
    transform: scale(0.95);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4), var(--shadow-glow);
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    pointer-events: none;
    border-radius: inherit;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f766e 0%, #0891b2 50%, #7c3aed 100%);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.55), var(--shadow-glow-lg);
    transform: translateY(-3px);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-light) 0%, #047857 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.55);
    transform: translateY(-3px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--warning-light) 0%, #b45309 100%);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.55);
    transform: translateY(-3px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--danger-light) 0%, #b91c1c 100%);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.55);
    transform: translateY(-3px);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: none;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-800);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 4px;
}

/* ============================================================
APP LAYOUT
============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    max-width: 100vw;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: white;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px -4px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, var(--accent) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px -2px rgba(12, 167, 170, 0.4);
}

.sidebar-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 3px;
    font-weight: 400;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 14px 16px 8px;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--border-radius);
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(12, 167, 170, 0.4);
    font-weight: 600;
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-right: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
}

/* ============ SIDEBAR FOOTER ============ */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 2px 8px -2px rgba(12, 167, 170, 0.35);
}

.user-info {
    flex: 1;
    min-width: 0;
}

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

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

/* ============ MAIN CONTENT AREA ============ */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--gray-50);
    overflow-x: hidden;
    min-width: 0;
}

/* ============ APP HEADER - Enhanced Unified Design ============ */
.app-header {
    background: linear-gradient(135deg, var(--secondary, #1e1b4b) 0%, var(--primary-dark, #0f766e) 100%);
    height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    font-size: 20px;
    cursor: pointer;
    color: #ffffff;
    padding: 6px 10px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-actions .btn-outline {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.header-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ============ PAGE CONTENT ============ */
.page-content {
    flex: 1;
    padding: 20px;
    overflow-x: hidden;
    min-width: 0;
}

/* ============================================================
CARDS
============================================================ */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 23px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ============================================================
STATS GRID
============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.2);
}

.stat-icon.green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.2);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #ea580c;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.2);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #7c3aed;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

.stat-icon.red {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

.stat-icon.cyan {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    color: #0891b2;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.2);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
    letter-spacing: -1px;
    margin: 0;
}

.stat-info p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 6px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
DATA TABLE
============================================================ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-lg);
    background: white;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    max-width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f8f8;
    border-bottom: 2px solid #e5e5e5;
}

.data-table th {
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
STATUS BADGES
============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.1px;
    line-height: 1.5;
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: #b8860b;
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================================
TABS
============================================================ */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-right: none;
    border-left: none;
    font-family: var(--font-family);
}

.tab:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================================
MODAL (Unified for all pages)
============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 24, 32, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
    backdrop-filter: blur(4px);
}

/* תמיכה כפולה ב-active וב-is-open לכל הדפים */
.modal-overlay.active,
.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.92) translateY(20px);
    transition: var(--transition-slow);
}

.modal-overlay.active .modal,
.modal-overlay.is-open .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
    border-radius: 6px 6px 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--gray-500);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    background: var(--gray-50);
    border-radius: 0 0 6px 6px;
}

/* ============================================================
TOAST NOTIFICATIONS
============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 22px;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    min-width: 300px;
    max-width: 420px;
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 5px solid;
    color: var(--gray-700);
}

.toast.success {
    border-color: var(--success);
    background: linear-gradient(to left, var(--success-bg), white);
}

.toast.error {
    border-color: var(--danger);
    background: linear-gradient(to left, var(--danger-bg), white);
}

.toast.warning {
    border-color: var(--warning);
    background: linear-gradient(to left, var(--warning-bg), white);
}

.toast.info {
    border-color: var(--primary);
    background: linear-gradient(to left, var(--primary-bg), white);
}

@keyframes toastSlideIn {
    from { transform: translateX(-100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(-120%) scale(0.9); opacity: 0; }
}

/* ============================================================
TOGGLE SWITCH
============================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--gray-300);
    border-radius: 26px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    right: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(-22px);
}

/* ============================================================
SEARCH & FILTER TOOLBAR
============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 220px;
    padding: 11px 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-family);
    direction: rtl;
    transition: var(--transition);
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(12, 167, 170, 0.1);
}

.search-input:hover:not(:focus) {
    border-color: var(--gray-300);
}

.filter-select {
    padding: 11px 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-family);
    background: white;
    cursor: pointer;
    min-width: 160px;
    transition: var(--transition);
    direction: rtl;
    appearance: none;
    -webkit-appearance: none;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(12, 167, 170, 0.1);
}

/* ============================================================
EMPTY STATE
============================================================ */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--gray-500);
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
FORM GRID (multi-column form layout)
============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

/* ============================================================
INSTRUCTOR RECORDS
============================================================ */
.instructor-record {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 18px;
    margin-bottom: 14px;
    position: relative;
    transition: var(--transition);
}

.instructor-record:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.instructor-record-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.instructor-record h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.record-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.record-field label {
    font-size: 11px;
    color: var(--gray-500);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.record-field .value {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 600;
}

/* ============================================================
LOGIN CREDENTIALS
============================================================ */
.login-credentials {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--gray-200);
}

.login-credentials h4 {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 14px;
    font-weight: 600;
}

.credential-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    font-size: 13px;
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.credential-item:hover {
    background: var(--primary-bg);
    border-color: var(--primary-bg);
}

.credential-item .cred-label {
    font-weight: 600;
    color: var(--gray-700);
}

.credential-item .cred-value {
    color: var(--gray-500);
    direction: ltr;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    background: white;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
}

/* ============================================================
SIDEBAR OVERLAY (mobile)
============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 24, 32, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: var(--transition);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================================
SECTION PAGES (SPA routing)
============================================================ */
.section-page {
    display: none;
}

.section-page.active {
    display: block;
    animation: sectionFadeIn 0.3s ease;
}

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

/* ============================================================
CONFIRM DIALOG
============================================================ */
.confirm-content {
    text-align: center;
    padding: 20px 0;
}

.confirm-content .confirm-icon {
    font-size: 52px;
    margin-bottom: 16px;
}

.confirm-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.confirm-content p {
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================================
PROGRESS BAR
============================================================ */
.progress-bar {
    height: 10px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.blue {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.progress-fill.green {
    background: linear-gradient(90deg, var(--success), var(--success-light));
}

.progress-fill.orange {
    background: linear-gradient(90deg, var(--warning), var(--warning-light));
}

.progress-fill.red {
    background: linear-gradient(90deg, var(--danger), var(--danger-light));
}

/* ============================================================
RESPONSIVE DESIGN
============================================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }
    .main-content {
        margin-right: 0;
    }
    .mobile-menu-btn {
        display: block;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .stat-info h3 {
        font-size: 18px;
    }
    .stat-info p {
        font-size: 11px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .modal {
        max-width: 98%;
        max-height: 94vh;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 12px;
    }
    .search-input {
        min-width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
    .filter-select {
        width: 100%;
        padding: 10px 14px;
        min-width: 100%;
    }
    .page-content {
        padding: 12px;
    }
    .login-card {
        padding: 36px 28px;
    }
    .login-card h1 {
        font-size: 26px;
    }
    .app-header {
        padding: 0 12px;
        height: 56px;
    }
    .header-title {
        font-size: 16px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }
    .card-body {
        padding: 14px;
    }
    .card-title {
        font-size: 14px;
    }
    .toast-container {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    .toast {
        min-width: unset;
        max-width: 100%;
    }
    .data-table th,
    .data-table td {
        padding: 8px 8px;
        font-size: 12px;
    }
    .data-table th {
        font-size: 10px;
        letter-spacing: 0;
        text-transform: none;
    }
    .action-bar {
        gap: 4px !important;
        padding: 8px 10px !important;
    }
    .action-bar .btn {
        font-size: 11px;
        padding: 6px 10px;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
    }
    .stats-grid {
        margin-bottom: 16px;
    }
    .data-table {
        font-size: 12px;
    }
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    .card + .card {
        margin-top: 16px;
    }
    .card {
        max-width: 100%;
        overflow: hidden;
    }
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 4px;
        padding-bottom: 4px;
    }
    .tabs .tab {
        flex-shrink: 0;
        font-size: 12px;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 32px 22px;
    }
    .login-logo {
        width: 72px;
        height: 72px;
        font-size: 34px;
    }
    .header-actions .btn span {
        display: none;
    }
    .modal-header {
        padding: 18px 20px;
    }
    .modal-body {
        padding: 20px;
    }
    .modal-footer {
        padding: 14px 20px;
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
    }
}

/* ============================================================
PRINT STYLES
============================================================ */
@media print {
    .sidebar,
    .app-header,
    .toolbar,
    .btn,
    .mobile-menu-btn,
    .sidebar-overlay,
    .modal-overlay,
    .toast-container {
        display: none !important;
    }
    .main-content {
        margin-right: 0 !important;
    }
    .page-content {
        padding: 0 !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    .stat-card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    .data-table thead {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
    }
    .badge {
        border: 1px solid #ddd;
        -webkit-print-color-adjust: exact;
    }
    body {
        font-size: 12px;
        color: #000;
    }
    .table-wrapper tbody tr {
        display: table-row !important;
    }
    .pagination-controls {
        display: none !important;
    }
    .data-table th,
    .data-table td {
        display: table-cell !important;
    }
}

/* ============================================================
TABLE FEATURES (Column Visibility & Pagination)
============================================================ */
.pagination-controls {
    user-select: none;
}

.pagination-controls button:not(:disabled):hover {
    background: var(--primary-bg, #eef2ff);
}

@media (max-width: 640px) {
    .pagination-controls {
        gap: 4px !important;
        padding: 6px 8px !important;
    }
    .pagination-controls span {
        font-size: 11px !important;
    }
}

/* ============================================================
ACCESSIBILITY & UTILITY
============================================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::selection {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    .badge {
        border: 1px solid currentColor;
    }
    .nav-item.active {
        outline: 2px solid white;
    }
}

/* ============================================================
MULTI-SELECT AUTOCOMPLETE
============================================================ */
.ms-autocomplete {
    position: relative;
}

.ms-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: #fff;
    cursor: text;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ms-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 10px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    animation: ms-tag-in 0.15s ease-out;
}

@keyframes ms-tag-in {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.ms-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.ms-tag-remove:hover {
    background: var(--primary);
    color: #fff;
}

.ms-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    padding: 4px 0;
    background: transparent;
    color: var(--gray-800);
}

.ms-input::placeholder {
    color: var(--gray-400);
}

.ms-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.ms-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--gray-100);
}

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

.ms-item:hover,
.ms-item.ms-highlighted {
    background: var(--primary-bg);
}

.ms-item.ms-selected {
    opacity: 0.45;
    pointer-events: none;
    background: var(--gray-50);
}

.ms-item-name {
    font-weight: 600;
    color: var(--gray-800);
}

.ms-item-sub {
    font-size: 12px;
    color: var(--gray-400);
    direction: ltr;
}

.ms-empty {
    padding: 16px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}

.ms-placeholder {
    color: var(--gray-400);
    font-size: 14px;
    pointer-events: none;
    user-select: none;
}

@media (max-width: 768px) {
    .ms-item {
        padding: 12px 14px;
        font-size: 15px;
    }
    .ms-tag {
        font-size: 14px;
        padding: 4px 10px 4px 12px;
    }
    .ms-tag-remove {
        width: 22px;
        height: 22px;
        font-size: 16px;
    }
}

/* ============ HEALTH CHECK RESULTS ============ */
.health-check-results .hc-result-item {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.health-check-results .hc-result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

@media (max-width: 640px) {
    .health-check-results .hc-result-item {
        flex-direction: column;
        gap: 6px;
    }
}

/* ============ HEALTH CHECK – cPanel OWNERSHIP WARN ============ */
.hc-result-item[data-check-id="cpanel_owner"][data-status="fail"] {
    border-color: #f59e0b !important;
    background: #fffbeb !important;
}

.hc-result-item[data-check-id="cpanel_owner"][data-status="fail"]::after {
    content: "";
    display: block;
    clear: both;
}

.hc-cpanel-guidance {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    direction: rtl;
    text-align: right;
    font-size: 12px;
    color: #92400e;
    line-height: 1.7;
}

/* ============ INSTITUTION TAGS (Multi-Select Autocomplete) ============ */
.inst-autocomplete-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 44px;
    background: var(--white, #fff);
    border: 1.5px solid var(--gray-200, #e5e7eb);
    border-radius: var(--border-radius, 8px);
    padding: 4px 8px;
    cursor: text;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inst-autocomplete-wrapper:focus-within {
    border-color: var(--primary, #0ca7aa);
    box-shadow: 0 0 0 3px rgba(12, 167, 170, 0.1);
}

.inst-autocomplete-wrapper .form-input {
    border: none !important;
    box-shadow: none !important;
    padding: 6px 4px !important;
    flex: 1;
    min-width: 100px;
    background: transparent !important;
}

.inst-autocomplete-wrapper .form-input:focus {
    box-shadow: none !important;
    outline: none;
}

.institution-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-bg, #e9f6fb);
    color: var(--primary-dark, #09787a);
    padding: 5px 8px 5px 12px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100%;
    animation: tagAppear 0.2s ease;
} 

@keyframes tagAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.institution-tag .tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.institution-tag .tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary, #0ca7aa);
    border: none; 
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: opacity 0.2s;
    opacity: 0.75;
}

.institution-tag .tag-remove:hover {
    opacity: 1;
}

.inst-autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--border-radius, 8px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.inst-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.inst-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--gray-300, #d1d5db);
    border-radius: 3px;
}

.inst-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    font-size: 14px;
    transition: background 0.15s;
}

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

.inst-suggestion-item:hover,
.inst-suggestion-item.active {
    background: var(--gray-50, #f3f3f3);
}

.inst-suggestion-item .inst-sug-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inst-suggestion-item .inst-sug-code {
    font-weight: 600;
    direction: ltr;
    display: inline-block;
    font-size: 12px;
    color: var(--gray-500, #555555);
    background: var(--gray-100, #f2f2f2);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.inst-suggestion-item .inst-sug-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inst-suggestion-item .inst-sug-sub {
    font-size: 12px;
    color: var(--gray-400, #777777);
    margin-top: 2px;
    padding-right: 4px;
}

/* ============================================================
CUSTOM PAGES – יצירת דף חדש
============================================================ */
.cp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    background: linear-gradient(180deg, #fff 0%, var(--primary-bg, #e9f6fb) 100%);
    border-radius: var(--border-radius-lg, 12px);
    border: 2px dashed var(--gray-200, #e5e5e5);
    margin-top: 12px;
}

.cp-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.7;
    animation: cp-empty-float 3s ease-in-out infinite;
}

@keyframes cp-empty-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.cp-empty h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-700, #24343f);
    margin: 0 0 6px 0;
}

.cp-empty p {
    font-size: 15px;
    color: var(--gray-400, #777);
    margin: 0;
}

.cp-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
    line-height: 1.6;
    transition: transform 0.15s ease;
}

.cp-status-badge:hover {
    transform: scale(1.05);
}

.cp-status-published {
    background: var(--success-bg, #dff0d8);
    color: var(--success, #5cb85c);
}

.cp-status-draft {
    background: var(--gray-100, #f2f2f2);
    color: var(--gray-500, #555);
}

.cp-table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cp-table-actions .btn {
    min-width: 44px;
    min-height: 34px;
}

.cp-editor-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cp-field-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}

.cp-field-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cp-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600, #4c6373);
    margin-bottom: 6px;
    line-height: 1.4;
}

.cp-field-group input[type="text"],
.cp-field-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200, #e5e5e5);
    border-radius: var(--border-radius, 8px);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-700, #24343f);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    direction: rtl;
    line-height: 1.5;
    box-sizing: border-box;
}

.cp-field-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
    cursor: pointer;
}

.cp-field-group input[type="text"]:focus,
.cp-field-group select:focus {
    outline: none;
    border-color: var(--primary, #0ca7aa);
    box-shadow: 0 0 0 3px rgba(12, 167, 170, 0.12);
}

.cp-field-group input[type="text"]:hover:not(:focus),
.cp-field-group select:hover:not(:focus) {
    border-color: var(--gray-300, #999);
}

.cp-field-group input[type="text"]::placeholder {
    color: var(--gray-400, #999);
    font-weight: 400;
}

.cp-field-group input[type="text"][disabled] {
    background: var(--gray-50, #f3f3f3);
    cursor: not-allowed;
}

.cp-field-group:only-of-type > label,
.cp-editor-wrap > .cp-field-group > label:only-child {
    margin-bottom: 0;
    font-size: 14px;
}

.cp-editor-container {
    border: 2px solid var(--gray-200, #e5e5e5);
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 12px;
}

.cp-editor-container:focus-within {
    border-color: var(--primary, #0ca7aa);
    box-shadow: 0 0 0 3px rgba(12, 167, 170, 0.12);
}

.cp-editor-container .tox-tinymce {
    border: none !important;
    border-radius: 0 !important;
}

.cp-editor-container textarea {
    width: 100%;
    min-height: 400px;
    border: none;
    padding: 16px;
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    direction: rtl;
    color: var(--gray-700);
    resize: vertical;
    box-sizing: border-box;
}

.cp-editor-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

@media (max-width: 768px) {
    .cp-field-row {
        flex-direction: column;
        gap: 14px;
    }
    .cp-table-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cp-table-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .cp-empty {
        padding: 40px 16px;
    }
    .cp-empty-icon {
        font-size: 44px;
    }
}

@media (max-width: 480px) {
    .cp-editor-container textarea {
        min-height: 280px;
        padding: 12px;
        font-size: 14px;
    }
}

/* ============================================================
UNIFIED PAGE HEADER (כותרת עליונה מאוחדת לדפי FAQ, צוות, דפים מותאמים וכו')
============================================================ */
.unified-page-header,
.faq-header, 
.team-header, 
.custom-page-header,
.catalog-header {
    background: linear-gradient(135deg, var(--primary, #0ca7aa) 0%, var(--primary-dark, #09787a) 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

.unified-header-inner,
.faq-header-inner, 
.team-header-inner, 
.custom-page-header .header-inner,
.catalog-header .faq-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.unified-page-title,
.page-main-title {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.unified-back-btn,
.btn-back {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.unified-back-btn:hover,
.btn-back:hover {
    background: rgba(255,255,255,.3);
    transform: translateX(-3px);
}

@media (max-width: 768px) {
    .unified-header-inner,
    .faq-header-inner, 
    .team-header-inner, 
    .custom-page-header .header-inner, 
    .catalog-header .faq-header-inner {
        flex-wrap: wrap;
        padding: 16px 18px;
    }
    .unified-page-title, 
    .page-main-title {
        font-size: 22px;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }
    .unified-back-btn, 
    .btn-back {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
FAQ PAGE SPECIFIC STYLES
============================================================ */
.search-section {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 24px 0;
}
.search-wrapper {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}
.search-wrapper .search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    pointer-events: none;
    color: #a0aec0;
    transition: color .2s;
}
.search-wrapper input {
    width: 100%;
    padding: 16px 50px 16px 48px;
    border-radius: 16px;
    border: 2px solid #e5e5e5;
    background: #fff;
    color: #1a1a1a;
    font-size: 16px;
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
    transition: all .25s;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.search-wrapper input::placeholder { color: #a0aec0; }
.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary, #0ca7aa);
    box-shadow: 0 4px 20px rgba(12,167,170,.12);
}
.search-wrapper input:focus ~ .search-icon { color: var(--primary, #0ca7aa); }
.search-clear {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #cbd5e0;
    padding: 4px;
    line-height: 1;
    display: none;
    transition: color .2s;
}
.search-clear:hover { color: #e53e3e; }
.search-clear.visible { display: block; }
.search-results-count {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    min-height: 22px;
}
.faq-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}
.faq-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
    border: 1px solid #edf2f7;
    margin-bottom: 16px;
    transition: all .25s ease;
}
.faq-item:hover {
    box-shadow: 0 6px 24px rgba(12,167,170,.12);
    transform: translateY(-1px);
}
.faq-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.faq-item-header:hover { background: rgba(12,167,170,.04); }
.faq-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ca7aa, #09787a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.faq-item-title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.5;
}
.faq-item-arrow {
    font-size: 18px;
    color: #a0aec0;
    transition: transform .3s ease;
    flex-shrink: 0;
}
.faq-item.open .faq-item-arrow { transform: rotate(180deg); }
.faq-item-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}
.faq-item.open .faq-item-body { max-height: 2000px; }
.faq-item-answer {
    padding: 0 22px 20px 76px;
    font-size: 15px;
    line-height: 1.8;
    color: #555555;
    direction: rtl;
}
.faq-item-answer img { max-width: 100%; border-radius: 8px; }
.faq-item-answer a { color: var(--primary, #0ca7aa); text-decoration: underline; }
.faq-item-answer ul, .faq-item-answer ol { padding-right: 20px; margin: 8px 0; }
.faq-item-answer li { margin-bottom: 4px; }
.faq-empty {
    text-align: center;
    padding: 80px 20px;
}
.faq-empty-icon { font-size: 64px; margin-bottom: 16px; }
.faq-empty-text { font-size: 20px; color: #a0aec0; font-weight: 700; }
.faq-empty-sub { font-size: 14px; color: #cbd5e0; margin-top: 8px; }
.faq-footer {
    text-align: center;
    padding: 18px;
    color: #a0aec0;
    font-size: 12px;
    border-top: 1px solid #edf2f7;
    background: rgba(255,255,255,.7);
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .search-section { padding: 16px 16px 0; }
    .search-wrapper { max-width: 100%; }
    .search-wrapper input { padding: 14px 44px 14px 42px; font-size: 15px; }
    .faq-content { padding: 16px; }
    .faq-item-header { padding: 14px 16px; }
    .faq-item-answer { padding: 0 16px 16px 58px; font-size: 14px; }
    .faq-item-icon { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
    .faq-item-title { font-size: 15px; }
}
@media (max-width: 480px) {
    .faq-item-answer { padding: 0 14px 14px 14px; }
}

/* ============================================================
CATALOG PAGE SPECIFIC STYLES
============================================================ */
.catalog-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 30px 20px; 
    flex: 1; 
    width: 100%; 
    box-sizing: border-box; 
}
.solutions-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 24px; 
}

.solution-card { 
    background: white; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    border: 1px solid var(--gray-100, #f2f2f2); 
    transition: transform 0.2s, box-shadow 0.2s; 
    display: flex; 
    flex-direction: column; 
}
.solution-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 24px rgba(0,0,0,0.1); 
}
.card-top { 
    padding: 20px; 
    color: white; 
    position: relative; 
}
.card-top h3 { 
    margin: 0 0 8px 0; 
    font-size: 18px; 
    font-weight: 800; 
    line-height: 1.4; 
}
.domain-badge { 
    display: inline-block; 
    background: rgba(255,255,255,0.25); 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 700; 
    backdrop-filter: blur(4px); 
}
.card-body { 
    padding: 20px; 
    flex-grow: 1; 
    font-size: 14px; 
    color: var(--gray-700, #333); 
}
.card-body p { 
    margin: 8px 0; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.card-body .desc { 
    margin-top: 12px; 
    padding-top: 12px; 
    border-top: 1px dashed var(--gray-200, #e5e5e5); 
    font-size: 13px; 
    color: var(--gray-600, #555); 
    line-height: 1.6; 
    white-space: pre-line; 
}
.card-footer { 
    padding: 16px 20px; 
    background: var(--gray-50, #f9f9f9); 
    border-top: 1px solid var(--gray-100, #f2f2f2); 
    display: flex; 
    gap: 10px; 
}
.card-footer .btn { 
    flex: 1; 
    text-align: center; 
    justify-content: center; 
    font-size: 14px; 
    font-weight: 700; 
    padding: 10px; 
    border-radius: 8px; 
    cursor: pointer; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    border: none; 
}
.btn-info { 
    background: white; 
    border: 1px solid var(--gray-300, #ccc); 
    color: var(--gray-700, #333); 
}
.btn-info:hover { 
    background: var(--gray-100, #f2f2f2); 
}
.btn-register { 
    background: var(--primary, #0ca7aa); 
    color: white; 
}
.btn-register:hover { 
    background: var(--primary-dark, #09787a); 
}

.empty-state, .loading { 
    text-align: center; 
    padding: 60px 20px; 
    color: var(--gray-500, #777); 
    grid-column: 1 / -1; 
    font-size: 18px; 
}

@media (max-width: 768px) {
    .catalog-container { padding: 20px 16px; }
    .solutions-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================
TEAM PAGE SPECIFIC STYLES
============================================================ */
.team-hero {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 8px;
    text-align: center;
}
.team-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-700, #24343f);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}
.team-hero-sub {
    font-size: 15px;
    color: var(--gray-400, #777777);
    font-weight: 500;
}
.team-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 40px;
}
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.guide-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
    border: 1px solid var(--gray-100, #f2f2f2);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}
.guide-card:hover {
    box-shadow: 0 12px 32px rgba(12,167,170,.18);
    transform: translateY(-4px);
    border-color: rgba(12,167,170,.2);
}
.guide-card:focus-within {
    box-shadow: 0 12px 32px rgba(12,167,170,.18);
}
.card-header {
    height: 130px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #0ca7aa) 0%, var(--primary-dark, #09787a) 100%);
    overflow: visible;
}
.card-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.18) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(255,255,255,.12) 0%, transparent 50%);
    pointer-events: none;
}
.card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
    background: #fff;
    position: relative;
    z-index: 2;
    margin-bottom: -50px;
    flex-shrink: 0;
}
.card-avatar-fallback {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: linear-gradient(135deg, #0e8a8d 0%, #0a5c5e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
    margin-bottom: -50px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.card-avatar-fallback span {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.card-body {
    padding: 58px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}
.card-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-700, #24343f);
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
}
.card-name-ar {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-500, #555555);
    line-height: 1.4;
    margin: 0;
    direction: rtl;
    word-break: break-word;
}
.card-position {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-400, #777777);
    line-height: 1.5;
    word-break: break-word;
    min-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-details-btn {
    margin-top: 14px;
    background: var(--primary-bg, #e9f6fb);
    color: var(--primary-dark, #09787a);
    border: 1.5px solid rgba(12,167,170,.2);
    padding: 8px 22px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.card-details-btn:hover,
.guide-card:hover .card-details-btn {
    background: var(--primary, #0ca7aa);
    color: #fff;
    border-color: var(--primary, #0ca7aa);
    box-shadow: 0 4px 12px rgba(12,167,170,.3);
}
.card-details-btn .btn-arrow {
    font-size: 14px;
    transition: transform .2s;
}
.guide-card:hover .card-details-btn .btn-arrow {
    transform: translateX(-3px);
}
.team-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}
.team-empty-icon { font-size: 64px; margin-bottom: 16px; opacity: .7; }
.team-empty-text { font-size: 20px; color: var(--gray-400, #999999); font-weight: 700; }
.team-empty-sub { font-size: 14px; color: var(--gray-300, #b1b1b1); margin-top: 8px; }
.card-skeleton .card-header { background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.card-skeleton .card-avatar-fallback { background: #e0e0e0; }
.card-skeleton .card-avatar-fallback span { visibility: hidden; }
.card-skeleton .sk-line {
    height: 14px; background: #eee; border-radius: 6px; margin: 4px auto;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.card-skeleton .sk-1 { width: 60%; }
.card-skeleton .sk-2 { width: 40%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.team-footer {
    text-align: center;
    padding: 18px;
    color: var(--gray-300, #999999);
    font-size: 12px;
    border-top: 1px solid var(--gray-100, #f2f2f2);
    background: rgba(255,255,255,.7);
    flex-shrink: 0;
}

/* Modal specific to team page */
.modal-card {
    background: #fff;
    border-radius: 22px;
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    transform: scale(.92) translateY(16px);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    position: relative;
}

/* תמיכה כפולה ב-active וב-is-open */
.modal-overlay.active .modal-card,
.modal-overlay.is-open .modal-card {
    transform: scale(1) translateY(0);
}

.modal-content {
    display: flex;
    flex-direction: row;
    min-height: 340px;
}
.modal-image-side {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary, #0ca7aa) 0%, var(--primary-dark, #09787a) 100%);
}
.modal-image-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.18) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(255,255,255,.12) 0%, transparent 50%);
    pointer-events: none;
}
.modal-photo {
    width: 220px;
    height: 280px;
    border-radius: 18px;
    border: none;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    background: #fff;
    position: relative;
    z-index: 2;
}
.modal-photo-fallback {
    width: 220px;
    height: 280px;
    border-radius: 18px;
    border: none;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    position: relative;
    z-index: 2;
}
.modal-photo-fallback span {
    font-size: 64px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.modal-details-side {
    flex: 1;
    padding: 32px 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}
.modal-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-700, #24343f);
    line-height: 1.35;
    margin: 0 0 2px;
    word-break: break-word;
}
.modal-name-ar {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-500, #555555);
    line-height: 1.5;
    margin: 0 0 12px;
    direction: rtl;
    word-break: break-word;
}
.modal-position-badge {
    display: inline-block;
    background: var(--primary-bg, #e9f6fb);
    color: var(--primary-dark, #09787a);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 18px;
    line-height: 1.5;
    max-width: 100%;
    word-break: break-word;
    align-self: flex-start;
}
.modal-detail-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}
.modal-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--gray-50, #f7f7f7);
    border-radius: 12px;
    transition: background .2s;
}
.modal-detail-row:hover {
    background: var(--gray-100, #f0f0f0);
}
.modal-detail-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.4;
}
.modal-detail-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.modal-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400, #999999);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.modal-detail-value {
    font-size: 14px;
    color: var(--gray-700, #24343f);
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
    direction: ltr;
    unicode-bidi: embed;
    text-align: right;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}
.modal-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .2s;
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
    border: none;
    cursor: pointer;
}
.modal-btn .btn-icon { font-size: 17px; }
.modal-btn .btn-value {
    direction: ltr;
    unicode-bidi: embed;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}
.modal-btn--email .btn-value { font-size: 12.5px; }
.modal-btn--whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
}
.modal-btn--whatsapp:hover {
    box-shadow: 0 6px 18px rgba(37,211,102,.4);
    transform: translateY(-2px);
    color: #fff;
}
.modal-btn--full {
    min-width: 0;
    flex: 1 1 100%;
}
.modal-btn--email {
    background: var(--primary-bg, #e9f6fb);
    color: var(--primary-dark, #09787a);
    border: 1.5px solid rgba(12,167,170,.2);
}
.modal-btn--email:hover {
    background: var(--primary, #0ca7aa);
    color: #fff;
    border-color: var(--primary, #0ca7aa);
    transform: translateY(-2px);
}

/* Responsive for team page */
@media (max-width: 768px) {
    .team-hero { padding: 24px 16px 4px; }
    .team-hero-title { font-size: 24px; }
    .team-grid { grid-template-columns: 1fr; gap: 18px; }
    .modal-card { max-width: 100%; border-radius: 18px; }
    .modal-content { flex-direction: column; min-height: auto; }
    .modal-image-side { width: 100%; min-height: 200px; }
    .modal-photo, .modal-photo-fallback { width: 180px; height: 220px; border-radius: 14px; }
    .modal-photo-fallback span { font-size: 48px; }
    .modal-details-side { padding: 24px 20px 20px; }
    .modal-actions { flex-direction: column; }
    .modal-btn { min-width: 0; }
}
@media (max-width: 480px) {
    .team-hero-title { font-size: 21px; }
    .card-name, .card-name-ar { font-size: 16px; }
}

/* ============ APP FOOTER (Dashboard) ============ */
.app-footer {
    text-align: center;
    padding: 16px;
    color: var(--gray-500);
    font-size: 13px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    margin-top: auto;
}