html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.navbar {
    background-color: #051851!important;
    text-align: center;
}

.nav-link {
    color: #0c4f6b;
}

.nav-link:hover, .active {
    color: white;
    background-color: #5f7e8c;
}

.page-title {
    color: #0e6185;
}

a, .btn-link {
    color: #1381b0;
}

.btn {
border: none;
border-radius: none;
}

.btn-primary {
    color: #fff;
    background-color: #0e6185;
    border-color: none!important;
}

.btn-primary:hover {
    color: #fff;
    background-color: #5298b5;
    border: none!important;
}

.btn-outline-secondary:hover {
    background-color: #0e6185;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #1381b0;
}

.transparent-background {
    opacity: 0.8;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIu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ExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.hero-panel {
    display: grid;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: none;
    color: #0b4760;
    background: linear-gradient(135deg, #eef2f5 5%, #afc8d3 55%, #adcfde 90%);
    border: none;
    margin-bottom: 2rem;
}

.eyebrow {
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: #0e6185;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-grid,
.inspection-grid {
    display: grid;
    gap: 1rem;
}

.home-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.info-card,
.inspection-card,
.empty-state {
    border: none;
    border-radius: none;
    color: #0e6185;
    background: #cbe0eae3;
    box-shadow: 0 18px 40px rgba(119, 146, 230, 0.06);
}

.info-card,
.empty-state {
    padding: 1.25rem;
}

.inspection-form {
    max-width: 680px;
}

.inspection-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.inspection-card {
    overflow: hidden;
}

.inspection-preview {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #b9d3db;
}

.inspection-card-body {
    padding: 1rem;
}

.inspection-meta dt,
.inspection-meta dd {
    margin-bottom: 0.35rem;
}

.inspection-table-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: none;
    background: #eaebef;
    box-shadow: 0 18px 40px rgba(24, 38, 72, 0.06);
    padding: 1rem;
    max-width: 100%;
}

.report-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f6f7fa;
    border: 1px solid #e5e5e5;
    border-radius: 0.25rem;
}

.report-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-filter-field .form-label {
    font-size: 0.75rem;
    margin-bottom: 0;
    color: #495057;
}

.report-filter-field .form-select,
.report-filter-field .form-control {
    min-width: 9rem;
}

.report-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.inspection-table-toolbar,
.inspection-pagination,
.inspection-page-list,
.inspection-page-size {
    display: flex;
    align-items: center;
}

.inspection-table-toolbar,
.inspection-pagination {
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.inspection-pagination {
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.inspection-page-size,
.inspection-page-list {
    gap: 0.75rem;
}

.inspection-page-size .form-select {
    width: auto;
    min-width: 5rem;
}

.inspection-table, .report-table {
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 0.8rem;
}

.inspection-table th, .report-table th {
    white-space: normal;
    color: #0e6185;
}

.inspection-table th,
.inspection-table td {
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.inspection-table th:nth-child(1),
.inspection-table td:nth-child(1) {
    width: 6.5rem;
}

.inspection-table th:nth-child(3),
.inspection-table td:nth-child(3) {
    width: 8rem;
}

.inspection-table th:nth-child(4),
.inspection-table td:nth-child(4) {
    width: 8rem;
}

.inspection-table th:nth-child(5),
.inspection-table td:nth-child(5) {
    width: 8rem;
}

.inspection-table th:nth-child(6),
.inspection-table td:nth-child(6) {
    width: 10rem;
}

.inspection-table th:nth-child(7),
.inspection-table td:nth-child(7) {
    width: 12rem;
}

.inspection-table th:nth-child(8),
.inspection-table td:nth-child(8) {
    width: 5.5rem;
}

.table-responsive {
    overflow: visible;
    min-width: 0;
}

.inspection-thumbnail {
    display: block;
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.75rem;
    background: #f5f5f5;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.inspection-file-cell {
    min-width: 0;
}

.inspection-description {
    margin-top: 0.35rem;
    max-width: 32ch;
}

.inspection-description-wide {
    max-width: none;
}

.inspection-template-card {
    height: 100%;
}

.min-w-0 {
    min-width: 0;
}

.inspection-template-table th:nth-child(1),
.inspection-template-table td:nth-child(1) {
    width: 6.5rem;
}

.inspection-template-table th:nth-child(2),
.inspection-template-table td:nth-child(2) {
    width: 6rem;
}

.inspection-template-table th:nth-child(3),
.inspection-template-table td:nth-child(3) {
    width: 9rem;
}

.inspection-template-table th:nth-child(4),
.inspection-template-table td:nth-child(4),
.inspection-template-table th:nth-child(5),
.inspection-template-table td:nth-child(5),
.inspection-template-table th:nth-child(6),
.inspection-template-table td:nth-child(6) {
    width: 8rem;
}

.inspection-template-table th:nth-child(7),
.inspection-template-table td:nth-child(7) {
    width: 5.5rem;
}

.inspection-row-actions {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.inspection-row-menu-button {
    min-width: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.inspection-row-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 30;
    min-width: 12rem;
    padding: 0.35rem 0;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 18px 40px rgba(42, 30, 18, 0.12);
}

.inspection-row-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.85rem;
    border: 0;
    background: transparent;
    text-align: left;
}

.inspection-row-menu .dropdown-item:hover,
.inspection-row-menu .dropdown-item:focus {
    background: #e5e7f4;
}

.inspection-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(24, 24, 27, 0.45);
}

.inspection-modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.inspection-modal-card {
    width: min(100%, 28rem);
    padding: 1.25rem;
    border: 1px solid #e5e5e5;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 24px 60px rgba(42, 30, 18, 0.18);
}

.inspection-modal-shell-wide {
    align-items: center;
}

.inspection-modal-card-wide {
    width: min(100%, 72rem);
    max-height: min(92vh, 64rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
}

.inspection-defect-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.inspection-defect-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.inspection-defect-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inspection-model-panel {
    border: 1px solid #d6dae3;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.85rem 1rem;
}

.inspection-model-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.inspection-model-legend-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.78rem;
    color: #516274;
}

.inspection-model-color-picker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #16364b;
    font-size: 0.85rem;
    font-weight: 600;
}

.inspection-model-color {
    inline-size: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

.inspection-model-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.inspection-model-color::-webkit-color-swatch {
    border: none;
    border-radius: 999px;
}

.inspection-model-color::-moz-color-swatch {
    border: none;
    border-radius: 999px;
}

.inspection-defect-viewer {
    display: grid;
    place-items: center;
    flex: 1;
    min-height: 18rem;
    max-height: calc(92vh - 10rem);
    overflow: auto;
    border-radius: 0.85rem;
    background:
        linear-gradient(135deg, rgba(199, 213, 224, 0.16), rgba(255, 255, 255, 0)),
        repeating-conic-gradient(from 45deg, #f4f4f5 0% 25%, #ececee 0% 50%) 50% / 20px 20px;
}

.inspection-defect-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: calc(92vh - 10rem);
    line-height: 0;
}

.inspection-defect-image {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 10rem);
    width: auto;
    height: auto;
}

.inspection-defect-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.inspection-defect-overlay rect {
    fill: transparent;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.inspection-defect-empty {
    font-size: 0.95rem;
}

.inspection-table td:nth-last-child(2) {
    color: #b42318;
}

@media (max-width: 768px) {
    .hero-panel {
        padding: 1.25rem;
    }

    .inspection-table-panel {
        padding: 0.75rem;
        min-height: 0;
    }

    .inspection-page-list {
        width: 100%;
        flex-wrap: wrap;
    }

    .inspection-modal-card-wide {
        max-height: 94vh;
        padding: 1rem;
    }

    .inspection-defect-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inspection-defect-modal-body {
        flex-direction: column;
    }

    .inspection-defect-viewer {
        min-height: 14rem;
        max-height: calc(94vh - 12rem);
    }

    .inspection-defect-image {
        max-height: calc(94vh - 12rem);
    }

    .fit-to-lines-name {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
