        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { 
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
            background-color: #f5f5f5; 
            color: #333;
        }
        .page-actions {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            flex-wrap: wrap;
        }
        .page-actions button {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        @media print {
            header, nav, .page-actions, button { display: none !important; }
            .page-content { box-shadow: none; padding: 0; }
            body { background: white; }
        }
        header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            position: relative;
        }
        .header-top-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .header-actions {
            display: flex;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
            align-items: center;
        }
        .header-actions-spacer { flex: 1; }
        #mobile-menu-toggle {
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 5px;
            width: 42px;
            height: 42px;
            background: rgba(255,255,255,0.15);
            border: none;
            border-radius: 6px;
            cursor: pointer;
            flex-shrink: 0;
            padding: 0;
        }
        #mobile-menu-toggle span {
            display: block;
            width: 22px;
            height: 2px;
            background: white;
            border-radius: 2px;
            transition: transform 0.25s, opacity 0.25s;
        }
        #mobile-menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
        #mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
        #mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
        #mobile-menu-overlay {
            display: none;
        }
        h1 { margin-bottom: 5px; font-size: 28px; }
        header p { font-size: 14px; opacity: 0.9; }
        nav { 
            display: flex; 
            gap: 10px; 
            flex-wrap: wrap; 
            margin-top: 15px; 
            justify-content: flex-start;
            align-items: center;
        }
        nav button { 
            background: rgba(255,255,255,0.2); 
            color: white; 
            border: none;
            padding: 8px 16px; 
            cursor: pointer;
            border-radius: 4px;
            font-size: 14px;
            transition: all 0.3s;
        }
        nav button:hover { 
            background: rgba(255,255,255,0.3);
            transform: translateY(-2px);
        }
        nav button.active {
            background: rgba(255,255,255,0.4);
            font-weight: bold;
        }
        main { padding: 20px; max-width: 1400px; margin: 0 auto; }
        .page-content { 
            background: white; 
            padding: 25px; 
            border-radius: 8px; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            display: none;
        }
        .page-content.active { display: block; animation: fadeIn 0.3s; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        h2 { margin-bottom: 20px; color: #667eea; border-bottom: 2px solid #667eea; padding-bottom: 10px; }
        h3 { margin-top: 20px; margin-bottom: 15px; color: #555; }
        .form-group { 
            display: flex; 
            gap: 10px; 
            margin-bottom: 15px; 
            flex-wrap: wrap;
            align-items: center;
        }
        input[type="text"], input[type="number"], select { 
            padding: 10px; 
            border: 1px solid #ddd; 
            border-radius: 4px;
            font-family: inherit;
        }
        input[type="text"]:focus, input[type="number"]:focus, select:focus { 
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 5px rgba(102,126,234,0.3);
        }
        button { 
            padding: 10px 20px; 
            background: #667eea; 
            color: white; 
            border: none; 
            border-radius: 4px; 
            cursor: pointer;
            font-weight: 500;
            transition: background 0.3s;
        }
        button:hover { background: #764ba2; }
        button.secondary { background: #95a5a6; }
        button.secondary:hover { background: #7f8c8d; }
        button.danger { background: #e74c3c; }
        button.danger:hover { background: #c0392b; }
        table { 
            width: 100%; 
            border-collapse: collapse; 
            margin: 15px 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        th { 
            background: #f8f9fa; 
            padding: 12px; 
            text-align: right; 
            font-weight: 600;
            border-bottom: 2px solid #ddd;
        }
        td { 
            padding: 12px; 
            border-bottom: 1px solid #eee;
        }
        tr:hover { background: #f9f9f9; }
        input[type="text"].inline-edit, input[type="number"].inline-edit {
            width: 100%;
            padding: 6px;
            min-width: 80px;
            box-sizing: border-box;
        }
        select {
            min-width: 120px;
        }
        .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 15px;
            margin: 20px 0;
        }
        .stat-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 8px;
            text-align: center;
        }
        .stat-label { font-size: 14px; opacity: 0.9; }
        .stat-value { font-size: 24px; font-weight: bold; margin-top: 5px; }
        .tab-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid #eee;
        }
        .tab-buttons button {
            background: transparent;
            color: #667eea;
            border: none;
            border-bottom: 3px solid transparent;
            padding: 12px 20px;
            cursor: pointer;
            font-weight: 500;
        }
        .tab-buttons button.active {
            color: #667eea;
            border-bottom-color: #667eea;
        }
        .hidden { display: none !important; }
        .instruction-box {
            background: #e3f2fd;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        .step-box {
            background: white;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        .step-box ol {
            line-height: 1.8;
            margin-right: 20px;
        }
        textarea {
            font-family: monospace;
            font-size: 12px;
            direction: ltr;
            text-align: left;
        }

        /* Mobile Responsive Styles */
        @media screen and (max-width: 768px) {
            body {
                font-size: 14px;
            }

            header {
                padding: 15px !important;
            }

            header h1 {
                font-size: 20px !important;
            }

            header p {
                font-size: 12px !important;
            }

            header button {
                padding: 6px 12px !important;
                font-size: 12px !important;
            }

            nav {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                white-space: nowrap;
                padding: 10px 5px !important;
            }

            nav button {
                font-size: 12px !important;
                padding: 8px 12px !important;
                white-space: nowrap;
            }

            /* המרת תפריט הניווט לתפריט המבורגר נפתח/נסגר */
            #mobile-menu-toggle {
                display: flex;
            }

            /* תפריט שנפתח "בזרימה הרגילה" של הדף (לא position:fixed) - כך שהדף
               כולו גולל אליו באופן טבעי, במקום להסתמך על גלילה פנימית של אזור
               מוגבל שהתגלתה כלא אמינה בחלק מהדפדפנים/מכשירים */
            #main-nav {
                display: none;
                width: 100%;
                background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
                flex-direction: column;
                align-items: stretch;
                white-space: normal;
                gap: 6px;
                padding: 15px !important;
                border-radius: 8px;
                margin-top: 15px;
            }

            #main-nav.mobile-open {
                display: flex;
            }

            #main-nav button {
                width: 100%;
                text-align: right;
                padding: 14px 16px !important;
                font-size: 15px !important;
                border-radius: 6px;
                background: rgba(255,255,255,0.08);
            }

            #main-nav button.active {
                background: rgba(255,255,255,0.35);
            }

            #mobile-menu-overlay.mobile-open {
                display: none;
            }

            main {
                padding: 10px !important;
            }

            .page-content {
                padding: 15px !important;
            }

            .page-content h2 {
                font-size: 20px !important;
                margin-bottom: 15px !important;
            }

            .page-content h3 {
                font-size: 16px !important;
            }

            /* Stats Cards - Stack vertically on mobile */
            .stats-container {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }

            .stat-card {
                padding: 15px !important;
            }

            .stat-value {
                font-size: 24px !important;
            }

            /* Buttons */
            button {
                font-size: 13px !important;
                padding: 10px 15px !important;
            }

            .page-actions {
                flex-direction: column !important;
                gap: 8px !important;
            }

            .page-actions button {
                width: 100% !important;
            }

            /* Form Groups */
            .form-group {
                flex-direction: column !important;
                align-items: stretch !important;
            }

            .form-group label {
                margin-bottom: 5px !important;
                margin-left: 0 !important;
            }

            .form-group input,
            .form-group select {
                max-width: 100% !important;
                width: 100% !important;
            }

            /* Tables - Enable horizontal scroll with better UX */
            table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                white-space: nowrap;
                font-size: 12px !important;
                border: 1px solid #ddd;
            }

            table thead {
                position: sticky;
                top: 0;
                background: white;
                z-index: 10;
            }

            table th {
                font-size: 11px !important;
                padding: 8px 6px !important;
                position: sticky;
                top: 0;
            }

            table td {
                padding: 8px 6px !important;
                font-size: 12px !important;
            }

            /* Make first column sticky for better navigation */
            table th:first-child,
            table td:first-child {
                position: sticky;
                right: 0;
                background: white;
                z-index: 5;
                box-shadow: 2px 0 4px rgba(0,0,0,0.1);
            }

            table th:first-child {
                z-index: 11;
            }

            /* Make second column sticky too */
            table th:nth-child(2),
            table td:nth-child(2) {
                position: sticky;
                right: 0;
                background: white;
                z-index: 4;
                box-shadow: 2px 0 4px rgba(0,0,0,0.08);
            }

            table th:nth-child(2) {
                z-index: 10;
                box-shadow: 2px 0 4px rgba(0,0,0,0.1);
            }

            /* Calculate right position for second column dynamically */
            #rishum-management-table th:nth-child(2),
            #rishum-management-table td:nth-child(2) {
                right: 70px; /* Approximate width of first column */
            }

            #hug-details-table th:nth-child(2),
            #hug-details-table td:nth-child(2) {
                right: 70px;
            }

            #debt-excess-table th:nth-child(2),
            #debt-excess-table td:nth-child(2) {
                right: 70px;
            }

            #salaries-summary-table th:nth-child(2),
            #salaries-summary-table td:nth-child(2) {
                right: 120px; /* Larger for hug name column */
            }

            /* Better visual separation between sticky columns and scrollable content */
            table th:nth-child(2)::after,
            table td:nth-child(2)::after {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 1px;
                height: 100%;
                background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1), transparent);
            }

            /* Inline edit inputs */
            .inline-edit {
                min-width: 60px !important;
                font-size: 12px !important;
                padding: 4px !important;
            }

            input[type="number"] {
                width: 70px !important;
            }

            select {
                font-size: 12px !important;
                padding: 4px !important;
            }

            /* Search box */
            #search-student {
                width: 100% !important;
                max-width: 100% !important;
                margin-bottom: 10px !important;
            }

            /* Schedule cards on mobile */
            .schedule-card {
                padding: 15px !important;
            }

            .schedule-card > div:first-child {
                flex-direction: column !important;
                align-items: flex-start !important;
            }

            .schedule-card button {
                width: 100% !important;
                margin-top: 5px !important;
            }

            /* Reports page grid */
            #page-9 > div[style*="grid"] {
                grid-template-columns: 1fr !important;
            }

            /* Salary table - special handling */
            #salaries-summary-table input {
                width: 60px !important;
                font-size: 11px !important;
            }

            /* Expense/Income tabs */
            .tab-buttons {
                flex-wrap: wrap !important;
            }

            .tab-buttons button {
                flex: 1 1 45% !important;
                margin: 2px !important;
            }

            /* Step boxes */
            .step-box {
                padding: 15px !important;
            }

            .step-box ol {
                margin-right: 15px !important;
                font-size: 13px !important;
            }

            /* Text areas */
            textarea {
                font-size: 10px !important;
                min-height: 200px !important;
            }

            /* Welcome page stats */
            #welcome-stats {
                font-size: 13px !important;
            }

            /* Add scroll hint for tables */
            table::after {
                content: '← גלול לצדדים לראות עוד ←';
                display: block;
                text-align: center;
                padding: 10px;
                background: #fff3cd;
                color: #856404;
                font-size: 11px;
                border-top: 1px solid #ddd;
            }

            /* Hide scroll hint after first scroll */
            table.scrolled::after {
                display: none;
            }
        }

        /* Extra small devices (phones in portrait) */
        @media screen and (max-width: 480px) {
            header h1 {
                font-size: 18px !important;
            }

            nav button {
                font-size: 11px !important;
                padding: 6px 10px !important;
            }

            table {
                font-size: 11px !important;
            }

            table th,
            table td {
                padding: 6px 4px !important;
                font-size: 11px !important;
            }

            .inline-edit {
                font-size: 11px !important;
            }

            button {
                font-size: 12px !important;
                padding: 8px 12px !important;
            }
        }
