:root {
    font-family: Segoe UI, Arial, sans-serif;
    color: #1e293b;
    background: #f5f7fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    color: #075985;
}

.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #102a43;
    color: white;
}

.brand {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.tag {
    font-size: .85rem;
    color: #d9eafd;
}

.body-grid {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    flex: 1;
}

.sidebar {
    padding: 1.25rem;
    background: #e8eef5;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

    .sidebar a {
        padding: .7rem .8rem;
        text-decoration: none;
        border-radius: .4rem;
    }

        .sidebar a.active {
            background: white;
            font-weight: 600;
        }

.content {
    padding: 2rem;
    max-width: 1100px;
    width: 100%;
}

.notice {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: .6rem;
    background: white;
}

.primary {
    padding: .65rem 1rem;
    border: 0;
    border-radius: .4rem;
    background: #075985;
    color: white;
    cursor: pointer;
}

    .primary:disabled {
        opacity: .65;
        cursor: wait;
    }

footer {
    padding: 1rem 1.5rem;
    font-size: .85rem;
    color: #475569;
    border-top: 1px solid #dbe2ea;
}

@media (max-width: 700px) {
    .body-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
    }

    .content {
        padding: 1.2rem;
    }
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}

    .module-grid section {
        border: 1px solid #d7dce2;
        border-radius: 8px;
        padding: 1rem;
        background: var(--bs-body-bg,#fff);
    }

    .module-grid h3 {
        margin-top: 0;
    }

.table-scroll {
    overflow: auto;
    max-width: 100%;
    border: 1px solid #d7dce2;
    margin: 1rem 0;
}

.data-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: .85rem;
}

    .data-table th, .data-table td {
        border-bottom: 1px solid #e0e4e8;
        border-right: 1px solid #e0e4e8;
        padding: .4rem .55rem;
        max-width: 340px;
        overflow-wrap: anywhere;
    }

    .data-table th {
        position: sticky;
        top: 0;
        background: #f1f4f7;
        text-align: left;
    }

.pager, .table-links {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin: .8rem 0;
}

    .table-links a {
        border: 1px solid #d7dce2;
        border-radius: 5px;
        padding: .3rem .5rem;
    }

.error {
    color: #b42318;
}

.edit-panel {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 1px solid var(--border, #ccc);
    border-radius: .5rem;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(10rem, 16rem) minmax(12rem, 1fr);
    gap: .5rem 1rem;
    margin: .75rem 0;
    align-items: start;
}

    .field-row label {
        font-weight: 600;
    }

    .field-row input, .field-row textarea {
        width: 100%;
        box-sizing: border-box;
        padding: .55rem;
    }

    .field-row small {
        color: #666;
        font-weight: normal;
    }

button.danger {
    border-color: #b42318;
    color: #b42318;
}

@media (max-width: 700px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}


.job-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .8rem;
    margin: 1rem 0;
}

    .job-filters label {
        display: flex;
        flex-direction: column;
        gap: .35rem;
        min-width: 13rem;
    }

    .job-filters input, .job-filters select {
        padding: .55rem;
        min-width: 13rem;
    }

.job-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: .7rem;
    margin: 1rem 0;
}

    .job-summary div {
        display: flex;
        flex-direction: column;
        gap: .25rem;
        border: 1px solid #d7dce2;
        border-radius: 6px;
        padding: .75rem;
        background: white;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .job-summary strong {
        color: #475569;
        font-size: .85rem;
    }

/* Main module landing and segregated module dashboards */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

    .topbar-right a {
        color: #cbd5e1;
        text-decoration: none;
        font-size: .9rem;
    }

.content-landing {
    padding: clamp(1.25rem, 4vw, 3.5rem);
}

.portal-home {
    max-width: 1500px;
    margin: 0 auto;
}

.welcome-banner {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    margin: clamp(1rem, 4vw, 3.25rem) 0 3rem;
}

.welcome-mark {
    width: 5rem;
    height: 5rem;
    display: grid;
    place-items: center;
    font-size: 3.4rem;
    color: #f5d84b;
    line-height: 1;
}

.welcome-banner h1 {
    color: #3498f7;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 400;
    margin: 0 0 .4rem;
}

.welcome-banner p {
    margin: 0;
    color: #263238;
}

.module-landing-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 3rem;
}

.landing-card {
    min-height: 210px;
    padding: 2rem 2.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #101820;
    text-decoration: none;
    background: #fff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 8px 18px #0002,0 12px 24px #0001;
    transition: transform .15s ease,box-shadow .15s ease;
}

    .landing-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px #0003;
    }

    .landing-card h2 {
        font-size: 2rem;
        font-weight: 400;
        margin: 0 0 .65rem;
        line-height: 1.15;
    }

    .landing-card span {
        color: #367ac5;
        font-size: .95rem;
    }

    .landing-card p {
        color: #64748b;
        max-width: 24rem;
        margin: .8rem 0 0;
        font-size: .9rem;
    }

.landing-icon {
    flex: 0 0 auto;
    font-size: 5rem;
    line-height: 1;
    width: 100px;
    text-align: center;
}

.inspection-card .landing-icon {
    color: #cc2344;
}

.workshop-card .landing-icon {
    color: #5dbb66;
}

.rental-card .landing-icon {
    color: #24529b;
}

.module-page {
    max-width: 1500px;
    margin: 0 auto;
}

.module-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

    .module-heading h1 {
        font-size: 2.2rem;
        font-weight: 400;
        margin: .2rem 0;
        color: #253244;
    }

    .module-heading p {
        margin: .3rem 0;
        color: #64748b;
    }

.eyebrow {
    font-size: .75rem !important;
    letter-spacing: .12em;
    font-weight: 700;
    color: #64748b !important;
}

.primary-action {
    display: inline-block;
    padding: .7rem 1rem;
    border-radius: 4px;
    background: #50b85e;
    color: white;
    text-decoration: none;
    white-space: nowrap;
}

    .primary-action:hover {
        background: #319747;
    }

.dashboard-tile-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 1.5rem;
}

.dashboard-tile {
    min-height: 130px;
    padding: 1rem 1.1rem;
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: .25rem .8rem;
    text-decoration: none;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 3px 10px #0000000d;
}

    .dashboard-tile:hover {
        box-shadow: 0 6px 15px #0002;
        transform: translateY(-1px);
    }

.tile-symbol {
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 2.7rem;
    line-height: 1;
    text-align: center;
}

.dashboard-tile strong {
    align-self: end;
    color: #263238;
    font-size: 1.15rem;
    font-weight: 500;
}

.dashboard-tile small {
    color: #64748b;
    line-height: 1.4;
}

.dashboard-tile.blue {
    border-top: 4px solid #427bb8;
}

    .dashboard-tile.blue .tile-symbol {
        color: #427bb8;
    }

.dashboard-tile.green {
    border-top: 4px solid #58b864;
}

    .dashboard-tile.green .tile-symbol {
        color: #58b864;
    }

.dashboard-tile.amber {
    border-top: 4px solid #f0b44f;
}

    .dashboard-tile.amber .tile-symbol {
        color: #e6a13b;
    }

.dashboard-tile.red {
    border-top: 4px solid #d9534f;
}

    .dashboard-tile.red .tile-symbol {
        color: #d9534f;
    }

.dashboard-tile.purple {
    border-top: 4px solid #8b75b7;
}

    .dashboard-tile.purple .tile-symbol {
        color: #8b75b7;
    }

.dashboard-tile.slate {
    border-top: 4px solid #64748b;
}

    .dashboard-tile.slate .tile-symbol {
        color: #64748b;
    }

.module-footnote {
    margin-top: 1.5rem;
    padding: 1rem;
    border-left: 3px solid #eab54c;
    background: #fffaf0;
    color: #66552d;
    font-size: .9rem;
}

.sidebar-title {
    display: block;
    color: #fff;
    padding: .85rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid #3a3a3a;
}

.nav-group {
    padding: .8rem 0;
    border-bottom: 1px solid #333;
}

    .nav-group > span {
        display: block;
        padding: .25rem 1rem .45rem;
        color: #9ca3af;
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .1em;
    }

    .nav-group a {
        display: block;
        padding: .48rem 1rem;
        color: #cbd5e1;
        text-decoration: none;
        font-size: .9rem;
    }

        .nav-group a.active, .nav-group a:hover {
            color: white;
            background: #343434;
        }

@media(max-width:900px) {
    .module-landing-grid {
        gap: 1.25rem;
    }

    .landing-card {
        padding: 1.4rem;
        min-height: 180px;
    }

    .dashboard-tile-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media(max-width:650px) {
    .module-landing-grid, .dashboard-tile-grid {
        grid-template-columns: 1fr;
    }

    .landing-card {
        min-height: 150px;
    }

    .welcome-banner {
        margin-bottom: 2rem;
    }

    .module-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-icon {
        font-size: 3.5rem;
        width: 65px;
    }

    .body-grid {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        max-height: none !important;
    }
}
