* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f5f7;
    color: #18212a;
}

.topbar {
    background: #111820;
    padding: 14px 20px;
    border-bottom: 4px solid #f2c811;
}

.brand {
    color: white;
    text-decoration: none;
    display: inline-block;
}

.brand-main {
    font-weight: 800;
    font-size: 21px;
    letter-spacing: 1.5px;
}

.brand-sub {
    color: #f2c811;
    font-size: 13px;
}

.container {
    max-width: 1050px;
    margin: auto;
    padding: 22px;
}

h1 {
    margin: 6px 0;
}

h2 {
    margin-top: 0;
}

h3 {
    margin: 0;
}

.page-heading,
.section-heading,
.tray-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-heading p {
    margin: 5px 0;
    color: #65717c;
}

.back {
    color: #56616b;
    text-decoration: none;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 7px;
    padding: 12px 18px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
}

.primary {
    background: #f2c811;
    color: #111820;
}

.secondary {
    background: #e8ecef;
    color: #202830;
}

.form label {
    display: block;
    margin-bottom: 20px;
    font-weight: 600;
}

.form input,
.form textarea,
.form select,
.search input {
    width: 100%;
    display: block;
    margin-top: 7px;
    padding: 13px;
    border: 1px solid #cbd2d8;
    border-radius: 7px;
    font: inherit;
    background: white;
}

.form textarea {
    resize: vertical;
}

.form small {
    display: block;
    margin-top: 7px;
    color: #687580;
    font-weight: normal;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.gps {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    padding: 16px;
    background: white;
    border-radius: 9px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.stat span {
    display: block;
    font-size: 28px;
    font-weight: 800;
}

.stat.good span {
    color: #16803b;
}

.stat.acceptable span {
    color: #588000;
}

.stat.remedial span {
    color: #c27700;
}

.stat.failed span {
    color: #be2b2b;
}

.project-row,
.joint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #e4e8eb;
    padding: 15px 5px;
}

.project-row:last-child,
.joint-row:last-child {
    border-bottom: 0;
}

.project-row strong,
.joint-row strong {
    display: block;
    font-size: 17px;
}

.project-row small,
.joint-row small {
    display: block;
    color: #687580;
    margin-top: 3px;
}

.condition {
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    background: #e9edf0;
}

.condition.good {
    background: #dcf3e3;
    color: #14642c;
}

.condition.acceptable {
    background: #edf2d3;
    color: #566c00;
}

.condition.remedial-required {
    background: #fff0cb;
    color: #8c5b00;
}

.condition.failed {
    background: #f9dada;
    color: #9f2020;
}

.condition.large {
    display: inline-block;
    margin-top: 5px;
    font-size: 14px;
}

.details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.details span {
    display: block;
    color: #6b7680;
    font-size: 13px;
}

.details strong {
    display: block;
    margin-top: 4px;
}

.notes {
    white-space: pre-wrap;
    line-height: 1.5;
}

.photos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.photos img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 7px;
    display: block;
}

.search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 18px;
}

.search input {
    margin: 0;
}

.flash {
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 20px;
}

.flash.success {
    background: #dff4e5;
}

.flash.error {
    background: #f9dddd;
}

.empty {
    color: #697680;
    text-align: center;
    padding: 30px;
}

@media (max-width: 700px) {

    .container {
        padding: 15px;
    }

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

    .page-heading .button {
        width: 100%;
        text-align: center;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid,
    .gps,
    .details {
        grid-template-columns: 1fr;
    }

    .photos {
        grid-template-columns: repeat(2, 1fr);
    }

    .photos img {
        height: 150px;
    }

    .joint-row {
        align-items: flex-start;
    }

    .section-heading {
        align-items: center;
    }

    .button {
        min-height: 46px;
    }
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #d7dde2;
    font-size: 14px;
}

.user-menu a {
    color: #f2c811;
    text-decoration: none;
    font-weight: 650;
}

.login-wrap {
    max-width: 420px;
    margin: 70px auto;
}

.login-card {
    padding: 32px;
}

.login-card h1 {
    margin-bottom: 0;
}

.login-subtitle {
    margin-top: 3px;
    margin-bottom: 28px;
    color: #687580;
}

.login-button {
    width: 100%;
    font-size: 16px;
}
