/* --- GLOBAL RESET --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Light Theme Defaults */
    --primary: #2563eb;
    --secondary: #1e40af;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --data: #10b981;
    --radius: 12px;

    /* Table Accents */
    --tbl-head-bg: #f8fafc;
    --week-sep-bg: #f1f5f9;
    --week-sep-text: #475569;
    --grand-total-bg: #eff6ff;
    --grand-total-text: var(--primary);
    --modal-overlay: rgba(15, 23, 42, 0.4);

    /* Tot Hrs Column Specifics */
    --tot-hrs-bg: #f0f9ff;
    --tot-hrs-text: #0369a1;

    /* Mobile Card Accents */
    --card-label: #64748b;
    --card-val: #0f172a;
}

/* DARK MODE OVERRIDES */
body.dark-mode {
    --primary: #3b82f6;
    --secondary: #60a5fa;
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;

    --tbl-head-bg: #1e293b;
    --week-sep-bg: #334155;
    --week-sep-text: #e2e8f0;
    --grand-total-bg: #172554;
    --grand-total-text: #60a5fa;
    --modal-overlay: rgba(0, 0, 0, 0.7);

    --tot-hrs-bg: #172554;
    --tot-hrs-text: #93c5fd;

    --card-label: #94a3b8;
    --card-val: #f1f5f9;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* --- Header --- */
header {
    background: var(--surface);
    padding: 20px 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border: 1px solid var(--border);
    transition: background-color 0.3s;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--bg);
}

.btn-audit {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-audit:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-nav-wrapper {
    display: flex;
    gap: 5px;
    width: 100%;
}

.btn-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0 15px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
    color: var(--text-muted);
    transition: 0.2s;
    flex-shrink: 0;
}

.btn-nav:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

.control-group input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text-main);
    transition: 0.2s;
    flex-grow: 1;
    min-width: 0;
}

.control-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- Stats Card --- */
.summary-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background: var(--surface);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

body:not(.dark-mode) .summary-card {
    background: #f0f9ff;
    border-color: #e0f2fe;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-val.money {
    color: var(--success);
}

.stat.total {
    grid-column: span 4;
    border-top: 1px dashed var(--border);
    margin-top: 5px;
    padding-top: 15px;
}

.stat.total .stat-val {
    font-size: 2rem;
    color: var(--primary);
}

/* --- Calendar --- */
.calendar-wrapper {
    overflow-x: auto;
    padding-bottom: 10px;
    padding-top: 10px;
    -webkit-overflow-scrolling: touch;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 35px;
    min-width: 800px;
}

.day-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    min-height: 100px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.day-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.day-card.weekend {
    background-color: var(--bg);
    border-style: dashed;
}

.day-card.has-data {
    border-left: 4px solid var(--primary);
}

.day-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.day-tag {
    font-size: 0.65rem;
    background: #fee2e2;
    color: #991b1b;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: bold;
}

body.dark-mode .day-tag {
    background: #7f1d1d;
    color: #fecaca;
}

.day-content {
    flex-grow: 1;
}

.day-summary {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.day-total {
    font-weight: 800;
    color: var(--success);
    font-size: 1.1rem;
    display: block;
    margin-top: auto;
    text-align: right;
}

.week-divider {
    grid-column: 1 / -1;
    background: var(--week-sep-bg);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--week-sep-text);
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.week-divider span {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.week-divider .wk-total {
    color: var(--success);
    font-size: 1rem;
    font-weight: 800;
}

/* --- TABLE BASE --- */
.table-wrap {
    background: var(--surface);
    padding: 5px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    table-layout: auto;
}

th {
    background: var(--tbl-head-bg);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 10px 6px;
    /* Reduced Padding */
    border-bottom: 2px solid var(--border);
}

td {
    padding: 10px 6px;
    /* Reduced Padding */
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    color: var(--text-main);
}

/* --- DESKTOP STYLES (Min Width Applied Here Only) --- */
@media (min-width: 769px) {
    table {
        min-width: 900px;
        table-layout: fixed;
    }

    th {
        position: sticky;
        top: 0;
        z-index: 5;
    }

    /* 1. Date Column */
    th:first-child,
    td:first-child {
        width: 95px;
        /* Reduced from 110px */
        min-width: 95px;
    }

    /* 2. Description Column - Takes remaining space, allow wrap to show full text */
    th:nth-child(2),
    td:nth-child(2) {
        width: auto;
        min-width: 300px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* 3. Numeric Columns - FIXED Uniform Width */
    th.num,
    td.num {
        width: 85px;
        /* Reduced from 100px */
        min-width: 85px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .col-tot-hrs {
        background-color: var(--tot-hrs-bg);
        color: var(--tot-hrs-text);
        font-weight: 600;
        width: 85px;
        /* Match numeric width */
        min-width: 85px;
    }

    /* 4. Total Column - Needs more width for large totals & larger font in footer */
    th:last-child,
    td:last-child {
        width: 120px;
        min-width: 120px;
    }

    /* Desktop Rows */
    .tr-week-total td {
        background: var(--week-sep-bg);
        font-weight: 700;
        color: var(--week-sep-text);
        border-bottom: none;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .tr-week-total td:first-child {
        border-top-left-radius: 12px;
        border-bottom-left-radius: 12px;
    }

    .tr-week-total td:last-child {
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .tr-total td {
        background: var(--grand-total-bg);
        font-weight: 800;
        color: var(--grand-total-text);
        font-size: 1.1rem;
        border-bottom: none;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .tr-total td:first-child {
        border-top-left-radius: 16px;
        border-bottom-left-radius: 16px;
    }

    .tr-total td:last-child {
        border-top-right-radius: 16px;
        border-bottom-right-radius: 16px;
    }
}

.num {
    text-align: right;
    font-feature-settings: "tnum";
    font-weight: 500;
}

.col-ot {
    color: var(--warning);
    font-weight: 700;
}

.col-total {
    color: var(--success);
    font-weight: 700;
}

.tr-spacer td {
    border: none;
    height: 10px;
    padding: 0;
    background: transparent;
}

.desc-text {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: normal;
    margin-left: 6px;
    display: inline-block;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.job-link {
    cursor: pointer;
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.1s;
}

.job-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* --- Footer --- */
footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-bottom: 20px;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    margin-left: 5px;
}

.footer-link:hover {
    text-decoration: underline;
}

.changelog-item {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    text-align: left;
}

.changelog-item:last-child {
    border-bottom: none;
}

.cl-ver {
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.cl-desc {
    color: var(--text-main);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.modal {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: var(--text-main);
}

.modal.large {
    max-width: 1200px;
    width: 95%;
}

.modal h2 {
    margin-top: 0;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

/* --- Job Entry Styles --- */
.existing-jobs {
    margin-bottom: 20px;
    background: var(--bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn {
    border: none;
    cursor: pointer;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    transition: 0.2s;
}

.btn-edit {
    background: #e0f2fe;
    color: #0284c7;
}

body.dark-mode .btn-edit {
    background: #1e3a8a;
    color: #93c5fd;
}

.btn-del {
    background: #fee2e2;
    color: #dc2626;
}

body.dark-mode .btn-del {
    background: #7f1d1d;
    color: #fca5a5;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px dashed var(--border);
    padding-top: 20px;
    margin-top: 10px;
}

.row {
    display: flex;
    gap: 15px;
}

.field {
    flex: 1;
}

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: 0.2s;
    background: var(--bg);
    color: var(--text-main);
}

.field input:focus {
    border-color: var(--primary);
    outline: none;
    border-color: var(--primary);
}

.btn-main {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-main.is-editing {
    background-color: var(--success);
}

.btn-cancel-edit {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 10px;
    margin-top: 8px;
    cursor: pointer;
    display: none;
    font-weight: 600;
}

.btn-close {
    width: 100%;
    background: var(--bg);
    color: var(--text-main);
    padding: 14px;
    border: none;
    border-radius: 10px;
    margin-top: 25px;
    cursor: pointer;
}

.btn-run {
    background: var(--secondary);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 2px;
}

.report-section {
    margin-bottom: 25px;
}

.report-title {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.rep-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    font-size: 0.95rem;
}

.rep-total {
    background: var(--grand-total-bg);
    color: var(--grand-total-text);
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    text-align: center;
    border: 1px solid var(--border);
}

.report-controls {
    display: flex;
    gap: 10px;
}

/* --- MOBILE LAYOUT --- */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 0;
    }

    .header-top {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        align-items: stretch;
    }

    h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        justify-content: center;
    }

    .controls {
        flex-direction: column;
        gap: 15px;
    }

    .control-group {
        min-width: 100%;
    }

    .summary-card {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px;
    }

    .stat.total {
        grid-column: span 2;
        margin-top: 10px;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        min-width: 100%;
        gap: 15px;
    }

    .day-card {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        min-height: auto;
    }

    .day-header {
        margin: 0;
        flex: 1;
        flex-direction: column;
        justify-content: center;
    }

    .day-content {
        display: none;
    }

    .day-total {
        margin: 0;
    }

    .week-divider {
        flex-direction: column;
        gap: 5px;
        text-align: center;
        border-radius: 16px;
    }

    .table-wrap {
        border-radius: 16px;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    table {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody {
        display: block;
    }

    tr {
        display: block;
        background: var(--surface);
        margin-bottom: 20px;
        border-radius: 16px;
        border: 1px solid var(--border);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        overflow: hidden;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid var(--border);
        text-align: right;
        font-size: 0.95rem;
        white-space: normal;
        /* Force text wrap */
        word-break: break-word;
        /* Prevent overflow */
    }

    td:last-child {
        border-bottom: none;
    }

    /* Add Data Labels using pseudo-elements */
    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--card-label);
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-right: 15px;
        text-align: left;
        flex: 1;
        /* Allow label to take space */
    }

    /* Special layout for the Date/Job cells */
    td[data-label="Date"] {
        background: var(--bg);
        font-weight: 800;
        color: var(--text-main);
        border-bottom: 1px solid var(--border);
    }

    td[data-label="Job # / Desc"] {
        font-weight: 700;
        color: var(--primary);
        font-size: 1.1rem;
    }

    td[data-label="Total"],
    td[data-label="Total Pay"] {
        /* Added Total Pay for week summary */
        background: var(--grand-total-bg);
        color: var(--grand-total-text);
        font-weight: 800;
        font-size: 1.1rem;
    }

    /* Hide empty cells in mobile if needed, or style them */
    .tr-spacer {
        display: none;
    }

    tfoot {
        display: block;
        margin-top: 20px;
    }

    tfoot tr {
        background: var(--grand-total-bg);
        border-color: var(--primary);
    }

    tfoot td {
        color: var(--grand-total-text);
    }

    /* Week Summary Mobile Fix */
    .tr-week-total {
        background: var(--week-sep-bg);
        margin-bottom: 15px;
    }

    .tr-week-total td {
        color: var(--text-main);
        background: transparent;
        justify-content: space-between;
    }

    /* Specific fix to ensure label/value alignment */
    .tr-week-total td[colspan="2"] {
        justify-content: center;
        font-weight: 800;
        font-size: 1rem;
        color: var(--text-muted);
        background: rgba(0, 0, 0, 0.02);
    }


    /* GRID LAYOUT: Hours [Left] vs Pay [Right] */
    tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    td {
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    /* Full Width Headers */
    td[data-label="Date"],
    td[data-label="Job # / Desc"] {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    td[data-label="Job # / Desc"] {
        border-bottom: 2px solid var(--border);
    }

    /* --- GRID ROW ASSIGNMENTS (Force Visual Order) --- */

    /* Row 1: Date (Full Width) */
    td[data-label="Date"] {
        grid-row: 1;
        grid-column: 1 / -1;
    }

    /* Row 2: Job Desc (Full Width) */
    td[data-label="Job # / Desc"] {
        grid-row: 2;
        grid-column: 1 / -1;
    }

    /* Hide the label for Job Desc as it causes vertical stacking and is implicit */
    td[data-label="Job # / Desc"]::before {
        display: none;
    }

    /* Row 3: Reg Hrs | Reg Pay */
    td[data-label="Reg Hrs"] {
        grid-row: 3;
        grid-column: 1;
    }

    td[data-label="Reg Pay"] {
        grid-row: 3;
        grid-column: 2;
        text-align: right;
        align-items: flex-end;
    }

    /* Row 4: OT Hrs | OT Pay */
    td[data-label="OT Hrs"] {
        grid-row: 4;
        grid-column: 1;
    }

    td[data-label="OT Pay"] {
        grid-row: 4;
        grid-column: 2;
        text-align: right;
        align-items: flex-end;
    }

    /* Row 5: Miles | Miles Pay */
    td[data-label="Miles"] {
        grid-row: 5;
        grid-column: 1;
    }

    td[data-label="Miles Pay"] {
        grid-row: 5;
        grid-column: 2;
        text-align: right;
        align-items: flex-end;
    }

    /* Row 6: Expenses (Full Width) */
    td[data-label="Expenses"] {
        grid-row: 6;
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        border-bottom: 2px solid var(--border);
        background: rgba(0, 0, 0, 0.01);
    }

    /* Row 7: Total Hrs | Total Pay (Bottom) */
    /* This overrides the DOM order (Tot Hrs is usually Index 2) */
    td[data-label="Tot Hrs"] {
        grid-row: 7;
        grid-column: 1;
        font-weight: 700;
        background: var(--tot-hrs-bg);
        color: var(--tot-hrs-text);
        justify-content: flex-end;
        align-items: flex-start;
    }

    td[data-label="Total"] {
        grid-row: 7;
        grid-column: 2;
        text-align: right;
        align-items: flex-end;
        font-size: 1.1rem;
        font-weight: 800;
        color: var(--success);
    }

    /* Handle Pseudo-labels alignments */
    td[data-label="Reg Pay"]::before,
    td[data-label="OT Pay"]::before,
    td[data-label="Miles Pay"]::before,
    td[data-label="Total"]::before {
        align-self: flex-end;
        text-align: right;
    }

    /* FOOTER / WEEKLY SUMMARY GRID OVERRIDES */
    .tr-week-total,
    .tr-total {
        display: grid;
    }

    /* Re-map the footer/summary cells to match the grid */
    /* Reg */
    .tr-week-total td[data-label="Reg Hrs"],
    .tr-total td[data-label="Reg Hrs"] {
        grid-column: 1;
        grid-row: 2;
    }

    .tr-week-total td[data-label="Reg Pay"],
    .tr-total td[data-label="Reg Pay"] {
        grid-column: 2;
        grid-row: 2;
        text-align: right;
        align-items: flex-end;
    }

    /* OT */
    .tr-week-total td[data-label="OT Hrs"],
    .tr-total td[data-label="OT Hrs"] {
        grid-column: 1;
        grid-row: 3;
    }

    .tr-week-total td[data-label="OT Pay"],
    .tr-total td[data-label="OT Pay"] {
        grid-column: 2;
        grid-row: 3;
        text-align: right;
        align-items: flex-end;
    }

    /* Miles */
    .tr-week-total td[data-label="Miles"],
    .tr-total td[data-label="Miles"] {
        grid-column: 1;
        grid-row: 4;
    }

    .tr-week-total td[data-label="Miles Pay"],
    .tr-total td[data-label="Miles Pay"] {
        grid-column: 2;
        grid-row: 4;
        text-align: right;
        align-items: flex-end;
    }

    /* Expenses */
    .tr-week-total td[data-label="Expenses"],
    .tr-total td[data-label="Expenses"] {
        grid-column: 1 / -1;
        grid-row: 5;
        font-weight: 700;
    }

    /* Total */
    .tr-week-total td[data-label="Tot Hrs"],
    .tr-total td[data-label="Tot Hrs"] {
        grid-column: 1;
        grid-row: 6;
    }

    .tr-week-total td[data-label="Total Pay"],
    .tr-total td[data-label="Total Pay"] {
        grid-column: 2;
        grid-row: 6;
        text-align: right;
        align-items: flex-end;
    }

    /* Header Title Spanning */
    .tr-week-total td[colspan="2"],
    .tr-total td[colspan="2"] {
        grid-column: 1 / -1;
        grid-row: 1;
    }

}