/* General Table Styling */

.custom-table {

    width: 100%;

    margin-bottom: 15px;

    border-collapse: collapse;

}



.custom-table th,
.custom-table td {

    font-size: 12px;

    white-space: normal;

    word-wrap: break-word;

    vertical-align: middle;

    text-align: center;
    /* Ensure all text in the table is center-aligned */

}



.custom-table th {

    background-color: #f8f9fa;
    /* Light grey background for headers */

    text-align: center;

}



.custom-table td {

    padding: 8px;

}



.custom-table th:nth-child(4),
/* Description header */

.custom-table td:nth-child(4) {
    /* Description data cells */

    width: auto;

    word-break: break-word;

    white-space: normal;

}



/* Zebra stripe for the table rows */

.custom-table tbody tr:nth-of-type(odd) {

    background-color: rgba(0, 0, 0, 0.05);

}



/* Responsive adjustments */

@media (max-width: 768px) {

    .custom-table {

        font-size: 10px;

    }



    .custom-table th,
    .custom-table td {

        padding: 5px;

    }



    .custom-table th:nth-child(4),
    /* Description header */

    .custom-table td:nth-child(4) {

        width: 100%;

        white-space: normal;

    }

}



/* Highlight the most recent row */

.custom-table tbody tr.highlight {

    background-color: #dff0d8;
    /* Light green background for the latest row */

}





/* Prevent button text from wrapping */

button {

    white-space: nowrap;
    /* Keep button text on a single line */

}





body {

    background-color: #f4f4f4;

    font-family: 'Arial', sans-serif;

}



.container {

    padding-left: 1cm;

    padding-right: 1cm;

}



/* Styling for the header row */

.header-row {

    background-color: #ffffff;
    /* Solid white background */

    color: #333333;
    /* Dark text for readability */

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for depth */

    align-items: center;
    /* Center items vertically */

    padding: 0 15px;
    /* Padding on sides for spacing */

    height: 50px;

    border-bottom: 2px solid;
    /* Base border size */

    border-image-slice: 1;
    /* Enables the gradient to be used as border image */

    border-image-source: linear-gradient(to left, #007BFF 0%, #00f2fe 100%);
    /* Light blue gradient */

}





.navbar-brand,
.nav-link {

    color: #007BFF;
    /* Blue for links for better visibility */

    font-weight: bold;

    text-decoration: none;

}



.username {

    color: #007BFF;
    /* Blue for username */

    font-style: italic;

    font-weight: normal;

}



/* Styling for the clock and date */

.clock,
.date {

    font-size: 16px;
    /* Slightly smaller font */

    font-weight: normal;
    /* Normal weight to keep it simple */

    background-color: #f8f9fa;
    /* Light grey background */

    padding: 5px 10px;

    border-radius: 5px;

    margin: 0 5px;
    /* Spacing between clock and date */

}



.nav-link.logout {

    color: #dc3545;
    /* Bootstrap 'danger' color for logout to highlight it */

    padding: 5px 10px;

    border-radius: 5px;

    background-color: #f8f9fa;
    /* Matching background to clock/date */

    transition: color 0.3s, background-color 0.3s;
    /* Smooth transition for hover effects */

    display: inline-block;
    /* Ensures the padding and background affect only the text area */

    text-decoration: none;
    /* Removes underline from links */

}



.nav-link.logout:hover {

    color: #ffffff;
    /* White text on hover */

    background-color: #dc3545;
    /* Dark red background on hover */

}







.card {

    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);

    border: none;

}



.card-title {

    color: #333;

    font-weight: bold;

}



.btn-custom {

    width: 100%;

    padding: 12px;

    margin-top: 5px;

    background-color: #d6e2ed;
    /* Light gray background */

    color: #333;
    /* Dark text for readability */

    border: 1px solid #ddd;
    /* Subtle borders */

    border-radius: 4px;
    /* Rounded corners */

    transition: background-color 0.3s, box-shadow 0.3s;
    /* Smooth transitions for interactive effects */

}



/* Specific styles for different actions to maintain minimal but distinct differences */

.btn-custom.btn-start {

    border-color: #cce5ff;
    /* Lighter blue border */

}



.btn-custom.btn-info {

    border-color: #ffeeba;
    /* Lighter yellow border */

}



.btn-custom.btn-warning {

    border-color: #f5c6cb;
    /* Lighter red border */

}



.btn-custom.btn-primary {

    border-color: #b8daff;
    /* Blue border */

}



.btn-custom.btn-secondary {

    border-color: #e2e3e5;
    /* Gray border */

}



.btn-custom.btn-danger {

    border-color: #f5c6cb;
    /* Red border */

}



.btn-custom:hover {

    background-color: #e2e3e5;
    /* Slightly darker on hover for better interaction feedback */

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    /* Subtle shadow for depth */

}



.btn-custom:disabled {

    background-color: #cccccc;
    /* Grey out for disabled state */

    color: #666666;
    /* Darker text to indicate non-interactivity */

    cursor: not-allowed;
    /* Cursor to indicate disabled state */

}

#show {

    background-color: #007BFF;
    /* Grey background */

    color: #f6f6f6;
    /* Dark text for visibility */

    border: 1px solid #007BFF;
    /* Slightly darker border for definition */

    transition: background-color 0.3s, color 0.3s;
    /* Smooth transition for background and text color */

}



#show:hover {

    background-color: #bbbbbb;
    /* Blue background on hover */

    color: #ffffff;
    /* White text on hover */

}





/* Real-time Clock and Date Styles */

.clock:before,
.date:before {

    content: attr(data-label) " ";

    color: #6c757d;

    font-weight: bold;

}



.pagination {

    text-align: center;
    /* Center the pagination controls */

    margin-top: 20px;
    /* Add some space above the pagination controls */

    padding: 10px 0;
    /* Padding for better touch interaction */

}



.page-num {

    display: inline-block;
    /* Display as inline-block for alignment */

    margin-right: 5px;
    /* Space between buttons */

    padding: 5px 10px;
    /* Padding inside the buttons */

    background-color: #f8f9fa;
    /* Light grey background */

    border: 1px solid #ddd;
    /* Slight border */

    color: #007BFF;
    /* Bootstrap primary blue color for text */

    cursor: pointer;
    /* Pointer cursor on hover */

    border-radius: 5px;
    /* Rounded corners for aesthetics */

}



.page-num.active {

    background-color: #007BFF;
    /* Bootstrap primary blue for active page */

    color: #ffffff;
    /* White text for contrast */

}



.page-num:hover {

    background-color: #0056b3;
    /* Slightly darker blue on hover */

    color: #ffffff;
    /* White text for readability */

}



/* Add this to your CSS file */

.textarea-singleline {

    overflow-y: auto;

    resize: vertical;
    /* or 'resize: vertical;' if you want to allow vertical resizing */

}



.in-progress {

    background-color: lightyellow;

}



.complete {

    background-color: #E0FFFF;

}



.paused {

    background-color: #FFE0FF;
    /* Light red color for paused tasks */

}



/* class to hightligt latest break in live */

.highlight-latest {

    background-color: #c6cff7;
    /* Light yellow background to highlight */



}

/*css for link taskID on task.php*/

.task-link {

    color: #007bff;
    /* A noticeable blue color to indicate it's clickable */

    text-decoration: underline;
    /* Underline to clearly indicate it's a link */

    cursor: pointer;
    /* Change cursor to pointer to indicate it's clickable */

}



.task-link:hover {

    color: #0056b3;
    /* Slightly darker blue on hover for a subtle effect */

}



/* Style to make tabs look inactive */

.disabled-tabs {

    pointer-events: none;
    /* Prevent clicking */

    opacity: 0.5;
    /* Make it visually appear inactive */

}



/*css for .description-cell*/

.description-cell {

    position: relative;

}



.description-controls {

    position: absolute;

    top: 5px;

    right: 5px;

}



.description-controls button {

    background: none;

    border: none;

    cursor: pointer;

    font-size: 14px;

    margin-left: 5px;

}



.description-edit {

    width: 100%;

    box-sizing: border-box;

}



.description-controls .edit-icon {

    display: inline-block;

    width: 24px;

    height: 24px;

    border-radius: 50%;

    background-color: #007bff;
    /* Bright blue for visibility */

    color: white;

    font-size: 16px;

    font-weight: bold;

    text-align: center;

    line-height: 24px;

    cursor: pointer;

    margin-right: 5px;

}



.description-controls .save-icon {

    display: inline-block;

    width: 24px;

    height: 24px;

    border-radius: 50%;

    background-color: #28a745;
    /* Bright green for visibility */

    color: white;

    font-size: 16px;

    text-align: center;

    line-height: 24px;

    cursor: pointer;

    margin-left: 5px;

}



.description-cell:hover .edit-icon {

    transform: scale(1.1);
    /* Slightly enlarge on hover */

}



.description-cell:hover .save-icon {

    transform: scale(1.1);
    /* Slightly enlarge on hover */

}


/*when clicking of task id under tasks - below styling is for that modal*/

.modal-body {
    overflow-x: auto;
    max-height: 70vh;
    /* Adjust height as needed */
    overflow-y: auto;
    overflow-x: auto;
    /* optional: if table width exceeds */
    padding: 10px;
}

.task-note-block {
    font-size: 0.85em;
    padding-left: 5px;
    border-left: 2px solid #007bff;
    margin-top: 5px;
}

.description-heading {
    text-align: left;
    margin-bottom: 12px;
    padding: 2px;
    background: rgb(251, 253, 227);
    /* Light blue background */
    border-left: 5px solid #007bff;
    /* Blue left border */
    border-radius: 5px;
    font-size: 12px;
    color: #0056b3;
}

#taskLogsTable th {
    font-size: 0.8rem;
    padding: 4px 6px;
    white-space: nowrap;
}

#taskLogsTable td {
    font-size: 0.8rem;
    padding: 4px 6px;
    vertical-align: top;
}

#taskLogsTable th:last-child,
#taskLogsTable td:last-child {
    font-weight: bold;
    color: #222;
}









/* =========================================================
   LIVE TASK TABLE - COMPACT FOUR-COLUMN PRESENTATION
   ---------------------------------------------------------
   Production-safe presentation-only enhancement.

   IMPORTANT:
   - The original 9 task <td> cells remain unchanged.
   - teamTimeMM.js remains unchanged.
   - Existing task IDs, status updates, notes, actions,
     colours, modals and AJAX behaviour are preserved.
   - Rules are scoped to .live-task-table so Task History
     and other .custom-table elements are not affected.
   ========================================================= */

.live-task-table {
    width: 100%;
    min-width: 880px;
    table-layout: auto;
    margin-bottom: 15px;
}

/* Keep the original table DOM but visually arrange each row as 4 groups. */
.live-task-table thead,
.live-task-table tbody {
    display: block;
    width: 100%;
}

.live-task-table thead tr,
.live-task-table tbody tr {
    display: grid;
    grid-template-columns:
        minmax(165px, 18%) minmax(390px, 1fr) minmax(180px, 20%) minmax(120px, 11%);
    width: 100%;
}

/* Override old inline column widths only for the live task table. */
.live-task-table th,
.live-task-table td {
    width: auto !important;
    min-width: 0;
}

/* -------------------------
   Header: show 4 group names
   ------------------------- */
.live-task-table thead tr {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Existing TH1 (ID) becomes the visual Task Details group heading. */
.live-task-table thead th:nth-child(1) {
    grid-column: 1;
    font-size: 0;
}

.live-task-table thead th:nth-child(1)::after {
    content: "Task Details";
    font-size: 12px;
}

/* Existing TH4 remains Description. */
.live-task-table thead th:nth-child(4) {
    grid-column: 2;
}

/* Existing TH5 (End Date & Time) becomes the visual Task Status group heading. */
.live-task-table thead th:nth-child(5) {
    grid-column: 3;
    font-size: 0;
}

.live-task-table thead th:nth-child(5)::after {
    content: "Task Status";
    font-size: 12px;
}

/* Existing TH8 remains Actions. */
.live-task-table thead th:nth-child(8) {
    grid-column: 4;
}

/* Secondary headings are represented as labels inside their grouped cells. */
.live-task-table thead th:nth-child(2),
.live-task-table thead th:nth-child(3),
.live-task-table thead th:nth-child(6),
.live-task-table thead th:nth-child(7),
.live-task-table thead th:nth-child(9) {
    display: none;
}

.live-task-table thead th {
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    vertical-align: middle;
    border: 0 !important;
}

.live-task-table thead th:nth-child(8) {
    text-align: center;
}

.live-task-table thead th:nth-child(1),
.live-task-table thead th:nth-child(4),
.live-task-table thead th:nth-child(5) {
    border-right: 1px solid #dee2e6 !important;
}

/* -------------------------
   Individual task row
   ------------------------- */
.live-task-table tbody tr {
    position: relative;
    margin-bottom: 6px;
    border: 1px solid #dfe3e7;
    border-radius: 5px;
    overflow: hidden;
}

/* Keep cells transparent so existing .in-progress/.paused/.complete row colours remain visible. */
.live-task-table tbody td {
    background: transparent;
    border: 0 !important;
    padding: 5px 8px;
    vertical-align: top;
}

/* -------------------------
   GROUP 1: TASK DETAILS
   TD1 = ID
   TD2 = Type
   TD3 = Start Date & Time
   ------------------------- */
.live-task-table tbody td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.live-task-table tbody td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.live-task-table tbody td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
}

.live-task-table tbody td:nth-child(1),
.live-task-table tbody td:nth-child(2),
.live-task-table tbody td:nth-child(3) {
    text-align: left;
    border-right: 1px solid #dfe3e7 !important;
}

/* -------------------------
   GROUP 2: DESCRIPTION
   TD4 retains all existing note/add/edit/save behaviour.
   ------------------------- */
.live-task-table tbody td:nth-child(4) {
    grid-column: 2;
    grid-row: 1 / 5;
    text-align: left;
    padding: 8px 38px 8px 10px;
    border-right: 1px solid #dfe3e7 !important;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.4;
}

.live-task-table tbody td:nth-child(4) .description-cell {
    position: relative;
}

/* -------------------------
   GROUP 3: TASK STATUS
   TD5 = End Date & Time
   TD6 = Active Duration
   TD7 = Current Status
   TD9 = Final Status
   ------------------------- */
.live-task-table tbody td:nth-child(5) {
    grid-column: 3;
    grid-row: 1;
}

.live-task-table tbody td:nth-child(6) {
    grid-column: 3;
    grid-row: 2;
}

.live-task-table tbody td:nth-child(7) {
    grid-column: 3;
    grid-row: 3;
}

.live-task-table tbody td:nth-child(9) {
    grid-column: 3;
    grid-row: 4;
}

.live-task-table tbody td:nth-child(5),
.live-task-table tbody td:nth-child(6),
.live-task-table tbody td:nth-child(7),
.live-task-table tbody td:nth-child(9) {
    text-align: left;
    border-right: 1px solid #dfe3e7 !important;
}

/* -------------------------
   GROUP 4: ACTIONS
   TD8 remains the exact original dropdown/action output.
   ------------------------- */
.live-task-table tbody td:nth-child(8) {
    grid-column: 4;
    grid-row: 1 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.live-task-table tbody td:nth-child(8) select,
.live-task-table tbody td:nth-child(8) button {
    width: 100%;
    max-width: 150px;
    font-size: 11px;
}

/* -------------------------
   Compact labels inside the two grouped cards
   ------------------------- */
.live-task-table tbody td:nth-child(1)::before,
.live-task-table tbody td:nth-child(2)::before,
.live-task-table tbody td:nth-child(3)::before,
.live-task-table tbody td:nth-child(5)::before,
.live-task-table tbody td:nth-child(6)::before,
.live-task-table tbody td:nth-child(7)::before,
.live-task-table tbody td:nth-child(9)::before {
    display: block;
    margin-bottom: 1px;
    color: #6c757d;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.live-task-table tbody td:nth-child(1)::before {
    content: "ID";
}

.live-task-table tbody td:nth-child(2)::before {
    content: "Type";
}

.live-task-table tbody td:nth-child(3)::before {
    content: "Start Date & Time";
}

.live-task-table tbody td:nth-child(5)::before {
    content: "End Date & Time";
}

.live-task-table tbody td:nth-child(6)::before {
    content: "Active Duration";
}

.live-task-table tbody td:nth-child(7)::before {
    content: "Current Status";
}

.live-task-table tbody td:nth-child(9)::before {
    content: "Final Status";
}

.live-task-table tbody td:nth-child(1),
.live-task-table tbody td:nth-child(2),
.live-task-table tbody td:nth-child(3),
.live-task-table tbody td:nth-child(5),
.live-task-table tbody td:nth-child(6),
.live-task-table tbody td:nth-child(7),
.live-task-table tbody td:nth-child(9) {
    font-size: 11px;
    line-height: 1.3;
}

.live-task-table tbody td:nth-child(2),
.live-task-table tbody td:nth-child(3),
.live-task-table tbody td:nth-child(6),
.live-task-table tbody td:nth-child(7),
.live-task-table tbody td:nth-child(9) {
    padding-top: 3px;
}

/* Existing Description controls remain in their original relative container. */
.live-task-table .description-controls {
    top: 5px;
    right: 5px;
}

.live-task-table .description-edit {
    width: 100%;
    min-height: 60px;
}

/* On smaller screens preserve readability and let .table-responsive scroll horizontally. */
@media (max-width: 992px) {
    .live-task-table {
        min-width: 820px;
    }

    .live-task-table thead tr,
    .live-task-table tbody tr {
        grid-template-columns:
            155px minmax(340px, 1fr) 175px 115px;
    }
}


/* =========================================================
   RESPONSIVE / MOBILE LAYOUT ENHANCEMENTS
   Added 2026-09-16

   Presentation only. No IDs, event targets, AJAX targets,
   table-cell order, status classes, or JavaScript behaviour
   are changed.
   ========================================================= */

/* Prevent long content from forcing the whole page wider. */
html,
body {
    max-width: 100%;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   TABLET / NARROW DESKTOP
   ========================================================= */
@media (max-width: 991.98px) {

    /* Header is allowed to wrap instead of overflowing. */
    .header-row {
        height: auto;
        min-height: 50px;
        padding-top: 7px;
        padding-bottom: 7px;
        margin-left: 0;
        margin-right: 0;
        row-gap: 7px;
    }

    .header-row>[class*="col-"] {
        min-width: 0;
    }

    /* Override the inline nowrap used around Time / Date / Time Zone. */
    .header-row .d-flex {
        flex-wrap: wrap !important;
        white-space: normal !important;
        gap: 5px !important;
    }

    .clock,
    .date {
        margin: 0 2px;
    }

    .main-dashboard-row {
        margin-left: 0;
        margin-right: 0;
    }

    .shift-controls-column,
    .tracker-content-column {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Keep the three tab labels inside the available width. */
    #tabs>ul {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        overflow: hidden;
        padding-right: 0;
    }

    #tabs>ul>li {
        flex: 1 1 0;
        min-width: 0;
        margin-right: 2px;
    }

    #tabs>ul>li>a {
        display: block;
        width: 100%;
        padding-left: 6px;
        padding-right: 6px;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    /* Task creation controls become easier to use on narrower screens. */
    #taskForm .form-control {
        max-width: 100%;
    }

    #taskForm .task-start-column .btn,
    #taskForm .task-start-column button {
        max-width: 100%;
    }

    /* Non-live custom tables remain readable by scrolling rather than crushing columns. */
    .table-responsive>.custom-table:not(.live-task-table) {
        min-width: 720px;
    }
}


/* =========================================================
   PHONE LAYOUT
   ========================================================= */
@media (max-width: 767.98px) {

    body {
        overflow-x: hidden;
    }

    /* -------------------------
       Top header
       ------------------------- */
    .header-row {
        padding: 7px 8px;
        margin-bottom: 10px !important;
    }

    .header-row>[class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        text-align: center !important;
        padding-left: 4px;
        padding-right: 4px;
    }

    .navbar-brand {
        display: inline-block;
        margin-right: 0;
        font-size: 18px;
        line-height: 1.2;
    }

    .header-row .clock,
    .header-row .date {
        font-size: 11px;
        padding: 4px 6px;
        margin: 0;
    }

    .nav-link.logout {
        margin-top: 1px;
        padding: 4px 10px;
        font-size: 12px;
    }

    /* -------------------------
       Main dashboard stacking
       ------------------------- */
    .main-dashboard-row {
        display: block;
        margin-left: 0;
        margin-right: 0;
    }

    .shift-controls-column,
    .tracker-content-column {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        padding-left: 6px;
        padding-right: 6px;
    }

    .shift-controls-column {
        margin-bottom: 9px;
    }

    /* Compact Shift Controls into a two-column button grid. */
    .shift-controls-column .card-body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 10px;
    }

    .shift-controls-column .card-title {
        grid-column: 1 / -1;
        margin-bottom: 2px;
        font-size: 16px;
    }

    .shift-controls-column .btn-custom {
        width: 100%;
        min-width: 0;
        margin: 0 !important;
        padding: 9px 5px;
        font-size: 12px;
    }

    /* -------------------------
       Tabs
       ------------------------- */
    #tabs {
        width: 100%;
        min-width: 0;
        padding: 3px;
    }

    #tabs>ul {
        margin: 0 0 6px 0;
        padding: 2px;
    }

    #tabs>ul>li {
        min-width: 0;
    }

    #tabs>ul>li>a {
        padding: 7px 3px;
        font-size: 11px;
        line-height: 1.15;
    }

    /* Live Data cards naturally stack; tighten their mobile spacing. */
    #live-data-tab {
        padding: 4px;
    }

    #live-data-tab .row {
        margin-left: -4px;
        margin-right: -4px;
    }

    #live-data-tab [class*="col-"] {
        padding-left: 4px;
        padding-right: 4px;
    }

    #live-data-tab .card {
        margin-bottom: 8px;
    }

    #live-data-tab .card-body {
        padding: 10px;
    }

    #live-data-tab .card-title {
        font-size: 15px;
    }

    /* Live-data tables: allow horizontal swipe instead of page distortion. */
    #shiftDetailsContainer,
    #lunchDetailsContainer,
    #breakDetailsContainer {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #shiftDetailsContainer .table,
    #lunchDetailsContainer .table,
    #breakDetailsContainer .table {
        min-width: 540px;
        margin-bottom: 5px;
    }

    /* -------------------------
       Task creation form
       ------------------------- */
    h3 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    #taskForm .task-form-row {
        margin-left: 0;
        margin-right: 0;
    }

    #taskForm .task-type-column,
    #taskForm .task-description-column,
    #taskForm .task-start-column {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    #taskForm .form-group {
        margin-bottom: 8px;
    }

    #taskForm label {
        margin-bottom: 3px;
        font-size: 12px;
        font-weight: 600;
    }

    #taskForm .form-control {
        width: 100%;
        font-size: 14px;
    }

    #taskDescription {
        min-height: 42px;
    }

    /* Override the existing inline margin-top:32px on Start Task. */
    #taskForm .task-start-column .btn,
    #taskForm .task-start-column button {
        width: 100%;
        margin-top: 2px !important;
        margin-bottom: 4px;
        padding: 9px 12px;
    }

    .task-list-row {
        margin-top: 8px !important;
        margin-left: 0;
        margin-right: 0;
    }

    .task-list-row>.col-md-12 {
        padding-left: 0;
        padding-right: 0;
    }

    /* -------------------------
       LIVE TASKS: mobile card layout

       Same original 9 TD elements are kept in the DOM:
       1 ID, 2 Type, 3 Start, 4 Description,
       5 End, 6 Duration, 7 Current,
       8 Actions, 9 Final.
       ------------------------- */
    .table-responsive:has(.live-task-table) {
        overflow-x: visible;
    }

    .live-task-table {
        display: block;
        width: 100%;
        min-width: 0 !important;
        margin: 0;
        border: 0;
        background: transparent;
    }

    .live-task-table thead {
        display: none;
    }

    .live-task-table tbody {
        display: block;
        width: 100%;
    }

    .live-task-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        width: 100%;
        margin: 0 0 10px 0;
        border: 1px solid #d9dee3;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .live-task-table tbody td {
        min-width: 0;
        width: auto !important;
        padding: 6px 8px;
        font-size: 11px;
        line-height: 1.35;
        text-align: left;
        border: 0 !important;
        overflow-wrap: anywhere;
    }

    /* ID + Type */
    .live-task-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        border-right: 1px solid rgba(0, 0, 0, 0.09) !important;
    }

    .live-task-table tbody td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    /* Start date/time across the full card. */
    .live-task-table tbody td:nth-child(3) {
        grid-column: 1 / -1;
        grid-row: 2;
        border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    /* Description receives the full phone width. */
    .live-task-table tbody td:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: 3;
        padding: 8px 36px 8px 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.10) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.10) !important;
        font-size: 12px;
        line-height: 1.4;
    }

    .live-task-table .task-description {
        margin-bottom: 7px !important;
    }

    .live-task-table .description-entry {
        margin-bottom: 7px !important;
    }

    .live-task-table .description-controls {
        top: 6px;
        right: 6px;
    }

    /* End + Duration */
    .live-task-table tbody td:nth-child(5) {
        grid-column: 1;
        grid-row: 4;
        border-right: 1px solid rgba(0, 0, 0, 0.09) !important;
    }

    .live-task-table tbody td:nth-child(6) {
        grid-column: 2;
        grid-row: 4;
    }

    /* Current + Final */
    .live-task-table tbody td:nth-child(7) {
        grid-column: 1;
        grid-row: 5;
        border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-right: 1px solid rgba(0, 0, 0, 0.09) !important;
    }

    .live-task-table tbody td:nth-child(9) {
        grid-column: 2;
        grid-row: 5;
        border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    /* Actions gets its own full-width row. */
    .live-task-table tbody td:nth-child(8) {
        grid-column: 1 / -1;
        grid-row: 6;
        display: block;
        padding: 7px 8px 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.10) !important;
    }

    .live-task-table tbody td:nth-child(8)::before {
        content: "Actions";
        display: block;
        margin-bottom: 3px;
        color: #6c757d;
        font-size: 9px;
        line-height: 1.2;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .live-task-table tbody td:nth-child(8) select,
    .live-task-table tbody td:nth-child(8) button {
        width: 100%;
        max-width: none;
        min-height: 36px;
        font-size: 12px;
    }

    .live-task-table .description-edit {
        min-height: 72px;
        font-size: 14px;
    }

    /* -------------------------
       Task Logs modal
       ------------------------- */
    #taskLogsModal .modal-dialog {
        width: auto;
        max-width: calc(100vw - 12px);
        margin: 6px auto;
    }

    #taskLogsModal .modal-content {
        max-width: 100%;
    }

    #taskLogsModal .modal-header,
    #taskLogsModal .modal-footer {
        padding: 8px 10px;
    }

    #taskLogsModal .modal-body {
        max-height: 72vh;
        padding: 8px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    #taskLogsModal .modal-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    #taskLogsModal .modal-footer .btn {
        flex: 1 1 130px;
        margin: 0;
    }

    /* The detailed log table has many columns; horizontal swipe is preferable. */
    #taskLogsModal #taskLogsTable {
        min-width: 720px;
    }

    /* Generic non-live tables: contain their width inside scroll areas. */
    .table-responsive>.custom-table:not(.live-task-table) {
        min-width: 680px;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */
@media (max-width: 420px) {

    .header-row .clock,
    .header-row .date {
        font-size: 10px;
        padding: 3px 4px;
    }

    #tabs>ul>li>a {
        padding: 6px 2px;
        font-size: 10px;
    }

    .shift-controls-column .card-body {
        gap: 5px;
        padding: 8px;
    }

    .shift-controls-column .btn-custom {
        font-size: 11px;
        padding: 8px 3px;
    }

    .live-task-table tbody td {
        padding-left: 6px;
        padding-right: 6px;
    }

    .live-task-table tbody td:nth-child(4) {
        padding-left: 7px;
        padding-right: 34px;
    }
}

/* =========================================================
   TASK LOGS MODAL - PHONE CARD LAYOUT
   Added 2026-09-16

   Purpose:
   - Removes horizontal scrolling from the Task Logs modal on phones.
   - Keeps all six original log fields and all JavaScript/PDF functionality.
   - Desktop/tablet table layout is unchanged.
   ========================================================= */
@media (max-width: 767.98px) {

    /* Keep the modal fully inside the phone viewport. */
    #taskLogsModal .modal-dialog {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        margin: 6px auto;
    }

    #taskLogsModal .modal-content {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /* Vertical scrolling is still allowed when there are many logs,
       but horizontal scrolling is deliberately removed. */
    #taskLogsModal .modal-body {
        max-height: 72vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }

    /* teamTimeMM.js wraps the generated table in .table-responsive.
       On phones we no longer need horizontal scrolling because each
       table row is converted into a responsive card below. */
    #taskLogsModal .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: visible !important;
        overflow-y: visible;
    }

    /* Remove the old mobile minimum width that caused the horizontal bar. */
    #taskLogsModal #taskLogsTable {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0;
        border: 0;
        table-layout: fixed;
    }

    /* Column names are shown inside every card using ::before labels,
       so the desktop table heading is not needed on a phone. */
    #taskLogsModal #taskLogsTable thead {
        display: none;
    }

    #taskLogsModal #taskLogsTable tbody {
        display: block;
        width: 100%;
    }

    /* Every database log remains the same original TR with six TDs.
       Only its visual presentation changes to a two-column card. */
    #taskLogsModal #taskLogsTable tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        width: 100%;
        margin: 0 0 10px 0;
        padding: 0;
        border: 1px solid #d9dee3;
        border-radius: 6px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    #taskLogsModal #taskLogsTable tbody td {
        display: block;
        width: auto !important;
        min-width: 0;
        max-width: 100%;
        padding: 6px 7px;
        border: 0 !important;
        border-bottom: 1px solid #edf0f2 !important;
        vertical-align: top;
        text-align: left;
        font-size: 11px;
        line-height: 1.35;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Small field label above each value. */
    #taskLogsModal #taskLogsTable tbody td::before {
        display: block;
        margin-bottom: 2px;
        color: #6c757d;
        font-size: 8px;
        line-height: 1.2;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.25px;
    }

    /* Compact summary row: Task ID + Status */
    #taskLogsModal #taskLogsTable tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        border-right: 1px solid #edf0f2 !important;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(1)::before {
        content: "Task ID";
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(5) {
        grid-column: 2;
        grid-row: 1;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(5)::before {
        content: "Status To";
    }

    /* Start and End time share the next row. */
    #taskLogsModal #taskLogsTable tbody td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        border-right: 1px solid #edf0f2 !important;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(2)::before {
        content: "Start Time";
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(4)::before {
        content: "End Time";
    }

    /* Duration gets its own compact full-width row. */
    #taskLogsModal #taskLogsTable tbody td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(6)::before {
        content: "Duration";
    }

    /* Description/notes get the maximum available width. */
    #taskLogsModal #taskLogsTable tbody td:nth-child(3) {
        grid-column: 1 / -1;
        grid-row: 4;
        padding: 7px;
        border-bottom: 0 !important;
        background: #fafbfc;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(3)::before {
        content: "Description";
    }

    /* Existing note blocks from teamTimeMM.js stay intact, but are made
       narrow-screen safe. */
    #taskLogsModal .task-note-block {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-top: 5px;
        padding: 4px 4px 4px 6px;
        font-size: 11px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    #taskLogsModal .description-heading {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: 8px;
        font-size: 11px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Keep footer controls readable without increasing modal width. */
    #taskLogsModal .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
        padding: 8px 10px;
    }

    #taskLogsModal .modal-footer .btn {
        width: 100%;
        min-width: 0;
        margin: 0;
        font-size: 13px;
    }
}

/* On very narrow devices, dates/times may need a little more room.
   Stack Start and End time only if the screen is exceptionally narrow. */
@media (max-width: 340px) {
    #taskLogsModal #taskLogsTable tbody tr {
        grid-template-columns: 1fr;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(1),
    #taskLogsModal #taskLogsTable tbody td:nth-child(5),
    #taskLogsModal #taskLogsTable tbody td:nth-child(2),
    #taskLogsModal #taskLogsTable tbody td:nth-child(4),
    #taskLogsModal #taskLogsTable tbody td:nth-child(6),
    #taskLogsModal #taskLogsTable tbody td:nth-child(3) {
        grid-column: 1;
        border-right: 0 !important;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(1) {
        grid-row: 1;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(5) {
        grid-row: 2;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(2) {
        grid-row: 3;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(4) {
        grid-row: 4;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(6) {
        grid-row: 5;
    }

    #taskLogsModal #taskLogsTable tbody td:nth-child(3) {
        grid-row: 6;
    }
}


/* =========================================================
   LIVE DATA - THREE RESPONSIVE SUMMARY CARDS
   Added 2026-09-16
   Presentation-only change. Existing AJAX containers and table
   cell order remain unchanged, so no JS/business logic changes.
   ========================================================= */

#live-data-tab.live-summary-tab {
    padding: 8px;
}

#live-data-tab .live-summary-row {
    margin-left: -6px;
    margin-right: -6px;
    align-items: stretch;
}

#live-data-tab .live-summary-column {
    padding-left: 6px;
    padding-right: 6px;
    margin-bottom: 12px;
}

#live-data-tab .live-summary-card {
    height: 100%;
    margin-bottom: 0;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

#live-data-tab .live-summary-card .card-body {
    padding: 12px;
}

#live-data-tab .live-summary-title {
    margin: 0 0 9px 0;
    padding: 0 0 7px 0;
    border-bottom: 1px solid #e3e7eb;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
    color: #222;
}

/* Do not allow the legacy live-table mobile min-width rule to create
   horizontal scrolling. The original tables remain in the DOM. */
#live-data-tab .live-summary-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

#live-data-tab .live-summary-container .table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* Header labels are reproduced inside each data cell with ::before,
   which makes the data readable inside one-third-width cards. */
#live-data-tab .live-summary-container .table thead {
    display: none;
}

#live-data-tab .live-summary-container .table tbody {
    display: block;
    width: 100%;
}

#live-data-tab .live-summary-container .table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    margin: 0 0 8px 0;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    background: #fafbfc;
    overflow: hidden;
}

#live-data-tab .live-summary-container .table tbody tr:last-child {
    margin-bottom: 0;
}

#live-data-tab .live-summary-container .table tbody td {
    display: block;
    width: auto !important;
    min-width: 0;
    padding: 6px 7px;
    border: 0 !important;
    border-bottom: 1px solid #edf0f2 !important;
    vertical-align: top;
    text-align: left;
    font-size: 11px;
    line-height: 1.35;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#live-data-tab .live-summary-container .table tbody td:nth-child(odd) {
    border-right: 1px solid #edf0f2 !important;
}

#live-data-tab .live-summary-container .table tbody td::before {
    display: block;
    margin-bottom: 2px;
    color: #6c757d;
    font-size: 8px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

/* Shift card labels: Date / Shift Start / Shift End / Duration */
#shiftDetailsContainer .table tbody td:nth-child(1)::before {
    content: "Date";
}

#shiftDetailsContainer .table tbody td:nth-child(2)::before {
    content: "Shift Start";
}

#shiftDetailsContainer .table tbody td:nth-child(3)::before {
    content: "Shift End";
}

#shiftDetailsContainer .table tbody td:nth-child(4)::before {
    content: "Shift Duration";
}

/* Lunch card labels */
#lunchDetailsContainer .table tbody td:nth-child(1)::before {
    content: "Date";
}

#lunchDetailsContainer .table tbody td:nth-child(2)::before {
    content: "Lunch Start";
}

#lunchDetailsContainer .table tbody td:nth-child(3)::before {
    content: "Lunch End";
}

#lunchDetailsContainer .table tbody td:nth-child(4)::before {
    content: "Lunch Duration";
}

/* Break card labels */
#breakDetailsContainer .table tbody td:nth-child(1)::before {
    content: "Date";
}

#breakDetailsContainer .table tbody td:nth-child(2)::before {
    content: "Start Time";
}

#breakDetailsContainer .table tbody td:nth-child(3)::before {
    content: "End Time";
}

#breakDetailsContainer .table tbody td:nth-child(4)::before {
    content: "Duration";
}

#breakDetailsContainer .table tbody td:nth-child(5) {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 0 !important;
}

#breakDetailsContainer .table tbody td:nth-child(5)::before {
    content: "Description";
}

/* Shift/Lunch cards have four cells, so remove the lower border on
   their second row. */
#shiftDetailsContainer .table tbody td:nth-child(3),
#shiftDetailsContainer .table tbody td:nth-child(4),
#lunchDetailsContainer .table tbody td:nth-child(3),
#lunchDetailsContainer .table tbody td:nth-child(4) {
    border-bottom: 0 !important;
}

/* Preserve the existing latest-break highlight but keep it card-like. */
#breakDetailsContainer .table tbody tr.highlight-latest {
    background-color: #c6cff7;
}

/* Empty/error messages stay compact inside their card. */
#live-data-tab .live-summary-container>p {
    margin: 4px 0;
    padding: 8px;
    border: 1px dashed #d7dce1;
    border-radius: 6px;
    background: #fafbfc;
    color: #6c757d;
    font-size: 12px;
}

/* Tablet: Shift and Lunch share the first row; Break uses full width,
   as defined by Bootstrap col-md classes in welcome.php. */
@media (min-width: 768px) and (max-width: 991.98px) {
    #live-data-tab .live-summary-card .card-body {
        padding: 11px;
    }
}

/* Phone: all three cards stack, but every individual data block remains
   two-column where practical, so the page stays compact. */
@media (max-width: 767.98px) {
    #live-data-tab.live-summary-tab {
        padding: 4px;
    }

    #live-data-tab .live-summary-row {
        margin-left: -4px;
        margin-right: -4px;
    }

    #live-data-tab .live-summary-column {
        padding-left: 4px;
        padding-right: 4px;
        margin-bottom: 8px;
    }

    #live-data-tab .live-summary-card .card-body {
        padding: 9px;
    }

    #live-data-tab .live-summary-title {
        margin-bottom: 7px;
        padding-bottom: 6px;
        font-size: 14px;
    }

    /* Override earlier responsive rules that made these tables 540px wide
       and horizontally scrollable. */
    #shiftDetailsContainer,
    #lunchDetailsContainer,
    #breakDetailsContainer {
        overflow-x: visible !important;
    }

    #shiftDetailsContainer .table,
    #lunchDetailsContainer .table,
    #breakDetailsContainer .table {
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* Exceptionally narrow devices: use one value per line rather than
   allowing a date/time value to become cramped. */
@media (max-width: 340px) {
    #live-data-tab .live-summary-container .table tbody tr {
        grid-template-columns: 1fr;
    }

    #live-data-tab .live-summary-container .table tbody td,
    #live-data-tab .live-summary-container .table tbody td:nth-child(odd),
    #breakDetailsContainer .table tbody td:nth-child(5) {
        grid-column: 1;
        border-right: 0 !important;
    }

    #live-data-tab .live-summary-container .table tbody td:last-child {
        border-bottom: 0 !important;
    }
}

/* =========================================================
   LIVE TASK TABLE - HIGH CONTRAST / READABILITY THEME
   Added 2026-09-16
   Presentation only: no HTML, JavaScript or functionality changes.
   ========================================================= */

/* Stronger default text and borders inside live task rows. */
.live-task-table tbody tr {
    color: #111827;
    border-color: #cbd5e1;
}

.live-task-table tbody td {
    color: #111827;
}

/* Make the compact field labels easier to read on every row colour. */
.live-task-table tbody td:nth-child(1)::before,
.live-task-table tbody td:nth-child(2)::before,
.live-task-table tbody td:nth-child(3)::before,
.live-task-table tbody td:nth-child(5)::before,
.live-task-table tbody td:nth-child(6)::before,
.live-task-table tbody td:nth-child(7)::before,
.live-task-table tbody td:nth-child(9)::before {
    color: #374151;
    font-weight: 800;
}

/* Higher-contrast task ID link. */
.live-task-table .task-link {
    color: #0047a8;
    font-weight: 700;
}

.live-task-table .task-link:hover,
.live-task-table .task-link:focus {
    color: #002f73;
}

/* Improve readability of the Task Name strip generated by teamTimeMM.js.
   !important is intentional because the JS currently applies inline styles. */
.live-task-table .task-description {
    background: #eef6ff !important;
    border-left-color: #0b63ce !important;
    color: #073b7a !important;
    font-weight: 600;
}

/* Notes/history: dark body text and clearly visible timestamps. */
.live-task-table .description-history,
.live-task-table .description-entry,
.live-task-table .description-entry span {
    color: #111827;
}

.live-task-table .description-entry strong {
    color: #111827;
    font-weight: 700;
}

.live-task-table .description-entry em {
    color: #374151;
}

/* Status colours: muted enough for long reading, but with stronger contrast
   and a coloured left accent so status remains easy to distinguish. */
.live-task-table tbody tr.in-progress {
    background-color: #fff3bf !important;
    color: #1f2937 !important;
    box-shadow: inset 4px 0 0 #c77700;
}

.live-task-table tbody tr.paused {
    background-color: #f2e7ff !important;
    color: #24143a !important;
    box-shadow: inset 4px 0 0 #7c3aed;
}

.live-task-table tbody tr.complete {
    background-color: #dff4f1 !important;
    color: #102a26 !important;
    box-shadow: inset 4px 0 0 #0f766e;
}

/* Neutral rows remain light but readable. This only applies when a task row
   has none of the three status classes above. */
.live-task-table tbody tr:not(.in-progress):not(.paused):not(.complete) {
    background-color: #f8fafc !important;
    color: #111827 !important;
}

/* Slightly stronger separators are easier to follow across a wide row. */
.live-task-table tbody td:nth-child(1),
.live-task-table tbody td:nth-child(2),
.live-task-table tbody td:nth-child(3),
.live-task-table tbody td:nth-child(4),
.live-task-table tbody td:nth-child(5),
.live-task-table tbody td:nth-child(6),
.live-task-table tbody td:nth-child(7),
.live-task-table tbody td:nth-child(9) {
    border-color: #cbd5e1 !important;
}

/* Keep form controls clearly legible against all status backgrounds. */
.live-task-table tbody td:nth-child(8) select,
.live-task-table tbody td:nth-child(8) button,
.live-task-table .description-edit {
    color: #111827;
    background-color: #ffffff;
    border-color: #94a3b8;
}

/* Mobile cards use the same high-contrast labels and text. */
@media (max-width: 767.98px) {
    .live-task-table tbody tr {
        color: #111827;
    }

    .live-task-table tbody td {
        color: #111827;
    }
}

/* =========================================================
   APPLICATION READABILITY THEME V2
   Added 2026-09-16
   Presentation-only overrides. No HTML/JS/backend functionality changes.
   Goal: clearer typography, lower visual fatigue, stronger hierarchy,
   and subtle status colours with high contrast.
   ========================================================= */

:root {
    --ui-text: #172033;
    --ui-text-muted: #526173;
    --ui-label: #475569;
    --ui-border: #d8e0e8;
    --ui-border-strong: #c2ccd7;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8fafc;
    --ui-blue: #0b63ce;
    --ui-blue-dark: #084c9e;

    --status-progress-bg: #fffaf0;
    --status-progress-accent: #b45309;
    --status-pending-bg: #fbf7ff;
    --status-pending-accent: #7c3aed;
    --status-complete-bg: #f2fbf8;
    --status-complete-accent: #0f766e;
}

/* ---------- Global typography ---------- */
html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ui-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.card-title,
.live-summary-title {
    color: #0f172a;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 650;
}

.navbar-brand {
    font-size: 20px;
    line-height: 1.2;
}

.header-row,
.header-row .clock,
.header-row .date,
.header-row .username,
.nav-link.logout {
    font-size: 14px;
}

.clock:before,
.date:before {
    color: var(--ui-label);
    font-weight: 700;
}

/* ---------- Forms / buttons ---------- */
label,
.form-group label {
    font-size: 13px;
    font-weight: 650;
    color: #27364a;
}

.form-control,
select.form-control,
textarea.form-control,
input.form-control {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ui-text);
    border-color: var(--ui-border-strong);
}

.btn,
button,
.btn-custom {
    font-size: 14px;
    font-weight: 500;
}

/* ---------- Tabs ---------- */
#tabs>ul li a {
    font-size: 14px;
    font-weight: 500;
}

/* ---------- Live Data cards ---------- */
#live-data-tab .live-summary-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

#live-data-tab .live-summary-title {
    font-size: 16px;
    font-weight: 700;
}

#live-data-tab .live-summary-container .table tbody td {
    color: var(--ui-text);
    font-size: 13px;
    line-height: 1.4;
}

#live-data-tab .live-summary-container .table tbody td::before {
    color: var(--ui-label);
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: 0.02em;
}

#live-data-tab .live-summary-container .table tbody tr {
    background: #ffffff;
    border-color: var(--ui-border);
}

#breakDetailsContainer .table tbody tr.highlight-latest {
    background-color: #eef4ff;
    box-shadow: inset 3px 0 0 #3b82f6;
}

/* ---------- Live task table typography ---------- */
.live-task-table thead th {
    font-size: 12.5px;
    line-height: 1.3;
    color: #263548;
    font-weight: 700;
}

.live-task-table tbody td {
    color: var(--ui-text) !important;
    font-size: 12.5px;
    line-height: 1.42;
}

/* Compact metadata labels: larger than previous 9px version. */
.live-task-table tbody td:nth-child(1)::before,
.live-task-table tbody td:nth-child(2)::before,
.live-task-table tbody td:nth-child(3)::before,
.live-task-table tbody td:nth-child(5)::before,
.live-task-table tbody td:nth-child(6)::before,
.live-task-table tbody td:nth-child(7)::before,
.live-task-table tbody td:nth-child(9)::before {
    color: var(--ui-label) !important;
    font-size: 10.5px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: 0.025em;
}

/* Main description gets the largest, most comfortable text. */
.live-task-table tbody td:nth-child(4),
.live-task-table .description-history,
.live-task-table .description-entry,
.live-task-table .description-entry span {
    font-size: 13.25px;
    line-height: 1.48;
    color: #172033 !important;
}

.live-task-table .description-entry strong {
    color: #162033 !important;
    font-size: 12.5px;
    font-weight: 700;
}

.live-task-table .description-entry em {
    color: #44546a !important;
    font-size: 12px;
}

/* Task title strip: clearer, neutral-blue and not too bright. */
.live-task-table .task-description {
    background: #edf5ff !important;
    border-left: 4px solid #1d6fd6 !important;
    color: #0d417f !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 650 !important;
    padding: 4px 6px !important;
}

.live-task-table .task-link {
    color: #0757b3 !important;
    font-size: 12.75px;
    font-weight: 700;
}

.live-task-table .task-link:hover,
.live-task-table .task-link:focus {
    color: #053d7d !important;
}

/* Status information is important, so slightly emphasise it. */
.live-task-table tbody td:nth-child(7),
.live-task-table tbody td:nth-child(9) {
    font-size: 12.75px;
    font-weight: 650;
    color: #172033 !important;
}

/* ---------- Softer, higher-readability task status theme ----------
   Keep colour as a cue, not as the main reading surface.
   This is easier to read than saturated full-row fills.
   --------------------------------------------------------------- */
.live-task-table tbody tr.in-progress {
    background: var(--status-progress-bg) !important;
    box-shadow: inset 4px 0 0 var(--status-progress-accent) !important;
}

.live-task-table tbody tr.paused {
    background: var(--status-pending-bg) !important;
    box-shadow: inset 4px 0 0 var(--status-pending-accent) !important;
}

.live-task-table tbody tr.complete {
    background: var(--status-complete-bg) !important;
    box-shadow: inset 4px 0 0 var(--status-complete-accent) !important;
}

.live-task-table tbody tr:not(.in-progress):not(.paused):not(.complete) {
    background: #ffffff !important;
    box-shadow: inset 4px 0 0 #94a3b8;
}

.live-task-table tbody tr {
    border-color: var(--ui-border) !important;
}

.live-task-table tbody td:nth-child(1),
.live-task-table tbody td:nth-child(2),
.live-task-table tbody td:nth-child(3),
.live-task-table tbody td:nth-child(4),
.live-task-table tbody td:nth-child(5),
.live-task-table tbody td:nth-child(6),
.live-task-table tbody td:nth-child(7),
.live-task-table tbody td:nth-child(9) {
    border-color: var(--ui-border) !important;
}

/* Keep action controls visually distinct and readable. */
.live-task-table tbody td:nth-child(8) select,
.live-task-table tbody td:nth-child(8) button,
.live-task-table .description-edit {
    font-size: 13px;
    color: #172033 !important;
    background: #ffffff !important;
    border-color: #aeb9c7 !important;
}

/* ---------- Task Logs modal ---------- */
#taskLogsModal .modal-title {
    font-size: 20px;
    font-weight: 650;
    color: #182235;
}

#taskLogsModal .description-heading {
    font-size: 13px;
    line-height: 1.4;
    color: #114a8f;
}

#taskLogsTable th {
    font-size: 12px;
    color: #324157;
    font-weight: 700;
}

#taskLogsTable td {
    font-size: 12.75px;
    line-height: 1.45;
    color: var(--ui-text);
}

#taskLogsTable .task-note-block {
    font-size: 12.5px;
    line-height: 1.45;
}

/* ---------- Mobile readability ---------- */
@media (max-width: 767.98px) {
    body {
        font-size: 14px;
        line-height: 1.45;
    }

    h3 {
        font-size: 20px;
    }

    .navbar-brand {
        font-size: 19px;
    }

    .header-row,
    .header-row .clock,
    .header-row .date,
    .header-row .username,
    .nav-link.logout {
        font-size: 13px;
    }

    #tabs>ul li a {
        font-size: 12px;
    }

    .live-task-table tbody td {
        font-size: 12.5px;
        line-height: 1.42;
    }

    .live-task-table tbody td:nth-child(4),
    .live-task-table .description-history,
    .live-task-table .description-entry,
    .live-task-table .description-entry span {
        font-size: 13px;
        line-height: 1.48;
    }

    .live-task-table tbody td:nth-child(1)::before,
    .live-task-table tbody td:nth-child(2)::before,
    .live-task-table tbody td:nth-child(3)::before,
    .live-task-table tbody td:nth-child(5)::before,
    .live-task-table tbody td:nth-child(6)::before,
    .live-task-table tbody td:nth-child(7)::before,
    .live-task-table tbody td:nth-child(9)::before,
    #live-data-tab .live-summary-container .table tbody td::before {
        font-size: 10.5px;
    }

    #taskLogsModal .modal-title {
        font-size: 19px;
    }
}