html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA9InciOyI7Zm9jdXNlID4KPGRpdiBzdHlsZT0iImlwYWRkaW5nOjIuNTB4NTAtMTAuNzl4yaI+Ij4KICA8cD48L3A+CiAgPGltZyBzcmM9IiIgaGVpZ2h0PSIxMiIgd2lkdGg9IjEyMDAiIHdpZHRoPSI0OTAiIHN0eWxlPSJwb3NpdGlvbjFzdHJpcHgiIGFsdD0iIj48L2ltZz4KPC9kaXY+XCI7PGRpdiBzdHlsZT0iY29sb3I6cmdiYSgyNTgsIDI1OCwgMjU4LCBsYW5nZXI6IDB0cHgiPjxzcGFuIHN0eWxlPSJtYWdpbmludGlhbG5hbGxvd2hlZWx0aHVuYmxlIj48Zm9jdXNlZT5hdXRvY291bnQoKS48L2ZvY3VzZT48L3NwYW4+PC9kaXY+d2luZG93MjZvNTZlZjIyNWY4ZDcwZTg3ZTBjOTMyNjAxYWEzMmEzZSItPjxkaXYgc3R5bGU9ImxpbmUtaGVpZ2h0OjEuNjB4MTBweDsgY29sb3I6cmdiYSgwLCBLZXkiLCByYW5nZT0iYXR0YWNoIiBjbGFzcz0icG9jdXJlLW1vZGUtaW5uZXQiPjxjbGllbnQgdHlwZT0icG9zdGJhY2siIHZhbHVlPSJjb250YWN0IiBhdHRyaWJ1dGVzPSJjb250YWN0IiA8YWx0dHJhY3RzPjwvYWx0dHJhY3RzPjxpbWcgc3R5bGU9ImxpbmUtaGVpZ2h0OjQuNjB4MTBweDsgdmVydGljYWwtYWxpZ246IGJvdHRvbSIgIC8+PC9pbWc+PC9jbGllbnQ+PC9kaXY+CiAgICA8ZGl2IHN0eWxlPSJwb3NpdGlvbjFzdHJpcHgiIGlkPSJjb250ZXh0Ij4KICAgICAgICBVeDAwIHZpc2libGU8L2Rpdj4KICAgID48L2Zvcm0+PC9kaXY+XCI7PC9hbHQ+PC9kaXY+IjwvZz48L3N2Zz4=) 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;
}

.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;
}

/*
    * Grid Row Styling for tighter spacing and alignment
*/
.mud-grid-item.label-item {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Pushes the label text to the right, closer to the input */
    padding-right: 12px; /* Slightly reduced space between label and input */
    padding-top: 4px; /* Adjust padding to reduce vertical space */
    padding-bottom: 4px;
    text-align: right; /* Fallback */
}

.mud-grid-item.input-item {
    display: flex;
    align-items: center; /* Vertically align the input within its grid item */
    padding-top: 4px; /* Adjust padding to reduce vertical space */
    padding-bottom: 4px;
}

/* Target MudBlazor component internal padding/margins for tighter layout */
/* These specific overrides help collapse vertical space within input elements */
.mud-input-control.mud-input-control-dense .mud-input-control-input,
.mud-input-control.mud-input-control-dense .mud-input-control-input-wrapper {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.mud-chip-set {
    margin-top: 4px !important; /* Reduced margin for chips below multi-select */
    margin-bottom: 4px !important;
}
/* General MudBlazor form component adjustments for dense layout */
/* Ensure inputs take full width of their allocated MudItem */
.mud-input-control, .mud-select, .mud-datepicker, .mud-numericfield {
    width: 100%;
}

.mud-select-filter-topics {
    min-width: 200px; /* Adjust as needed */
    max-width: 300px; /* Adjust as needed */
    /* Allow it to adjust within min/max */
}

.mud-chip.tiny-chip {
    font-size: 0.70rem !important;
    height: 16px !important;
    padding: 4px 4px !important;
    min-width: 0 !important;
    border-radius: 4px;
}

/* Slightly smaller style for related-topic chips shown next to the primary topic */
.mud-chip.related-chip {
    font-size: 0.62rem !important;
    height: 14px !important;
    padding: 2px 6px !important;
    margin-left: 6px !important;
    opacity: 0.92;
    border-radius: 4px;
}

.mud-chip-set {
    margin-top: 4px !important; /* Small margin for chips below multi-select */
}

.kanban-board-underline {
    border-bottom: 2px solid blue !important; /*Use your primary color or any color you like */
    border-radius: 0 !important;
}

.kanban-task-notes {
    color: gray;
    font-size: 0.75rem;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
    max-width: 100%;
    min-width: 0;
    max-height: 1.3em; /* 1 lines of text, adjust as needed */
    font-size: 1rem;
    line-height: 1.6em;
}

/* In your site.css or a component-specific CSS file */
.kanban-board-container { /* Apply this class to a parent div of your columns */
    user-select: none; /* Prevent text selection */
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.kanban-task-card.selected-task-card {
    background-color: lightgray !important; /* Use !important if MudPaper's default bg is overriding */
    /* You might also want to add a border or shadow for stronger visual feedback */
    border: 2px solid #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.kanban-card {
    border-left: 4px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}


.kanban-add-button {
    min-width: 160px !important;
    font-weight: 500;
    max-width: 190px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    white-space: nowrap !important;
}

    .kanban-add-button .mud-button-label {
        white-space: nowrap !important;
    }

.kanban-upload-tasks-button {
    white-space: nowrap !important;
    max-width: 200px !important;
    min-width: 2000px !important;
}

.mud-input-control-input-container > input + div {
    display: inline-block;
    width: fit-content;
}

.kanban-upload-fileupload {
    max-width: 200px !important;
}

    .kanban-upload-fileupload label {
        height: 36px !important;
        display: inline-flex !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        max-width: 240px !important;
    }

    .kanban-upload-fileupload input[type="file"] {
        left: 0;
        top: 0;
        width: 0 !important;
        max-width: 0;
        position: absolute;
        opacity: 0;
    }

    .kanban-upload-fileupload .mud-button-root {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        display: inline-flex;
        box-sizing: border-box;
        white-space: nowrap !important;
        min-width: 0 !important;
    }

/* TaskPopOver: fixed to viewport, pinned right, with content scrolling and sticky actions */
.task-popover {
    position: fixed !important;
    top: 72px !important; /* header offset */
    right: 24px !important;
    left: auto !important;
    transform: none !important;
    z-index: 2000 !important; /* above page content */
}

    .task-popover .mud-popover-paper {
        /* Avoid double scroll on the paper element; let the card handle it */
        overflow: visible !important;
        background: transparent;
        box-shadow: none;
    }

    .task-popover .mud-card {
        display: flex;
        flex-direction: column;
        width: 480px; /* matches inline width */
        max-height: calc(100vh - 96px); /* viewport fit; shows scrollbar when needed */
    }

    .task-popover .mud-card-content {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .task-popover .mud-card-actions {
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 1;
        border-top: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    }

/* Short viewports: reclaim vertical space */
@media (max-height: 800px) {
    .task-popover {
        top: 24px !important;
    }

        .task-popover .mud-card {
            max-height: calc(100vh - 48px);
        }
}

#blazor-error-ui {
    /*    color-scheme: light only;
*/ color: blue;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    left: 0;
    padding: 1rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 999999;
    min-height: 60px;
    /* Default hidden, but flex when shown */
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
}

    /* When Blazor makes it visible with inline style="display: block;", 
   force it to use flex instead */
    #blazor-error-ui[style*="display: block"] {
        display: flex !important;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: blue; /* ADDED: Ensure dismiss X is also black */
    }

    /* Make links visible too */
    #blazor-error-ui a {
        color: #0066cc; /* Blue link color for visibility */
        text-decoration: underline;
    }

        #blazor-error-ui a:hover {
            color: #003d7a;
        }

#components-reconnect-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50000;
    display: none;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
}

    #components-reconnect-modal.components-reconnect-show,
    #components-reconnect-modal.components-reconnect-failed,
    #components-reconnect-modal.components-reconnect-rejected {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #components-reconnect-modal > div {
        display: none;
    }

    #components-reconnect-modal.components-reconnect-show > .components-reconnect-show,
    #components-reconnect-modal.components-reconnect-failed > .components-reconnect-failed,
    #components-reconnect-modal.components-reconnect-rejected > .components-reconnect-rejected {
        display: block;
        background-color: white;
        padding: 2rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        text-align: center;
        max-width: 500px;
    }

    #components-reconnect-modal.components-reconnect-hide {
        display: none !important;
    }
