/* css/style.css */

/* Theme toggle — only the icon for the theme you'd SWITCH TO is visible.
   Both <i> tags (sun + moon) are rendered in the markup; CSS hides the
   inactive one based on the current data-bs-theme attribute. Used by both
   the admin sidebar (#theme-toggle in components/sidebar.blade.php) and the
   customer portal navbar. The "light" branch matches when the attribute is
   absent OR set to "light", since main.js removes the attribute entirely
   on the light path. */
html[data-bs-theme="dark"] #theme-toggle .theme-icon-dark { display: none; }
html:not([data-bs-theme="dark"]) #theme-toggle .theme-icon-light { display: none; }

/* Task overview (tasks/_overview_card, portal event page): tidy spacing for
   the paragraphs and bullet lists OverviewFormatter renders. */
.overview-text p:last-child, .overview-text ul:last-child { margin-bottom: 0; }
.overview-text ul { padding-left: 1.25rem; }

/* Sidebar and mobile top bar logos: both <img> tags are rendered and CSS
   shows the one for the active theme, as the customer portal header does. */
html[data-bs-theme="dark"] .logo-theme-light { display: none !important; }
html:not([data-bs-theme="dark"]) .logo-theme-dark { display: none !important; }


.bg-gradient-light-gray {
    /* Set a solid base color */
    background-color: #6c757d; 

    /* Apply a gradient that starts at 70% from the top */
    background-image: linear-gradient(to bottom, #6c757d 70%, #858796 100%);
    
    color: #ffffff; /* Keep the text white */
}


    :root {
        --side-nav-width: 250px;
        --side-nav-collapsed-width: 60px; /* If you ever want a collapsed icon-only version */
        --side-nav-bg: #343a40;
        --side-nav-color: #adb5bd;
        --side-nav-hover-bg: #495057;
        --side-nav-hover-color: #ffffff;
        --side-nav-active-bg: #0d6efd;
        --side-nav-active-color: #ffffff;
    }

    html[data-bs-theme="light"] {
        --side-nav-bg: #f8f9fa;
        --side-nav-color: #495057;
        --side-nav-hover-bg: #e9ecef;
        --side-nav-hover-color: #000000;
    }

    /* Base styles for the side navigation - will be fixed on desktop, offcanvas on mobile */
    .side-nav {
        background-color: var(--side-nav-bg);
        width: var(--side-nav-width);
        height: 100vh;
        display: flex;
        flex-direction: column;
        transition: width 0.3s ease; /* For potential future collapse */
        border-right: 1px solid var(--bs-border-color);
        /* Ensure it's fixed on desktop and positioned correctly */
        position: fixed; /* Keep this to fix it to the left edge */
        top: 0;
        left: 0;
        z-index: 1030; /* Should be lower than mobile backdrop (1040) but higher than normal content */
    }

    /* Adjust page content wrapper for desktop fixed sidebar */
    .page-content-wrapper {
        transition: margin-left 0.3s ease; /* Smooth transition if sidebar changes width */
    }

    @media (min-width: 992px) {
        /* On desktop, push the content wrapper to the right */
        .page-content-wrapper {
            margin-left: var(--side-nav-width); /* This pushes the content over */
        }
        /* Ensure the offcanvas is visible and not transformed on desktop */
        .side-nav.offcanvas-lg {
            transform: none !important; /* Overrides offcanvas hide transform */
            visibility: visible !important; /* Overrides offcanvas hide visibility */
            /* IMPORTANT: Bootstrap's offcanvas sets z-index: 1045 when open on mobile.
               On desktop, we want it fixed but not interfering with mobile z-index.
               The default z-index: 1030 in .side-nav is fine here, as there's no backdrop on desktop.
            */
        }
        /* No body padding-left needed if content-wrapper handles it */
        body {
            padding-left: 0; /* Reset if previously set for mobile */
        }
    }

    /* On mobile, account for the fixed top bar and let offcanvas handle the sidebar position */
    @media (max-width: 991.98px) {
        .page-content-wrapper {
            /* This padding ensures content starts below the mobile topbar */
            padding-top: 56px; /* Adjust if your mobile top bar height in topbar_mobile.html is different */
        }
        /* For offcanvas behavior on mobile, let Bootstrap handle position and z-index for the sidebar */
        .side-nav {
            position: fixed; /* Ensure it stays fixed at top/left */
            top: 0;
            left: 0;
            /* Bootstrap's offcanvas.js will add 'show' class and manage its z-index (to 1045)
               and transform when opened. The backdrop will be z-index 1040.
               Your fixed z-index: 1030 on .side-nav will be overridden by Bootstrap when it opens.
            */
        }
        /* Add padding to body to prevent content being hidden by fixed topbar when *not* using content-wrapper padding */
        body {
            padding-top: 56px; /* Match page-content-wrapper padding-top */
        }
    }


    /* --- Existing sidebar styles (keep these) --- */
    .side-nav-header {
        padding: 0.75rem 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .side-nav-title {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--bs-body-color);
        text-decoration: none;
    }

    .side-nav-menu {
        list-style: none;
        padding: 0;
        margin: 0;
        flex-grow: 1;
        overflow-y: auto;
    }

    .side-nav-menu-item a {
        display: flex;
        align-items: center;
        padding: 0.9rem 1.25rem;
        color: var(--side-nav-color);
        text-decoration: none;
        transition: background-color 0.2s, color 0.2s;
    }

    .side-nav-menu-item a:hover {
        background-color: var(--side-nav-hover-bg);
        color: var(--side-nav-hover-color);
    }

    .side-nav-menu-item.active > a {
        background-color: var(--side-nav-active-bg);
        color: var(--side-nav-active-color);
        font-weight: 500;
    }

    .side-nav-menu-item a .modus-icons {
        font-size: 1.25rem;
        margin-right: 1rem;
        width: 24px; /* Ensure alignment */
        text-align: center;
    }

    /* Arrow for collapsible menus */
    .side-nav-menu-item a.has-arrow::after {
        content: '\e90a'; /* Modus icon for 'chevron_down' */
        font-family: 'modus-icons';
        margin-left: auto;
        transition: transform 0.3s ease;
    }

    .side-nav-menu-item a.has-arrow[aria-expanded="true"]::after {
        transform: rotate(-180deg);
    }

    .side-nav-sub-menu {
        list-style: none;
        padding-left: 2rem; /* Indent sub-menu items */
        background-color: rgba(0,0,0,0.1);
    }
    html[data-bs-theme="light"] .side-nav-sub-menu {
        background-color: rgba(0,0,0,0.03);
    }
    .side-nav-sub-menu .side-nav-menu-item a {
        padding-left: 2.5rem;
    }

    .side-nav-footer {
        padding: 0.75rem;
        border-top: 1px solid var(--bs-border-color);
        display: flex;
        justify-content: space-around;
    }
    .side-nav-footer .menu-item {
        color: var(--side-nav-color);
        font-size: 1.5rem;
        padding: 0.5rem;
        border-radius: 0.25rem;
        transition: all 0.2s ease-in-out;
    }
    .side-nav-footer .menu-item:hover {
        background-color: var(--side-nav-hover-bg);
        color: var(--side-nav-hover-color);
    }
/* In your css/style.css file */

/* Hide the special download button by default in all browsers */
.download-lidar-btn {
    display: none;
}

/* ONLY show the button when the page is running inside Electron */
body.is-electron .download-lidar-btn {
    display: inline-block; /* Or 'block', depending on your layout */
}
html:not([data-bs-theme="dark"]) {
    --bs-body-bg: #F5F5F7;
    --bs-border-color: #238EA8;
}

/* ---------------------------------------------------------------------
   Phone task picker (/tasks).

   Job and Activity dropdowns replace the Open/Completed tabs below the md
   breakpoint; the panel then lists the same columns the desktop table
   shows for that task. Values are rendered by DataTables, so badges and
   buttons arrive already styled and need nothing here.
   --------------------------------------------------------------------- */
#pickerDetail .tp-detail {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
}

#pickerDetail .tp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

#pickerDetail .tp-row:first-child { padding-top: 0; }

#pickerDetail .tp-label {
    flex: 0 0 40%;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

#pickerDetail .tp-value { text-align: right; }

#pickerDetail .tp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    /* Right-aligned to match .tp-value above it, so the actions line up with
       the column of values rather than starting back at the label edge. */
    justify-content: flex-end;
}

/* Download ZIP stays disabled while the archive is prepared, and its label
   says so. Modus draws a disabled outline button in its light-theme grey at
   40% opacity, which is near-invisible on the dark theme. Draw it in the
   theme's amber at full strength so "Preparing ZIP…" reads clearly. */
.zip-download-btn:disabled {
    --bs-btn-disabled-color: var(--bs-warning);
    --bs-btn-disabled-border-color: var(--bs-warning);
    --bs-btn-disabled-opacity: 1;
}

/* ==========================================================================
   Bootstrap colour classes that Modus Bootstrap 2.0.12 leaves out.
   Used ~70 times across the app; an undefined class does nothing, so
   "Completed" / "FF/FL" badges were white text on nothing, the camber
   matching and import-wizard highlights never showed, and "Back to Reports"
   style buttons were bare text on blue headers (audit 2026-09-24).
   Defined once, from the theme's own variables, so light and dark mode both
   work. "info" maps to the theme's blue; "light" means light-on-colour.
   ========================================================================== */
.bg-info { background-color: var(--bs-primary) !important; color: #fff; }
.text-info { color: var(--bs-primary-text-emphasis) !important; }
.alert-info {
    --bs-alert-color: var(--bs-primary-text-emphasis);
    --bs-alert-bg: var(--bs-primary-bg-subtle);
    --bs-alert-border-color: var(--bs-primary-border-subtle);
    --bs-alert-link-color: var(--bs-primary-text-emphasis);
}
.alert-light {
    --bs-alert-color: var(--bs-body-color);
    --bs-alert-bg: var(--bs-tertiary-bg);
    --bs-alert-border-color: var(--bs-border-color);
}
.bg-light { background-color: var(--bs-tertiary-bg) !important; }
.text-light { color: #f1f1f6 !important; }

/* On coloured (bg-primary) card headers: a solid white button... */
.btn-light {
    --bs-btn-color: #252a2e; --bs-btn-bg: #fff; --bs-btn-border-color: #fff;
    --bs-btn-hover-color: #252a2e; --bs-btn-hover-bg: #f1f1f6; --bs-btn-hover-border-color: #f1f1f6;
    --bs-btn-active-color: #252a2e; --bs-btn-active-bg: #e0e1e9; --bs-btn-active-border-color: #e0e1e9;
    --bs-btn-disabled-color: #252a2e; --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: #fff;
}
/* ...and a white outline one (e.g. Undo on the dark toast). */
.btn-outline-light {
    --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .75);
    --bs-btn-hover-color: #252a2e; --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: #252a2e; --bs-btn-active-bg: #fff; --bs-btn-active-border-color: #fff;
}

/* Table row / header tints. Modus paints cells from --bs-table-bg and an inset
   shadow of --bs-table-bg-type, so both are set on the row or header. */
.table-primary, .table-success, .table-warning, .table-danger, .table-light {
    --bs-table-color: var(--bs-body-color);
}
/* Opaque pale fills with dark text, the same in light and dark mode
   (operator, 2026-09-24): the theme's *-bg-subtle shades turn near-black in
   dark mode. Modus paints cells from --bs-table-bg plus an inset shadow of
   --bs-table-bg-type, so both carry the colour. */
/* Selected / matched: solid theme blue and green with white text (operator,
   2026-09-24). */
.table-primary { --bs-table-bg: #0063a3; --bs-table-bg-type: #0063a3; --bs-table-color: #fff; }
.table-success { --bs-table-bg: #006638; --bs-table-bg-type: #006638; --bs-table-color: #fff; }
.table-warning { --bs-table-bg: #fff3cd; --bs-table-bg-type: #fff3cd; --bs-table-color: #252a2e; }
.table-danger  { --bs-table-bg: #f8d7da; --bs-table-bg-type: #f8d7da; --bs-table-color: #252a2e; }
.table-light   { --bs-table-bg: var(--bs-tertiary-bg); --bs-table-bg-type: var(--bs-tertiary-bg); }
/* A highlighted cell (not a whole row), e.g. the matching panel's warning. */
td.table-warning, th.table-warning { background-color: #fff3cd !important; box-shadow: none !important; color: #252a2e !important; }

/* Dark mode: deep navy instead of Bootstrap's charcoal (2026-11-17).
   Scoped to the dark attribute only, so light mode is untouched. */
html[data-bs-theme="dark"] {
    --bs-body-bg: #0b1526;            --bs-body-bg-rgb: 11, 21, 38;
    --bs-secondary-bg: #1c2b45;       --bs-secondary-bg-rgb: 28, 43, 69;
    --bs-tertiary-bg: #13203a;        --bs-tertiary-bg-rgb: 19, 32, 58;
    --bs-border-color: #2a3b5c;
    --side-nav-bg: #0f1b31;
    --side-nav-hover-bg: #1c2b45;
}
