/* Ramadan Volunteer Manual page styles.
   Extracted from Ramadan Volunteer.html to keep page-specific CSS maintainable. */

/* Extracted style block 1 */
        :root {
            --primary: #059669;
            --primary-light: #10b981;
            --primary-dark: #047857;
            --secondary: #1e3a8a;
            --secondary-light: #3b82f6;
            --accent: #f59e0b;
            --accent-light: #fbbf24;
            --bg-light: #f9fafb;
            --bg-dark: #111827;
            --text-dark: #1f2937;
            --text-light: #f9fafb;
            --text-muted: #6b7280;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --border: #e5e7eb;
            --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --glass-bg: rgba(255, 255, 255, 0.8);
            --glass-border: rgba(255, 255, 255, 0.3);
        }

        [data-theme="dark"] {
            --bg-light: #1f2937;
            --text-dark: #f9fafb;
            --border: #374151;
            --glass-bg: rgba(31, 41, 55, 0.8);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Outfit', 'Inter', 'Almarai', sans-serif;
            background: var(--bg-light);
            color: var(--text-dark);
            line-height: 1.6;
            transition: all 0.3s ease;
            overflow-x: hidden;
            padding-bottom: 0;
        }

        body.rtl {
            direction: rtl;
            font-family: 'Almarai', 'Noto Naskh Arabic', serif;
        }

        /* Header: shared main-dashboard shell comes from css/style.css and Tailwind utilities. */
        .volunteer-header-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.75rem;
            flex-wrap: wrap;
            flex-shrink: 0;
        }

        .volunteer-header-actions .i18n-toggle-host,
        .volunteer-header-actions .header-context-controls .i18n-toggle-host,
        .volunteer-header-actions .i18n-toggle {
            display: none !important;
        }

        .spiritual-card-action {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.55rem;
            min-height: 3.1rem;
            padding: 0.55rem 1rem;
            border-radius: 9999px;
            border: 1px solid #a7f3d0;
            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
            color: #065f46;
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
            font-size: 0.85rem;
            font-weight: 800;
            line-height: 1;
            text-decoration: none;
            white-space: nowrap;
            transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
        }

        .spiritual-card-action:hover {
            background: linear-gradient(135deg, #d1fae5 0%, #bbf7d0 100%);
            transform: translateY(-1px);
            box-shadow: 0 16px 28px rgba(6, 78, 59, 0.12);
        }

        .header-btn {
            background: rgba(255, 255, 255, 0.15);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: all 0.2s ease;
            backdrop-filter: blur(10px);
        }

        .header-btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.05);
        }

        .header-btn:active {
            transform: scale(0.95);
        }

        /* Main Container */
        .main-container {
            display: flex;
            min-height: calc(100vh - 80px);
            max-width: 1600px;
            margin: 0 auto;
        }

        /* Sidebar - Desktop */
        .sidebar {
            width: 260px;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            border-right: 1px solid var(--border);
            padding: 1.5rem 0;
            position: sticky;
            top: 73px;
            height: calc(100vh - 73px);
            overflow-y: auto;
            transition: transform 0.3s ease;
        }

        .sidebar-title {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-muted);
            padding: 0 1.5rem;
            margin-bottom: 1rem;
            font-weight: 600;
        }

        .nav-menu {
            list-style: none;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.875rem 1.5rem;
            color: var(--text-dark);
            cursor: pointer;
            transition: all 0.2s ease;
            border-left: 3px solid transparent;
            font-weight: 500;
        }

        .nav-item:hover {
            background: rgba(5, 150, 105, 0.08);
            color: var(--primary);
        }

        .nav-item.active {
            background: linear-gradient(90deg, rgba(5, 150, 105, 0.15) 0%, transparent 100%);
            color: var(--primary);
            border-left-color: var(--primary);
            font-weight: 600;
        }

        .nav-icon {
            font-size: 1.25rem;
            width: 24px;
            text-align: center;
        }

        /* Content Area */
        .content {
            flex: 1;
            padding: 1.5rem;
            max-width: 100%;
            overflow-x: hidden;
        }

        .page {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .page.active {
            display: block;
        }

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

        /* Page Header */
        .page-header {
            margin-bottom: 1.5rem;
        }

        .page-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-dark);
            margin-bottom: 0.25rem;
        }

        .page-subtitle {
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        /* Cards */
        .card {
            background: white;
            border-radius: 16px;
            padding: 1.25rem;
            box-shadow: var(--card-shadow);
            border: 1px solid var(--border);
            transition: all 0.3s ease;
            margin-bottom: 1rem;
        }

        .card:hover {
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }

        .card-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 1rem;
            color: var(--text-dark);
        }

        /* Roles Grid */
        .roles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }

        /* Filter Bar */
        .filter-bar {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            overflow-x: auto;
            padding-bottom: 0.5rem;
            -webkit-overflow-scrolling: touch;
        }

        .filter-btn {
            background: white;
            border: 1px solid var(--border);
            color: var(--text-dark);
            padding: 0.625rem 1rem;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 500;
            white-space: nowrap;
            transition: all 0.2s ease;
            min-height: 44px;
            display: flex;
            align-items: center;
        }

        .filter-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .filter-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        .filter-btn:active {
            transform: scale(0.95);
        }

        /* Mobile Bottom Navigation */
        .mobile-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            border-top: 1px solid var(--border);
            padding: 0.5rem 0;
            z-index: 1000;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        .mobile-nav-items {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 0.5rem;
            max-width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior-x: contain;
            scroll-snap-type: x proximity;
            scrollbar-width: thin;
            padding: 0 0.75rem;
        }

        .mobile-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.25rem;
            padding: 0.5rem;
            border: 0;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s ease;
            flex: 0 0 auto;
            min-width: 72px;
            min-height: 56px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
            font-family: inherit;
            line-height: 1.1;
            scroll-snap-align: center;
            touch-action: manipulation;
        }

        .mobile-nav-item.active {
            color: var(--primary);
            background: rgba(5, 150, 105, 0.1);
        }

        .mobile-nav-item:active {
            transform: scale(0.9);
        }

        .mobile-nav-icon {
            font-size: 1.5rem;
        }

        /* Floating Action Button */
        .fab {
            display: none;
            position: fixed;
            bottom: 90px;
            right: 20px;
            width: 56px;
            height: 56px;
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
            border-radius: 16px;
            box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            z-index: 999;
            transition: all 0.3s ease;
        }

        .fab:hover {
            transform: scale(1.1);
        }

        .fab:active {
            transform: scale(0.95);
        }

        /* Responsive */
        @media (max-width: 1024px) {
            .sidebar {
                position: fixed;
                left: 0;
                top: 73px;
                height: calc(100vh - 73px);
                transform: translateX(-100%);
                z-index: 500;
                width: 280px;
                background: var(--glass-bg);
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .sidebar-overlay {
                display: none;
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 499;
                backdrop-filter: blur(4px);
            }

            .sidebar-overlay.open {
                display: block;
            }

            .mobile-nav {
                display: block;
            }

            .fab {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            body {
                padding-bottom: 0;
            }

            .content {
                padding: 1rem;
            }

            .roles-grid {
                grid-template-columns: 1fr;
            }

            .page-title {
                font-size: 1.25rem;
            }

            .volunteer-header-actions {
                width: 100%;
                justify-content: flex-start;
            }
        }

        @media (max-width: 640px) {
            .card {
                padding: 1rem;
                border-radius: 12px;
            }

            .filter-btn {
                padding: 0.5rem 0.875rem;
                font-size: 0.8rem;
            }

            .mobile-nav-item {
                min-width: 50px;
                font-size: 0.7rem;
            }

            .mobile-nav-icon {
                font-size: 1.25rem;
            }
        }

        /* Animations */
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

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

        .animate-pulse {
            animation: pulse 2s ease-in-out infinite;
        }

        .animate-slide-up {
            animation: slideUp 0.3s ease-out;
        }

        /* Touch-friendly inputs */
        input, select, textarea, button {
            font-size: 16px;
            min-height: 44px;
        }

        /* Scrollbar styling */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-light);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        /* Glass effect */
        .glass {
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
        }

        /* Gradient text */
        .gradient-text {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        /* Status badges */
        .status-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .status-active {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success);
        }

        .status-pending {
            background: rgba(245, 158, 11, 0.1);
            color: var(--warning);
        }

        .status-completed {
            background: rgba(59, 130, 246, 0.1);
            color: var(--secondary-light);
        }

        .btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
           font-size: 0.875rem ;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
        }

        .btn-outline:hover {
            background: rgba(255,255,255,0.1);
        }

        .btn-primary {
            background: var(--secondary);
            color: var(--text-dark);
        }

        .btn-primary:hover {
            background: var(--secondary-light);
        }

        .btn-secondary {
            background: white;
            color: var(--primary);
            border: 1px solid var(--primary);
        }

        .lang-switcher {
            display: flex;
            gap: 0.25rem;
            background: rgba(255,255,255,0.1);
            padding: 0.25rem;
            border-radius: 8px;
        }

        .lang-btn {
            padding: 0.375rem 0.75rem;
            border: none;
            background: transparent;
            color: rgba(255,255,255,0.7);
            cursor: pointer;
            border-radius: 6px;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .lang-btn.active {
            background: white;
            color: var(--primary);
        }

        /* Main Layout */
        .main-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
            display: grid;
            grid-template-columns: 280px 1fr;
            gap: 2rem;
        }

        @media (max-width: 1024px) {
            .main-container {
                grid-template-columns: 1fr;
            }
        }

        /* Sidebar */
        .sidebar {
            background: white;
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: var(--card-shadow);
            height: fit-content;
            position: sticky;
            top: 100px;
        }

        [data-theme="dark"] .sidebar {
            background: var(--bg-light);
        }

        .sidebar-title {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            margin-bottom: 1rem;
            font-weight: 600;
        }

        .nav-menu {
            list-style: none;
        }

        .nav-item {
            padding: 0.75rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.25rem;
            color: var(--text-dark);
        }

        .nav-item:hover, .nav-item.active {
            background: rgba(0, 92, 85, 0.1);
            color: var(--primary);
        }

        .nav-item.active {
            font-weight: 600;
        }

        .nav-icon {
            width: 20px;
            text-align: center;
        }

        /* Content Area */
        .content {
            min-height: 80vh;
        }

        .page {
            display: none;
            animation: fadeIn 0.4s ease;
        }

        .page.active {
            display: block;
        }

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

        /* Page Header */
        .page-header {
            margin-bottom: 2rem;
        }

        .page-title {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .page-subtitle {
            color: var(--text-muted);
        }

        /* Filter Bar */
        .filter-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 2rem;
            padding: 1rem;
            background: white;
            border-radius: 12px;
            box-shadow: var(--card-shadow);
        }

        [data-theme="dark"] .filter-bar {
            background: var(--bg-light);
        }

        .filter-btn {
            padding: 0.5rem 1rem;
            border: 1px solid var(--border);
            background: white;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.875rem;
            color: var(--text-dark);
        }

        [data-theme="dark"] .filter-btn {
            background: var(--bg-light);
            border-color: var(--border);
        }

        .filter-btn:hover, .filter-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        /* Cards */
        .card {
            background: white;
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: var(--card-shadow);
            margin-bottom: 1.5rem;
        }

        [data-theme="dark"] .card {
            background: var(--bg-light);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        .card-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-dark);
        }

        /* Role Cards Grid */
        .roles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1rem;
        }

        .role-card {
            background: white;
            border-radius: 12px;
            padding: 1.25rem;
            border: 1px solid var(--border);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        [data-theme="dark"] .role-card {
            background: var(--bg-light);
        }

        .role-card:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: var(--card-shadow);
        }

        .role-card-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
        }

        .role-icon {
            width: 40px;
            height: 40px;
            background: rgba(0, 92, 85, 0.1);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
        }

        .role-name {
            font-weight: 600;
            color: var(--text-dark);
        }

        .role-category {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .role-desc {
            font-size: 0.875rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }

        .role-skills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
        }

        .skill-tag {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            background: rgba(0, 92, 85, 0.1);
            color: var(--primary);
            border-radius: 4px;
        }

        /* FAQ Accordion */
        .faq-categories {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }

        .faq-item {
            border: 1px solid var(--border);
            border-radius: 8px;
            margin-bottom: 0.75rem;
            overflow: hidden;
        }

        .faq-question {
            padding: 1rem;
            background: white;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 500;
        }

        [data-theme="dark"] .faq-question {
            background: var(--bg-light);
        }

        .faq-answer {
            padding: 1rem;
            background: rgba(0, 92, 85, 0.03);
            color: var(--text-muted);
            font-size: 0.875rem;
            display: none;
        }

        .faq-item.active .faq-answer {
            display: block;
        }

        /* Du'a Cards */
        .dua-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1rem;
        }

        .dua-card {
            background: white;
            border-radius: 12px;
            padding: 1.25rem;
            border: 1px solid var(--border);
        }

        [data-theme="dark"] .dua-card {
            background: var(--bg-light);
        }

        .dua-arabic {
            font-family: 'Noto Naskh Arabic', 'Almarai', serif;
            font-size: 1.25rem;
            line-height: 1.8;
            color: var(--primary);
            margin-bottom: 0.75rem;
            text-align: center;
        }

        .dua-transliteration {
            font-style: italic;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
            font-size: 0.875rem;
        }

        .dua-translation {
            color: var(--text-dark);
            font-size: 0.875rem;
        }

        .dua-label {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--secondary);
            margin-bottom: 0.5rem;
        }

        /* Framework Section */
        .framework-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            align-items: start;
        }

        @media (max-width: 768px) {
            .framework-container {
                grid-template-columns: 1fr;
            }
        }

        .framework-visual {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            border-radius: 16px;
            padding: 2rem;
            color: white;
            text-align: center;
            min-height: 300px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .framework-pie {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            background: conic-gradient(
                var(--secondary) 0deg 288deg,
                rgba(255,255,255,0.3) 288deg 360deg
            );
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1.5rem;
        }

        .framework-pie-inner {
            width: 100px;
            height: 100px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.5rem;
        }

        .framework-percent {
            font-size: 3rem;
            font-weight: 700;
        }

        .framework-label {
            font-size: 1.125rem;
            opacity: 0.9;
        }

        .framework-list {
            list-style: none;
        }

        .framework-list li {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
        }

        .framework-list li:last-child {
            border-bottom: none;
        }

        .framework-badge {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            white-space: nowrap;
        }

        .badge-80 {
            background: rgba(212, 175, 55, 0.2);
            color: var(--secondary);
        }

        .badge-20 {
            background: rgba(0, 92, 85, 0.1);
            color: var(--primary);
        }

        /* Competency Matrix Table */
        .matrix-table {
            overflow-x: auto;
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 800px;
        }

        th, td {
            padding: 0.75rem;
            text-align: left;
            border-bottom: 1px solid var(--border);
            font-size: 0.875rem;
        }

        th {
            background: rgba(0, 92, 85, 0.1);
            color: var(--primary);
            font-weight: 600;
            position: sticky;
            top: 0;
        }

        td {
            color: var(--text-dark);
        }

        tr:hover td {
            background: rgba(0, 92, 85, 0.03);
        }

        .competency-level {
            display: inline-block;
            padding: 0.125rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .level-H {
            background: rgba(0, 92, 85, 0.15);
            color: var(--primary);
        }

        .level-M {
            background: rgba(212, 175, 55, 0.15);
            color: #B8860B;
        }

        .level-L {
            background: rgba(107, 114, 128, 0.1);
            color: var(--text-muted);
        }

        /* Rubric Grid */
        .rubric-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
            margin-bottom: 2rem;
        }

        @media (max-width: 768px) {
            .rubric-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .rubric-cell {
            background: white;
            border: 2px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        [data-theme="dark"] .rubric-cell {
            background: var(--bg-light);
        }

        .rubric-cell:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
        }

        .rubric-cell.selected {
            border-color: var(--primary);
            background: rgba(0, 92, 85, 0.05);
        }

        .rubric-level-icon {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .rubric-dimension {
            font-weight: 600;
            color: var(--primary);
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }

        .rubric-title {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Certification Levels */
        .cert-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1rem;
        }

        .cert-card {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            text-align: center;
            border: 2px solid var(--border);
            transition: all 0.3s ease;
        }

        [data-theme="dark"] .cert-card {
            background: var(--bg-light);
        }

        .cert-card.active {
            border-color: var(--secondary);
            box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
        }

        .cert-icon {
            font-size: 2.5rem;
            margin-bottom: 0.75rem;
        }

        .cert-name {
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 0.25rem;
        }

        .cert-arabic {
            font-family: 'Almarai', serif;
            color: var(--primary);
            font-size: 0.875rem;
            margin-bottom: 0.5rem;
        }

        .cert-score {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Team Development */
        .timeline {
            position: relative;
            padding-left: 2rem;
        }

        .timeline::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--primary);
        }

        .timeline-item {
            position: relative;
            padding-bottom: 2rem;
        }

        .timeline-item::before {
            content: '';
            position: absolute;
            left: -2rem;
            top: 0.25rem;
            width: 12px;
            height: 12px;
            background: var(--primary);
            border-radius: 50%;
            transform: translateX(-5px);
        }

        .timeline-phase {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--primary);
            font-weight: 600;
            margin-bottom: 0.25rem;
        }

        .timeline-title {
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 0.5rem;
        }

        .timeline-desc {
            font-size: 0.875rem;
            color: var(--text-muted);
        }

        /* Action Plans */
        .action-list {
            list-style: none;
        }

        .action-item {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 1rem;
            border-bottom: 1px solid var(--border);
        }

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

        .action-checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid var(--primary);
            border-radius: 4px;
            cursor: pointer;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .action-checkbox.checked {
            background: var(--primary);
        }

        .action-text {
            flex: 1;
        }

        .action-title {
            font-weight: 500;
            color: var(--text-dark);
            margin-bottom: 0.25rem;
        }

        .action-desc {
            font-size: 0.875rem;
            color: var(--text-muted);
        }

        /* Modal */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

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

        .modal {
            background: white;
            border-radius: 16px;
            padding: 2rem;
            max-width: 600px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            animation: modalIn 0.3s ease;
        }

        [data-theme="dark"] .modal {
            background: var(--bg-light);
        }

        @keyframes modalIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        .modal-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-dark);
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-muted);
        }

        /* Common Responsibilities */
        .common-responsibilities {
            background: linear-gradient(135deg, rgba(0, 92, 85, 0.05), rgba(212, 175, 55, 0.05));
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            border-left: 4px solid var(--primary);
        }

        body.rtl .common-responsibilities {
            border-left: none;
            border-right: 4px solid var(--primary);
        }

        .common-title {
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .common-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 0.5rem;
            list-style: none;
        }

        .common-list li {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-dark);
        }

        .common-list li::before {
            content: '✓';
            color: var(--primary);
            font-weight: 600;
        }

        /* Privacy Notice */
        .privacy-notice {
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid var(--success);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .privacy-icon {
            font-size: 1.5rem;
        }

        .privacy-text {
            font-size: 0.875rem;
            color: var(--text-dark);
        }

        /* Footer */
        .footer {
            background: var(--primary);
            color: white;
            padding: 2rem;
            margin-top: 4rem;
        }

        .footer-content {
            max-width: 1400px;
            margin: 0 auto;
            text-align: center;
        }

        .footer-text {
            opacity: 0.9;
            font-size: 0.875rem;
        }

        /* Theme Toggle */
        .theme-toggle {
            background: rgba(255,255,255,0.1);
            border: none;
            color: white;
            padding: 0.5rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .spiritual-card-action {
                width: 100%;
                justify-content: center;
            }

            .sidebar {
                position: static;
            }

            .roles-grid {
                grid-template-columns: 1fr;
            }
        }
    

/* Extracted style block 2 */
                        @keyframes pulse {
                            0%, 100% { transform: scale(1); opacity: 0.5; }
                            50% { transform: scale(1.1); opacity: 0.8; }
                        }
                        @keyframes shimmer {
                            0% { transform: translateX(-100%); }
                            100% { transform: translateX(100%); }
                        }
                    

/* Extracted style block 3 */
                    .scenarios-grid {
                        display: grid;
                        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
                        gap: 1.5rem;
                        margin-top: 1.5rem;
                    }
                    .scenario-card {
                        background: white;
                        border-radius: 12px;
                        padding: 1.5rem;
                        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
                        border-left: 4px solid var(--primary-color);
                        position: relative;
                    }
                    .scenario-number {
                        position: absolute;
                        top: 1rem;
                        right: 1rem;
                        width: 32px;
                        height: 32px;
                        background: var(--primary-color);
                        color: white;
                        border-radius: 50%;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        font-weight: bold;
                        font-size: 14px;
                    }
                    .scenario-role {
                        font-weight: 700;
                        color: var(--primary-color);
                        margin-bottom: 1rem;
                        padding-right: 40px;
                        font-size: 1.1rem;
                    }
                    .scenario-section {
                        margin-bottom: 1rem;
                    }
                    .scenario-section strong {
                        display: block;
                        color: #333;
                        margin-bottom: 0.5rem;
                        font-size: 0.95rem;
                    }
                    .scenario-section p, .scenario-section li {
                        font-size: 0.9rem;
                        color: #555;
                        line-height: 1.5;
                    }
                    .scenario-section ul {
                        padding-left: 1.25rem;
                        margin: 0;
                    }
                    .scenario-section li {
                        margin-bottom: 0.25rem;
                    }
                    .facilitator {
                        background: #f8f9fa;
                        padding: 1rem;
                        border-radius: 8px;
                        margin-top: 1rem;
                    }
                    .facilitator strong {
                        color: #d97706;
                    }
                    .facilitator p {
                        color: #666;
                    }


/* Mobile layout fixes added after extraction. Keep at the end so these rules
   win over earlier duplicated sidebar/mobile styles in the legacy page CSS. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.main-container,
.content,
.card,
.role-card,
.modal,
.volunteer-header-actions,
header.bg-emerald-800 > div,
header.bg-emerald-800 nav.page-nav {
    min-width: 0;
}

.volunteer-mobile-menu-btn {
    display: none;
}

.filter-bar,
.table-container,
.matrix-table,
.rubric-table,
.scenarios-grid,
.roles-grid {
    max-width: 100%;
}

.filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card,
.role-card,
.scenario-card,
.faq-item,
.modal {
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    header.bg-emerald-800 > div > .flex.items-center.justify-between {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 1rem;
    }

    .volunteer-header-actions {
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        gap: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
    }

    .volunteer-mobile-menu-btn {
        display: inline-flex;
        flex: 0 0 auto;
        min-width: 44px;
        min-height: 44px;
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
        border: 1px solid rgba(255, 255, 255, 0.28);
    }

    body .main-container {
        display: block;
        max-width: 100%;
        padding: 1rem;
    }

    body .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: min(86vw, 320px) !important;
        height: 100dvh !important;
        max-height: 100dvh;
        overflow-y: auto;
        transform: translateX(-105%) !important;
        z-index: 1002 !important;
        border-radius: 0 16px 16px 0;
        padding-top: max(1.5rem, env(safe-area-inset-top, 0px));
        transition: transform 0.25s ease;
    }

    body .sidebar.open {
        transform: translateX(0) !important;
    }

    body .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        display: none;
        background: rgba(15, 23, 42, 0.48);
        z-index: 1001 !important;
        backdrop-filter: blur(3px);
    }

    body .sidebar-overlay.open {
        display: block !important;
    }

    .content {
        padding: 1rem 0;
    }

    .mobile-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .mobile-nav-items {
        padding-inline: max(0.75rem, env(safe-area-inset-left, 0px)) max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .fab {
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    #scrollTopBtn {
        right: 20px;
        bottom: calc(164px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 768px) {
    header.bg-emerald-800 {
        padding: 1rem;
    }

    .volunteer-header-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        width: 100%;
        gap: 0.6rem;
        overflow: visible;
        padding-bottom: 0;
    }

    .volunteer-header-actions .header-context-controls {
        display: contents;
    }

    .volunteer-header-actions .year-switcher {
        grid-column: 1 / -1;
        width: 100%;
    }

    .volunteer-header-actions .year-switcher-pills {
        width: 100%;
    }

    .volunteer-header-actions .year-switcher-btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .spiritual-card-action {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding-inline: 0.8rem;
        white-space: normal;
        line-height: 1.2;
    }

    header.bg-emerald-800 .portal-hamburger {
        display: inline-flex;
        width: 44px;
        height: 44px;
        margin-inline-start: 0;
        border-color: rgba(255, 255, 255, 0.28);
        background: rgba(255, 255, 255, 0.96);
        color: #065f46;
        grid-column: 2;
    }

    .volunteer-mobile-menu-btn {
        grid-column: 3;
    }

    header.bg-emerald-800 nav.page-nav {
        display: none !important;
    }

    body.portal-menu-open header.bg-emerald-800 nav.page-nav {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        position: fixed;
        top: 0;
        right: 0;
        bottom: auto;
        z-index: 1050;
        width: min(82vw, 320px);
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        padding: max(5.5rem, calc(4.5rem + env(safe-area-inset-top, 0px))) 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
        gap: 0.4rem;
        background: #ffffff;
        border-top: none;
        border-left: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.16);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.portal-menu-open header.bg-emerald-800 nav.page-nav .page-nav-link {
        flex: 0 0 auto;
        padding: 0.65rem 0.9rem;
        border-radius: 0.75rem;
        color: #065f46;
        font-size: 0.9rem;
        text-align: center;
    }

    body.portal-menu-open header.bg-emerald-800 nav.page-nav .page-nav-link:hover {
        color: #064e3b;
        background: #d1fae5;
    }

    body.portal-menu-open header.bg-emerald-800 nav.page-nav .page-nav-link.active {
        color: #064e3b;
        background: #a7f3d0;
    }

    .roles-grid,
    .scenarios-grid,
    .quick-actions,
    .stats-grid,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .modal {
        width: min(100%, calc(100vw - 1.5rem));
        max-height: calc(100dvh - 1.5rem);
        overflow-y: auto;
    }

    .mobile-nav-item {
        min-width: 72px;
        min-height: 56px;
    }
}

@media (max-width: 480px) {
    .card,
    .role-card,
    .scenario-card {
        padding: 1rem;
    }

    .spiritual-card-action {
        width: 100%;
        max-width: 100%;
        white-space: normal;
        line-height: 1.25;
    }

    .mobile-nav-item {
        font-size: 0.68rem;
        min-width: 68px;
        min-height: 56px;
        padding: 0.45rem 0.35rem;
    }
}

@media (max-width: 768px) {
    body.spiritual-modal-open {
        overflow: hidden;
        touch-action: none;
    }

    #spiritual-modal {
        z-index: 10050;
        padding:
            max(0.5rem, env(safe-area-inset-top, 0px))
            max(0.5rem, env(safe-area-inset-right, 0px))
            max(0.5rem, env(safe-area-inset-bottom, 0px))
            max(0.5rem, env(safe-area-inset-left, 0px));
        align-items: center;
    }

    #spiritual-modal .modal {
        width: min(100%, calc(100vw - 1rem));
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1rem);
        padding: 0.85rem;
        border-radius: 14px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #spiritual-modal .modal-header {
        position: sticky;
        top: -0.85rem;
        z-index: 1;
        margin: -0.85rem -0.85rem 0.55rem;
        padding: 0.7rem 0.85rem 0.55rem;
        background: white;
    }

    #spiritual-modal .modal-title {
        font-size: 1rem;
        line-height: 1.2;
    }

    #spiritual-modal .modal-close {
        min-width: 40px;
        min-height: 40px;
        line-height: 1;
    }

    #spiritual-modal .card-title {
        margin-bottom: 0.5rem !important;
        font-size: 0.95rem;
        line-height: 1.25;
    }

    #spiritual-modal .dua-grid {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    #spiritual-modal .dua-card {
        padding: 0.65rem;
        border-radius: 10px;
    }

    #spiritual-modal .dua-label {
        margin-bottom: 0.3rem;
        font-size: 0.68rem;
        letter-spacing: 0.35px;
    }

    #spiritual-modal .dua-arabic {
        margin-bottom: 0.4rem;
        font-size: 0.98rem;
        line-height: 1.45;
    }

    #spiritual-modal .dua-transliteration,
    #spiritual-modal .dua-translation {
        font-size: 0.76rem;
        line-height: 1.35;
    }

    #spiritual-modal .dua-transliteration {
        margin-bottom: 0.3rem;
    }

    #spiritual-modal .dua-grid + div {
        margin-top: 0.65rem !important;
        padding: 0.65rem !important;
        font-size: 0.82rem;
        line-height: 1.3;
    }
}

@media (max-width: 380px), (max-height: 680px) {
    #spiritual-modal .modal {
        padding: 0.7rem;
    }

    #spiritual-modal .modal-header {
        top: -0.7rem;
        margin: -0.7rem -0.7rem 0.45rem;
        padding: 0.6rem 0.7rem 0.45rem;
    }

    #spiritual-modal .dua-card {
        padding: 0.55rem;
    }

    #spiritual-modal .dua-arabic {
        font-size: 0.92rem;
        line-height: 1.35;
    }
}
