:root {
    /* Insight Blue */
    --insight-blue-darker: #000A48;
    --insight-blue-dark: #12206A;
    --insight-blue-default: #1B3192;
    --insight-blue-light: #2B4BB8;
    --insight-blue-lighter: #409CFD;
    --insight-blue-accent: #52A6FF;
    --insight-blue-pale: #E8F1FC;

    /* Insight Gray */
    --insight-gray-darker: #2D3748;
    --insight-gray-dark: #4A5568;
    --insight-gray-default: #718096;
    --insight-gray-light: #A0AEC0;
    --insight-gray-lighter: #CBD5E0;
    --insight-gray-pale: #EDF2F7;
    --insight-gray-background: #F5F7FA;

    /* Semantics (AA on white) */
    --insight-success: #15881A;
    --insight-error: #CC0000;
    --insight-warning: #B45309;

    --insight-surface: #FFFFFF;
    --insight-radius: 8px;
    --insight-focus-color: var(--insight-blue-lighter);
    --insight-brand-gradient:
        radial-gradient(ellipse 80% 55% at 8% -8%, color-mix(in srgb, var(--insight-blue-dark) 38%, transparent), transparent 58%),
        radial-gradient(ellipse 70% 50% at 100% 108%, color-mix(in srgb, var(--insight-blue-default) 32%, transparent), transparent 54%),
        linear-gradient(165deg, var(--insight-blue-darker) 0%, var(--insight-blue-dark) 46%, var(--insight-blue-default) 100%);
}

html, body {
    margin: 0;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    color: var(--insight-blue-darker);
    background-color: var(--insight-gray-background);
}

:focus-visible {
    outline: 2px solid var(--insight-focus-color);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.75rem 1rem;
    background: var(--insight-blue-default);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 0 0 var(--insight-radius) 0;
}

.skip-link:focus {
    left: 0;
}

.language-selector .language-selector-button {
    min-width: 2.5rem;
    padding: 0.375rem 0.5rem;
    background-color: var(--insight-blue-pale) !important;
}

.language-selector .language-selector-button:hover:not(.mud-disabled) {
    background-color: var(--insight-blue-pale) !important;
    filter: brightness(0.96);
}

.language-selector .language-selector-button.mud-disabled {
    background-color: var(--insight-blue-pale) !important;
    opacity: 1;
    border-color: var(--insight-blue-lighter);
}

.language-flag {
    width: 1.25rem;
    height: auto;
    border-radius: 2px;
    vertical-align: middle;
    object-fit: cover;
    aspect-ratio: 3 / 2;
    display: block;
}

.appbar-user-name {
    display: none;
}

@media (min-width: 960px) {
    .appbar-user-name {
        display: inline;
    }
}

/* MVC authentication layout */
.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--insight-blue-darker);
    background-image: var(--insight-brand-gradient);
}

.insight-appbar.mud-appbar {
    background-color: var(--insight-blue-darker) !important;
    background-image: var(--insight-brand-gradient) !important;
}

.auth-brand {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.75rem 1.25rem 0.25rem;
}

.auth-logo {
    display: block;
    width: min(25rem, 70vw);
    height: auto;
    aspect-ratio: 3218 / 860;
    object-fit: contain;
    padding: 0.65rem 1.1rem;
    box-sizing: border-box;
}

.auth-main {
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 1.5rem 1.25rem 2rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--insight-surface);
    border-radius: var(--insight-radius);
    padding: 2rem 1.75rem;
    border: 1px solid var(--insight-gray-lighter);
    box-shadow: 0 20px 48px color-mix(in srgb, var(--insight-blue-darker) 42%, transparent);
}

.auth-card--wide {
    max-width: 40rem;
}

.auth-card h1,
.auth-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--insight-blue-darker);
    text-align: center;
}

.auth-form .form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--insight-gray-dark);
}

.auth-form .form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--insight-blue-darker);
    background-color: var(--insight-surface);
    border: 1px solid var(--insight-gray-light);
    border-radius: var(--insight-radius);
    box-sizing: border-box;
}

.auth-form .form-control:focus {
    border-color: var(--insight-blue-lighter);
    outline: 2px solid var(--insight-focus-color);
    outline-offset: 0;
}

.auth-form .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-form .form-check-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--insight-blue-default);
}

.auth-form .form-check-label {
    color: var(--insight-gray-dark);
}

.auth-form .field-group {
    margin-bottom: 1rem;
}

.auth-form .validation-summary-errors,
.auth-form .field-validation-error,
.auth-form .text-danger {
    color: var(--insight-error);
    font-size: 0.875rem;
}

.auth-btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--insight-radius);
    cursor: pointer;
}

.auth-card .auth-btn {
    width: 100%;
    box-sizing: border-box;
}

.auth-btn-primary {
    background-color: var(--insight-blue-default);
    color: #FFFFFF;
}

.auth-btn-primary:hover {
    background-color: var(--insight-blue-dark);
}

.auth-btn-primary:focus-visible {
    outline: 2px solid var(--insight-focus-color);
    outline-offset: 2px;
}

.auth-message {
    color: var(--insight-gray-dark);
    margin-bottom: 1.5rem;
}

.auth-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--insight-blue-pale);
    font-size: 0.875rem;
    background-color: color-mix(in srgb, var(--insight-blue-darker) 42%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--insight-surface) 16%, transparent);
}

@media (max-width: 480px) {
    .auth-brand {
        padding: 1.25rem 1rem 0;
    }

    .auth-main {
        align-items: center;
        padding: 1.25rem 1rem 1.5rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }
}

.mud-table.asset-property-table tbody tr.asset-property-group,
.mud-table.asset-property-table tbody tr.asset-property-group:hover,
.mud-table.asset-property-table.mud-table-striped tbody tr.asset-property-group:nth-of-type(odd),
.mud-table.asset-property-table.mud-table-striped tbody tr.asset-property-group:nth-of-type(even),
.mud-table.asset-property-table tbody tr.asset-property-group > th,
.mud-table.asset-property-table tbody tr.asset-property-group > td,
.mud-table.asset-property-table tbody tr.asset-property-group:hover > th,
.mud-table.asset-property-table tbody tr.asset-property-group:hover > td {
    background-color: #1B3192 !important;
    background-image: none !important;
    color: #fff !important;
}

.details-field + .details-field {
    border-top: 1px solid var(--insight-gray-lighter);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.details-field__value {
    word-break: break-word;
}

.details-access-list {
    max-height: 24rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.origin-config-dialog {
    height: 80vh;
    max-height: 80vh;
}

.origin-config-dialog__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.origin-config-dialog__text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.current-plant-chip {
    max-width: 16rem;
}

.current-plant-chip .mud-chip-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plant-context-selector {
    min-width: 0;
}

.nav-drawer-header {
    flex: 0 0 auto;
    padding-bottom: 0.25rem;
    background-color: var(--mud-palette-drawer-background);
    z-index: 1;
}

.nav-menu {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    padding-top: 0;
    overflow-y: auto;
}

.location-map {
    border-radius: var(--insight-radius);
    overflow: hidden;
    border: 1px solid var(--insight-gray-lighter);
    background-color: var(--insight-gray-pale);
}

.location-map__frame {
    width: 100%;
    height: 100%;
    min-height: 240px;
    border: 0;
    display: block;
}

.asset-explorer__tree-col,
.asset-explorer__detail-col {
    display: flex;
    min-height: 0;
}

.asset-explorer__tree,
.asset-explorer__detail {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    max-height: min(70dvh, 36rem);
}

.asset-explorer__tree {
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.asset-explorer__detail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.asset-explorer__detail > .mud-tabs {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.asset-explorer__detail .mud-tabs-panels {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 960px) {
    .asset-explorer__tree,
    .asset-explorer__detail {
        height: calc(100dvh - 12rem);
        max-height: calc(100dvh - 12rem);
    }
}

.mud-main-content.jobs-hangfire-main {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    padding: var(--mud-appbar-height, 64px) 0 0 0;
    overflow: hidden;
}

.jobs-hangfire-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ons-dashboard-card.mud-paper {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.ons-dashboard-card__title {
    margin: 0;
    padding: 0.7rem 1rem;
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ons-dashboard-card__body {
    padding: 1rem 1rem 1.15rem;
    flex: 1 1 auto;
}

.mud-chip.ons-tone-yellow.mud-chip-filled,
.mud-chip.ons-tone-yellow.mud-chip-filled:hover,
.mud-chip.ons-tone-yellow.mud-chip-filled:focus {
    background-color: #F5D400;
    color: #3A2A00;
}

.jobs-hangfire__frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: auto;
    border: 0;
    display: block;
    background-color: var(--insight-surface);
}
