html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.main {
    flex: 1;
}

    .main .top-row {
        background-color: #f7f7f7;
        border-bottom: 1px solid #d6d5d5;
        justify-content: flex-end;
    }

        .main .top-row > a, .main .top-row .btn-link {
            white-space: nowrap;
            margin-left: 1.5rem;
        }

        .main .top-row a:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

    .sidebar .top-row {
        background-color: rgba(0,0,0,0.4);
    }

    .sidebar .navbar-brand {
        font-size: 1.1rem;
    }

    .sidebar .oi {
        width: 2rem;
        font-size: 1.1rem;
        vertical-align: text-top;
        top: -2px;
    }

    .sidebar .nav-item {
        font-size: 0.9rem;
        padding-bottom: 0.5rem;
    }

        .sidebar .nav-item:first-of-type {
            padding-top: 1rem;
        }

        .sidebar .nav-item:last-of-type {
            padding-bottom: 1rem;
        }

        .sidebar .nav-item a {
            color: #d7d7d7;
            border-radius: 4px;
            height: 3rem;
            display: flex;
            align-items: center;
            line-height: 3rem;
        }

            .sidebar .nav-item a.active {
                background-color: rgba(255,255,255,0.25);
                color: white;
            }

            .sidebar .nav-item a:hover {
                background-color: rgba(255,255,255,0.1);
                color: white;
            }

.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;
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.fc-quickinfo {
    font-size: 1.15rem; /* overall scale */
    line-height: 1.1;
}

    .fc-quickinfo .title {
        font-size: 1.2rem;
        font-weight: 500;
    }

    .fc-quickinfo .meta {
        font-size: 0.9rem;
    }

    .fc-quickinfo .description {
        font-size: 0.9rem;
    }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem 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");
    }


@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, .main .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        min-height: 100vh;
        height: auto;
        min-height: 100vh;
        position: sticky;
        top: 0;
        z-index:1200;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }

    .main > div {
        padding-left: 20rem !important;
        padding-right: 1.5rem !important;
        padding-top: 1.1rem;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }
}

.e-filemanager .e-fe-popup.e-dialog.e-popup.e-dlg-resizable {
    z-index: 1202 !important;
}
/* Weather card baseline */
.wx-card .e-card-header-title {
    font-weight: 600;
}

/* Horizontal strip */
.wx-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(70px, 1fr);
    gap: .5rem;
    overflow-x: auto;
    padding: .25rem .25rem .5rem;
    scroll-snap-type: x mandatory;
}

    .wx-strip::-webkit-scrollbar {
        height: 8px;
    }

    .wx-strip::-webkit-scrollbar-thumb {
        background: rgba(128,128,128,.35);
        border-radius: 8px;
    }

/* Cells */
.wx-cell {
    scroll-snap-align: start;
    background: var(--e-sf-background, #fff);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: .75rem;
    padding: .5rem .4rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    min-width: 70px;
}

.wx-time {
    font-size: .8rem;
    opacity: .75;
}

.wx-ico {
    width: 88px;
    height: 88px;
    image-rendering: -webkit-optimize-contrast;
}

.wx-temp {
    font-size: .8rem;
    font-weight: 500;
    margin-top: .1rem;
}

.wx-sub {
    font-size: .7rem;
    opacity: .7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wx-empty {
    opacity: .7;
    padding: .5rem;
}

@media (min-width: 1200px) {
    .wx-strip {
        grid-auto-columns: minmax(82px, 1fr);
    }

    .wx-ico {
        width: 56px;
        height: 56px;
    }
}
/* Current weather tiny widget */
.wx-now .e-card-header-title {

    font-weight: 600;
}

.wx-now-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 60px;
}

.wx-now-ico {
    width: 88px;
    height: 88px;
}

.wx-now-temp {
    color: navy;
    font-size: .8rem;
    line-height: 1;
}

.wx-now-sub {
    font-size: .75rem;
    opacity: .6;
    color: navy;
    margin-left: 1.75rem;
    margin-top: .25rem;
}

.wx-empty {
    opacity: .7;
}


.nav-weather {
    margin: 0.5rem;
}

    .nav-weather .wx-now {
        font-size: 1.1rem;
        box-shadow: none;
        background: #fff;
        border: solid;
    }
/* ----- User Quick Bar (top strip) ----- */
.user-quickbar {
    display: block;
    padding: .25rem .5rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: var(--e-sf-background, #fff);
}
/* User Quick Bar: collapse to initials-only on mobile */
@media (max-width: 767.98px) {
    .uqb-label {
        display: none;
    }

    /* Tighten pill so it looks intentional when label disappears */
    .uqb-pill {
        gap: 0;
        padding: .35rem;
    }

    /* Optional: a slightly larger tap target feel without taking space */
    .uqb-avatar {
        width: 28px;
        height: 28px;
        font-size: .85rem;
    }

    /* Optional: reduce horizontal spacing so more pills fit */
    .uqb-row {
        gap: .3rem;
    }
}
.uqb-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.uqb-loading, .uqb-empty {
    opacity: .7;
    padding: .25rem .5rem;
}

/* Buttons */
.uqb-btn.e-btn {
    border-radius: 9999px;
    padding: .35rem .8rem;
    height: 32px;
    line-height: 1;
}

.uqb-btn-active.e-btn {
    background: var(--e-sf-primary, #6355ff);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* ----- User Quick Bar (color + avatar) ----- */
.user-quickbar {
    padding: .35rem .5rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: #fff;
}

.uqb-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.uqb-loading, .uqb-empty {
    opacity: .7;
    padding: .25rem .5rem;
}

.uqb-btn.e-btn {
    border-radius: 9999px;
    padding: 0;
    height: auto;
    border: none;
    background: transparent;
}

.uqb-btn-active .uqb-pill {
    outline: 2px solid rgba(0,0,0,.10);
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.uqb-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem .35rem .35rem;
    border-radius: 9999px;
    background: var(--uqb-bg,#eceff4);
    color: var(--uqb-fg,#111827);
}

.uqb-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
}

.uqb-initials {
    color: inherit;
}

.uqb-label {
    font-size: .85rem;
    font-weight: 600;
}

/* Avatar editor */
.avatar-editor {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1rem;
    align-items: start;
}

.ae-left {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.ae-stage {
    position: relative;
    width: 320px;
    height: 320px;
    background: #f3f4f6;
    border-radius: .75rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    touch-action: none;
}

    .ae-stage img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(calc(-50% + var(--ox, 0px)), calc(-50% + var(--oy, 0px))) scale(var(--s,1));
        transform-origin: center center;
        user-select: none;
        pointer-events: none;
        max-width: none; /* allow scaling past container */
    }

.ae-mask {
    position: absolute;
    inset: 0;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
    border-radius: 50%;
    width: 75%;
    height: 75%; /* circle window guide */
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    pointer-events: none;
}

.ae-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #6b7280;
}

.ae-controls {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.ae-right {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
}

.ae-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
    border: 1px solid rgba(0,0,0,.08);
}

    .ae-circle img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(calc(-50% + var(--ox, 0px)), calc(-50% + var(--oy, 0px))) scale(var(--s,1));
        transform-origin: center center;
        max-width: none;
    }

.ae-preview-label {
    font-size: .85rem;
    opacity: .7;
}

/* Avatar editor layout */
.avatar-editor {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1rem;
    align-items: start;
}

.ae-left {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.ae-editor {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: .75rem;
    overflow: hidden;
    background: #f9fafb;
}

.ae-controls {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.ae-right {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
}

.ae-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid rgba(0,0,0,.08);
    display: grid;
    place-items: center;
}

    .ae-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ae-empty {
    color: #6b7280;
}

.ae-preview-label {
    font-size: .85rem;
    opacity: .7;
}

.ae-circle {
    width: 256px;
    height: 256px;
    border-radius: 50%;
    overflow: hidden;
}

.ae-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar editor layout + circular preview */
.avatar-editor {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1rem;
    align-items: start;
}

.ae-left {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.ae-editor {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: .75rem;
    overflow: hidden;
    background: #f9fafb;
}

.ae-controls {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.ae-right {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
}

.ae-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid rgba(0,0,0,.08);
    display: grid;
    place-items: center;
}

    .ae-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ae-empty {
    color: #6b7280;
}

.ae-preview-label {
    font-size: .85rem;
    opacity: .7;
}
@media (max-width: 767px) {
    .fc-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .fc-show-mobile-only {
        display: none !important;
    }
}