/* =========================================================
   LOBS HOLE BUSSING OPERATIONS
   CLEAN STYLE SHEET - V0.7
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef2f5;
    color: #17212b;
}

body {
    overflow-x: hidden;
}


/* =========================================================
   TOP HEADER
   ========================================================= */

.topbar {
    height: 82px;
    background: #162533;
    color: white;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 22px;
    border-bottom: 4px solid #e3a51a;
}

.topbar h1 {
    margin: 0;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 1px;
}

.topbar p {
    margin: 3px 0 0;
    color: #b8c4ce;
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

.topbar button {
    border: 0;
    border-radius: 6px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

#todayBtn {
    background: #d8e0e6;
    color: #17212b;
}

.commit-button {
    background: #e3a51a;
    color: #17212b;
}


/* =========================================================
   MAIN
   ========================================================= */

main {
    padding: 14px;
}


/* =========================================================
   BOARD CONTAINER
   ========================================================= */

.board-container {
    width: 100%;
    overflow-x: auto;

    background: white;

    border: 1px solid #c5ced6;
    border-radius: 7px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   TABLE
   ========================================================= */

#rosterBoard {
    width: max-content;
    min-width: 100%;

    border-collapse: separate;
    border-spacing: 0;

    table-layout: fixed;
}


/* =========================================================
   DATE HEADERS
   ========================================================= */

#rosterBoard th {
    width: 92px;
    min-width: 92px;
    max-width: 92px;

    height: 64px;

    padding: 4px 2px;

    background: #263b4b;
    color: white;

    border-right: 1px solid #51616d;
    border-bottom: 2px solid #162533;

    text-align: center;
    overflow: hidden;
}

.day-name {
    display: block;
    margin-bottom: 2px;

    color: #c9d3db;

    font-size: 11px;
    line-height: 12px;
    font-weight: 700;
}

.date-number {
    display: block;

    font-size: 25px;
    line-height: 26px;
    font-weight: 900;
}

.month-name {
    display: block;
    margin-top: 1px;

    color: #9fb0bd;

    font-size: 9px;
    line-height: 10px;
}


/* =========================================================
   FROZEN DRIVER COLUMN
   ========================================================= */

.driver-column {
    position: sticky;
    left: 0;

    z-index: 10;

    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;

    text-align: left !important;

    padding-left: 14px !important;

    border-right: 3px solid #162533 !important;
}

thead .driver-column {
    z-index: 30;

    background: #162533 !important;
    color: white !important;

    font-size: 15px;
    font-weight: 900;
}


/* =========================================================
   DRIVER NAMES

   White cell.
   Name text colour identifies swing.
   ========================================================= */

.driver-name {
    height: 62px;

    background: white !important;

    font-size: 17px;
    font-weight: 900;

    border-bottom: 1px solid #ccd4da;

    padding-left: 14px !important;
}


/* THURSDAY */

.swing-thursday .driver-name {
    background: white !important;
    color: #1565c0 !important;
}


/* FRIDAY */

.swing-friday .driver-name {
    background: white !important;
    color: #ef6c00 !important;
}


/* MONDAY */

.swing-monday .driver-name {
    background: white !important;
    color: #2e7d32 !important;
}


/* =========================================================
   SWING HEADINGS
   ========================================================= */

.roster-group-row td {
    height: 28px !important;
    cursor: default !important;
}

.roster-group-name {
    color: white !important;

    font-size: 12px !important;
    font-weight: 900 !important;

    letter-spacing: 0.7px;
}

.swing-thursday .roster-group-name {
    background: #1565c0 !important;
}

.swing-friday .roster-group-name {
    background: #ef6c00 !important;
}

.swing-monday .roster-group-name {
    background: #2e7d32 !important;
}

.roster-group-fill {
    background: #f5f7f8 !important;

    border-bottom: 2px solid #c5ced6 !important;

    padding: 0 !important;
}


/* =========================================================
   NORMAL CALENDAR CELLS
   ========================================================= */

#rosterBoard td.run {
    width: 92px;
    min-width: 92px;
    max-width: 92px;

    height: 62px;

    padding: 0;

    text-align: center;

    font-size: 18px;
    font-weight: 900;

    border-right: 1px solid #ccd4da;
    border-bottom: 1px solid #ccd4da;

    cursor: pointer;

    overflow: hidden;
    white-space: nowrap;

    background: white;
}


/* =========================================================
   RUN COLOURS
   ========================================================= */

#rosterBoard td.run.run-1,
.run-1 {
    background: #e57373;
    color: #111;
}

#rosterBoard td.run.run-2,
.run-2 {
    background: #64b5f6;
    color: #111;
}

#rosterBoard td.run.run-3,
.run-3 {
    background: #81c784;
    color: #111;
}

#rosterBoard td.run.run-4,
.run-4 {
    background: #ffb74d;
    color: #111;
}

#rosterBoard td.run.run-5,
.run-5 {
    background: #ba68c8;
    color: #111;
}

#rosterBoard td.run.run-6,
.run-6 {
    background: #4dd0e1;
    color: #111;
}

#rosterBoard td.run.run-7,
.run-7 {
    background: #fff176;
    color: #111;
}


/* =========================================================
   SP RUN COLOURS
   ========================================================= */

.run-sp1 {
    background: #90caf9 !important;
    color: #111;
}

.run-sp2 {
    background: #a5d6a7 !important;
    color: #111;
}

.run-sp3 {
    background: #ffcc80 !important;
    color: #111;
}

.run-sp4 {
    background: #ce93d8 !important;
    color: #111;
}

.run-sp5 {
    background: #80cbc4 !important;
    color: #111;
}

.run-sp6 {
    background: #ef9a9a !important;
    color: #111;
}

.run-sp7 {
    background: #b39ddb !important;
    color: #111;
}

.run-sp8 {
    background: #9fa8da !important;
    color: #111;
}

.run-sp9 {
    background: #bcaaa4 !important;
    color: #111;
}


/* =========================================================
   SPECIAL RUNS
   ========================================================= */

.run-mt {
    background: #78909c !important;
    color: white !important;
}

.run-w {
    background: #ffd54f !important;
    color: #111 !important;
}


/* =========================================================
   STATUS COLOURS
   ========================================================= */

.status-in {
    background: #2e7d32 !important;
    color: white !important;
}

.status-out {
    background: #c62828 !important;
    color: white !important;
}

.status-x {
    background: #424242 !important;
    color: white !important;
}

.status-al {
    background: #7b1fa2 !important;
    color: white !important;
}

.status-lh {
    background: #455a64 !important;
    color: white !important;
}


/* =========================================================
   TODAY
   ========================================================= */

.today-column {
    background: #344f63 !important;

    box-shadow:
        inset 4px 0 0 #f4c542,
        inset -4px 0 0 #f4c542;
}

.today-cell {
    box-shadow:
        inset 4px 0 0 #f4c542,
        inset -4px 0 0 #f4c542 !important;
}


/* =========================================================
   HISTORY
   ========================================================= */

.past-cell {
    opacity: 0.50;

    cursor: not-allowed !important;

    filter: grayscale(35%);
}


/* =========================================================
   SPLIT RUN / OUT
   ========================================================= */

.split-out-cell {
    padding: 0 !important;
    background: white !important;
    overflow: hidden;
}

.split-cell {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
}

.split-run,
.split-out {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    font-weight: 900;
}

.split-out {
    background: #c62828;
    color: white;

    border-top: 2px solid white;
}


/* =========================================================
   RUN / BUS ALLOCATION
   ========================================================= */

.bus-allocation-section {
    margin-top: 14px;

    background: white;

    border: 1px solid #c5ced6;
    border-radius: 7px;

    overflow: hidden;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12);
}

.bus-allocation-section h2 {
    margin: 0;

    padding: 10px 16px;

    background: #263b4b;
    color: white;

    font-size: 15px;
    letter-spacing: 0.5px;
}

.bus-allocation-scroll {
    width: 100%;
    overflow-x: auto;
}

.bus-allocation-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;
}

.bus-allocation-table th {
    width: 85px;
    min-width: 85px;

    background: #162533;
    color: white;

    font-size: 14px;
    font-weight: 900;

    text-align: center;

    border-right: 2px solid white;
    border-bottom: 1px solid #ccd4da;
}

.bus-allocation-table td {
    min-width: 65px;

    height: 42px;

    text-align: center;

    font-size: 15px;
    font-weight: 900;

    border-right: 1px solid #ccd4da;
    border-bottom: 1px solid #ccd4da;
}


/* Bus numbers deliberately neutral */

.bus-number-row td {
    background: white !important;

    color: #17212b !important;

    font-size: 17px;
    font-weight: 900;
}


/* =========================================================
   OPERATIONAL NOTES
   ========================================================= */

.notes-section {
    margin-top: 14px;

    background: white;

    border: 1px solid #c5ced6;
    border-radius: 7px;

    overflow: hidden;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12);
}

.notes-section h2 {
    margin: 0;

    padding: 10px 16px;

    background: #263b4b;
    color: white;

    font-size: 15px;
    letter-spacing: 0.5px;
}

.note {
    min-height: 44px;

    display: flex;
    align-items: center;

    padding: 8px 16px;

    border-bottom: 1px solid #d9dfe4;

    font-size: 14px;
}

.note:last-child {
    border-bottom: none;
}

.note strong {
    width: 125px;
    min-width: 125px;

    color: #162533;
}


/* =========================================================
   CELL EDITOR
   ========================================================= */

.cell-editor {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.65);
}

.cell-editor.hidden {
    display: none !important;
}

.cell-editor-box {
    width: 360px;
    max-width: 90vw;
    max-height: 85vh;

    display: flex;
    flex-direction: column;

    background: white;

    border-radius: 10px;

    overflow: hidden;

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.40);
}

.editor-header {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px;

    background: #162533;
    color: white;
}

.editor-header h2 {
    margin: 0;
    font-size: 21px;
}

.editor-header p {
    margin: 4px 0 0;

    color: #b8c4ce;

    font-size: 13px;
}

#closeEditor {
    border: 0;

    background: transparent;
    color: white;

    font-size: 30px;

    cursor: pointer;
}


/* =========================================================
   EDITOR OPTIONS
   ========================================================= */

.editor-options {
    display: flex;
    flex-direction: column;

    gap: 6px;

    padding: 12px;

    overflow-y: auto;
}

.editor-options button {
    width: 100%;
    min-height: 48px;

    flex-shrink: 0;

    border: 1px solid rgba(0, 0, 0, 0.25);

    border-radius: 6px;

    font-size: 17px;
    font-weight: 900;

    cursor: pointer;
}


/* =========================================================
   EDITOR FOOTER
   ========================================================= */

.editor-footer {
    flex-shrink: 0;

    display: flex;
    justify-content: flex-end;

    gap: 8px;

    padding: 12px;

    border-top: 1px solid #ddd;
}

.editor-footer button {
    padding: 11px 17px;

    border: 0;
    border-radius: 5px;

    font-weight: 800;

    cursor: pointer;
}


/* =========================================================
   SMALLER SCREENS
   ========================================================= */

@media (max-width: 900px) {

    .topbar h1 {
        font-size: 21px;
    }

    .topbar p {
        display: none;
    }

    main {
        padding: 8px;
    }

    .driver-column {
        width: 145px !important;
        min-width: 145px !important;
        max-width: 145px !important;
    }

    .bus-allocation-table {
        width: max-content;
    }

    .bus-allocation-table td {
        width: 65px;
    }
}