:root {
    --primary-color: #009cbc !important;
    --primary-rgb: 0, 156, 188 !important;
    --menu-bg: #002e3d !important;
}

@media print {
    /* Default print settings */
    @page {
        size: A4 landscape;
        margin: 4rem 2rem;
    }

    html, body {
        font-size: 10px !important;
    }

    th, td {
        border-bottom: 1px solid black !important;
    }

    /* Remove certain elements from print view using a class */
    .no-print {
        display: none !important;
    }

    /* remove sidebar */
    #sidebar {
        display: none;
    }
    .mud-layout {
        --mud-drawer-width-left: 0 !important;
        --mud-drawer-width-right: 0 !important;
    }

    .mud-main-content {
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Remove MudPaper styling */
    .mud-paper {
        all: unset !important;
        display: block !important;
        background: #fff !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Remove certain table elements */
    .mud-table-toolbar,
    .mud-table-pagination,
    .custom-pagination {
        display: none !important;
    }

    /* --- UNDO flex & fixed heights for print --- */

    /* any paper/container that hosts a scrollable grid */
    .page-with-grid,
    .potting-top,
    .potting-table-container,
    .page-grid-container,
    .ps-grid-fixed,
    .page-grid {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        display: block !important;
    }

    /* let the table body expand instead of scroll */
    .ps-grid-fixed .mud-table-container,
    .page-grid .mud-table-container {
        overflow: visible !important;
        max-height: none !important;
    }

    /* disable sticky headers in print (otherwise they overlap rows) */
    .ps-grid-fixed thead.mud-table-head tr:first-child,
    .ps-grid-fixed thead.mud-table-head tr:nth-child(2),
    .page-grid thead.mud-table-head tr:first-child {
        position: static !important;
        top: auto !important;
    }
}

/* ===========================
   POTTING PAGE LAYOUT
   =========================== */

/* Overall potting page container: let the page body handle scrolling */
.potting-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* TOP PANEL (grid + filters etc.)
   - capped at ~70% of screen height
   - internal flex so the table area can scroll
*/
.potting-top {
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Container around the data grid inside the top panel */
.potting-table-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* BOTTOM PANEL (drop zones)
   - no internal scroll; page scroll will reach it
*/
.potting-bottom {
    flex: 0 0 auto;
    overflow: visible;
}

/* ===========================
   DATA GRID / TABLE SCROLLING
   =========================== */

/* DataGrid root (you applied Class="ps-grid-fixed" on MudDataGrid)
   - flex column so the internal table container can grow and scroll
*/
.ps-grid-fixed {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* This is where the rows actually scroll.
   Header + filter row stay sticky above.
*/
.ps-grid-fixed .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}

/* Sticky header row */
.ps-grid-fixed thead.mud-table-head tr:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
}

/* Sticky filter row just below the header */
.ps-grid-fixed thead.mud-table-head tr:nth-child(2) {
    position: sticky;
    top: 48px;
    z-index: 2;
    background: #fff;
}

/* Optional: pager height tweak */
.mud-table-pagination {
    min-height: 80px;
}

/* ===========================
   DROP ZONES (BOTTOM PART)
   =========================== */

.drop-container {
    height: 100%;
    align-items: stretch;
}

.potting-dropzone {
    flex: 1 1 0;
    min-width: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.hover-primary span:hover {
    color: var(--mud-palette-primary);
}

/* Darker border for unchecked checkbox */
.mud-checkbox-false svg path:nth-child(2) {
    stroke: #919191 !important;
    stroke-width: 1.5 !important;
    fill: none !important;
}

/* Light grey header for all MudDataGrids */
.mud-table-root > .mud-table-head > .mud-table-row:first-child > .mud-table-cell {
    background-color: #eaeaea !important;
}

/* ===========================
   Trip overview layout
   =========================== */
.unplanned-dropzone {
    min-height: 60px;
}

.unassigned-trip-card {
    border-left: 4px solid var(--primary-color);
    transition: 0.2s ease;
}

.ui-draggable {
    Cursor: grab;
    user-select: none;
}

.ui-droppable {
    /*border: 1px dashed rgba(0, 0, 0, 0.5);*/
    background-color: rgba(var(--primary-rgb), 0.1) !important;}

.truck-timeline {
    position: relative;
    display: grid;
    min-height: 60px;
}

.timeline-wrapper {
    position: relative;
}

.timeline-header {
    display: flex;
}

.timeline-hour-marker {
    flex: 1 1 0;
    text-align: center;
    position: relative;
}

/* Vertical line that spans header + all trucks */
.timeline-hour-marker::after {
    content: "";
    position: absolute;
    top: 0;
    left: 100%;
    width: 1px;
    height: 100vh;
    background-color: #e0e0e0;
}

/* Remove last line */
.timeline-hour-marker:last-child::after {
    display: none;
}

.truck-line {
    border-top: 1px solid #e0e0e0;
}

.timeline-slot {
    background: transparent;
    pointer-events: auto;
}

.timeline-trip {
    align-self: start;
    min-height: 60px;
    z-index: 2;
}

.text-white {
    color: white !important;
}

/* ========== GENERIC PAGE + GRID LAYOUT ========== */

/* Paper that should fill the viewport and contain a grid */
.page-with-grid {
    /* leave some space for app bar / outer margins */
    height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Wrapper around the MudDataGrid */
.page-grid-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Root of the MudDataGrid */
.page-grid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Only the table body scrolls, header & pager stay in place */
.page-grid .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}

/* Optional: sticky header on top of the scroll area */
.page-grid thead.mud-table-head tr:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
}
