.min-vh-100 {
    min-height: 100vh;
}

:root {
    --background-color: #fff; /* default light mode background color */
    --table-border-color: #f2f2f2;
    color: #333; /* default text color */
}

/* Dark mode */
.dark-mode {
    --background-color: #333; /* dark mode background color */
    --table-border-color: #333;
    color: #fff !important; /* dark mode text color */
}

.darkmode-text {
    color: #000000 !important;
}

.navbar-lightmode .nav-link {
    color: #333;
    --background-color: #fff;
}

.navbar-darkmode .nav-link {
    --background-color: #343a40; /* Bootstrap's dark navbar background color */
    color: #ffffff; /* dark mode text color */
}

td p:last-child {
    margin-bottom: 0 !important;
}

/*html {
  font-size: 14px;
}*/

@media (min-width: 768px) {
    html {
        /*font-size: 16px;*/
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .container {
        max-width: 100vw;
        padding: 0 15px; 
    }

    .table-appointment-fixed td {
        font-size: 13px; 
    }

    .dark-mode .table-appointment-fixed td {
        font-size: 13px; 
    }
}

@media (min-width: 1600px) {
    .table-appointment-fixed td {
        font-size: 16px; 
    }
    .dark-mode .table-appointment-fixed td {
        font-size: 16px; 
    }
}



    pre {
        /*font-size: inherit;*/
        font-family: sans-serif;
    }

    .container {
        width: 100%;
        height: 100%;
        max-width: 98vw;
        max-height: 100vh;
        /*max-width: 1040px;  Adjust this value as needed
    margin: 0 auto; /* Center the container
    padding: 0 0px; /* Add some padding */
    }

    .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
        box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    }

    .table-appointment .darkmode-text {
        color: #000000 !important;
    }

.table-appointment-fixed {
    box-sizing: inherit;
    width: 98vw;
    table-layout: fixed;
    border-collapse: collapse;
}

    .col1 {
        width: 5%;
    }
    /*.col2 { width: 4%; }*/
    .col3 {
        width: 6%;
    }

    .col4 {
        width: 8%;
    }

    .col5 {
        width: 7%;
    }

    .col6 {
        width: 6%;
    }

    .col7 {
        width: 25%;
    }

    .col8 {
        width: 25%;
    }

    .col9 {
        width: 3%;
        padding: 0 !important;
    }

    .col10 {
        width: 4%;
        padding: 0 !important;
    }

    .col11 {
        width: 20px !important;
        padding: 0 !important;
    }

    .col12 {
        width: 20px !important;
        padding: 0 !important;
    }

    .col13 {
        width: 20px !important;
        padding: 0 !important;
    }

    .col14 {
        width: 126px !important;
        padding: 0;
    }

    td.col14 {
        padding: 0 !important;
    }

    th.col11, th.col12, th.col13 {
        writing-mode: vertical-rl;
        text-orientation: upright;
        letter-spacing: -7px;
        text-align: center;
        align-content: center;
        font-weight: 500;
        justify-content: center;
        padding: 8px !important;
    }

.table-appointment-fixed td {
    border-right: 2px solid var(--table-border-color);
    align-content: center;
    vertical-align: middle;
    /*font-size: 13px; Table font size - default 16px (does not include header row)*/
}

tr td:first-child {
    border-left: 2px solid var(--table-border-color);
    padding: 4px;
}

.dark-mode tr td:first-child {
    border-right: 2px solid var(--table-border-color);
    padding: 4px;
}

.dark-mode .table-appointment-fixed td {
    border-right: 2px solid var(--table-border-color);
    /* font-size: 13px;*/
}

    tr td:last-child, tr th:last-child {
        border-top: none;
        border-bottom: none;
        border-right: none;
        padding-left: 1px;
        padding-right: 0;
    }

    .dark-mode tr td:last-child, .dark-mode tr th:last-child {
        border-top: none;
        border-bottom: none;
        border-right: none;
        padding-left: 1px;
        padding-right: 0px;
    }

tr td:last-child > div:nth-last-child(2), tr th:last-child > div:nth-last-child(2) {
    border-right: 2px solid var(--table-border-color);
}

.dark-mode tr td:last-child > div:nth-last-child(2), .dark-mode tr th:last-child > div:nth-last-child(2) {
    border-right: 2px solid var(--table-border-color);
}

    *, ::after, ::before {
        box-sizing: content-box !important;
    }

    .container-width, .container-width::before, .container-width::after {
        box-sizing: content-box !important;
    }

.table-header {
    /*background-color: #212529;*/
    position: sticky !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 100;
    margin-bottom: 0 !important;
    overflow: auto !important;
}

.table-header1 {
    /*background-color: #212529;*/
    position: sticky !important;
    top: 116px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 99;
    margin-bottom: 0 !important;
    overflow: unset !important;
}

.table-header2 {
    /*background-color: #212529;*/
    position: sticky !important;
    top: 0px !important;
    z-index: 98;
    margin-bottom: 0 !important;
    overflow: inherit;
}

.dark-mode .table-header {
    background-color: #212529;
    position: sticky !important;
    top: 0 !important;
    z-index: 100;
    margin-bottom: 0 !important;
    overflow: auto !important;
}
.dark-mode .table-header1 {
    background-color: #212529;
    position: sticky !important;
    top: 116px !important;
    z-index: 99;
    margin-bottom: 0 !important;
    overflow: unset !important;
}

.dark-mode.table-header2 {
    background-color: #212529;
    position: sticky !important;
    top: 0px !important;
    z-index: 98;
    margin-bottom: 0 !important;
    overflow: inherit;
}

table {
    border-collapse: separate;
}
    .container-width {
        position: relative;
        /*top: 272px !important;*/
        z-index: 90;
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        white-space: normal;
        word-wrap: normal;
        overflow-y: auto;
        max-height: calc(100vh - 261px);
        scroll-padding-top: 72px;
        scroll-snap-type: y proximity;
        scroll-behavior: smooth;
    }

   / .container-width tbody tr {
        scroll-snap-align: none;
        scroll-snap-stop: always;
    }
    .container-flex {
        display: flex;
        flex-direction: column;
        min-height: 90%;
        flex-grow: 1;
        max-height: calc(100vh - 30px);
        /*overflow: auto; */
        position: relative;
    }

    .edit-body {
        display: flex;
        width: 100%;
        height: 100%;
        justify-content: center; /* Centers the child horizontally */
    align-items: center; /* Centers the child vertically */
    text-align: center;
}

    .edit-body2 {
        display: flex;
        width: 100%;
        height: 100%;
        justify-content: center; /* Centers the child horizontally */
        align-items: center; /* Centers the child vertically */
        text-align: center;
    }

    .edit-body-tech {
        display: flex;
        width: 100%;
        height: 35%;
        justify-content: center; /* Centers the child horizontally */
        align-items: center; /* Centers the child vertically */
        text-align: center;
    }

    .edit-footer {
        justify-content: center; /* Centers the child horizontally */
        align-items: center; /* Centers the child vertically */
        text-align: center;
        padding-right: 25px;
        padding-top: 5px;
    }

    .details-delete-body {
        align-items: center;
        align-content: center;
        /*padding-left: 800px;*/
    }

    .details-delete-footer {
        align-items: center;
        align-content: center;
        /*padding-left: 900px;*/
    }

    .clickable-cell {
        user-select: none;
        padding-top: 1px !important;
        padding-bottom: 1px !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
    }

    .cellData {
    }

    .combined-cellfullname {
    }

    .combined-cellvehicle {
    }

    .textarea {
        border-radius: 7px;
        border-color: #EBE9ED;
        min-height: 150px; /* Adjust as needed */
        min-width: 900px;
        /*max-width: 525px;  Adjust as needed */
        overflow: hidden; /* Prevents scrollbar appearance during expansion */
        resize: none; /* Optional: Disables manual resizing */
    }

    .navbar-nav li:hover > .dropdown-menu {
        display: block;
    }

    .highlight-yellow {
        background-color: yellow;
    }

    .highlight-lightgreen {
        background-color: lightgreen;
    }

    .highlight-orchid {
        background-color: orchid;
    }

    .form-check-label {
        white-space: nowrap;
    }

    /* Update the CSS to handle highlight colors */
    body.dark-mode .clickable-cell[style*="background-color: yellow"],
    body.dark-mode .clickable-cell[style*="background-color: lightgreen"],
    body.dark-mode .clickable-cell[style*="background-color: orchid"],
    body.dark-mode .cellData[style*="background-color: yellow"]
    /*body.dark-mode .cellData[style*="background-color: green"]*/ {
        color: black;
    }

    /*.truck-shop-row {
    background-color: orchid !important;
}

.body-shop-row {
    background-color: lightgreen !important;
}*/

    html {
        min-width: 100%;
        height: 100%;
        min-height: 100%;
        position: relative;
    }

    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin-bottom: 10px;
        min-width: 100%;
        position: relative;
    }

    html, body {
        height: 100%;
        margin: 0;
    }

    #wrap\; main {
        flex: 1 0 auto;
        padding-bottom: 0px; /* Space for the footer */
        overflow: auto; /* Ensures content scrolls within the area */
    }

    .main, .pb-3 {
        flex-grow: 1;
        max-height: 100%;
        padding-bottom: 0px;
        /*overflow: auto;*/
    }

    .appt-col {
        margin-right: 10px;
        justify-content: center;
        align-content: center;
    }

    #footer {
        position: fixed;
        height: 30px;
        bottom: 0;
        width: 100%;
        clear: both;
        padding: 0px;
        padding-right: 0px;
        flex-shrink: 0;
        z-index: 1000;
    }

    .text-tiny {
        /*font-size: 12px;*/
        font-size: .7em;
    }

    .text-small {
        /*font-size: 15px;*/
        font-size: .85em;
    }

    .text-big {
        /*font-size: 26px;*/
        font-size: 1.4em;
    }

    .text-huge {
        /*font-size: 33px;*/
        font-size: 1.8em;
    }

    .d-flex {
        display: flex;
        min-height: 90%;
        max-height: calc(100vh - 30px)
    }

    .flex-column {
        flex-direction: column;
    }

    .flex-grow-1 {
        flex-grow: 1;
    }

    .mt-auto {
        margin-top: auto;
    }

    .bi-trash3 {
        vertical-align: -10px !important;
        font-size: 1.4em;
    }

    .back {
        text-align: center;
        margin-right: 25px;
        padding-top: 10px;
    }

    .notes-field {
        background-color: #212529; /* Adjust the color to match your page background */
        color: white; /* Assuming you want light text on a dark background */
        border: none; /* Removes the border if present */
        padding: 10px; /* Optional: Adjust padding for aesthetics */
        box-sizing: border-box; /* Makes sure padding doesn't affect width */
    }

    .edit-btns-appt {
        vertical-align: middle;
        padding: .45rem !important;
    }
    /*/.container:not(.details-page-container) {
    display: flex;
}*/

    .details-container {
        display: grid;
        place-items: center;
        justify-content: center;
        max-height: 65vh;
        max-width: 90vw;
        margin: 0 !important;
    }

    .details-list {
        max-width: 90vw;
    }

        .details-list dt {
            text-align: right;
        }

    #appointmentRows {
        flex-wrap: wrap;
        word-wrap: break-word;
    }

    .date-container {
        display: inline-block;
    }

        .date-container label {
            margin-bottom: 5px;
            white-space: nowrap;
        }

        .date-container input {
            width: auto;
            box-sizing: border-box;
        }

    .details-complete {
        display: grid;
        place-items: center;
        justify-content: center;
        max-height: 65vh;
        max-width: 100vw;
        margin: 0 !important;
        font-size: 20px;
        font-weight: bold;
    }

/* Only in Firefox, avoid layer promotion on the scroller */
@-moz-document url-prefix() {
    .container-width {
        transform: none !important;
        will-change: auto !important;
    }
}

.search-results{
  max-height: 90vh;
  overflow: auto;
}

.faded-text {
    color: rgba(255, 255, 255, 0.6); /* adjust for dark mode */
}

body:not(.dark-mode) .faded-text {
    color: rgba(0, 0, 0, 0.5); /* lighter fade on light mode */
}

.search-input {
    padding-right: 2rem;
    position: relative;
}

    .search-input::after {
        content: "x";
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
        color: rgba(255,255,255,0.5);
        display: none;
    }

    .search-input.faded-text::after {
        display: inline;
    }

.search-box {
    max-width: 200px;
    display: inline-block;
    opacity: 0.85; /* Optional fade for previous search */
}

/* --- Sizer row (invisible helper row used to lock column widths) --- */
.sizer-row td {
    padding: 0;
    border: hidden !important;
    height: 0;
}

/* --- In-table date separator row --- */
.group-date-row td {
    border: none !important; /* remove borders on the full-width date row */
    background: transparent;
    font-size: 28px !important; /* same size you had inline */
    padding: 10px 0 6px;
}

.group-date {
    font-weight: 600;
    padding: 6px 0;
    text-align: center;
}

/* Ensure the FIRST data row after a date header gets a top border
   (fixes the “missing border on first row per date” issue) */
.group-date-row + tr td {
    border-top: 2px solid var(--table-border-color);
}
