﻿:root {
    --font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    --sidebar-width: 20rem;
    --collapsed-sidebar-width: 4.5rem;
    --default-theme-mode: system;
    --bg: #F9F9F9;
    --text: rgb(9, 9, 11);
    --muted: darkgray;
    --table-head-bg: #f3f2f2;
    --primary: #0d6efd;
    --success: #4caf50;
    --danger: #cc2e2e;
    --warning: #FFBF00;
    --secondary: #6900c7;
    --border-gray: rgba(33, 40, 50, 0.125);
    --card-radius: 12px;
    --focus-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
    font-family: var(--font-family);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    margin-bottom: 60px;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text);
}

html, body {
    font-family: var(--font-family);
    position: relative;
    min-height: 100%;
}

/* Links */
a:link, a:visited, a:hover {
    text-decoration: none !important;
}

/* Headings */
h3 {
    font-weight: 700;
}

/* Form controls and selects */
.form-control, .form-select,
input.form-control, select.form-select {
    /*padding: 0.575rem 1.25rem;*/
    appearance: none;
    /*border-radius: 0.35rem;*/
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    /*font-size: 0.9rem;
    height: auto;*/

    height: calc(2.25rem + 2px); /* force equal height */
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.3rem;
    line-height: 1.5;
}

    /* Focus */
    .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
        box-shadow: var(--focus-shadow);
    }

/* Buttons */
.btn {
    font-weight: 600 !important;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.3rem;
}

/* Icons */
.icon-small {
    font-size: 12px;
}

.icon-large {
    font-size: 36px;
}

/* Navbar logo */
.navbar-logo {
    height: 55px;
    margin: 0 20px;
    padding: 0;
}

/* Containers and spacing */
.container {
    margin-bottom: 50px;
}

.h-100 {
    height: 100% !important;
}

/* Borders (left) */
.border-start-lg {
    border-left-width: 0.4rem !important;
}

.border-start-success {
    border-left-color: var(--success) !important;
}

.border-start-danger {
    border-left-color: red !important;
}

.border-start-warning {
    border-left-color: var(--warning) !important;
}

.border-start-secondary {
    border-left-color: var(--secondary) !important;
}

.border-start-primary {
    border-left-color: #0061f2 !important;
}

/* Cards */
.card {
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 0 0 rgba(0,0,0,0) !important;
}

.card-header {
    background-color: #fff !important;
    margin-left: 0;
    margin-right: 0;
}

.card-body {
    margin: 15px;
    overflow: visible !important;
}


    .card-body:has(> .table) {
        margin: 0;
    }

.card .table {
    border-radius: 0;
    margin-bottom: 0;
}

/* Table styles */
.table {
    color: var(--text);    
    border-collapse: collapse !important;
}

.table-responsive .table {
    margin-bottom: 0;
}

.table thead {
    vertical-align: middle;
}

    .table thead th {
        position: sticky;
        top: 0;
        background-color: #dee2e6 !important;
        z-index: 2;        
    }

/* Consolidated table header rules */
.table th {
    color: var(--text);
    background-color: #f8f9fa;
}

.table td,
.table th {
    vertical-align: middle;
    line-height: 1.5;    
    padding: 0.55rem 0.65rem;
}

#assignedUsersTable.table > :not(caption) > * > * {
    padding: 0.25rem 0.4rem !important;
}


.table td {
    font-weight: 200;
}


/* Remove link underline inside tables */
.table a:link, .table a:visited, .table a:hover {
    text-decoration: none;
}

/* Legend */
.legend {
    display: flex;
    align-items: center;
    color: gray;
}

    .legend .item {
        display: flex;
        align-items: center;
        margin-right: 20px;
    }

    .legend .icon {
        display: inline-block;
        width: 20px;
        height: 5px;
        background-color: currentColor;
        border-radius: 2px;
        margin-right: 8px;
    }

/* Required fields */
.required-field::after {
    content: " *";
    color: red;
    font-weight: bold;
}

/* Driver details */
.email-label {
    display: flex;
    justify-content: center;
    align-items: center;
}

.driver dd, .driver-licence > div {
    margin-bottom: 20px;
}

/* Simple utility colors */
.red-text {
    color: var(--danger);
}

.orange-text {
    color: #eba91f;
}

.black-text {
    color: black;
}

.disabled-icon {
    color: gray;
    pointer-events: none;
}

/* Placeholder styling (modern + fallback) */
::placeholder {
    color: lightgray !important;
    opacity: 1;
}

:-ms-input-placeholder {
    color: lightgray !important;
}
/* IE 10-11 */
::-ms-input-placeholder {
    color: lightgray !important;
}
/* Edge */

/* Misc */
.italic-text {
    font-style: italic;
}

.btn-icon {
    padding-right: 10px;
}

.dropdown-item-separator {
    border-bottom: 1px solid #ccc;
}

/* Elements hidden for truck pages */
#weightInput, #nextPMIContainer, #tachoCalibContainer, #LOLERExpiryContainer,
#PUWERExpiryContainer, #OLicenceExpiryContainer, #BrakeTestContainer {
    display: none;
}

/* Stepper */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.step {
    flex: 1;
    position: relative;
    text-align: center;
}

    .step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        width: 100%;
        height: 2px;
        background: #ddd;
        z-index: 1;
    }

    .step .circle {
        width: 40px;
        height: 40px;
        line-height: 40px;
        border-radius: 50%;
        background: #ddd;
        margin: 0 auto;
        position: relative;
        z-index: 2;
    }

    .step.completed .circle {
        background: var(--success);
        color: white;
    }

    .step .label {
        margin-top: 0.5rem;
    }

/* Confirm route button disabled */
#confirm-route-button:disabled {
    color: lightgrey;
    background-color: var(--primary);
    cursor: not-allowed;
    opacity: 1;
}

/* Traffic lights */
.red {
    color: red;
}

.green {
    color: green;
}

.amber {
    color: orange;
}

tr.task-highlight td {
    background-color: #b1c3e0 !important;
    transition: background-color 0.5s ease-out !important;
}

 
/* Disabled primary button style */
button.btn-primary.disabled,
button.btn-primary:disabled {
    background-color: #d6d6d6;
    color: #888888;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.65;
    border-color: gray;
}

/* Tooltip for disabled elements (uses data-tooltip attribute) */
button[disabled]:hover:after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0.9;
    z-index: 1000;
}

/* Disabled-link utility (keeps tooltip + no hover changes) */
.disabled-link {
    pointer-events: auto;
    cursor: not-allowed;
    background-color: #6c757d !important;
    color: #e2e6ea !important;
    opacity: 0.9;
}

    .disabled-link:hover {
        cursor: not-allowed;
        background-color: #6c757d !important;
        color: #e2e6ea !important;
    }

    .disabled-link i {
        color: #e2e6ea !important;
    }

    .disabled-link i, .disabled-link span {
        pointer-events: auto;
    }

/* Tabs */
.tab-section {
    display: none;
}

    .tab-section.active {
        display: block;
    }

/* Main navbar */
.main-navbar {
    font-size: .85rem;
    font-weight: 500;
}

    .main-navbar .nav-link {
        color: #333 !important;
        border-radius: 6px;
        transition: all 0.2s ease;
        padding: 0.5rem 0.75rem;
    }

        .main-navbar .nav-link:hover, .main-navbar .nav-link.active {
            background-color: #f1f5f9;
            color: var(--primary) !important;
        }

    .main-navbar .dropdown-menu {
        font-size: .85rem;
        font-weight: 500;
    }

        .main-navbar .dropdown-menu .dropdown-item:hover {
            background-color: #f8f9fa;
        }

/* Responsive tweaks */
@media (min-width: 768px) {
    html {
        font-weight: 400 !important;
    }
}

dt, dd {
    margin: 0;
    padding: 4px 0;
}

.d-flex dt,
.d-flex dd {
    display: flex;
    align-items: center;
}

.black-text {
    color: #000;
}


.table-active {
    --bs-table-bg-state: #b1c3e0
}

.compact-table td,
.compact-table th {
    padding: 0.25rem 0.5rem !important;
    line-height: 1.2; /* optional, reduces vertical spacing */
}


a.disabled-link[aria-disabled="true"] {
    pointer-events: none; /* Prevent click */
    color: #aaa !important; /* Light gray text */
    opacity: 0.6;
    background: transparent !important; /* Remove gray background */
    text-decoration: none;
}


#dateSelector option[disabled] {
    display: none;
}

.assign-actions .btn {
    font-size: 1rem; /* icon size */
    padding: 0; /* reset Bootstrap's default padding */
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    width: 38px;
    height: 38px;
    display: inline-flex; /* ensure flex sizing stays natural */
    align-items: center; /* vertical center */
    justify-content: center; /* horizontal center */
    line-height: 1; /* prevent vertical offset */
}

    /* Make icons visually centered */
    .assign-actions .btn i {
        display: block;
        line-height: 1;
        vertical-align: middle;
    }

/* Disabled look */
.assign-actions .disabled-link {
    pointer-events: none;
    opacity: 0.5;
}

/* Subtle hover lift */
.assign-actions .btn:hover:not(.disabled-link) {
    transform: translateY(-1px);
}

/* Stack vertically on smaller screens */
/*@media (max-width: 1400px) {
    .assign-actions {
        flex-direction: column !important;
        align-items: center !important;
    }

        .assign-actions .btn {
            width: 45px;*/ /* consistent width when stacked */
            /*height: 45px;*/ /* keeps square shape */
        /*}
}*/


.dropdown-menu {
    z-index: 9999 !important;
    
}

.table thead th {
    position: inherit!important
}

    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }


.dropdown-item.active:hover {
    color: #fff;
    text-decoration: none;
    background-color: #0d6efd!important;
}


.form-label {
    margin-bottom: 0.25rem !important; /* default is 0.5rem */
}



.rule-switch[title]:hover {
    cursor: not-allowed;
}
