/* Bootstrap-compatible mobile defaults; enhance at 48rem, 75rem and 90rem. */
:root { --app-max-width: 96rem; --app-ink: #1c2f48; --app-muted: #62748a; --app-accent: #285fca; --app-border: #dfe6ef; --app-gutter: clamp(.75rem, 2vw, 1.5rem); --app-gap: .75rem; --space-xs: .25rem; --space-sm: .5rem; --space-md: .75rem; --space-lg: 1rem; --app-target: 2.75rem; }
html { font-size: 16px; min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-wrap: anywhere; color: var(--app-ink); }
.gray-bg { background-color: #f3f6fa; }
.app-container { width: 100%; max-width: var(--app-max-width); margin-inline: auto; padding-inline: max(var(--app-gutter), env(safe-area-inset-left)) max(var(--app-gutter), env(safe-area-inset-right)); }
.app-main { flex: 1; padding-block: .75rem; }
.footer { margin-top: auto; padding-block: 1rem max(1rem, env(safe-area-inset-bottom)); }
.identity-main { width: 100%; min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; padding-block: 1.5rem; }
.row > *, .card, .card-body, .card-text, .input-group, .navbar-collapse { min-width: 0; }
img, video, canvas, svg { max-width: 100%; }
img, video { height: auto; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
:focus-visible, .btn-check:focus-visible + .btn { outline: 3px solid #0867c5; outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: .5rem; transform: translateY(-200%); z-index: 1100; padding: .75rem; background: white; }
.skip-link:focus { transform: none; }
.navbar .nav-link, .navbar .dropdown-item { min-height: var(--app-target); padding: .65rem .75rem; white-space: normal; }
.navbar .nav-link[aria-current="page"] { background: #e8f0fa; border-radius: .375rem; font-weight: 600; }
.navbar > .app-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.navbar-brand { display: inline-flex; align-items: center; gap: .5rem; }
.navbar-toggler { min-height: var(--app-target); min-width: var(--app-target); }
.navbar .dropdown-menu { max-width: 100%; }
.btn { min-height: var(--app-target); align-content: center; white-space: normal; }

.form-control, .form-select, .input-group-sm > .form-control, .input-group-sm > .form-select { min-height: var(--app-target); font-size: 1rem; min-width: 0; }
textarea.form-control { min-height: 4.5rem; resize: vertical; }
.form-group { margin-bottom: .75rem; }
/* Normal-flow labels keep long labels and validation readable at zoom. */
.form-floating { display: flex; flex-direction: column; gap: .25rem; }
.form-floating > label { position: static; order: -1; height: auto; padding: 0; white-space: normal; pointer-events: auto; transform: none !important; opacity: 1 !important; }
.form-floating > .form-control, .form-floating > .form-select { height: auto; min-height: var(--app-target); padding: .65rem .75rem; }
.form-floating > .form-control:focus, .form-floating > .form-control:not(:placeholder-shown) { padding: .65rem .75rem; }
.form-floating > .form-control ~ label, .form-floating > .form-select ~ label { transform: none; color: inherit; }
.form-floating > label::after { display: none; }
.form-floating:has(> .btn) { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.form-check, .checkbox > label { min-height: var(--app-target); }
.form-check-label { padding-block: .35rem; }
input[type="checkbox"]:not(.btn-check) { width: 1.25rem; height: 1.25rem; vertical-align: middle; }
.form-page { width: 100%; max-width: 42rem; margin-inline: auto; }
.card { width: 100%; margin-bottom: var(--app-gap); border: 1px solid #e6e7eb; border-radius: .75rem; box-shadow: none; }
.card-body, .card-header { padding: clamp(.75rem, 1.25vw, 1rem); }
.card .card .card-body { padding: .75rem; }
.card-header .row { row-gap: .75rem; }
.card-header .row > .col:first-child { flex: 1 1 18rem; }
.card-header .row > .col.text-end { flex: 0 1 auto; width: auto; }
.card-header .text-end { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; }
.masonry { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--app-gap); align-items: start; }
.masonry > .card { margin: 0; }
.table-responsive { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin-bottom: 1rem; }
.table-responsive > .table { margin-bottom: 0; }
.table { vertical-align: middle; }
.table th { overflow-wrap: normal; }
.table td { overflow-wrap: normal; word-break: normal; }
.table .badge { white-space: nowrap; }
.icon-action, .action-links a, a[aria-label]:has(> i) { display: inline-flex; align-items: center; justify-content: center; min-width: var(--app-target); min-height: var(--app-target); }
.table td a:not(.btn):not([aria-label]) { text-underline-offset: .2em; }
.table-sort { display: inline-flex; align-items: center; min-height: var(--app-target); border: 0; background: transparent; padding: 0; font-weight: 600; color: inherit; text-decoration: none; }
.table-sort:hover { text-decoration: underline; }
.asset-plate-link { font-weight: 600; text-decoration: none; }
.asset-plate-link:hover { text-decoration: underline; }
.asset-icon { width: 1.25rem; text-align: center; color: var(--app-muted); }
.asset-disabled td { color: var(--disabled-fg, #6c757d); background: var(--disabled-bg, #f8f9fa); }
.table-hint { font-size: .875rem; color: #495057; margin-bottom: .25rem; }
.checklist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.checklist tbody, .checklist tr, .checklist td { display: block; }
.checklist tr { display: flex; flex-direction: column-reverse; padding-block: .5rem; border-bottom: 1px solid #dee2e6; }
.check-options { display: flex; gap: .5rem; flex-wrap: wrap; }
.checklist td { border: 0; }
.media-gallery { display: flex; flex-wrap: wrap; gap: .75rem; padding: 0; list-style: none; margin-block: 1rem; }
.media-gallery img, .thumbnail { width: 6.25rem; height: 6.25rem; object-fit: cover; border-radius: .375rem; }
.tile-heading { display: flex; flex-wrap: wrap; gap: .75rem; align-items: start; }
.modal-dialog { margin: .5rem; }
.modal-content { max-height: calc(100dvh - 1rem); }
.modal-body { overflow-y: auto; }
.modal-footer { gap: .5rem; }
/* Keep the month readable and scroll only its own region on narrow screens. */
.calendar-scroll { overflow-x: auto; max-width: 100%; }
.calendar-scroll > .fc:not(:has(.fc-list)) { min-width: 38rem; }
.fc .fc-toolbar { gap: .75rem; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-size: 1.25rem; }
.fc .fc-button { min-height: var(--app-target); font-size: 1rem; }
.fc-event-container { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; white-space: normal; }
.fc-event-title { overflow-wrap: anywhere; }
.delete-event-icon { border: 0; border-radius: .25rem; background: white; color: #b02a37; min-width: var(--app-target); min-height: var(--app-target); }
#external-events-list { display: flex; flex-wrap: wrap; gap: .5rem; }
#external-events-list .fc-event { min-height: var(--app-target); color: #212529; cursor: grab; padding: .75rem; }
#external-events-list .bg-danger { color: white; }
.calendar-entry { display: grid; gap: .75rem; margin-block: 1rem; }
@media (min-width: 48rem) {
    .checklist thead { position: static; width: auto; height: auto; clip-path: none; }
    .checklist tbody { display: table-row-group; }
    .checklist tr { display: table-row; }
    .checklist td { display: table-cell; }
    .calendar-entry { grid-template-columns: 1fr 1fr auto; align-items: end; }
    .modal-dialog { margin: 1.75rem auto; }
}
@media (min-width: 68rem) {
    .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 90rem) {
    .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.setting-help summary { min-height: var(--app-target); padding-block: .65rem; color: #0759aa; cursor: pointer; }

/* Shared visual language: restrained colour, clear hierarchy and consistent surfaces. */
a { color: var(--app-accent); }
a:hover { color: #1c489d; }
h1, h2, h3, h4, h5, h6 { color: var(--app-ink); font-weight: 650; letter-spacing: -.025em; }
.text-muted, .table-hint { color: var(--app-muted) !important; }
.navbar { padding-block: .375rem; background: #ffffff; box-shadow: 0 1px 0 var(--app-border); }
.navbar-brand { font-weight: 750; letter-spacing: -.04em; margin-right: 1.5rem; }
.navbar-brand img { width: 2.5rem; height: 2.5rem; object-fit: contain; padding: 0; border-radius: .25rem; }
.navbar .nav-link { font-size: .875rem; border-radius: .25rem; color: #475569; }
.navbar .navbar-brand { color: var(--app-ink); font-size: 1.125rem; }
.navbar .nav-link:hover, .navbar .nav-link:focus-visible { color: var(--app-accent); background: #eef0f6; }
.navbar .nav-link[aria-current="page"] { color: var(--app-accent); background: #e8ebf5; }
.navbar-toggler { border-color: #596b83; border-radius: .25rem; }
.navbar-collapse { padding-top: .75rem; }
.btn { border-radius: .45rem; font-weight: 600; padding: .5rem .875rem; line-height: 1.4; }
.btn-primary { background: var(--app-accent); border-color: var(--app-accent); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: #1c489d; border-color: #1c489d; }
.btn-outline-secondary { color: #465a70; border-color: #cbd6e0; background: white; }
.btn-link { color: var(--app-accent); }
.form-control, .form-select { border-color: #cbd6e0; border-radius: .45rem; }
.form-control:focus, .form-select:focus { border-color: #5276b8; box-shadow: 0 0 0 .2rem rgb(41 85 163 / 14%); }
.form-label, .form-floating > label { font-size: .9rem; font-weight: 600; }
.input-group-text { background: #f5f7fa; border-color: #cbd6e0; color: var(--app-muted); }
.card { border-color: var(--app-border); box-shadow: 0 1px 2px rgb(20 30 45 / 3%); }
.card-header { background: white; border-bottom-color: var(--app-border); padding-block: .875rem; }
.card-header:first-child { border-radius: .75rem .75rem 0 0; }
.card-header h5 { font-size: 1.35rem; margin-bottom: .3rem !important; }
.card-header small { display: block; line-height: 1.6; }
.table { color: var(--app-ink); font-size: .875rem; line-height: 1.35; border-color: #e5e8ed; --bs-table-hover-bg: #f1f4f9; }
.table > :not(caption) > * > * { padding: .25rem .625rem; }
.table > thead { vertical-align: middle; }
#assetsTable { min-width: 34rem; }
.table > thead > tr > th { background: #edf0f5; color: #46556a; font-size: .8rem; font-weight: 650; border-bottom: 1px solid var(--app-border); }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table .badge { font-size: .8rem; margin-block: .1rem; font-weight: 500; padding: .25em .5em; line-height: 1.3; }
.table .badge.bg-secondary, .table .badge.text-bg-secondary { background: #e9eef3 !important; color: #40556a !important; }
.icon-action, .action-links a, a[aria-label]:has(> i) { border-radius: .5rem; }
.icon-action:hover, .action-links a:hover { background: #e9f1f4; }
.page-heading { margin-bottom: 1rem; }
.page-heading h1 { margin-bottom: .35rem; }
.page-heading p { color: var(--app-muted); margin: 0; }
.dashboard-notice { border-left: 4px solid #c39732; background: #fffaf0; }
.masonry > .card { overflow: hidden; }
.masonry .card-title h5 { font-size: 1.1rem; }
.masonry .card-title small { color: var(--app-muted); }
.asset-dashboard .card-title { text-align: left; padding-bottom: .75rem; margin-bottom: .75rem; border-bottom: 1px solid var(--app-border); }
.asset-dashboard h2 { font-size: 1.4rem; }
.asset-dashboard h2 a { text-decoration: none; }
.asset-dashboard .card-title > span { color: var(--app-muted); display: block; margin-bottom: .5rem; }
.asset-dashboard .card .card-body { padding: .75rem; }
.asset-dashboard .card .card { border: 0; box-shadow: none; }
.asset-dashboard th.pending-heading { color: #845b12; background: #fff5db; }
.completion-tile { border-top: 4px solid var(--app-accent); }
.completion-value { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 750; letter-spacing: -.05em; color: var(--app-accent); margin-block: 1rem .25rem; }
.completion-tile .progress { height: .5rem; background: #e7edf8; margin-block: 1.25rem .5rem; }
.completion-tile .progress-bar { background: var(--app-accent); }
.login-page { max-width: 29rem; }
.login-page .card-body { padding: clamp(1.25rem, 4vw, 2.5rem); }
.login-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; font-size: 1.3rem; font-weight: 750; }
.login-brand img { width: 4rem; height: 4rem; object-fit: contain; }
.login-intro { color: var(--app-muted); margin-bottom: 1.5rem; }
.login-page .checkbox > label { display: flex; align-items: center; gap: .5rem; margin: 0; }
.login-page #forgot-password { display: inline-flex; align-items: center; min-height: var(--app-target); margin-top: .75rem; }
.footer { font-size: .8rem; background: #eef2f6; }
@media (min-width: 75rem) { .navbar-collapse { padding-top: 0; } }

/* Compact data density; touch devices retain 44px controls. */
.table td p:last-child, .table td ul:last-child { margin-bottom: 0; }
.table-responsive:last-child { margin-bottom: 0; }
.table-sort { line-height: 1.25; }
.checklist tr { padding-block: .25rem; }
.card .card { box-shadow: none; }
.btn-primary { --bs-btn-disabled-bg: #285fca; --bs-btn-disabled-border-color: #285fca; }
.btn-outline-primary { --bs-btn-color: #285fca; --bs-btn-border-color: #285fca; --bs-btn-hover-bg: #285fca; --bs-btn-hover-border-color: #285fca; --bs-btn-active-bg: #1c489d; --bs-btn-active-border-color: #1c489d; }
@media (min-width: 48rem) and (hover: hover) and (pointer: fine) {
    .table .icon-action, .table .action-links a, .table a[aria-label]:has(> i), .table .btn, .table-sort { min-height: 2rem; }
    .table .icon-action, .table .action-links a, .table a[aria-label]:has(> i) { min-width: 2rem; }
    .table .btn { padding: .25rem .625rem; }
}

/* Shared action patterns. Never wrap an edit/delete pair inside a table cell. */
.actions-cell { width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: .375rem; }
.row-actions > form { display: flex !important; margin: 0; }
.row-actions .icon-action { flex: 0 0 auto; padding: 0; }
.icon-action, .action-links a { color: var(--app-accent); background: #edf3ff; border: 1px solid #d5e1f6; text-decoration: none; }
.icon-action:hover, .action-links a:hover { color: #1c489d; background: #e1ebfc; border-color: #a8bde3; }
.row-actions .action-danger, a.icon-action[aria-label^="Delete"], .action-links a[aria-label^="Delete"] { color: #b42335; background: #fff1f2; border-color: #f1cbd0; }
.row-actions .action-danger:hover, a.icon-action[aria-label^="Delete"]:hover, .action-links a[aria-label^="Delete"]:hover { color: #8c1726; background: #ffe1e5; border-color: #d998a1; }
.btn > i { flex: 0 0 auto; width: 1em; text-align: center; margin-right: .375rem; }
.btn.icon-action > i { margin: 0; }
.btn-primary { box-shadow: 0 1px 2px rgb(22 42 76 / 18%); }
.btn-outline-primary { background: #edf3ff; }
.btn-outline-primary:hover, .btn-outline-primary:active { color: white; background: #285fca; }
.action-toolbar, .form-group:has(> .btn) { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.action-toolbar > form { display: flex !important; margin: 0; }
.form-group:has(> .btn) > p { flex-basis: 100%; }
.action-toolbar .btn, .form-group:has(> .btn) > .btn { display: inline-flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: no-preference) { .btn, .icon-action { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; } }

/* Asset detail layout shares the same surfaces and action styles as list pages. */

    .asset-page {
        padding-top: .5rem;
    }

    .asset-title {
        display: flex;
        align-items: center;
        gap: .75rem;
        margin-bottom: .25rem;
    }

    .asset-title-icon {
        width: 2.75rem;
        height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: .75rem;
        background-color: #f1f3f5;
        color: #212529;
        font-size: 1.35rem;
    }

    .asset-number-plate {
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.1;
    }

    .asset-status-enabled {
        background-color: #198754;
        color: #fff;
    }

    .asset-status-disabled {
        background-color: #dc3545;
        color: #fff;
    }

    .asset-disabled-banner {
        border-left: .35rem solid #dc3545;
        background-color: #fff5f5;
        color: #842029;
        border-radius: .5rem;
        padding: .75rem 1rem;
        margin-bottom: 1rem;
    }

    .asset-action-bar {
        display: flex;
        gap: .5rem;
        justify-content: flex-start;
        margin-top: .75rem;
        flex-wrap: wrap;
    }

    .asset-summary-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
        margin-top: 1rem;
    }

    .asset-summary-item {
        border: 1px solid #e9ecef;
        border-radius: .65rem;
        padding: .75rem;
        background-color: #fff;
    }

    .asset-summary-label {
        display: block;
        color: #6c757d;
        font-size: .8rem;
        margin-bottom: .25rem;
    }

    .asset-summary-value {
        font-weight: 700;
        font-size: 1rem;
    }

    .asset-detail-table th {
        width: 38%;
        color: #495057;
        font-weight: 600;
        background-color: #f8f9fa;
    }

    .asset-detail-table td {
        font-weight: 500;
    }

    .section-title {
        display: flex;
        align-items: center;
        gap: .5rem;
        margin-bottom: .25rem;
    }

        .section-title h5 {
            margin-bottom: 0;
            font-weight: 700;
        }

    .section-subtitle {
        color: #6c757d;
        font-size: .875rem;
    }

    .card-section-header {
        display: flex;
        justify-content: space-between;
        gap: .75rem;
        align-items: center;
        flex-wrap: nowrap;
        margin-bottom: .75rem;
    }

    .table-clean {
        margin-bottom: 0;
    }

        .table-clean td {
            vertical-align: middle;
        }

    .empty-state {
        padding: 1.25rem;
        text-align: center;
        color: #6c757d;
        background-color: #f8f9fa;
        border-radius: .5rem;
    }

    .card-footer-clean {
        background-color: #f8f9fa;
        border-top: 1px solid #e9ecef;
        padding: .65rem 1rem;
        border-bottom-left-radius: .75rem;
        border-bottom-right-radius: .75rem;
    }

    @media (min-width: 768px) {
        .asset-summary-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        .asset-action-bar {
            justify-content: flex-end;
            margin-top: 0;
        }
    }

/* Data columns keep a readable width; overflow belongs to the table region. */
.record-table { min-width: 38rem; }
.inspection-table { min-width: 48rem; }
.record-table th, .record-table td, .inspection-table th, .inspection-table td { white-space: nowrap; }
.record-table td:nth-child(3), .inspection-table td:nth-child(3) { white-space: normal; min-width: 10rem; max-width: 18rem; }
.record-table .btn, .inspection-table .btn { white-space: nowrap; }
.status-label { display: inline-block; padding: .2rem .5rem; border-radius: .25rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status-positive { color: #216342; background: #e8f3ec; }
.status-pending { color: #775512; background: #faf1d9; }
.status-negative { color: #a12b3b; background: #fbecef; }
.asset-status-enabled { background: #e8f3ec; color: #216342; }
.asset-status-disabled { background: #fbecef; color: #a12b3b; }
.asset-title { align-items: center; }
.asset-title-icon { flex: 0 0 2.75rem; color: var(--app-accent); background: #edf3ff; }
.asset-number-plate { display: inline-block; margin-right: .4rem; }
.card-section-header > :first-child { flex: 1; min-width: 0; }
.card-section-header > form, .card-section-header > .btn { flex: 0 0 auto; }
.section-title h5 { font-size: 1.1rem; margin: 0 !important; }
.section-title > i { color: var(--app-accent) !important; width: 1.1rem; text-align: center; flex-shrink: 0; }
.section-subtitle { font-size: .8rem; line-height: 1.4; margin-top: .25rem; }
.asset-detail-table th { width: 46%; white-space: normal; }
.asset-detail-table td { overflow-wrap: anywhere; }
.asset-action-bar { align-items: center; }
.asset-action-bar > form { margin: 0; }
.login-brand img { width: 3rem; height: 3rem; }
.table-responsive:focus-visible { outline-offset: 2px; }

/* Inspection records become labelled cards on phones, using the same links and data. */
.inspection-table { min-width: 0; display: block; }
.inspection-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.inspection-table tbody { display: grid; gap: .75rem; }
.inspection-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--app-border); border-radius: .5rem; padding: .625rem; gap: .5rem .75rem; }
.inspection-table tbody td { display: block; border: 0; padding: 0; white-space: normal; min-width: 0; max-width: none; overflow-wrap: anywhere; box-shadow: none; }
.inspection-table tbody td:first-child { display: none; }
.inspection-table tbody td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.inspection-table tbody td:nth-child(4) { grid-column: 2; grid-row: 1; }
.inspection-table tbody td::before { content: attr(data-label); display: block; color: var(--app-muted); font-size: .75rem; font-weight: 600; margin-bottom: .125rem; }
.inspection-table tbody td:last-child { grid-column: 1 / -1; padding-top: .25rem; }
.inspection-table tbody td:last-child::before { display: none; }
.inspection-table tbody td:last-child .btn { display: inline-flex; align-items: center; }
@media (min-width: 48rem) {
    .inspection-table { display: table; min-width: 48rem; }
    .inspection-table thead { position: static; width: auto; height: auto; clip-path: none; }
    .inspection-table tbody { display: table-row-group; }
    .inspection-table tbody tr { display: table-row; border: 0; }
    .inspection-table tbody td, .inspection-table tbody td:first-child { display: table-cell; padding: .25rem .625rem; border-bottom: 1px solid var(--app-border); white-space: nowrap; }
    .inspection-table tbody td:nth-child(3) { white-space: normal; min-width: 10rem; max-width: 18rem; }
    .inspection-table tbody td::before { display: none; }
}

/* Shared fleet shell with a desktop workspace rail; palette supplied by branding. */
.fleet-topbar { position: relative; background: #102540; padding-block: max(.375rem, env(safe-area-inset-top)) .375rem; min-height: 3.5rem; box-shadow: none; }
.fleet-topbar > .app-container { flex-wrap: nowrap; gap: .5rem; }
.fleet-topbar .navbar-brand { color: white; font-size: 1.3rem; margin: 0; padding: 0; min-width: 0; gap: .5rem; }
.fleet-topbar .navbar-brand small { display: block; margin-top: .15rem; color: #b9c9de; font-size: .55rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; }
.fleet-topbar .navbar-brand:hover { color: white; }
.fleet-topbar .nav-link { color: #dce7f6; }
.fleet-topbar .nav-link:hover, .fleet-topbar .nav-link:focus-visible { color: white; background: #223c5d; }
.fleet-topbar .navbar-toggler { width: 44px; height: 44px; padding: .25rem; font-size: 1rem; border-color: #72859f; border-radius: .4rem; }
.fleet-account { display: flex; align-items: center; gap: .375rem; min-width: 0; flex: 0 0 auto; }
.fleet-account .dropdown { position: relative; }
.account-toggle { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: transparent; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12rem; }
@media (max-width: 35rem) { .account-name { display: none; } .account-toggle { width: 44px; min-width: 44px; padding: .25rem; gap: .25rem; } }
.fleet-topbar .navbar-brand .customer-logo { height: 32px; max-width: 18vw; min-width: 0; flex-shrink: 1; }
.fleet-account .navbar-nav { min-width: 0; }
.fleet-account .dropdown-toggle { max-width: 14rem; }
.fleet-account .dropdown-menu { position: absolute; top: 100%; right: 0; left: auto; margin-top: .625rem; min-width: 0; max-width: none; width: min(17rem, calc(100vw - max(var(--app-gutter), env(safe-area-inset-left)) - max(var(--app-gutter), env(safe-area-inset-right)) - 3.25rem)); max-height: calc(100dvh - 5rem); overflow-y: auto; overscroll-behavior: contain; z-index: 1050; }
.fleet-layout { flex: 1; width: 100%; max-width: var(--app-max-width); margin-inline: auto; }
.fleet-content { min-width: 0; display: flex; flex-direction: column; }
.fleet-sidebar { background: white; padding: 1rem; border-bottom: 1px solid var(--app-border); }
.fleet-sidebar .nav-link { display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; min-height: var(--app-target); color: var(--app-muted); border-radius: .45rem; font-size: .875rem; font-weight: 600; }
.fleet-sidebar .nav-link > i { width: 1.15rem; flex-shrink: 0; text-align: center; }
.fleet-sidebar .nav-link:hover { background: #f3f6fa; color: var(--app-accent); }
.fleet-sidebar .nav-link[aria-current="page"] { color: var(--app-accent); background: #edf3ff; }
.fleet-sidebar .navbar-nav { gap: .2rem; }
.fleet-nav-label { color: var(--app-muted); text-transform: uppercase; letter-spacing: .14em; font-size: .65rem; font-weight: 650; margin: .5rem .75rem .85rem; }
.fleet-nav-footer { display: none; }
.fleet-hero { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.fleet-hero h1 { font-size: clamp(1.65rem, 2.8vw, 2.4rem); font-weight: 750; }
.fleet-hero p { font-size: .9rem; }
.fleet-eyebrow { font-size: .65rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--app-accent); margin-bottom: .6rem; }
.fleet-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.fleet-stat { display: flex; flex-direction: row; justify-content: space-between; gap: 1rem; padding: 1rem; margin: 0; }
.fleet-stat h2 { font-size: .85rem; font-weight: 600; letter-spacing: 0; }
.fleet-stat-value { font-size: 2rem; font-weight: 750; line-height: 1.2; margin-block: .5rem; }
.fleet-stat-value small { font-size: .9rem; font-weight: 400; color: var(--app-muted); }
.fleet-stat p { font-size: .75rem; color: var(--app-muted); margin: .35rem 0 0; }
.fleet-stat > i { background: #edf3ff; color: var(--app-accent); border-radius: .6rem; padding: .65rem; height: fit-content; }
.fleet-stat-pending > i { background: #fff3dc; color: #976314; }
.fleet-stat-failed > i { background: #fcebed; color: #ad3546; }
.fleet-stat .progress { height: .3rem; max-width: 10rem; background: #e3eaf5; }
.fleet-stat .progress-bar { background: var(--app-accent); }
.fleet-dashboard .card-title { margin-bottom: 1rem; }
.fleet-dashboard .card-title h5 { font-size: 1.1rem; font-weight: 700; }
.fleet-dashboard .card-title small { font-size: .8rem; display: block; line-height: 1.5; }
.asset-dashboard h2 { font-size: 1.2rem; }
.asset-dashboard h2 > i, .asset-dashboard h2 > a > i { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; background: #edf3ff; color: var(--app-accent); border-radius: .5rem; margin-right: .4rem; }
.asset-dashboard .card-title > span { font-size: .85rem; }
.fleet-reading { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; color: var(--app-muted); }
.fleet-reading strong { color: var(--app-ink); }
.fleet-task-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; margin-bottom: 1rem; }
.fleet-task-list .btn { display: inline-flex; align-items: center; text-align: left; font-size: .85rem; }
.fleet-section-label { text-transform: uppercase; letter-spacing: .08em; color: var(--app-muted); font-size: .65rem; font-weight: 700; margin-bottom: .6rem; }
.dashboard-notice { border-left-color: #81a4e5; background: #edf3ff; color: #344d70; }
.dashboard-notice h2 { font-size: 1rem; }
.dashboard-notice .card-body { font-size: .85rem; }
.email-legend { border: 1px solid var(--app-border); background: #f8fafc; border-radius: .4rem; padding: .4rem .6rem; font-size: .7rem; }
.email-legend summary { min-height: var(--app-target); display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.fleet-content .footer { background: transparent; padding-block: 1.25rem; font-size: .7rem; }
.fleet-content .footer .app-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.form-page > .card.shadow { box-shadow: 0 2px 8px rgb(28 47 72 / 4%) !important; }
@media (min-width: 40rem) { .fleet-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fleet-stat { gap: .5rem; } .fleet-stat > i { display: none; } }
@media (min-width: 75rem) {
    .fleet-layout { display: grid; grid-template-columns: 12rem minmax(0, 1fr); }
    .fleet-sidebar.collapse { display: block; border-bottom: 0; border-right: 1px solid var(--app-border); padding: 1.5rem .75rem; }
    .fleet-topbar .navbar-toggler { display: none; }
    .fleet-nav-footer { display: flex; flex-direction: column; border-top: 1px solid var(--app-border); margin: 5rem .75rem 0; padding-top: 1rem; color: var(--app-muted); font-size: .75rem; }
    .fleet-stat > i { display: block; }
    .fleet-content .app-main { padding: 1rem; }
}

/* Guided inspections use the same controls and surfaces at every viewport. */
.inspection-editor { max-width: 60rem; margin-inline: auto; }
.inspection-editor h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.inspection-progress { padding: .75rem 0; color: var(--app-accent); }
.inspection-items { display: grid; gap: .5rem; }
.inspection-item { min-width: 0; padding: .75rem; border: 1px solid var(--app-border); border-radius: .6rem; }
.inspection-item legend { float: none; width: auto; padding-inline: .25rem; margin: 0; font-size: 1rem; font-weight: 700; }
.inspection-item p { font-size: .9rem; }
.inspection-item .check-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.inspection-item .check-options .btn { flex: 1 1 5rem; margin: 0; }
.inspection-explanation:not(:empty) { margin-top: .5rem; }
.inspection-explanation[hidden] { display: none; }
.inspection-explanation label span { color: var(--app-muted); font-size: .8rem; }
.inspection-photos { border-top: 1px solid var(--app-border); padding-top: 1rem; }
.inspection-photos .media-gallery li { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.photo-queue { list-style: none; padding: 0; }
.photo-queue li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-block: .5rem; border-bottom: 1px solid var(--app-border); }
.photo-queue li strong, .photo-queue li span { flex: 1 1 100%; overflow-wrap: anywhere; }
.inspection-review { border: 2px solid var(--app-accent); background: #f4f7fd; padding: 1rem; border-radius: .6rem; }
.inspection-review .btn { margin: .25rem 0; }
.customer-logo, .navbar-brand .customer-logo, .login-brand .customer-logo { width: auto; height: 2.75rem; max-width: 35vw; object-fit: contain; }

/* In-app guides: ordinary links preserve browser history and work without JavaScript. */
.contextual-help { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .25rem .5rem; margin-bottom: .5rem; }
.page-title-row { display: flex; align-items: center; gap: .5rem; justify-content: space-between; margin-bottom: .5rem; }
.page-title-row > h1 { min-width: 0; flex: 1; margin: 0; }
.page-title-row .contextual-help { flex: 0 0 auto; margin: 0; }
.contextual-help small { flex-basis: 100%; }
.help-short-label { display: none; }
@media (max-width: 47.99rem) { .help-link-text { display: none; } .help-short-label { display: inline; } }
.contextual-help a, .help-topics a { display: inline-block; padding: .7rem .25rem; }
.contextual-help small { color: #52616b; }
.help-heading { margin-bottom: 1.5rem; }
.help-grid { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.help-topics h2, .help-article h2 { font-size: 1.3rem; }
.help-topics ul { list-style: none; padding: 0; margin: 0; }
.help-topics a[aria-current="page"] { font-weight: 700; text-decoration-thickness: .18em; }
.help-article { min-width: 0; overflow-wrap: anywhere; }
.help-article .card-body { max-width: 75ch; padding: clamp(1rem, 3vw, 2rem); }
.help-article li { margin-bottom: .8rem; }
.help-article figure { margin: 1.5rem 0; }
.help-article img { width: 100%; height: auto; border: 1px solid #ccd5dd; border-radius: .5rem; }
.help-article figcaption { margin-top: .5rem; }
.help-grid a:focus-visible, .help-heading a:focus-visible, .contextual-help a:focus-visible { outline: 3px solid #1765a3; outline-offset: 3px; }
@media (max-width: 767px) { .help-grid { grid-template-columns: minmax(0, 1fr); } }

/* Shared presentation components: keep these patterns consistent across views. */
a, button, summary, label { touch-action: manipulation; }
.table td, .fleet-stat-value { font-variant-numeric: tabular-nums; }
.filter-bar, .form-grid { display: grid; gap: .5rem .75rem; align-items: end; }
.filter-bar { margin-bottom: .75rem; grid-template-columns: minmax(0, 1fr); }
.filter-bar label { min-width: 0; font-weight: 600; }
.filter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.filter-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.filter-advanced { grid-column: 1 / -1; }
.filter-advanced > summary { min-height: 44px; display: list-item; padding-block: .5rem; cursor: pointer; }
.filter-advanced .form-grid { margin-top: .5rem; }
.form-grid .form-floating { margin-bottom: .5rem !important; }
.form-grid .form-full { grid-column: 1 / -1; }
.page-intro { margin-bottom: .75rem; }
.guidance-panel { margin-bottom: .75rem; }
.guidance-panel > summary { min-height: 44px; display: list-item; padding-block: .5rem; cursor: pointer; font-weight: 600; }
.guidance-panel > div { padding-block: .5rem; }
.asset-context { margin-bottom: .5rem; }
.asset-context h2 { font-size: 1.1rem; margin-bottom: .25rem; }
.asset-context p { margin-bottom: .25rem; }
@media (min-width: 48rem) {
 .filter-bar { grid-template-columns: minmax(12rem, 2fr) minmax(8rem, 1fr) auto; }
 .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mobile-asset-status { display: none; }
@media (max-width: 47.99rem) {
 #assetsTable { min-width: 0; }
 #assetsTable thead { display: none; }
 #assetsTable tbody { display: grid; gap: .5rem; }
 #assetsTable .asset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--app-border); border-radius: .5rem; padding: .5rem; }
 #assetsTable .asset-row > td { border: 0; background: transparent; padding: .25rem; }
 #assetsTable .asset-row > td:first-child { grid-column: 1 / -1; }
 #assetsTable .asset-row .action-links { display: flex; align-items: center; gap: .375rem; }
 #assetsTable .mobile-asset-status { display: block; font-size: .8rem; margin-top: .25rem; }
 .calendar-scroll > .fc:has(.fc-list) { min-width: 0; }
 .calendar-scroll > .fc .fc-toolbar { font-size: .85rem; }
}
.calendar-summary { margin-bottom: .75rem; }
.calendar-summary > summary { min-height: 44px; font-weight: 600; cursor: pointer; }

.empty-results { grid-column: 1 / -1; display: block !important; padding: 1rem !important; }
.empty-results::before { display: none !important; }

.form-grid > .form-floating:has(> input[type="hidden"]):not(:has(> input:not([type="hidden"]))) { display: none; }

.unsaved-warning:not([hidden]) { display: block; margin-bottom: .5rem; color: var(--app-muted); font-size: .875rem; }
