* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

a {
    color: inherit;
}

.topbar {
    background: #111;
    color: white;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand img {
    height: 28px;
    width: auto;
    display: block;
}

.brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.logout-form {
    display: inline;
}

.logout-form button {
    background: transparent;
    color: white;
    border: 1px solid #777;
    border-radius: 6px;
    padding: 6px 10px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.vehicle-card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    text-decoration: none;
    border-left: 8px solid #999;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    display: block;
    min-height: 180px;
}

.vehicle-card h2 {
    margin: 0 0 22px;
    font-size: 25px;
    line-height: 1.15;
}

.vehicle-card p {
    display: none;
}

.vehicle-card strong {
    display: block;
    font-size: 22px;
    margin-bottom: 14px;
}

.vehicle-card span {
    display: block;
    margin-bottom: 18px;
}

.vehicle-card small {
    display: block;
    color: #555;
    line-height: 1.25;
    font-size: 14px;
}

.vehicle-card-status {
    font-weight: 700;
    font-size: 17px;
}

.vehicle-card-status.ready {
    color: #2eaf5d;
}

.vehicle-card-status.in_use {
    color: #b89200;
}

.vehicle-card-status.preparation {
    color: #d64242;
}

.vehicle-card-status.needs_attention {
    color: #e67e22;
}

.ready {
    border-color: #2eaf5d !important;
}

.in_use {
    border-color: #d7a900 !important;
}

.preparation {
    border-color: #d64242 !important;
}

.needs_attention {
    border-color: #e67e22 !important;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.badge.ready {
    background: #dff4e7;
    color: #176a34;
}

.badge.in_use {
    background: #fff2c7;
    color: #7a5a00;
}

.badge.preparation {
    background: #ffe0e0;
    color: #8a2020;
}

.badge.needs_attention {
    background: #fff0dc;
    color: #b45f06;
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

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

.button,
button {
    background: #111;
    color: white;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    background: #555;
}

.details,
.form-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    margin-bottom: 22px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
}

th,
td {
    padding: 11px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eee;
}

.notes-row {
    background: #fafafa;
    color: #555;
}

.message {
    background: #e8f4ff;
    border: 1px solid #b9ddff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.field-block {
    margin-bottom: 16px;
}

.field-block label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.radio-block ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.radio-block li {
    margin: 0;
}

.radio-block label,
.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.radio-block input,
.checkbox-row input {
    width: auto;
}

.checkbox-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.form-card h3 {
    margin-top: 22px;
    margin-bottom: 10px;
}

.vehicle-profile-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 520px);
    gap: 28px;
    align-items: start;
}

.vehicle-photo-box {
    width: 100%;
}

.vehicle-photo-box img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.vehicle-photo-placeholder {
    width: 100%;
    min-height: 260px;
    border: 2px dashed #d8d8d8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    background: #fafafa;
    text-align: center;
    padding: 20px;
}

.form-errors,
.errorlist {
    background: #fff1f1;
    border: 1px solid #f0bcbc;
    color: #9b1c1c;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0 18px;
}

.errorlist {
    list-style: none;
}

@media (max-width: 800px) {
    .vehicle-profile-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .container {
        padding: 14px;
    }

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

    .radio-block ul,
    .checkbox-row {
        flex-direction: column;
        gap: 8px;
    }

    .brand img {
        height: 24px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 8px;
    }
}

/* Vehicle profile photo */
.vehicle-profile-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 520px);
    gap: 28px;
    align-items: start;
}

.vehicle-photo-box {
    width: 100%;
}

.vehicle-photo-box img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.vehicle-photo-placeholder {
    width: 100%;
    min-height: 260px;
    border: 2px dashed #d8d8d8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    background: #fafafa;
    text-align: center;
    padding: 20px;
}

@media (max-width: 800px) {
    .vehicle-profile-card {
        grid-template-columns: 1fr;
    }
}
/* Mobile expandable menu */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 99px;
    margin: 5px 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .topbar {
        align-items: center;
        padding: 18px 24px;
    }

    .brand img {
        height: 24px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding-top: 18px;
    }

    body.menu-open .main-nav {
        display: flex;
    }

    .main-nav a {
        font-size: 20px;
        line-height: 1.2;
    }

    .logout-form button {
        font-size: 18px;
        padding: 8px 14px;
    }
}
@media (max-width: 700px) {

    .main-nav {

        align-items: flex-end;

        text-align: right;

    }

    .main-nav a,

    .main-nav .logout-form {

        align-self: flex-end;

    }

}
/* Login page */
.login-body {
    min-height: 100vh;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    max-width: 210px;
    height: auto;
}

.login-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    padding: 34px 34px 30px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.1;
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: #555;
    margin: 0 0 28px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

.login-field input {
    width: 100%;
    max-width: none;
    padding: 12px 13px;
    border: 1px solid #aaa;
    border-radius: 3px;
    font-size: 16px;
    background: #fff;
}

.login-field input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.login-button {
    width: 100%;
    margin-top: 6px;
    padding: 13px 18px;
    border-radius: 4px;
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.login-error {
    background: #fff1f1;
    border: 1px solid #e8b6b6;
    color: #8a2020;
    padding: 11px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

@media (max-width: 500px) {
    .login-card {
        padding: 28px 24px;
    }

    .login-card h1 {
        font-size: 28px;
    }

    .login-logo img {
        max-width: 170px;
    }
}
/* Check-in photo gallery popup */
.photo-gallery {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.photo-thumb {
    background: #fff;
    color: #222;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 8px;
    width: 150px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.photo-thumb img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 9px;
    display: block;
    margin-bottom: 7px;
}

.photo-thumb span {
    font-size: 14px;
    font-weight: 700;
}

.photo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,0.88);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.photo-modal.is-open {
    display: flex;
}

.photo-modal img {
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
}

.photo-modal-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-size: 30px;
    line-height: 1;
    padding: 0;
}

@media (max-width: 700px) {
    .photo-gallery {
        flex-direction: column;
    }

    .photo-thumb {
        width: 100%;
    }

    .photo-thumb img {
        height: 180px;
    }
}