/*
 * Copyright (c) 2024–2026 Pyracor Engineering Inc. (Qikspace)
 * All rights reserved.
 * CONFIDENTIAL AND PROPRIETARY — NOT FOR DISTRIBUTION
 * Unauthorized use prohibited. accounts@qikspace.com | qikspace.com
 * SPDX-License-Identifier: LicenseRef-Qikspace-Proprietary
 */

/* =====================================================
   GLOBAL THEME TOKENS

   The single source of truth for colour across the portal. Loaded first (right
   after reset.css) so every other stylesheet can consume these; each token has
   a light value here and a dark override below, so anything built from them
   follows `prefers-color-scheme` for free. Prefer adding a token here over
   hardcoding a hex in a feature stylesheet.
   ===================================================== */

:root {
    --bg-main: #f4f6f8;
    --bg-panel: #ffffff;
    --bg-hover: #e9eff4;

    --text-main: #1b1f23;
    --text-muted: #6a7a85;

    --border-subtle: #d5dde3;

    --menu-bg: #ffffff;

    --link-color: #1976D2;
    --accent: #0d6efd;
    --success: #2e7d32;
    --warning: #c77800;
    --danger: #c62828;
}

/* =====================================================
   Z-INDEX LADDER

   Component-internal stacking (sticky list heads, sticky table headers,
   in-panel popovers) stays as small literals in the 1–20 range: those sit in
   their own stacking context and never compete page-wide. So does in-page
   chrome at 100–200 (the explorer's sticky breadcrumb and its "New" menu).
   Anything that overlays the page uses a token here.

   Two bands are reserved rather than tokenised, because within each feature the
   relative order carries meaning and the members must stay adjacent:
     1040–1060   feed drawer: click-catcher / popover / its dialog overlay
     1099–1400   feature-local dialog stacks: mobile "more" sheet, chat +
                 notepad modals, nested modal-from-a-modal, notepad busy veil.
                 These are page-scoped and never co-occur with --z-modal below.
   ===================================================== */

:root {
    --z-sidebar: 900;    /* desktop left rail */
    --z-overlay: 1000;   /* page-level menus, viewer chrome, mobile tabbar */
    /* Shared confirmation dialog. Must clear the feed drawer (tops out at 1060)
       and the global mobile "more" sheet (1100), both of which are navbar
       chrome and can be open on any page. */
    --z-modal: 1150;
    --z-toast: 2000;     /* app-install banner */
    --z-preview: 3000;   /* full-screen file preview */
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0f161a;
        --bg-panel: #1b2429;
        --bg-hover: #24333b;

        --text-main: #e6edf3;
        --text-muted: #9fb0bc;

        --border-subtle: #2a3942;

        --menu-bg: #1c252a;

        --link-color: #6cb6ff;
        --accent: #3b82f6;
        --success: #58d68d;
        --warning: #ffb347;
        --danger: #ff6b6b;
    }
}
