html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #000;
    color: whitesmoke;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: whitesmoke;
}

.btn,
.btn-primary,
.btn-outline-light {
    border: 1px solid whitesmoke;
    border-radius: 0.4rem;
}

.btn-primary {
    color: #000;
    background-color: whitesmoke;
    border-color: whitesmoke;
}

.dashboard-wrapper {
    min-height: calc(100vh - 7.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(0.75rem, 1.5vw, 1.5rem);
    overflow: hidden;
}

.dashboard-grid {
    width: min(1400px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: clamp(1rem, 1.8vw, 1.8rem);
}

.home-dashboard-grid {
    width: min(1400px, 100%);
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.dashboard-item {
    padding: 0.6rem;
    min-width: 300px;
    min-height: 340px;
}

.home-dashboard-item {
    padding: 0.6rem;
    min-width: 300px;
    min-height: auto;
}

.dashboard-card {
    background: linear-gradient(165deg, #0e0e0e 0%, #000 70%);
    color: whitesmoke;
    border: 1px solid rgba(245, 245, 245, 0.8);
    border-radius: 0.75rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    height: 100%;
    min-height: 320px;
    min-width: 280px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    transform-origin: center;
    will-change: auto;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    text-rendering: geometricPrecision;
    animation: dashboard-card-grow-in 0.5s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-dashboard-card {
    width: 100%;
    min-width: 280px;
    min-height: 0;
    aspect-ratio: 16 / 9;
}

.material-category-card {
    animation: dashboard-card-grow-in 0.5s ease-out;
}

.home-dashboard-card .card-body {
    padding: 0.85rem;
}

.home-dashboard-card .card-title {
    margin-bottom: 0.55rem;
}

.home-dashboard-card .chart-container {
    min-height: 0;
    height: 100%;
}

.dashboard-card .card-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    width: 100%;
    min-height: 0;
    padding: 1rem;
}

@media (hover: hover) and (pointer: fine) {
    .dashboard-card:hover {
        transform: scale3d(1.03, 1.03, 1);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.16);
        z-index: 2;
    }
}

@media (hover: none) {
    .dashboard-card:active,
    .dashboard-card:focus-within {
        transform: scale3d(1.03, 1.03, 1);
    }
}

@keyframes dashboard-card-grow-in {
    from {
        transform: scale3d(0.9, 0.9, 1);
        opacity: 0.88;
    }

    to {
        transform: scale3d(1, 1, 1);
        opacity: 1;
    }
}

@media (max-width: 767.98px) {
    .dashboard-wrapper {
        min-height: auto;
        align-items: stretch;
    }

    .dashboard-grid,
    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-item,
    .home-dashboard-item {
        min-width: auto;
        min-height: 280px;
    }

    .dashboard-card {
        min-width: auto;
        min-height: 260px;
    }

    .home-dashboard-card {
        min-width: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .chart-container {
        min-height: 0;
    }

    .home-dashboard-card .chart-container {
        min-height: 0;
    }
}

.dashboard-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.dashboard-card-link:hover,
.dashboard-card-link:focus,
.dashboard-card-link:active {
    color: inherit;
    text-decoration: none;
}

.material-category-action-btn {
    background: transparent;
    border: 2px solid whitesmoke;
    border-radius: 999px;
    color: whitesmoke;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

@media (hover: hover) and (pointer: fine) {
    .material-category-action-btn:hover {
        transform: scale3d(1.12, 1.12, 1);
        box-shadow: 0 0 0 1px rgba(245, 245, 245, 0.25);
    }
}

.material-category-action-btn:focus-visible,
.material-category-action-btn:active {
    transform: scale3d(1.12, 1.12, 1);
}

.dashboard-card .card-title {
    letter-spacing: 0.02em;
    font-weight: 700;
    margin-bottom: 1rem;
}

.chart-container {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.chart-container > * {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain;
}

.dashboard-card canvas {
    border-radius: 0.5rem;
    border: 1px solid rgba(245, 245, 245, 0.35);
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.55));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.diagram-track {
    height: 1.5rem;
    background: linear-gradient(180deg, #252525 0%, #151515 100%);
    border: 1px solid rgba(245, 245, 245, 0.35);
    border-radius: 0.55rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.35);
}

.diagram-bar {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.diagram-bar-accepted {
    background: linear-gradient(180deg, #42d487 0%, #1f9e5c 100%);
}

.diagram-bar-difference {
    background: linear-gradient(180deg, #5fd5ff 0%, #2b9fcf 100%);
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.drawings-grid-shell {
    border: 2px solid rgba(245, 245, 245, 0.55);
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
    outline: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(180deg, #111 0%, #070707 100%);
}

.drawings-grid {
    margin-bottom: 0;
}

.drawings-grid thead tr:first-child {
    background: linear-gradient(180deg, #1d1d1d 0%, #0d0d0d 100%);
}

.drawings-grid thead tr:first-child th {
    color: whitesmoke !important;
    letter-spacing: 0.02em;
    font-weight: 700;
    border-bottom: 1px solid rgba(245, 245, 245, 0.25);
}

.drawings-grid thead tr:first-child th[aria-sort="ascending"] {
    box-shadow: inset 0 -2px 0 #5fd5ff;
}

.drawings-grid thead tr:first-child th[aria-sort="descending"] {
    box-shadow: inset 0 -2px 0 #42d487;
}

.drawings-grid thead tr:first-child th[aria-sort]::after {
    margin-left: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    opacity: 0.95;
}

.drawings-grid thead tr:first-child th[aria-sort="ascending"]::after {
    content: "ASC";
    color: #5fd5ff;
}

.drawings-grid thead tr:first-child th[aria-sort="descending"]::after {
    content: "DSC";
    color: #42d487;
}

.drawings-grid thead tr:first-child th[aria-sort="none"]::after,
.drawings-grid thead tr:first-child th:not([aria-sort])::after {
    content: "⇅";
    color: rgba(245, 245, 245, 0.75);
}

.drawings-grid thead tr:nth-child(2) {
    background: linear-gradient(180deg, #151515 0%, #090909 100%);
}

.drawings-grid thead tr:nth-child(2) th {
    border-top: 1px solid rgba(245, 245, 245, 0.2);
    border-bottom: 1px solid rgba(245, 245, 245, 0.2);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.drawings-grid thead tr:nth-child(2) input,
.drawings-grid thead tr:nth-child(2) select {
    background-color: #030303;
    color: whitesmoke;
    border: 1px solid rgba(245, 245, 245, 0.5);
    border-radius: 0.45rem;
}

.drawings-grid thead tr:nth-child(2) input::placeholder {
    color: #d5d5d5;
    opacity: 1;
}

.drawings-grid,
.drawings-grid th,
.drawings-grid td {
    color: whitesmoke !important;
}

.drawings-grid tbody tr:nth-of-type(odd) {
    background-color: #030303;
}

.drawings-grid tbody tr:nth-of-type(even) {
    background-color: #090909;
}

.drawings-grid tbody td {
    border-color: rgba(245, 245, 245, 0.12);
    vertical-align: middle;
}

.drawings-grid tbody tr:hover {
    background-color: #141414;
}

.drawings-grid .btn-outline-light {
    border-color: rgba(245, 245, 245, 0.6);
    background: linear-gradient(180deg, #242424 0%, #121212 100%);
}

.drawings-grid .btn-outline-light:hover {
    background: linear-gradient(180deg, #2e2e2e 0%, #1a1a1a 100%);
}

.offcanvas {
    background: linear-gradient(165deg, #101010 0%, #050505 100%);
    color: whitesmoke;
    border-left: 1px solid rgba(245, 245, 245, 0.25);
    box-shadow: -16px 0 30px rgba(0, 0, 0, 0.55);
}

.offcanvas.offcanvas-end {
    --bs-offcanvas-width: 40vw;
    width: 40vw;
    max-width: 40vw;
}

@media (max-width: 992px) {
    .offcanvas.offcanvas-end {
        --bs-offcanvas-width: 70vw;
        width: 70vw;
        max-width: 70vw;
    }
}

@media (max-width: 576px) {
    .offcanvas.offcanvas-end {
        --bs-offcanvas-width: 92vw;
        width: 92vw;
        max-width: 92vw;
    }
}

.offcanvas-header {
    border-bottom: none;
    background: linear-gradient(180deg, #181818 0%, #0c0c0c 100%);
}

.offcanvas-title {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.offcanvas-body {
    color: rgba(245, 245, 245, 0.95);
}

.offcanvas .btn-close {
    filter: invert(1) grayscale(100%);
}

.material-offcanvas-chart-wrap {
    border: 1px solid rgba(245, 245, 245, 0.35);
    border-radius: 0.6rem;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.55));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.material-offcanvas-chart-title {
    color: whitesmoke;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.materials-shell {
    background: linear-gradient(180deg, #111 0%, #070707 100%);
    color: whitesmoke;
}

.materials-container {
    color: whitesmoke;
}

.materials-page-container {
    padding: 1.5rem;
    color: whitesmoke;
}

.materials-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.materials-toolbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.materials-search-wrap {
    width: min(360px, 100%);
}

.materials-search-input {
    background-color: #050505;
    color: whitesmoke;
    border: 1px solid rgba(245,245,245,0.5);
}

.materials-search-input::placeholder {
    color: rgba(245, 245, 245, 0.78);
}

.materials-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(245,245,245,0.85);
    pointer-events: none;
}

.materials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 1.8vw, 1.8rem);
    width: 100%;
}

.materials-card-item {
    padding: 0.3rem;
}

.materials-card-auto-height {
    min-height: auto !important;
    height: auto !important;
}


.materials-grid thead th {
    background: linear-gradient(180deg, #1d1d1d 0%, #0d0d0d 100%);
    color: whitesmoke !important;
    letter-spacing: 0.02em;
    font-weight: 700;
    border-bottom: 1px solid rgba(245, 245, 245, 0.25);
}

.materials-grid tbody tr,
.materials-grid tbody tr:nth-of-type(odd),
.materials-grid tbody tr:nth-of-type(even),
.materials-grid tbody tr:hover {
    background-color: #000 !important;
}

.materials-grid tbody td {
    background-color: #000 !important;
    color: whitesmoke !important;
}

.materials-grid th,
.materials-grid td {
    border-color: rgba(245, 245, 245, 0.55) !important;
}

.materials-grid th + th,
.materials-grid td + td {
    border-left: 1px solid rgba(245, 245, 245, 0.75) !important;
}

.materials-row {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.materials-row:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(95, 213, 255, 0.22);
}

.materials-image-cell {
    padding: 0.75rem;
}

.materials-thumb {
    width: 112px;
    height: 70px;
    object-fit: cover;
    border: 1px solid rgba(245,245,245,0.45);
    border-radius: 0.35rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.materials-metric-line {
    font-size: 0.95rem;
}

.materials-image-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.materials-image-preview {
    max-width: min(96vw, 1600px);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid rgba(245, 245, 245, 0.45);
    border-radius: 0.45rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.65);
    background: #000;
}

.materials-image-preview-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 245, 245, 0.75);
    background: rgba(10, 10, 10, 0.92);
    color: whitesmoke;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.materials-image-preview-close:hover {
    background: rgba(40, 40, 40, 0.96);
}

.materials-timeline-chart-host {
    width: 100%;
    min-width: 0;
    height: 260px;
}
