/* ========================================
   מצפן נט / بوصلة نت - 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;
}

/* Decorative background pattern - Enhanced floating circles with gradient */
.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);
}

/* Additional decorative element */
.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;
}

/* Small input variant (used inside instructor records) */
.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 ============ */
.app-header {
    background: white;
    height: var(--header-height);
    border-bottom: 1px solid var(--gray-200);
    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.06);
}

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

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
    padding: 6px 10px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

/* ============ 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
   ============================================================ */
/* ===== DASHBOARD STATS CARDS - Akademi Style 1:1 ===== */
.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;
}

/* Colored stat icon backgrounds - Akademi style with rounded circles */
.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
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 24, 32, 0.55);
    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);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.modal-overlay.active .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 mobile behavior */
    .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 mobile */
    .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 single column on small phones */
    .stats-grid {
        margin-bottom: 16px;
    }

    /* Make data tables font smaller on mobile */
    .data-table {
        font-size: 12px;
    }

    /* Reduce badge font on mobile */
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Card margin between cards */
    .card + .card {
        margin-top: 16px;
    }

    /* Ensure no horizontal overflow on any card */
    .card {
        max-width: 100%;
        overflow: hidden;
    }

    /* Tabs scrollable on mobile */
    .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;
    }

    /* Show all paginated rows when printing, hide pagination controls */
    .table-wrapper tbody tr {
        display: table-row !important;
    }
    .pagination-controls {
        display: none !important;
    }

    /* Show all table columns (even those hidden by column visibility) when printing */
    .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 color */
::selection {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

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

/* High contrast mode support */
@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;
}

/* Touch-friendly sizing */
@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) ============ */
/* Shared by registration.html and admin edit modal */
.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 – יצירת דף חדש
   ============================================================ */

/* ---- Empty State ---- */
.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;
}

/* ---- Status Badges ---- */
.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);
}

/* ---- Table Actions ---- */
.cp-table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cp-table-actions .btn {
    min-width: 44px;
    min-height: 34px;
}

/* ---- Editor Modal Form ---- */
.cp-editor-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Field Rows — horizontal layout for side-by-side fields */
.cp-field-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}

/* Individual Field Group */
.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;
}

/* Content Label (standalone above editor) */
.cp-field-group:only-of-type > label,
.cp-editor-wrap > .cp-field-group > label:only-child {
    margin-bottom: 0;
    font-size: 14px;
}

/* TinyMCE Editor Container */
.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);
}

/* Ensure TinyMCE fills the container */
.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;
}

/* Editor Actions (preview button below editor) */
.cp-editor-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

/* ---- Responsive ---- */
@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;
    }
}