:root {
    --cristal-header-height: 64px;
    --cristal-loading-bar-height: 6px;
    --cristal-loading-bar-color: #f3cc00;
}

html, body {
    font-family: "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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;
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5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rem;
    color: white;
}

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

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

.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;
}

.my-custom-class {
    backdrop-filter: blur(10px);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    height: var(--cristal-header-height);
    width: 100vw;
    background: var(--mud-palette-primary);
    z-index: 300;

    color: white;

    box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14),
    0px 1px 3px 0px rgba(0, 0, 0, 0.12);
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
}

/* Ensure MudText stays white */
.header-text-main,
.header-text-sub {
    color: white;
}

.header-text-main {
    font-size: 1.05rem !important;
    line-height: 1.2;
    color: white;
}

/* Ensure icons inherit white */
.header-icon .mud-icon-root {
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-divider {
    margin-left: 0.25rem;
    width: 3px;
    height: calc(var(--cristal-header-height) * 0.22);
    background-color: rgba(255, 255, 255, 0.6);
}


.loading-bar {
    position: fixed;
    top: var(--cristal-header-height);
    left: 0;
    height: var(--cristal-loading-bar-height);
    width: 100vw;
    background: #f3cc00;
    z-index: 200;
    border-bottom: 1px solid var(--mud-palette-divider);

    box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14),
    0px 1px 5px 0px rgba(0, 0, 0, 0.12);

    transition: height 0.2s ease-in-out, box-shadow 0.1s ease;
}

.loading-bar.loading {
    height: 8px;

    box-shadow: 0px 3px 3px -2px rgba(0, 0, 0, 0.2),
    0px 3px 4px 0px rgba(0, 0, 0, 0.14),
    0px 1px 8px 0px rgba(0, 0, 0, 0.12);
}

.main-container {
    position: fixed;
    top: calc(var(--cristal-header-height) + var(--cristal-loading-bar-height));
    left: 0;
    height: calc(100vh - calc(var(--cristal-header-height) + var(--cristal-loading-bar-height)));
    width: 100vw;
    z-index: 100;
    display: flex;
}

.anonymous-container {
    position: fixed;
    top: calc(var(--cristal-header-height) + var(--cristal-loading-bar-height));
    left: 0;
    height: calc(100vh - calc(var(--cristal-header-height) + var(--cristal-loading-bar-height)));
    width: 100vw;
}

.cristal-drawer {
    width: 235px;
    background: var(--mud-palette-background);
}

.cristal-content {
    flex: 1;
    overflow-y: auto;
    background: var(--mud-palette-surface);
}

.cristal-drawer {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: normal;
    align-items: normal;
    align-content: normal;
}

.cristal-drawer__nav {
    display: block;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
    align-self: auto;
    order: 0;
}

.cristal-drawer__border {
    position: relative;
    display: block;
    flex-grow: 0;
    flex-shrink: 1;
    flex-basis: auto;
    align-self: auto;
    order: 0;
    width: 8px;
    border-inline: 1px solid #d6d6d6;
    box-shadow: var(--mud-elevation-1);
    background: #f1f1f1;

}

/*--*/

.cristal-nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 5px;
    /*padding: 8px;*/
}

.cristal-nav-menu {
    flex: 1;
    overflow-y: auto;
}

.cristal-switcher-wrapper {
    padding: 8px 2px;
}

.cristal-switcher {
    display: flex;
    align-items: center;
    background: var(--mud-palette-surface);
    border-radius: 5px;
    padding: 6px 8px;
    cursor: pointer;
}

.cristal-switcher-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 8px;
}

/*.cristal-switcher-menu {*/
/*    margin-top: 6px;*/
/*}*/

.cristal-switcher-item {
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 5px;
    cursor: pointer;
}

.cristal-switcher-arrow {
    margin-left: auto;
    transition: transform .2s ease;
}

.cristal-switcher-arrow.open {
    transform: rotate(180deg);
}

.cristal-nav-group {
    margin-top: 5px;
}

.cristal-nav-group.no-expand .mud-nav-link-expand-icon {
    display: none !important;
}

.cristal-nav-group.no-expand .mud-nav-link {
    cursor: default !important;
    pointer-events: none !important;
}

.cristal-nav-group.no-expand .mud-nav-link .mud-nav-link-text {
    pointer-events: auto !important;
}

.cristal-nav-menu .mud-nav-link.active {
    font-weight: 700 !important;
    /*border-left: solid black 2px;*/
}

/* Style the group header text */
.cristal-nav-group > .mud-nav-link {
    font-size: 0.75rem !important; /* slightly smaller */
    font-weight: 700 !important; /* bold but small */
    opacity: 0.7 !important; /* faded look */
    letter-spacing: 0.05em; /* slight spacing for uppercase */
    text-transform: uppercase; /* force uppercase */
    color: #232323 !important; /* greyed text */
    padding-left: 6px !important;
    position: relative; 
}

.mud-nav-group * .mud-navmenu .mud-nav-item .mud-nav-link {
    padding-left: 24px !important;
    padding-inline-start: 24px !important;
    padding-inline-end: unset !important;
}

.cristal-switcher-wrapper {
    position: relative;
    width: 100%;
    padding: 15px 0;
}

.cristal-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 92%;
    margin: auto;

    padding: 10px 14px;
    border-radius: 10px;

    background: #ffffff;
    border: 1px solid #a5a5a5;

    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.cristal-switcher:hover {
    background: #e9eaec;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.cristal-switcher:active {
    background-color: #dde0e5; 
    border: solid 1px #8a8a8a;
}

.cristal-switcher-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;

    display: flex;
    justify-content: center;
    align-items: center;

    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.cristal-switcher-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.cristal-switcher-arrow {
    margin-left: auto;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.cristal-switcher-arrow.open {
    transform: rotate(180deg);
}

.cristal-switcher-menu {
    position: absolute;
    bottom: calc(92%);
    left: 0;

    width: 93%;
    margin-left: 3.5%;

    background: #ffffff;
    border: 1px solid #a5a5a5;
    border-radius: 8px;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);

    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);

    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cristal-switcher-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.cristal-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;
    cursor: pointer;

    transition: background 0.15s ease;
    border-radius: 6px;
}

.cristal-switcher-item:hover {
    background: #f3f4f6;
}

.cristal-switcher-item:active {
    background-color: #dde0e5;
}

.cristal-switcher-item .cristal-switcher-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.75rem;
}