﻿/* ============================================================================
   SECTION 1 — ROOT COLOURS, VARIABLES & GLOBAL DEFAULTS
   These variables give you unified colours across theCRM.
   Modify here once → reflected everywhere.
   ============================================================================ */

:root {
    --header-h: 56px; /* Height of top toolbar */
    --bs-primary: #C71A61;
    --bs-primary-rgb: 199, 26, 97;
    /* CRM brand colours */
    --tc-color-ps: #BAB812; /* Pastel yellow (Process) */
    --tc-color-st: #65613C; /* Slate olive (Status) */
    --tc-color-pk: #C71A61; /* Pink (Primary CRM colour) */
    --tc-color-ba: #BADA55; /* Lime (accent / highlight) */
    --tc-color-border: rgba(133,133,133,1);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    --dxbl-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    --dxbl-grid-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    --crm-row-focus: color-mix(in srgb, var(--crm-teal) 28%, white); /* focused/selected row */
    --crm-row-focus-hover: color-mix(in srgb, var(--crm-teal) 38%, white); /* hovering the focused row */
    --crm-row-hover: color-mix(in srgb, var(--crm-teal) 10%, white); /* plain hover / hot-track */
}


/* ============================================================================
   SECTION 1.1 — Global Body Defaults
   Full-height app, no scroll bleed, consistent font stack.
   ============================================================================ */

html, body {
    height: 100%;
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 16px;
    background-color: #EEEEEE !important;
    overflow: hidden; /* prevents page scroll behind modals/windows */
}

/* ============================================================================
   SECTION 2 — CORE LAYOUT (PAGE, SIDEBAR, HEADER, MAIN CONTENT AREA)
   Everything here defines the master UI frame of theCRM.
   ============================================================================ */

/* === Root application wrapper === */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.body-row {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.home-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}


/* === LEFT NAV SIDEBAR ============================================== */
.sidebar {
    flex: 0 0 260px; /* fixed width */
    overflow-y: auto; /* scroll only inside the sidebar */
}

/* Icon + text inside nav links */
nav .nav-link i {
    color: var(--tc-color-ba) !important;
    margin-right: 10px;
}

nav .nav-link .sv-normal {
    display: inline-block;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === MAIN COLUMN ==================================================== */
main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevents layout overflow */
    min-height: 0;
}

/* === TOP HEADER ROW ================================================= */
.top-row {
    flex: 0 0 var(--header-h);
    height: var(--header-h);
    display: flex;
    align-items: center;
    background-color: #404040 !important;
}

.top-left {
    color: white;
    font-size: 18px;
}

/* ============================================================================
   SECTION 2.1 — FULL-HEIGHT CONTENT MODE FOR LIST PAGES
   This fixes grids so they scroll inside the window, not the whole page.
   ============================================================================ */

.content--fullheight {
    height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding: 0 !important;
}

.content--fullheight .grid-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto; /* grid scrolls */
    display: flex;
    flex-direction: column;
    background-color: #fff;
    /*border-radius: 8px;*/
    box-shadow: 0px 0px 10px rgba(133,133,133,1);
}
.grid-container {
    padding:10px;
    margin:10px;
}

/* ============================================================================
   SECTION 3 — DESKTOP TILE DASHBOARD
   Used on theCRM Home screen. Flexible grid of tile panels.
   ============================================================================ */

.tiles-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    gap: 30px !important;
    width: 100%;
    margin: 0;
    padding: 26px;
    color: #65613C;
}

    /* Tile container */
    .tiles-grid .desktop-dock-panel {
        flex: 0 0 173px !important;
        height: 180px !important;
        padding: 10px;
        margin: 0 !important;
        border-top: 10px solid var(--tile-top, #000);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 0 10px rgba(133,133,133,1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* Tile header row */
.desktop-dock-panel-header {
    font-size: 1em;
    height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    min-width: 0;
}

.desktop-dock-panel-header-icon {
    font-family: "Font Awesome 7 Pro";
    font-weight: 900;
    font-size: 1.1em;
    margin-right: 6px;
    color: var(--tc-color-pk);
}

.desktop-dock-panel-header-heading {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The big tile number */
.desktop-count,
.desktop-count8,
.desktop-count9,
.desktop-count10,
.desktop-count11,
.desktop-count12,
.desktop-count13 {
    font-size: 1.6em;
    font-weight: 400;
    line-height: 1.2;
    margin: 6px 0;
    word-break: break-word;
}

/* Adjust when counts get long */
.desktop-count11 {
    font-size: 1.8em !important;
}

.desktop-count12 {
    font-size: 1.7em !important;
}

.desktop-count13 {
    font-size: 1.6em !important;
}

/* Search area inside a tile */
.desktop-dock-panel-searcharea {
    text-align: right;
    height: 32px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

    .desktop-dock-panel-searcharea .control-button-desktop {
        background: transparent;
        border: none;
        color: #65613c !important;
        font-size: 0.9em;
    }

    .desktop-dock-panel-searcharea .control-input {
        background: transparent;
        color: transparent !important;
        border: none;
        font-size: 0.9em;
        transition: 0.3s;
    }

        .desktop-dock-panel-searcharea:hover .control-input,
        .desktop-dock-panel-searcharea .control-input:focus {
            background: white;
            border-color: #ced4da;
            color: #495057 !important;
        }

/* Buttons row inside tile */
.desktop-dock-panel-buttons {
    margin-top: auto;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 09/09/2026: PG - Tighter tile buttons so icon + View + New fit on one row in a 160px tile */
.desktop-dock-panel-buttons .crm-button {
    padding: 0 8px;
    flex-shrink: 0;
}

.desktop-dock-panel-buttons .desktop-kanban-icon {
    padding: 0 6px;
}

/* 20/10/2026: PG - schedule tile icon, same spacing as kanban */
.desktop-dock-panel-buttons .desktop-schedule-icon {
    padding: 0 6px;
}

/* ===================================================================
   SECTION 4 — Home Icons (Schedule, Calendar, Kanban)
   =================================================================== */

.desktop-schedule-icon::before,
.desktop-calendar-icon::before,
.desktop-kanban-icon::before {
    font-family: "Font Awesome 7 Pro";
    font-weight: 400;
    font-size: 16px;
    color: #a5295f;
}

.desktop-schedule-icon::before {
    content: "\f550";
}

.desktop-calendar-icon::before {
    content: "\f073";
}

.desktop-kanban-icon::before {
    content: "\e64f";
}

/* Simple padding helper */
.pad20 {
    padding: 20px !important;
}

/* ============================================================================
   SECTION 5 — DxPopup / DxWindow (Record Windows + Modal Dialogs)
   Ensures that DevExpress windows match theCRM design, with fixed header,
   scrollable body, centred horizontally, and strong pink accents.
   ============================================================================ */

/* Main popup container */
.dxbl-popup {
    background-color: white !important;
    max-height: 80vh;
    z-index: 20000 !important;
}
/*.dxbl-popup-cell {
    pointer-events: none !important;
}*/
/*.dxbl-window,
.dxbl-window * {
    pointer-events: auto;
}*/
.dxbl-window-body {
    /*padding: 10px!important;*/
}
/* Popup content padding */
.dxbl-popup .dxbl-modal-content {
    padding: 20px !important;
}

.dxbl-popup-overlay {
    /*background: transparent !important;*/
    display: none !important;
}

.dxbl-window-overlay {
    pointer-events: none !important;
}
/* Popup header strip */
.dxbl-popup .dxbl-popup-header
/*, .dxbl-popup .dxbl-popup-header .dxbl-modal-title*/ {
    background-color: white !important;
    padding: 0 !important;
    margin: 0 10px 10px 0;
    border-bottom: 2px solid var(--tc-color-pk) !important;
    font-weight: 500;
    font-size: 20px !important;
}

    /* Close button spacing */
    .dxbl-popup .dxbl-popup-header .dxbl-popup-header-button {
        margin-right: 4px;
    }

/* Ensure window body is flex so inner content scrolls properly */
.crm-window .dxbl-window-dialog,
.crm-window .dxbl-popup-resizable-content,
.crm-window .dxbl-window-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
/* For some reason the newlinked window has padding */
.crm-window dxbl-popup-header,
.crm-window .dxbl-popup-header {
    padding: 0 !important;
    margin: 0 !important;
    /*border-radius: 8px 8px 0 0 !important;*/
    /*background-color: red!important;*/
}
    .crm-window .dxbl-popup-header .crm-win-header,
    .crm-window dxbl-popup-header .crm-win-header {
        width: 100% !important;
    }
.crm-window.dxbl-window-dialog {
    /*border-radius: 8px !important;*/
    overflow: hidden !important;
}
/* The outer window structure */
.crm-window {
    background-color: #fff;
    /*border-radius: 8px;*/
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    /*border: 1px solid var(--crm-teal);*/
    background-color: #EEE;
}

.crm-win-scroll {
    flex: 1 1 auto;
    min-height: 0; /* CRITICAL – allows shrinking inside DxWindow */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================================
   SECTION 6 — Phone Dialler / Twilio Call Bar
   Appears at the top of the app and inside record edit dialogs.
   ============================================================================ */

.phone-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

/* Flip phone icon if needed */
.flip-x {
    transform: scaleX(-1);
    display: inline-block;
}

/* Phonebook icon */
.phonebook-icon::before {
    font-family: "Font Awesome 7 Pro";
    font-weight: 400;
    content: "\f2b9";
    font-size: 1.4rem;
    color: #d7d7d7;
}

/* Dial input (compact) */
.phone-input {
    background: transparent !important;
    color: #fff !important;
    padding: 0.1rem 0.4rem;
    height: 1.8rem;
    font-size: 0.85rem;
}

    .phone-input::placeholder {
        color: #ccc;
    }

/* Vertical spacing for entire phone row */
.phone-row {
    margin: .6rem 0;
}

/* Incoming call banner */
.call-banner {
    border-radius: .75rem;
    padding: .6rem .8rem;
}

/* Buttons that sit next to phone input */
.dial-btn {
    border-radius: 4px;
    height: 1.8rem;
    min-width: 2.2rem;
    padding: 0 .5rem;
    line-height: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* ============================================================================
   SECTION 7 — Record Window Layout
   Controls the internal structure of theCRM’s new Blazor record windows:
   header, primary panel, tabs panel, scroll behaviour, spacing, etc.
   ============================================================================ */

/* Window shell (nav + content area) */
.crm-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

/* Main content area beside left nav */
.crm-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding: 10px; /* outer margin from nav */
}

/* Window header strip */
.crm-win-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    background-color: var(--crm-teal);
    color: #fff;
    padding: 6px 10px 1px 10px;
    /*border-top-left-radius: 8px;
    border-top-right-radius: 8px;*/
    border-top: 2px solid var(--tc-color-ba);
}

.crm-win-title {
    font-weight: 400;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-win-actions {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    gap: 0;
    color: var(--tc-color-ps);
}

/* Icon-only header buttons */
.crm-btn-icon.dxbl-btn {
    background: transparent;
    border: 0;
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem;
    border-radius: .375rem;
}

    .crm-btn-icon.dxbl-btn:hover {
        background: rgba(255,255,255,.08);
        color: #ffd761;
    }

/* Body of window (scrollable) */
.crm-win-body {
    flex: 1 1 auto;
    background: #FAFAFA;
    overflow: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Record window inner layout */
.crm-record-window {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0px;
}



/* Lower tabs panel */

    /* Tabs stretch and content scrolls */
.crm-details > .dxbl-tabs {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

/* Sub-list tab body: never shorter than 300px, never taller than 80% of the
   viewport. Grid scrolls inside this box; the window scrolls around it. */
.crm-details .dxbl-tabs-content-panel {
    min-height: 50cqh; /* 15/10/2026: PG - half the record window's content area (was 300px) */
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* clip here — the grid below does the scrolling */
}
    .crm-details .dxbl-tabs-content-panel .crm-tab-list,
    .crm-details .dxbl-tabs-content-panel .dxbl-grid {
        flex: 1 1 auto;
        min-height: 0;
    }

    .crm-details .dxbl-tabs-content-panel .dxbl-grid {
        overflow: auto;
    }

    /* 24/09/2026: PG - sub-list tabs only: let the DX tab-content wrapper shrink to the panel so the DxGrid gets a bounded height and scrolls (overrides flex:0 0 auto on .dxbl-tabs-content) */
    .crm-details .dxbl-tabs-content-panel .dxbl-tabs-content:has(> .crm-tab-list) {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* ============================================================================
   SECTION 8 — Global Scrollbar Theme
   Applies consistent thin scrollbars everywhere (Chrome, Edge, Safari, Firefox).
   ============================================================================ */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(186,218,85,0.45) transparent;
}

    /* Chrome / Edge / Safari */
    *::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    *::-webkit-scrollbar-thumb {
        background-color: rgba(186,218,85,0.45);
        border-radius: 4px;
        transition: background-color 0.3s, box-shadow 0.3s;
    }

        *::-webkit-scrollbar-thumb:hover {
            background-color: rgba(186,218,85,0.75);
            box-shadow: 0 0 4px rgba(186,218,85,0.4);
        }

    *::-webkit-scrollbar-track {
        background: rgba(240,240,240,0.05);
    }

/* Dark mode variants */
@media (prefers-color-scheme: dark) {
    * {
        scrollbar-color: rgba(186,218,85,0.65) rgba(255,255,255,0.05);
    }

        *::-webkit-scrollbar-thumb {
            background-color: rgba(186,218,85,0.65);
        }

            *::-webkit-scrollbar-thumb:hover {
                background-color: rgba(186,218,85,0.85);
                box-shadow: 0 0 4px rgba(186,218,85,0.6);
            }

        *::-webkit-scrollbar-track {
            background: rgba(30,30,30,0.25);
        }
}

/* 24/09/2026: PG - DevExpress draws its own div scrollbar (ignores ::-webkit-scrollbar) — recolour thumb to match global green theme */
.dxbl-scroll-viewer {
    --dxbl-scroll-viewer-vert-scroll-bar-width: 6px;
    --dxbl-scroll-viewer-vert-scroll-bar-hover-width: 6px;
    --dxbl-scroll-viewer-hor-scroll-bar-height: 6px;
    --dxbl-scroll-viewer-hor-scroll-bar-hover-height: 6px;
}

    .dxbl-scroll-viewer > .dxbl-scroll-viewer-vert-scroll-bar > .dxbl-scroll-viewer-scroll-thumb,
    .dxbl-scroll-viewer > .dxbl-scroll-viewer-hor-scroll-bar > .dxbl-scroll-viewer-scroll-thumb {
        background-color: rgb(186,218,85);
        border-radius: 4px !important;
    }

/* ============================================================================
   SECTION 9 — DxGrid Global Theme (Header, Body, Toolbar)
   Clean, borderless CRM grid style used across all object lists.
   ============================================================================ */

.dxbl-grid {
    border: none !important;
    box-shadow: none !important;
}

/* Remove header + toolbar chrome line */
.dxbl-grid-toolbar-container,
.dxbl-grid-top-panel,
.dxbl-grid-header-row {
    border-bottom: none !important;
    color: var(--crm-teal)!important;
}

/* Header row height + white BG */
.dxbl-grid .dxbl-grid-header-row {
    background-color: white;
    height: 32px;
    font-size: 0.85rem;
}

/* Remove header action borders */
.dxbl-grid .dxbl-grid-header .dxbl-grid-action {
    border: none !important;
}

/* Grid body font size */
.dxbl-grid * {
    --dxbl-grid-font-size: 0.92rem !important;
}

/* Remove internal borders */
.dxbl-grid .dxbl-grid-table td,
.dxbl-grid .dxbl-grid-table th {
    border: none !important;
}

/* Add subtle row separators */
.dxbl-grid .dxbl-grid-table tr td {
    border-bottom: 1px solid #e5e5e5 !important;
}

/* ============================================================================
   SECTION 10 — DxGrid Search Bar, Group Panel & Misc
   Makes search bar full-width, improves placeholder, aligns spacing.
   ============================================================================ */

/* Stretch search box across grid width */
.dxbl-grid-search-box-container,
.dxbl-grid-group-panel-container {
    display: flex;
    flex: 1 1 100%;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 0 6px 0 !important;
    box-sizing: border-box;
}

    /* Inner search input */
    .dxbl-grid-search-box-container .dxbl-text-edit-input,
    .dxbl-text {
        width: 100% !important;
        font-size: 1.1em;
        padding: 6px;
        color: rgb(33,37,41);
    }

/* Group panel styling */
.dxbl-grid-group-panel-container {
    align-items: center;
    padding: 6px 10px;
    margin-top: 4px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background-color: #f8f9fa;
}

    /* Group panel placeholder look */
    .dxbl-grid-group-panel-container .dxbl-text {
        font-style: italic;
        color: #6c757d;
        font-size: 1rem;
        margin: 0 !important;
    }

/* Clamp text inside cells to max 2 lines */
.crm-cell-2line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.35;
    max-height: 3.3em;
    min-height: 1.6em;
}

.crm-cell-2line a {
    color: inherit;
    text-decoration: none;
}
.grid-title{
    font-size:1.3em;
    font-weight: 500;
    color:var(--crm-teal);
}
.grid-title-summary {
    color: var(--tc-color-pk);
    font-size: .9rem;
}
.grid-title-icon {
    color: var(--tc-color-pk);
    margin-right:4px;
}
/* ============================================================================
   SECTION 11 — DxGrid Editing Styles
   Makes edit row stand out slightly, aligns inputs.
   ============================================================================ */
/* Edit row highlight */
.dxbl-grid-edit-row {
    background-color: white;
    box-shadow: 0px 0px 10px rgba(133,133,133,1);
    height: 40px;
}

.data-edit-cell {
    border-color: white !important;
}

/* Edit row textboxes */
/*.crm-grid-editing .dxbl-text-edit-input {
    border: 1px solid rgb(229,229,229);
    padding: 5px;
    width: 100% !important;
}*/
/* 13/10/2026: PG - inline-edit dropdowns get the same white box as inline-edit text boxes (25.1 root element is <dxbl-combo-box>) */
/*dxbl-combo-box.crm-grid-editing {
    background-color: #fff !important;
    border: 1px solid rgb(229,229,229) !important;
    border-radius: 3px;
}*/

/* ============================================================================
   SECTION 12 — Funnel Icon Override (Replace built-in SVG)
   Makes filter icon match theCRM styling + Pink active state.
   ============================================================================ */

.dxbl-grid-filter-menu-funnel-btn svg {
    display: none !important;
}

.dxbl-grid-filter-menu-funnel-btn::before {
    font-family: "Font Awesome 7 Pro";
    font-weight: 400;
    content: "\f1de"; /* sliders-h */
    font-size: 14px;
    line-height: 1;
    color: var(--tc-color-ba);
}

.dxbl-grid-filter-menu-funnel-btn.dxbl-grid-filter-menu-funnel-btn-active::before {
    color: var(--tc-color-pk);
}

.dxbl-grid-header-cell-filtered
.dxbl-grid-filter-menu-funnel-btn
.dxbl-grid-filter-menu-funnel-btn-filled::before {
    color: var(--tc-color-pk);
}

/* strongest selector */
.dxbl-grid-filter-menu-funnel-btn-filled::before {
    color: var(--tc-color-pk) !important;
}


/* ============================================================================
   SECTION 13 — Header Icons, Buttons, Links
   Styling used in record windows, toolbar icons, pink accents, etc.
   ============================================================================ */

/* Generic icon button inside record window header */
.crm-btn-icon.dxbl-btn {
    background: none;
    border: none;
    padding: .25rem;
    font-size: 1.2rem; /* controls icon size */
    color: #fff;
}

    .crm-btn-icon.dxbl-btn:hover {
        color: #ffc107; /* subtle yellow hover */
    }

/* Lime text utility (used for top-right header items) */
.lime-text {
    color: var(--tc-color-ba) !important;
    text-decoration: none !important;
}

.top-right {
    display: flex;
    justify-content: end;
    align-items: center;
    padding-right: 3px;
    font-size: 1.2em;
}

/* Hide Blazor error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f2dede;
    color: #a94442;
    padding: 0.6rem 1.25rem;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    z-index: 1000;
}

    #blazor-error-ui .reload,
    #blazor-error-ui .dismiss {
        cursor: pointer;
        text-decoration: underline;
    }

/* Pink toolbar icons */
.crm-pink,
.crm-pink .dxbl-icon,
.crm-pink i,
.crm-pink .dxbl-text {
    color: var(--tc-color-ba) !important;
    font-size: 1.1em;
}

.crm-pink-active {
    color: var(--tc-color-pk);
    transition: color 0.25s ease;
    font-size: 1.1em;
}

.crm-pink-cell {
    color: var(--tc-color-pk) !important;
}

.toolbar-button {
    color:var(--crm-teal);
    font-size: 1.0em;
}

/* ============================================================================
   SECTION 14 — CRM Window Manager
   Minimised window bar, floating manager toolbar, window centering.
   ============================================================================ */

/* Container element that hosts windows (right side of CRM) */
.rightcontent {
    position: relative;
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0;
}


/* Floating toolbar showing window count */
.crm-windowmanager-toolbar {
    position: fixed;
    left: 80px;
    bottom: 20px;
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 60, 82, 0.85);
    border: 1px solid var(--tc-color-ba);
    border-radius: 10px;
    padding: 6px 10px;
    backdrop-filter: blur(4px);
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
}

.crm-windowmanager-count {
    margin-left: 6px;
    font-size: 0.85rem;
    color: var(--tc-color-ba);
}

/* Minimized windows bar (bottom-left stack) */
.crm-minimized-bar {
    position: fixed;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 99999;
}

.crm-minimized-window {
    background-color: var(--crm-teal);
    color: white;
    border: 1px solid var(--tc-color-ba);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

    .crm-minimized-window:hover {
        background-color: var(--tc-color-pk);
        color: #fff;
    }

/* ============================================================================
   SECTION 15 — PDF Viewer & Quote Actions
   Ensures viewer fills window and quote actions remain visible.
   ============================================================================ */

.pdf-viewerwrapper {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: 10px !important;
}

.pdf-viewer {
    flex: 1 1 auto;
    width: 100%;
    height: 100% !important;
    min-height: 0;
    display: flex;
    margin-top: 10px;
}

/* Quote accept/reject buttons area */
.quote-actions {
    flex-shrink: 0;
    text-align: center;
}

/* ============================================================================
   SECTION 16 — Utility Classes & Field Separators
   Helpful small classes used across theCRM.
   ============================================================================ */

/* General padding helper */
.pad20 {
    padding: 20px !important;
}

/* Fieldset separator label (e.g., “Section Name”) */
.control-caption-separator {
    display: block;
    width: 100%;
    padding-bottom: 4px;
    margin-bottom: 6px;
    font-weight: 600;
    color: inherit;
}

/* 08/09/2026: PG - formpagebreak field: full-width divider with the page caption in a pill */
.crm-pagebreak {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0 .5rem;
}

.crm-pagebreak__pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--crm-pagebreak-accent);
    color: var(--crm-pagebreak-accent);
    background: #fff;
    background: color-mix(in srgb, var(--crm-pagebreak-accent) 8%, #fff);
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
}

.crm-pagebreak__line {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(to right, var(--crm-pagebreak-accent), transparent);
}

.crm-design-mode .crm-pagebreak-field {
    cursor: grab;
}

.control-caption,
.control-caption-readonly {
    color: var(--crm-teal) !important;
    font-size: 0.85rem !important;
}

/* Read-only fields: washed-out caption to signal not editable */
.control-caption-readonly {
    color: color-mix(in srgb, var(--crm-teal) 55%, white) !important;
}

/* First field on a form gets heavier label */
.first-field label {
    font-weight: 600;
}

/* Make inputs stretch full width */
.control-control .dxbl-textedit,
.control-control .dxbl-memo {
    width: 100%;
}

/* Placeholder for sortable form layout */
.sortable-field {
}

/* Phonebook, call icons etc. */
.phone-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.flip-x {
    transform: scaleX(-1);
}

.phonebook-icon::before {
    font-family: "Font Awesome 7 Pro";
    font-weight: 400;
    font-size: 1.4rem;
    color: #d7d7d7;
    content: "\f2b9"; /* address-book */
}

/* Dial input compact style */
.phone-input {
    background-color: transparent !important;
    color: #fff !important;
    padding: 0.1rem 0.4rem;
    height: 1.8rem;
    font-size: 0.85rem;
}

    .phone-input::placeholder {
        color: #ccc;
        opacity: 1;
    }

.phone-row {
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

.call-banner {
    border-radius: .75rem;
    padding: .6rem .8rem;
}

.dial-btn {
    border-radius: 4px;
    height: 1.8rem;
    min-width: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .5rem;
    line-height: 1;
}

/* SECTION 17 — trailing icon INSIDE the input (email, url, phone)
   Overlaid like the DevExpress calendar/chevron icons — takes no layout space. */
.control-control {margin-top: 0;}

.control-control .input-group {
    position: relative;
    display: block; /* neutralise d-flex — no side-by-side layout */
}

.control-control .input-group .flex-grow-1 {
    width: 100%;
}

.control-control .input-group .dxbl-input {
    padding-right: 36px !important; /* keep text clear of the icon */
}

    .control-control .input-group > .btn.btn-outline-secondary {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 1px;
        height: auto; /* override the 40px — stretch to input height */
        width: 34px;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none !important;
        background: transparent !important;
        color: var(--tc-color-pk);
        z-index: 2;
    }

.control-control .input-group > .btn.btn-outline-secondary:hover {
    color: var(--crm-teal);
}

.control-control .input-group > .btn.btn-outline-secondary:disabled {
    color: #ccc;
}

.control-control .input-group > .btn.btn-outline-secondary i {
    font-size: 15px;
    line-height: 1;
}

/* 24/09/2026: PG - two icon buttons in one field (phone + WhatsApp): step the earlier button left so they sit side by side instead of overlapping */
.control-control .input-group > .btn.btn-outline-secondary:nth-last-child(2) {
    right: 25px;
}

/* 24/09/2026: PG - two icon buttons: widen the text's right padding so it stays clear of both icons */
.control-control .input-group:has(> .btn.btn-outline-secondary ~ .btn.btn-outline-secondary) .dxbl-input {
    padding-right: 70px !important;
}

/* DevExpress editor buttons (combobox chevron, date calendar, spin arrows,
   clear button) — no divider line, no button chrome */
.control-control .dxbl-text-edit .dxbl-btn,
.control-control .dxbl-combobox .dxbl-btn,
.control-control .dxbl-date-edit .dxbl-btn,
.control-control .dxbl-spin-edit .dxbl-btn {
    border: none !important;
    border-left: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ============================================================================
   SECTION 18 — Base Public Form Styling (NO .crm-public-form prefix)
   These are the default styles for public forms AND CRM forms unless overridden.
   Public override sheet will re-add .crm-public-form to scope it.
   ============================================================================ */

/* Reduce turnstile widget */
.turnstile-inline {
    display: inline-block;
    transform: scale(0.7);
    transform-origin: left center;
}

/* Root background + text defaults */
body, html {
    background-color: #fff !important;
}

/* Remove reconnect UI (Blazor auto reconnect) */
.blazor-error-ui,
.components-reconnect-modal,
.components-reconnect-show,
#components-reconnect-modal,
#components-reconnect-modal.show,
#components-reconnect-modal-overlay {
    display: none !important;
    visibility: hidden !important;
    background: transparent !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Form wrapper base appearance */
.crm-form-complete,
.crm-form-loading {
    /*font-family: "Segoe UI", Roboto, Arial, sans-serif;*/
    color: #444;
    background-color: #fff !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 15px !important;
    box-sizing: border-box;
}

/* Containers */
.page .container,
.page .container-fluid {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove DevExpress wrapper chrome */
/* 13/10/2026: PG - white instead of transparent so editors look the same on forms and in the grid edit row; .dxbl-combobox removed (no such class in 25.1, combos are <dxbl-combo-box class="dxbl-text-edit">) */
.dxbl-text-edit,
.dxbl-date-edit,
.dxbl-spin-edit,
.dxbl-memo {
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Core DevExpress input styling */
.dxbl-input,
.dxbl-list-editor-input,
.dxbl-date-edit-input,
.dxbl-textarea {
    width: 100% !important;
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    padding: 4px 8px !important; /* 15/10/2026: PG - was 6px 10px */
    font-size: 14px !important; /* 15/10/2026: PG - was 16px, closer to v1 */
    height: 36px !important; /* 15/10/2026: PG - was 42px */
    background-color: #fff !important;
    color: #444 !important;
    box-shadow: none !important;
}

/* Dropdown specific */
.dxbl-combobox .dxbl-list-editor-input {
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    background-color: #fff !important;
    height: 36px !important; /* 15/10/2026: PG - was 42px */
}

/* Memo fields */
textarea.dxbl-input,
.dxbl-memo textarea {
    resize: vertical;
    line-height: 1.4;
    min-height: 80px !important;
}

/* Labels */
label {
    text-transform: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #555 !important;
    margin-bottom: 4px !important;
}

    /* Required marker */
    label.required::after {
        content: " *";
        color: #d9534f;
        font-weight: 600;
    }

/* Required field highlighting */
.dxbl-input.required:invalid,
input.required:invalid,
textarea.required:invalid {
    border-color: #d9534f !important;
}

/* Field spacing */
/* 15/10/2026: PG - was 14px on top of the g-3 row gap - too far apart vs v1 */
.row.g-3 > div {
    margin-bottom: 4px;
}

/* 15/10/2026: PG - editor text on forms, whatever DevExpress calls its inner input (was 16px) */
.control-control input:not([type=checkbox]):not([type=radio]),
.control-control textarea {
    font-size: 14px !important;
}

/* Submit button */
.crm-submit {
    background-color: #b93b63;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
}

    .crm-submit:hover {
        background-color: #a22e54;
    }

/* Focus behaviour */
.dxbl-input:focus,
.dxbl-list-editor-input:focus,
textarea.dxbl-input:focus {
    border-color: #b93b63 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(185, 59, 99, 0.15) !important;
}

/* Fix DevExpress editor containers */
.dxbl-editor-container,
.dxbl-list-editor-input-container {
    min-height: unset !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Completion message */
.crm-form-complete {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

/* Responsive column width enforcement */
.col-md-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

.col-md-4 {
    flex: 0 0 33.3333% !important;
    max-width: 33.3333% !important;
}

.col-md-3 {
    flex: 0 0 25% !important;
    max-width: 25% !important;
}

.col-md-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.row {
    flex-wrap: wrap !important;
}

/* ============================================================================
   Sub tabs
   ============================================================================ */
/* inactive tab */
.crm-tabs {
    background-color:white;
}
.crm-tab-list {
    margin: 10px;
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.crm-tabs .dxbl-tabs-item:not(.dxbl-active) {
    color: #666;
    font-weight: 500;
    padding: 10px 16px;
    border-bottom: 2px solid transparent;
}

/* active tab */
.crm-tabs .dxbl-tabs-item.dxbl-active {
    color: #0d6efd !important;
    font-weight: 600;
    border-bottom: 2px solid #0d6efd;
}

    /* ensure active tab text inherits color */
    .crm-tabs .dxbl-tabs-item.dxbl-active .dxbl-tabs-text {
        color: inherit !important;
    }

/* optional bottom border for tab row */
.crm-tabs .dxbl-tabs-nav {
    border-bottom: none;
}

.crm-upload-wrapper input[type=file] {
    margin-bottom: 10px;
}

.crm-upload-list {
    list-style: none;
    padding-left: 0;
}

    .crm-upload-list li {
        margin-bottom: 4px;
    }

    .crm-upload-list a {
        text-decoration: none;
    }

/* 09/03/2026 - Loading bar */
.crm-progress-bar {
    position: fixed;
    top: 53px; /* height of your header */
    left: 0;
    height: 3px;
    width: 30%;
    background: var(--tc-color-ba);
    z-index: 9999;
    animation: crm-progress 1.2s ease-in-out infinite;
}

@keyframes crm-progress {
    0% {
        left: -30%;
        width: 30%;
    }

    50% {
        width: 60%;
    }

    100% {
        left: 100%;
        width: 30%;
    }
}
/* Window loading bar */
.crm-win-progress-bar {
    position: absolute;
    top: 0;
    left: -30%;
    height: 3px;
    width: 30%;
    background: var(--tc-color-ba);
    border-bottom: 1px solid var(--tc-color-ba);
    z-index: 9999;
    animation: crm-progress 1.2s ease-in-out infinite;
}

.crm-win-progress-bar-idle {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: var(--crm-teal);
    border-bottom: 1px solid var(--tc-color-ba);
}

/*.dxbl-popup-cell {background-color: red;}*/
.dxbl-popup-cell {
    pointer-events: none !important;
}
/* re-enable interaction for DevExpress popups (AI window) */
.dxbl-popup {
    pointer-events: auto !important;
}

    .dxbl-popup * {
        pointer-events: auto !important;
    }

/* Tabl List Stuff */
.tabCountBadge {
    color: #C71A61;
    font-weight: 600;
    /*margin-left: 4px;*/
    font-size: 0.7em;
    vertical-align: super;
}

.crm-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* 15/10/2026: PG - record windows only: lets the sub-list tabs size off the window (cqh). Not on .crm-content generally -
   size containment collapses auto-height windows (New Object / New Field / dropdown dialogs) to nothing */
.crm-record-window .crm-content {
    container-type: size;
}

.crm-primary {
    /*border-radius: 8px;*/
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
    margin: 10px 10px 0 10px;
    padding: 25px 10px 14px 10px; /* 15/10/2026: PG - bottom was 0; fields' margin-bottom cut to 4px so the panel needs its own */
    background-color: white;
    flex: 0 0 auto;
    overflow: visible;
}
.crm-primary--standalone {
    margin-bottom: 10px;
}
.crm-details {
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
    margin: 5px 10px 10px 10px;
    padding: 0;
    flex: 0 0 auto; /* natural height — no longer capped by window */
    display: flex;
    flex-direction: column;
    overflow: visible; /* no clipping */
}

    .crm-details .dxbl-tabs {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        padding-bottom: 2px;
    }

    .crm-details .dxbl-tabs-content {
        flex: 0 0 auto;
        overflow: visible; /* was auto — this was the green scrollbar */
    }

/* ============================================================================
   SECTION 19 — Design Mode (field drag & drop)
   Toggled from the record window's compass button. Fields get an outline and a
   grab cursor so it's obvious what can be moved.
   ============================================================================ */

/* Design mode: floating "add existing field" panel. Styled to match the
   minimized-windows bar — teal, ba-green border, 6px radius. */
.crm-addfield-panel {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--crm-teal);
    color: white;
    border: 1px solid var(--tc-color-ba);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.crm-addfield-panel__title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    color: #fff;
    cursor: grab;
    user-select: none;
}

    .crm-addfield-panel__title i {
        color: var(--tc-color-ba);
        margin-right: 4px;
    }

.crm-addfield-panel select {
    max-width: 180px;
}

.crm-addfield-panel__btn {
    background-color: transparent;
    color: #fff;
    border: 1px solid var(--tc-color-ba);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

    .crm-addfield-panel__btn:hover {
        background-color: var(--tc-color-pk);
        border-color: var(--tc-color-pk);
    }

    .crm-addfield-panel__btn i {
        color: var(--tc-color-ba);
    }

    .crm-addfield-panel__btn:hover i {
        color: #fff;
    }

/* Design mode: per-field edit/remove buttons (rendered only when DesignMode). */
.crm-field-actions {
    position: absolute;
    top: 2px;
    right: 4px;
    display: flex;
    gap: 2px;
    z-index: 5;
}

.crm-field-actions__btn {
    background: var(--crm-teal);
    color: #fff;
    border: 1px solid var(--tc-color-ba);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

    .crm-field-actions__btn:hover {
        background: var(--tc-color-pk);
        border-color: var(--tc-color-pk);
    }
/* CRM - Add Field Panel*/

.crm-design-mode .sortable-field {
    position: relative;
    outline: 1px dashed var(--tc-color-border);
    outline-offset: -2px;
    border-radius: 4px;
    background-color: rgba(199, 26, 97, 0.03);
    cursor: grab;
    transition: outline-color .15s, background-color .15s;
}

    .crm-design-mode .sortable-field:hover {
        outline: 1px solid var(--tc-color-pk);
        background-color: rgba(199, 26, 97, 0.07);
    }

    .crm-design-mode .sortable-field:active {
        cursor: grabbing;
    }

/* Placeholder showing where the field will land. */
.crm-sortable-ghost {
    outline: 2px dashed var(--tc-color-pk) !important;
    background-color: rgba(186, 218, 85, 0.25) !important;
}

/* The field being dragged. */
.crm-sortable-chosen {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.crm-sortable-drag {
    opacity: 0.9;
}

/* For the desktop tiles */
.desktop-dock-panel-header {
    cursor: grab;
}

.desktop-dock-panel-header:active {
    cursor: grabbing;
}
/* Desktop tiles: pink drop placeholder, matching design mode's accent. */
.desktop-dock-panel.crm-sortable-ghost {
    background-color: rgba(199, 26, 97, 0.25) !important;
}

.crm-tab {
    border-bottom: 3px solid var(--tc-color-ba);
    padding-bottom: 4px;
    color: var(--crm-teal);
}
.crm-tab-fields {padding:25px 10px 0 10px!important}

.dxbl-tabs .dxbl-tab {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* remove DevExpress visual styling */
dxbl-tab-item.dxbl-tabs-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
dxbl-tab-item.crm-tab {
    padding: 6px 10px !important;
    margin-right: 6px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1.05em;
}

/* base tab */
.crm-tabs dxbl-tab-item.crm-tab {
    position: relative;
}
/* hover underline */
.crm-tabs dxbl-tab-item.crm-tab:hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 4px;
    background: var(--tc-color-pk);
}
.crm-tabs dxbl-tab-item.crm-tab {
    color: var(--tc-color-border) !important;
}
    .crm-tabs dxbl-tab-item.crm-tab.dxbl-active {
        color: var(--crm-teal) !important;
    }

/* active underline */
.crm-tabs dxbl-tab-item.crm-tab.dxbl-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 4px;
    background: var(--crm-teal);
}
    .crm-tabs dxbl-tab-item.crm-tab .crm-tab-header {
        font-weight: 500;
        font-size:1.05em;
    }

    /* fake bold without changing layout */
    .crm-tabs dxbl-tab-item.crm-tab.dxbl-active .crm-tab-header {
        text-shadow: 0 0 0 currentColor, 0.02px 0 currentColor;
    }

    /* MasterNav */
.body-row {
    overflow: hidden; /* add this */
}

.rightcontentwrapper {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - var(--header-h)); /* constrain total height */
}

/* 08/09/2026: PG - position:relative so z-index applies and the shadow paints over the record body */
.masternavwrapper {
    flex: 0 0 auto;
    position: relative;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    z-index: 1;
    background-color: white;
    min-height: 44px;
    padding-top: 2px;
}

.rightcontent {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background-color: #EEE;
}

.master-object-menu-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;

    /*border-bottom: 1px solid #e0e0e0;*/
    justify-content: flex-end;
}

/* Tiles on home page */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(8, 180px);
    grid-auto-rows: 200px;
    gap: 12px;
    align-content: start;
}

/* Backdrop */
.quicksearch-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
}

/* Modal container */
.quicksearch-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(500px, 90vw);
    max-height: 80vh;
    border-radius: 12px;
    z-index: 1060;
    overflow: hidden;
    cursor: default;
    user-select: none;
}

.quicksearch-header {
    cursor: move;
    user-select: none;
}

/* ✅ Only this part scrolls */
.quicksearch-results-area {
    max-height: 65vh;
    overflow-y: auto;
    padding: 0 8px 8px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.quicksearch-item {
    cursor: pointer;
    transition: background-color 0.15s;
}

    .quicksearch-item:hover {
        background-color: #f8f9fa;
    }

.quicksearch-color {
    width: 5px;
    height: 40px;
    border-radius: 3px;
}

/* ============================================================================
   Object Left Nav
   ============================================================================ */

/* Wrapper */
.crm-record-window {
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* LEFT NAV (hidden by default) */
.crm-left-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background-image: linear-gradient(to bottom, #145775 0%, #103c52 50%, #0a2634 100% );
    background-repeat: no-repeat;
    background-size: cover;
    color: #ddd;
    z-index: 1000;
    transform: translateX(-260px); /* off screen */
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 0; /* CRITICAL for flex scrolling */
    overflow-x: hidden;
}

/* OPEN */
.crm-left-nav.open {
    transform: translateX(0);
}

/* PINNED */
.crm-left-nav.pinned {
    transform: translateX(0);
}

    /* PUSH CONTENT WHEN PINNED */
    .crm-left-nav.pinned ~ .crm-main-and-timeline {
        margin-left: 260px;
    }

/* HEADER (pin icon area) */
.crm-left-nav-header {
    display: flex;
    justify-content: flex-end;
    padding: 8px;
    flex: 0 0 auto;
}

/* PIN BUTTON */
.pin-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
}

/* ============================================================================
   SCROLL + INNER LAYOUT (THIS WAS THE MISSING BIT)
   ============================================================================ */

/* container inside nav */
.crm-left-nav .nav-scrollable {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* sidebar wrapper */
.crm-left-nav .sidebar {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: transparent; /* inherit dark bg */
}

/* actual nav */
.crm-left-nav .nav {
    flex: 1 1 auto;
}

/* ============================================================================
   NAV LINK STYLING (MATCH MAIN NAV)
   ============================================================================ */

.crm-left-nav .nav-link {
    color: #ccc;
    font-size: 0.9rem;
}

    .crm-left-nav .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }

/* icons */
.crm-left-nav .nav-link i {
    color: var(--tc-color-ba);
    margin-right: 6px;
}

/* optional: collapsible headers slightly stronger */
.crm-left-nav .collapsible-header {
    font-weight: 400;
    font-size: .9rem;
}
.rotate-180 {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

.object-nav-left-button {
    color: var(--tc-color-ba);
}
    .object-nav-left-button:hover {
        color: var(--tc-color-pk);
    }
.object-nav-left-button {
    border: none;
    background-color: white !important;
    padding:1px;
}
.object-nav-left-buttons {
    margin-left: 10px;
}

.crm-avatar {
    width:40px;
    border-radius:20px;
}
.crm-display-name {
    font-size: 1.7em;
    color: var(--tc-color-ba);
}

.manage-layout {
    margin:auto;
    width:70%;
}

.crm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.25rem;
}

.crm-radio-group--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.crm-radio-option input[type="radio"]:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   SECTION 20 — HEADER PANELS (top-right icon dropdowns)
   Recent Items, Bookmarks, Favourites, Messages. Anchored under their icon in
   .top-row. Chrome reuses .crm-win-header / .crm-win-title from Section 7 so
   the panels match the record windows. Backdrop is a transparent full-screen
   div that closes on click — no JS document listener, nothing to dispose on
   circuit drop.
   ============================================================================ */

/* Positioning context for the panel. Sits inline with the other .top-right icons. */
.crm-header-panel-anchor {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Click-outside catcher. Transparent — unlike the quicksearch backdrop, these
   panels are non-modal and shouldn't dim the app behind them. */
.crm-header-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 1050;
}

.crm-header-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 420px;
    max-height: 60vh;
    background: #fff;
    /*border-radius: 8px;*/
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 1rem; /* reset — .top-right sets 1.2em for the icons */
    cursor: default;
}

    /* Record windows get this line from .crm-win-progress-bar-idle; panels don't
       have one, so add it directly. */
    .crm-header-panel .crm-win-header {
        border-bottom: 1px solid var(--tc-color-ba);
    }

/* --- Body --------------------------------------------------------------- */

.crm-header-panel-body {
    flex: 1 1 auto;
    min-height: 0; /* lets the list scroll rather than the panel grow */
    overflow-y: auto;
}

.crm-header-panel-message {
    padding: 20px 10px;
    text-align: center;
    color: var(--tc-color-border);
    font-style: italic;
}

/* --- List --------------------------------------------------------------- */

.crm-header-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Columns absent from a given panel (date, delete) simply don't render. */
.crm-header-panel-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
        "icon name object delete"
        "icon name date   delete";
    column-gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color .15s;
}

    .crm-header-panel-item:last-child {
        border-bottom: none;
    }

    .crm-header-panel-item:hover {
        background-color: rgba(199, 26, 97, 0.06);
    }

.crm-header-panel-item-icon {
    grid-area: icon;
    color: var(--tc-color-pk);
    font-size: 1em;
    width: 1.2em;
    text-align: center;
}

.crm-header-panel-item-name {
    grid-area: name;
    color: var(--crm-teal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9em;
    font-weight: 500;
}

.crm-header-panel-item-object {
    grid-area: object;
    justify-self: end;
    color: var(--tc-color-pk);
    font-size: .9em;
}

.crm-header-panel-item-date {
    grid-area: date;
    justify-self: end;
    color: var(--tc-color-border);
    font-size: .75em;
    white-space: nowrap;
}

/* Always visible, muted — matches the pencil/bin on the object lists. */
.crm-header-panel-item-delete {
    grid-area: delete;
    color: var(--tc-color-pk) !important;
    text-decoration: none !important;
    cursor: pointer;
    padding: 2px 4px;
    transition: color .15s;
}


/* --- Footer (bookmarks' "Manage Bookmarks" button lives here) ------------ */

.crm-header-panel-footer {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-top: 1px solid #e5e5e5;
    background-color: #fafafa;
    text-align: right;
}

/* --- Bookmark manager --------------------------------------------------- */

.crm-bookmark-manager-edit {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e5e5;
}

.crm-bookmark-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-bookmark-field--name {
    flex: 1 1 auto;
}

.crm-bookmark-swatches {
    display: grid;
    grid-template-columns: repeat(16, 16px);
    gap: 3px;
}

.crm-bookmark-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.15);
    cursor: pointer;
}

    .crm-bookmark-swatch.selected {
        outline: 2px solid var(--tc-color-pk);
        outline-offset: 1px;
    }



/* 08/09/2026: PG - Admin Dropdown Manager: white panel fills the window, lists scroll internally (no window scrollbar) */
.crm-dropmgr-panel {
    flex: 1 1 auto !important;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.crm-dropmgr-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px !important;
}

.crm-dropmgr-panel__row {
    flex: 1 1 auto;
    min-height: 0;
}

.crm-dropmgr-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.crm-dropmgr-list {
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    background: #fff;
}

.crm-dropmgr-list--disabled {
    background: #fafafa;
}




.crm-header-panel-item.selected {
    background-color: rgba(199, 26, 97, 0.12);
}

.crm-bookmark-manager-edit {
    background-color: #fff;
}

.crm-header-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #fff;
}

.crm-win-scroll:has(.crm-bookmark-manager),
.crm-win-scroll:has(.crm-message-manager),
.crm-win-scroll:has(.crm-reminder-list) {
    /*border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;*/
}
.crm-header-panel-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
        "icon name object delete"
        "icon name date   delete";
    column-gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color .15s;
}

.crm-header-panel-item-grip {
    grid-area: grip;
    color: var(--tc-color-border);
    cursor: grab;
}

.crm-header-panel-item-grip:active {
    cursor: grabbing;
}

.crm-reminder-list {
    padding: 10px;
    background-color: #fff;
    height: 100%;
}

/* --- DxGrid focused row / hover ----------------------------------------- */
/* Focused row */
.crm-grid .dxbl-grid-table tr.dxbl-grid-focused-row > td {
    background-color: var(--crm-row-focus) !important;
    color: #212529 !important;
}

/* Hovering the focused row — slightly deeper, not a different colour */
.crm-grid .dxbl-grid-table tr.dxbl-grid-focused-row:hover > td {
    background-color: var(--crm-row-focus-hover) !important;
}

/* Plain row hover (replaces the pink rgba hover and any lime mix) */
.crm-grid .dxbl-grid-table tr:hover td {
    background-color: var(--crm-row-hover) !important;
}

/* DevExpress hot-track / selection tint — keep it the same teal family */
.crm-grid .dxbl-grid-table tr.dxbl-grid-selected-row > td {
    background-color: var(--crm-row-focus) !important;
}

/* Empty rows stay inert */
.crm-grid .dxbl-grid-table tr.dxbl-grid-empty-row:hover td {
    background-color: transparent !important;
}

/* NAME links stay pink on teal rows */
.crm-grid .dxbl-grid-table tr.dxbl-grid-focused-row .crm-pink-cell,
.crm-grid .dxbl-grid-table tr.dxbl-grid-focused-row .crm-pink-cell a,
.crm-grid .dxbl-grid-table tr.dxbl-grid-focused-row .crm-pink-active {
    color: var(--tc-color-pk) !important;
}

/* --- Message manager ---------------------------------------------------- */

.crm-message-manager {
    display: flex;
    background-color: #fff;
    min-height: 400px;
}

.crm-message-list {
    flex: 0 0 320px;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
}

.crm-message-item {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name delete" "date delete";
}

    .crm-message-item.unread .crm-header-panel-item-name {
        font-weight: 600;
    }

.crm-message-preview {
    flex: 1 1 auto;
    padding: 12px;
    overflow-y: auto;
}

.crm-message-from {
    color: var(--tc-color-pk);
    font-size: .85em;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 12px;
}

.crm-message-body {
    color: var(--crm-teal);
}

/* --- Unread message badge ----------------------------------------------- */

.message-badge-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.message-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background-color: var(--tc-color-pk);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}


/* ============================================================================
   SECTION 21 — DUPLICATE CHECK PANEL
   Slide-in panel anchored top-right for existing records (dismissible),
   centred blocking overlay for new records pending save confirmation.
   Fields shown are driven by the Duplication | {Object}Fields system setting.
   ============================================================================ */
.crm-dupe-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
    pointer-events: none;
}

.crm-dupe-overlay--blocking {
    background: rgba(17, 40, 50, 0.55);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.crm-dupe-panel {
    background: var(--crm-surface, #1e2e35);
    border: 1px solid rgba(199, 26, 97, 0.4);
    border-radius: 12px;
    width: 380px;
    max-height: 99%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: all;
    overflow: hidden;
}

.crm-dupe-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(199, 26, 97, 0.08);
}

.crm-dupe-panel__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e88aab;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crm-dupe-panel__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s;
}

    .crm-dupe-panel__close:hover {
        color: #fff;
    }

.crm-dupe-panel__sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    padding: 0.6rem 1rem 0;
    margin: 0;
}

.crm-dupe-panel__list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.crm-dupe-panel__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

    .crm-dupe-panel__row:hover {
        background: rgba(255,255,255,0.07);
        border-color: rgba(199, 26, 97, 0.3);
    }

.crm-dupe-panel__row-fields {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.crm-dupe-panel__field {
    display: flex;
    flex-direction: column;
    min-width: 100px;
}

.crm-dupe-panel__field-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.35);
}

.crm-dupe-panel__field-value {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.crm-dupe-panel__row-action {
    color: rgba(255,255,255,0.25);
    font-size: 0.8rem;
    transition: color 0.15s;
}

.crm-dupe-panel__row:hover .crm-dupe-panel__row-action {
    color: #e88aab;
}

.crm-dupe-panel__footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.crm-dupe-panel__btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 7px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: opacity 0.15s;
}

    .crm-dupe-panel__btn:hover {
        opacity: 0.85;
    }

.crm-dupe-panel__btn--cancel {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.7);
}

.crm-dupe-panel__btn--save {
    background: var(--crm-teal);
    color: #fff;
}

/*Report viewer*/
.crm-report-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    display: flex;
    flex-direction: column;
}

/* ---------------------------------------------------------------
   Report Email Blade — slide-from-right panel inside report viewer
--------------------------------------------------------------- */
.crm-report-blade-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1049;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.crm-report-blade-backdrop--visible {
    opacity: 1;
    pointer-events: all;
}

.crm-report-blade {
    position: absolute;
    top: 20px;
    right: 0;
    height: calc(100% - 40px);
    width: 480px;
    max-width: 100%;
    background: #fff;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    /*border-radius: 8px 0 0 8px;*/
    border-radius: 0;
}

.crm-report-blade--open {
    transform: translateX(0);
}

.crm-report-blade__body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.crm-report-blade .crm-win-header {
    border-radius: 0;
    border-bottom: 1px solid var(--tc-color-ba);
}

.crm-report-blade__footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

/* ---------------------------------------------------------------
   Timeline object Blade — slide-from-right panel inside object window
--------------------------------------------------------------- */
.crm-timeline-blade {
    flex-shrink: 0;
    width: 28px;
    height: 100%;
    min-height: 0;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
}

    .crm-timeline-blade.open {
        width: 380px;
        box-shadow: -2px 0 6px rgba(0,0,0,0.08);
    }

.crm-timeline-tab {
    flex: 1 1 auto;
    background: white;
    color: var(--crm-teal);
    border: none;
    cursor: pointer;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 12px 0;
}

    .crm-timeline-tab:hover {
        background: var(--tc-color-ba);
    }

.crm-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #e8e8e8;
    background: white;
    color: var(--crm-teal);
    flex-shrink: 0;
}

.crm-timeline-header .crm-btn-icon,
.crm-timeline-header .pin-btn {
    background: none;
    border: none;
    color: var(--crm-teal);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
}
.crm-timeline-header .pin-btn, .crm-timeline-title {
    display:none;
}

.crm-timeline-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-timeline-filters {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.crm-timeline-search {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.crm-timeline-type-filter {
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    max-width: 120px;
}

.crm-timeline-icon {
    flex-shrink: 0;
    width: 100%;
    max-width: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--tc-color-pk);
    gap: 2px;
    padding-top: 4px;
}

.crm-timeline-icon-label {
    font-size: 8px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 44px;
    text-overflow: ellipsis;
}

.crm-timeline-blade.open .crm-timeline-icon {
    max-width: 20px;
}

.crm-timeline-blade.open .crm-timeline-icon-label {
    display: none;
}

.crm-timeline-blade.open .crm-timeline-header .pin-btn, .crm-timeline-blade.open .crm-timeline-title {
    display: inherit;
}

    .crm-timeline-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.crm-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.crm-timeline-body {
    flex: 1;
    min-width: 0;
    
    flex-direction: column;
    gap: 2px;
    display:none;
}
.crm-timeline-blade.open .crm-timeline-body {
    display: flex;
}

.crm-timeline-line1,
.crm-timeline-line2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

    .crm-timeline-line1 .crm-header-panel-item-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

.crm-timeline-status {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.crm-timeline-note {
    font-size: 13px;
    color: #777;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.crm-timeline-line1 .crm-header-panel-item-object {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Grid Footer Stuff */
.dxbl-grid-footer-row {
    background-color:white;
    font-weight: 400!important;
}

/* 04/09/2026 - New public paged form */
/* Public form - saving indicator */
.crm-public-form-saving {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    padding: 18px 28px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-family: var(--bs-body-font-family);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}


/* Public form - successful save toast */
.crm-public-form-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-family: var(--bs-body-font-family);
    font-size: 16px;
    text-align: center;
}

.crm-public-form-saving-text {
    margin-bottom: 10px;
    text-align: center;
}

.crm-public-form-progress {
    display: block;
    width: 250px;
    height: 12px;
}

/* ============================================================================
   Public Form - Page Navigation
   ============================================================================ */

.crm-form-page-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 20px 0;
}

.crm-form-page-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}


/* Back / Next */
.crm-page-nav-button {
    flex: 0 0 auto;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-family: var(--bs-body-font-family) !important;
    font-size: 15px;
    color: inherit;
    cursor: pointer;
}

    .crm-page-nav-button:hover:not(:disabled) {
        text-decoration: underline;
    }

    .crm-page-nav-button:disabled {
        opacity: 0.35;
        cursor: default;
    }


/* Individual page buttons */
.crm-form-page-tab {
    padding: 8px 14px;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    font-family: var(--bs-body-font-family) !important;
    font-size: 15px;
    color: inherit;
    cursor: pointer;
}

    .crm-form-page-tab:hover {
        text-decoration: underline;
    }

    .crm-form-page-tab.active {
        border-bottom-color: currentColor;
        font-weight: 600;
    }

.crm-public-form-page-loading-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
}

.crm-public-form-page-loading {
    padding: 18px 28px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-family: var(--bs-body-font-family) !important;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}


/* ===================================================================
   09/09/2026: PG - Kanban board (lives inside .grid-container like lists)
   =================================================================== */

/* ---- toolbar ---- */
.kanban-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 10px 6px;
}

    .kanban-toolbar .grid-title-summary {
        margin-left: 6px;
    }

.kanban-toolbar-filters {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-search {
    position: relative;
}

    .kanban-search i {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        color: #999;
        font-size: 0.8rem;
    }

    .kanban-search input {
        width: 200px;
        padding-left: 26px;
    }

.kanban-owner-filter {
    width: 170px;
}

.kanban-toolbar-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}

/* ---- board + columns ---- */
.kanban-board {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 12px;
    padding: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-start;
}

.kanban-column {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.kanban-column--completes {
    background: #f0f0f0;
}

.kanban-column-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--crm-teal);
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.kanban-column-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-column-count {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    background: var(--crm-teal);
    border-radius: 10px;
    padding: 1px 8px;
}

.kanban-column-body {
    flex: 1 1 auto;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    overflow-y: auto;
}

.kanban-column-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: #777;
    background: #fff;
    border-top: 1px solid #e5e5e5;
}

.kanban-column-total {
    font-weight: 600;
    color: var(--crm-teal);
}

/* ---- card ---- */
.kanban-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: grab;
    user-select: none;
}

    .kanban-card:hover {
        border-color: var(--crm-teal);
        box-shadow: 0 2px 6px rgba(0,0,0,.12);
    }

    .kanban-card.crm-sortable-ghost {
        opacity: .4;
    }

.kanban-card--rotten {
    background: #fffafb;
    border-color: #f3c9d4;
}

    .kanban-card--rotten .kanban-card-name {
        color: #8a6d75;
    }

.kanban-card-top {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.kanban-card-name {
    flex: 1 1 auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.kanban-card-open {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: 0 2px;
    color: #bbb;
    cursor: pointer;
    font-size: 0.8rem;
    visibility: hidden;
}

.kanban-card:hover .kanban-card-open {
    visibility: visible;
}

.kanban-card-open:hover {
    color: var(--tc-color-pk);
}

.kanban-card-subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--tc-color-pk);
    text-decoration: none;
    margin: 2px 0 4px 0;
}

    .kanban-card-subtitle i {
        margin-right: 4px;
    }

.kanban-card-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    line-height: 1.5;
}

.kanban-card-label {
    color: #999;
    white-space: nowrap;
}

.kanban-card-value {
    color: #444;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- card: pills row ---- */
.kanban-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 6px;
}

.kanban-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.kanban-pill--overdue {
    background: #fde8ec;
    color: var(--tc-color-pk);
}

.kanban-pill--today {
    background: #e6f4ea;
    color: #2e7d32;
}

.kanban-pill--future {
    background: #eef1f4;
    color: #555;
}

.kanban-pill--none {
    background: #fff4e0;
    color: #b26a00;
}

.kanban-pill--age {
    background: #eef1f4;
    color: #777;
}

/* ---- card: bottom row (value + avatar, always bottom-right) ---- */
.kanban-card-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    min-height: 22px;
}

.kanban-card-money {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--crm-teal);
    white-space: nowrap;
}

.kanban-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.kanban-avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-teal);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
}

/* ---- card: last activity line ---- */
.kanban-card-activity {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #eee;
    font-size: 0.72rem;
    color: #888;
}

    .kanban-card-activity i {
        margin-right: 4px;
    }

.kanban-card-activity--rotten {
    color: var(--tc-color-pk);
    font-weight: 600;
}

/* ============================================================================
   11/09/2026: PG - SECTION 3.1 — DESKTOP BLOCKS + CONFIGURE DESKTOP TOOLBAR
   Home page: floating configure panel, block containers (objects / bookmarks / dashboards
   / reports) their edit-mode drag headers and the corner resize grip.
   ============================================================================ */

/* Floating "Configure desktop" panel. Fixed bottom-RIGHT: the window manager
   toolbar already owns bottom-left. Light chrome (white, teal text, pink hover)
   so it reads as a different thing from the dark window manager bar. */
.desktop-toolbar {
    position: fixed;
    right: 10px;
    top: 110px;
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--tc-color-ba);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    color: var(--crm-teal);
}

.desktop-toolbar__title {
    font-size: 0.85rem;
    color: var(--tc-color-pk);
    white-space: nowrap;
    user-select: none;
}

    .desktop-toolbar__title i {
        margin-right: 4px;
    }

.desktop-toolbar__btn {
    background-color: transparent;
    color: var(--crm-teal);
    border: 1px solid var(--tc-color-ba);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

    .desktop-toolbar__btn:hover {
        background-color: var(--tc-color-pk);
        border-color: var(--tc-color-pk);
        color: #fff;
    }

    .desktop-toolbar__btn i {
        color: var(--tc-color-pk);
    }

    .desktop-toolbar__btn:hover i {
        color: #fff;
    }

.desktop-toolbar__select {
    max-width: 260px;
    height: 30px;
    padding: 2px 8px;
    border: 1px solid var(--tc-color-ba);
    border-radius: 6px;
    background-color: #fff;
    color: var(--crm-teal);
    font-size: 14px;
}

/* 11/09/2026: PG - Block container: a 9-column grid of square cells (--desktop-cell is set by
   crm-desktop.js = width / 9). dense packing lets small blocks fill gaps beside tall ones.
   Bottom padding leaves room so the floating panel never covers the last row. */
.desktop-blocks {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    grid-auto-rows: var(--desktop-cell, 190px);
    grid-auto-flow: row dense;
    align-items: stretch;
    width: 100%;
    padding-bottom: 70px;
}

/* Block: spans --cols x --rows cells (inline from the layout; --rows measured by JS for
   natural-height blocks). Column flex so the body scrolls, not the header/handle. */
.desktop-block {
    position: relative;
    grid-column: span var(--cols, 9);
    grid-row: span var(--rows, 1);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.desktop-block-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* Dashboard / report blocks: the viewer fills the body (they need a definite height).
       Same 26px padding as .tiles-grid so the viewer's edges line up with the tiles. */
.desktop-block-body--fill {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 26px;
}

    .desktop-block-body--fill > * {
        background-color: #fff;
        box-shadow: 0 0 10px rgba(133,133,133,1);
        border-radius: 8px;
        overflow: hidden;
    }

    .desktop-block-body--fill > * {
        flex: 1 1 auto;
        min-height: 0;
    }

/* Edit mode: match the tiles' reduced side padding */
.desktop-blocks--edit .desktop-block .desktop-block-body--fill {
    padding-left: 12px;
    padding-right: 12px;
}

/* Edit-mode stand-in for a live dashboard/report */
.desktop-block-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    color: var(--crm-teal);
    font-size: 1.1rem;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
}

    .desktop-block-placeholder i {
        font-size: 2.4rem;
        color: var(--tc-color-pk);
    }

/* Edit mode: each block gets a dashed outline and a draggable title bar */
.desktop-blocks--edit .desktop-block {
    outline: 1px dashed var(--tc-color-border);
    outline-offset: -2px;
    border-radius: 4px;
    background-color: rgba(199, 26, 97, 0.03);
    margin: 0 26px 1.5rem 26px;
}

    .desktop-blocks--edit .desktop-block:hover {
        outline: 1px solid var(--tc-color-pk);
    }

    .desktop-blocks--edit .desktop-block.desktop-block--resizing {
        outline: 2px solid var(--tc-color-pk);
        user-select: none;
    }

    /* Tiles inside an editing block keep their padding but lose the left/right so the outline hugs them */
    .desktop-blocks--edit .desktop-block .tiles-grid {
        padding-left: 12px;
        padding-right: 12px;
    }

.desktop-block-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: var(--crm-teal);
    color: #fff;
    border-top: 2px solid var(--tc-color-ba);
    border-radius: 4px 4px 0 0;
    font-weight: 500;
    cursor: grab;
    user-select: none;
}

    .desktop-block-header:active {
        cursor: grabbing;
    }

    .desktop-block-header i {
        color: var(--tc-color-ba);
    }

.desktop-block-header-size {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--tc-color-ba);
}

.desktop-block-header-remove {
    margin-left: 10px;
    color: #fff !important;
    cursor: pointer;
    padding: 0 4px;
}

    .desktop-block-header-remove:hover {
        color: var(--tc-color-pk) !important;
    }

/* Resize grip, bottom-right corner of the block (edit mode only) */
.desktop-block-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--crm-teal);
    color: var(--tc-color-ba);
    border: 1px solid var(--tc-color-ba);
    border-radius: 6px 0 4px 0;
    cursor: nwse-resize;
    user-select: none;
    touch-action: none;
    z-index: 5;
}

    .desktop-block-resize:hover {
        background-color: var(--tc-color-pk);
        border-color: var(--tc-color-pk);
        color: #fff;
    }

/* Drop placeholder for a whole block */
.desktop-block.crm-sortable-ghost {
    outline: 2px dashed var(--tc-color-pk) !important;
    background-color: rgba(186, 218, 85, 0.25) !important;
}

.desktop-block-empty {
    padding: 26px;
    color: var(--tc-color-border);
    font-style: italic;
}

/* ===================================================================
   20/10/2026: PG - Scheduler (ScheduleBoard.razor) - cards reuse .kanban-card*; only scheduler-specific overrides here
   =================================================================== */

.crm-schedule {
    height: calc(100% - 40px);
}

.schedule-resource-header {
    font-weight: 600;
    font-size: .85rem;
    color: #333;
}

.schedule-card {
    margin: 3px;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
}

    .schedule-card .kanban-card-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: normal;
    }

    .schedule-card .kanban-card-subtitle {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.schedule-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.schedule-card-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    background: color-mix(in srgb, var(--pill, #8a8a8a) 15%, white);
    color: color-mix(in srgb, var(--pill, #8a8a8a) 75%, black);
}

/* 20/10/2026: PG - dropdown HIGHLIGHT_HEX (v1 parity: text colour). FieldRenderer editors + CrmGrid cells.
                    Colour comes in --drop-hex so it can become a pill later with CSS only. */
.crm-drop-value--hex input {
    color: var(--drop-hex) !important;
}

.crm-drop-cell--hex {
    color: var(--drop-hex);
}

/* ===================================================================
   20/10/2026: PG - Route planner (RoutePlanner.razor) + schedule card route icon
   =================================================================== */

/* ---- schedule card icon ---- */
.schedule-card-route {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: 0 2px;
    color: #999;
    cursor: pointer;
    font-size: .85rem;
}

    .schedule-card-route:hover {
        color: var(--tc-color-pk);
    }

/* ---- layout ---- */
.route-planner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
    gap: 10px;
    background: #fff; /* 21/10/2026: PG - white like the kanban board, not the window grey */
}

/* 21/10/2026: PG - items aligned at the TOP so every caption is on one line, whatever the control's height */
.route-toolbar {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.route-toolbar-item {
    min-width: 220px;
    display: flex;
    flex-direction: column;
}

/* 21/10/2026: PG - room for the caption so Start time doesn't butt up against it */
.route-toolbar-item--check {
    min-width: 120px;
}
/* tick box vertically centred where the inputs are */
.route-check {
    flex: 1 1 auto;
    min-height: 34px;
    display: flex;
    align-items: center;
}

/* 21/10/2026: PG - Google Maps button in the pinned footer, lined up with the cards (48px time + 8 + 28px marker + 8) */
.route-gmaps {
    margin-left: 92px;
}

.route-toolbar-item--time {
    min-width: 140px;
}

.route-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    gap: 10px;
}

.route-stops {
    flex: 0 0 30%;
    min-height: 0;
    overflow: hidden; /* 21/10/2026: PG - the panel doesn't scroll; .route-stops-scroll does */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-stops-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.route-stops-footer {
    flex: 0 0 auto;
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
}

.route-map {
    flex: 1 1 auto;
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

/* ---- summary tiles ---- */
.route-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.route-summary-tile {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 10px;
}

.route-summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.route-summary-label {
    font-size: .7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ---- timeline: [time 48px] [marker 28px] [card] ----
   The vertical line is a 2px background on each row, centred in the marker column
   (48px time + 8px gap + 13px = 69px), so the letter circles always sit on top of it. */
.route-timeline {
    display: flex;
    flex-direction: column;
}

.route-tl-item,
.route-tl-leg {
    display: grid;
    grid-template-columns: 48px 28px 1fr;
    column-gap: 8px;
    background-image: linear-gradient(#d6d6d6, #d6d6d6);
    background-repeat: no-repeat;
    background-size: 2px 100%;
    background-position: 69px 0;
}

    /* line starts at the first circle and stops at the last one */
    .route-tl-item:first-child {
        background-size: 2px calc(100% - 14px);
        background-position: 69px 14px;
    }

.route-tl-item--last {
    background-size: 2px 14px;
}

.route-tl-time {
    padding-top: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.route-tl-orig {
    font-size: .7rem;
    font-weight: 400;
    color: #999;
}

.route-eta-changed {
    color: #e07b00; /* v1 orange */
    font-weight: 600;
}

.route-tl-marker {
    --dot: #999;
    justify-self: center;
    align-self: start;
    width: 24px;
    height: 24px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--dot);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-tl-marker--stop {
    --dot: #ea4335; /* Google's marker red, so the letters match the map pins */
}

.route-tl-card {
    min-width: 0;
    margin-bottom: 2px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.route-tl-item--endpoint .route-tl-card {
    background: #fafafa; /* 21/10/2026: PG - just off-white so Start/End still read as the ends */
}

.route-tl-title {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .route-tl-title i {
        margin-right: 4px;
        color: #888;
    }

.route-tl-title--link {
    color: var(--tc-color-pk);
}

    .route-tl-title--link:hover {
        text-decoration: underline;
    }

.route-tl-address {
    font-size: .75rem;
    color: #777;
}

.route-tl-details {
    margin-top: 4px;
    font-size: .75rem;
    color: #777;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.route-tl-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

/* ---- drive between two items ---- */
.route-tl-leg-text {
    padding: 6px 0;
    font-size: .72rem;
    color: #888;
}

    .route-tl-leg-text i {
        margin-right: 4px;
    }

.route-tl-dot {
    margin: 0 3px;
}