<!DOCTYPE html>
<html lang="en" dir="ltr" class="h-full bg-gray-50 dark:bg-gray-900">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> - SmartNurseries</title>
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700&display=swap" />
    <link rel="stylesheet" href="/css/site.css?v=IEd8l9xMHdhetPZXuYSKpushJUPLU7dSTqp4FCNTNQw" />
    <script>
        if (localStorage.getItem('theme') === 'dark' || (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
            document.documentElement.classList.add('dark');
        }
    </script>
    <script src="/lib/jquery/dist/jquery.min.js"></script>
    <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
    <!-- BG-09: PWA — manifest, theme color, install hooks -->
    <link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#4F46E5" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="SmartNurseries" />
<link rel="apple-touch-icon" href="/icons/icon-192.png" />

</head>
<body class="h-full bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-white">
    

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://smartnurseries.ar-smartsolutions.com</loc>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
    </url>
</urlset>

    
    <div id="pwaInstallWrap" hidden
     style="position:fixed;bottom:4.25rem;right:1rem;z-index:9999;display:flex;align-items:center;gap:.4rem;">
    <button type="button" id="pwaInstallButton"
            style="display:inline-flex;align-items:center;gap:.5rem;border-radius:9999px;background:#4F46E5;color:#fff;padding:.55rem 1rem;font-weight:800;font-size:.8125rem;box-shadow:0 8px 24px rgba(79,70,229,.35);border:0;cursor:pointer;">
        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
            <path d="M12 3v12" /><path d="m7 10 5 5 5-5" /><path d="M5 21h14" />
        </svg>
        Install App
    </button>
    <button type="button" id="pwaInstallDismiss" aria-label="Close"
            style="display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:9999px;background:rgba(15,23,42,.75);color:#fff;border:0;cursor:pointer;">
        <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" aria-hidden="true">
            <path d="M18 6 6 18M6 6l12 12" />
        </svg>
    </button>
</div>
<div id="snOfflineLabels" hidden
     data-scope="anon"
     data-offline="Offline"
     data-online="Online"
     data-pending="pending"
     data-saved-offline="Saved offline &#x2014; it will sync automatically when you&#x27;re back online"
     data-synced="Synced {0} item(s)"
     data-synced-review="Sent {0} item(s) &#x2014; {1} may need review"
     data-sync-failed="Could not sync an item &#x2014; it was discarded"
     data-syncing="Syncing&#x2026;"
     data-refresh="Refresh"
     data-pending-opt="pending sync"
     data-dep-blocked="{0} item(s) waiting on a record that did not sync &#x2014; review needed"
     data-auth-needed="Your session expired &#x2014; sign in again to resume syncing"
     data-dead-items="{0} item(s) failed permanently &#x2014; kept for manual review"
     data-review-title="Sync queue"
     data-retry-item="Retry"
     data-dismiss="Delete"
     data-failed-validation="Validation failed &#x2014; review the data and re-enter it"
     data-failed-status="Failed (HTTP {0})"
     data-empty-queue="No queued items"
     data-blocked-item="waiting on a queued record"
     data-close-label="Close"
     data-install-title="Install SmartNurseries"
     data-install-ios="In Safari: tap the Share button, then choose &quot;Add to Home Screen&quot;."
     data-install-android="Open the browser menu (&#x22EE;) and tap &quot;Install app&quot; or &quot;Add to Home screen&quot;."
     data-install-chromium="Click the install icon in the address bar, or open the browser menu and choose &quot;Install SmartNurseries&quot;."
     data-install-firefox="Open the browser menu (&#x2630;) and choose &quot;Install&quot; or &quot;Pin to taskbar&quot; when available &#x2014; or open the site in Chrome/Edge for one-click install."
     data-install-macsafari="In Safari: open the File menu and choose &quot;Add to Dock&quot;, or Share &#x2192; &quot;Add to Home Screen&quot;."
     data-got-it="Got it"></div>
<script defer src="/js/offline-db.js?v=8"></script>
<script defer src="/js/offline-sync.js?v=9"></script>
<script>
    (function () {
        // BG-09: PWA — Service Worker registration (whole app: tenant, staff, parent, host, public)
        if ('serviceWorker' in navigator) {
            window.addEventListener('load', function () {
                navigator.serviceWorker.register('/sw.js')
                    .then(function (reg) { console.log('SW registered:', reg.scope); })
                    .catch(function (err) { console.log('SW registration failed:', err); });
            });
        }

        // Install — button is always offered (unless already installed); browsers that
        // can't fire beforeinstallprompt get platform-specific instructions instead.
        var installWrap = document.getElementById('pwaInstallWrap');
        var installButton = document.getElementById('pwaInstallButton');
        var installDismiss = document.getElementById('pwaInstallDismiss');
        var deferredPrompt = null;
        var lab = document.getElementById('snOfflineLabels');

        function isStandalone() {
            return window.matchMedia('(display-mode: standalone)').matches
                || window.matchMedia('(display-mode: fullscreen)').matches
                || navigator.standalone === true;
        }

        function ua() { return navigator.userAgent; }

        function platformHelp() {
            var u = ua();
            var isMobile = /Android|iPhone|iPad|iPod|Mobile/i.test(u)
                || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
            if (/iPhone|iPad|iPod/i.test(u) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) {
                return lab.dataset.installIos;
            }
            if (/Android/i.test(u)) {
                return lab.dataset.installAndroid;
            }
            if (!isMobile && /Macintosh/i.test(u) && /Safari/i.test(u) && !/Chrome|Chromium|Edg/i.test(u)) {
                return lab.dataset.installMacsafari;
            }
            if (!isMobile && /Firefox/i.test(u)) {
                return lab.dataset.installFirefox;
            }
            return lab.dataset.installChromium;
        }

        var helpOverlay = null;
        function showHelp() {
            if (helpOverlay) { helpOverlay.remove(); }
            helpOverlay = document.createElement('div');
            helpOverlay.setAttribute('style',
                'position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;' +
                'background:rgba(15,23,42,.55);padding:1rem;');
            var card = document.createElement('div');
            card.setAttribute('style',
                'background:#fff;color:#0f172a;border-radius:16px;max-width:26rem;width:100%;' +
                'padding:1.4rem 1.5rem;box-shadow:0 25px 60px rgba(15,23,42,.4);font-family:inherit;');
            var title = document.createElement('div');
            title.setAttribute('style', 'font-weight:900;font-size:1.05rem;margin-bottom:.6rem;');
            title.textContent = lab.dataset.installTitle;
            var body = document.createElement('p');
            body.setAttribute('style', 'font-size:.9rem;line-height:1.6;margin:0 0 1rem;color:#334155;');
            body.textContent = platformHelp();
            var btn = document.createElement('button');
            btn.type = 'button';
            btn.textContent = lab.dataset.gotIt;
            btn.setAttribute('style',
                'width:100%;border:0;border-radius:10px;background:#4F46E5;color:#fff;' +
                'padding:.6rem;font-weight:800;cursor:pointer;');
            btn.addEventListener('click', function () { helpOverlay.remove(); helpOverlay = null; });
            card.appendChild(title); card.appendChild(body); card.appendChild(btn);
            helpOverlay.appendChild(card);
            helpOverlay.addEventListener('click', function (e) { if (e.target === helpOverlay) { helpOverlay.remove(); helpOverlay = null; } });
            document.body.appendChild(helpOverlay);
        }

        window.addEventListener('beforeinstallprompt', function (event) {
            event.preventDefault();
            deferredPrompt = event;
        });

        if (installWrap) {
            var dismissed = false;
            try { dismissed = sessionStorage.getItem('pwaInstallDismissed') === '1'; } catch (e) { }
            if (isStandalone() || dismissed) {
                installWrap.hidden = true;
            } else {
                installWrap.hidden = false;
            }
            if (installDismiss) {
                installDismiss.addEventListener('click', function () {
                    installWrap.hidden = true;
                    try { sessionStorage.setItem('pwaInstallDismissed', '1'); } catch (e) { }
                });
            }
        }
        if (installButton) {
            installButton.addEventListener('click', async function () {
                if (deferredPrompt) {
                    deferredPrompt.prompt();
                    await deferredPrompt.userChoice;
                    deferredPrompt = null;
                    return;
                }
                showHelp();
            });
        }

        window.addEventListener('appinstalled', function () {
            deferredPrompt = null;
            if (installWrap) {
                installWrap.hidden = true;
            }
        });
    }());
</script>

    <script>
        /* UI redesign: never show 0001-01-01 (DateTime.MinValue) in date inputs */
        document.addEventListener('DOMContentLoaded', function () {
            document.querySelectorAll('input[type="date"]').forEach(function (i) {
                if (i.value && i.value.indexOf('0001-01-01') === 0) i.value = '';
            });
        });
    </script>
</body>
</html>
