html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    height: 100%;
    /*overflow-x: hidden;*/
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}


/* Add Task Textfield */
.todo-addbar {
    /* Zentriert zur max-w-7xl Seite */
    left: max(1rem, calc((100vw - 80rem) / 2));
    right: max(1rem, calc((100vw - 80rem) / 2));
}

@media (max-width: 1280px) {
    .todo-addbar {
        left: 1rem;
        right: 1rem;
    }
}

/* Ende Add Task */

/* Scrollbar */
/* Schlanke Scrollbar – Chrome/Edge/Safari */
.thin-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.thin-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.thin-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.35); /* slate-ish */
    border-radius: 9999px;
    border: 2px solid transparent; /* macht sie optisch “schmaler” */
    background-clip: content-box;
}

    .thin-scrollbar::-webkit-scrollbar-thumb:hover {
        background-color: rgba(100, 116, 139, 0.55);
    }

/* Firefox */
.thin-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}


/* Ende Scrollbar */

/* Sortable */
.sortable-ghost {
    opacity: 0.35;
}

.sortable-chosen {
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.sortable-drag {
    box-shadow: 0 14px 40px rgba(0,0,0,0.18);
}

/*
 * Sortable Fallback (forceFallback=true):
 * Task-Cards haben i.d.R. Tailwind "transition". Diese Transition animiert
 * auch Positions-Updates des Drag-Elements und erzeugt einen sichtbaren
 * "Nachzieheffekt" hinter dem Mauszeiger in WebView2/Browser.
 *
 * Während des Drags deshalb alle Transition/Animation auf den Sortable-
 * Zustandsklassen deaktivieren.
 */
.sortable-fallback,
.sortable-chosen,
.sortable-drag {
    transition: none !important;
    animation: none !important;
}

/*
 * MAUI BlazorWebView Fix: touch-action: none
 *
 * Ohne dieses CSS fängt das native WebView (WKWebView/Android WebView) alle
 * Touch-Gesten als Scroll-Geste ab, bevor SortableJS sie verarbeiten kann.
 * Dadurch erscheint Drag & Drop wirkungslos ("nichts passiert beim Halten").
 *
 * touch-action: none gibt dem Browser an, keine native Touch-Behandlung
 * (Scrollen, Zoomen) für dieses Element durchzuführen, sodass SortableJS
 * die Events ungehindert erhält.
 */

/* Navigation: Handles für Listen und Gruppen */

.nav-list-handle,
.nav-group-handle,
.nav-drag-handle,
.drag-handle,
.kanban-column-handle {
    cursor: grab;
}

.nav-list-handle:active,
.nav-group-handle:active,
.nav-drag-handle:active,
.drag-handle:active,
.kanban-column-handle:active {
    cursor: grabbing;
}
.nav-list-handle,
.nav-group-handle,
.nav-drag-handle {
    touch-action: none;
    min-width: 1.5rem;
    min-height: 1.5rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.nav-list-handle:hover,
.nav-group-handle:hover,
.nav-drag-handle:hover {
    background: rgba(148, 163, 184, 0.18);
}

/* ListView: Drag-Handle (nur der Griff, nicht die ganze Karte) */
.drag-handle {
    touch-action: none;
}

/* KanbanView: Spalten-Handle */
.kanban-column-handle {
    touch-action: none;
}

/* KanbanView: Karten sind vollständig draggable (kein separater Handle) */
.kanban-sortable [data-taskid] {
    touch-action: none;
}

/* Sortable Optik */
.sortable-ghost {
    opacity: 0.35;
}

.sortable-chosen {
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.sortable-drag {
    box-shadow: 0 14px 40px rgba(0,0,0,0.18);
}

/* Zielspalte highlight */
.kanban-drop-target {
    outline: 2px solid rgba(59,130,246,0.8); /* blue-500 */
    box-shadow: 0 10px 20px rgba(59,130,246,0.12);
}
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
.sortable-drag { box-shadow: 0 14px 40px rgba(0,0,0,0.18); }

.kanban-drop-target {
  outline: 2px solid rgba(59,130,246,0.8);
  box-shadow: 0 10px 20px rgba(59,130,246,0.12);
}

/* Fokusrahmen im Task-Dialog komplett entfernen */
.task-edit-dialog :focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Kommentar-Tab: fluent-tabs füllt den verfügbaren Platz im Flex-Container,
   damit die interne Grid-Zeile (1fr) eine definite Höhe bekommt und
   height:100% im Kommentar-Tab auflösen kann → Eingabezeile bleibt unten. */
.task-edit-dialog fluent-tabs {
    flex: 1;
    min-height: 0;
}

/* Fluent UI Web Components: Button/Controls liegen im Shadow-DOM -> ::part */
.task-edit-dialog fluent-button::part(control):focus-visible,
.task-edit-dialog fluent-checkbox::part(control):focus-visible,
.task-edit-dialog fluent-text-field::part(control):focus-visible,
.task-edit-dialog fluent-text-area::part(control):focus-visible,
.task-edit-dialog fluent-select::part(control):focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
/* Calendar fallback (ohne externe CDN-Abhängigkeit) */
.todo-calendar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-calendar__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.todo-calendar__controls {
    display: flex;
    gap: 0.5rem;
}

.todo-calendar__btn {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
    padding: 0.35rem 0.7rem;
    font-size: 0.875rem;
}

.todo-calendar__btn:hover {
    background: #f8fafc;
}

.todo-calendar__title {
    margin: 0;
    font-size: 1.1rem;
    text-transform: capitalize;
}

.todo-calendar__weekdays,
.todo-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.todo-calendar__weekdays > div {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    padding: 0.4rem 0;
}

.todo-calendar__day {
    min-height: 7.5rem;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-bottom: none;
    padding: 0.35rem;
    background: #fff;
    overflow: hidden;
}

.todo-calendar__grid > .todo-calendar__day:nth-child(7n) {
    border-right: 1px solid #e2e8f0;
}

.todo-calendar__grid > .todo-calendar__day:nth-last-child(-n+7) {
    border-bottom: 1px solid #e2e8f0;
}

.todo-calendar__day.is-outside {
    background: #f8fafc;
    color: #94a3b8;
}

.todo-calendar__day.is-today .todo-calendar__day-number {
    color: #fff;
    background: #2563eb;
}

.todo-calendar__day-number {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.todo-calendar__event {
    --todo-calendar-card-color: transparent;
    background: #dbeafe;
    color: #1e3a8a;
    border-radius: 0.35rem;
    border: 1px solid #bfdbfe;
    border-top: 3px solid var(--todo-calendar-card-color);
    padding: 0.15rem 0.3rem;
    font-size: 0.72rem;
    min-height: 1.55rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.todo-calendar__event.is-full-color {
    border-top-width: 1px;
}

.todo-calendar__event-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.todo-calendar__avatar {
    position: relative;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.todo-calendar__avatar-fallback,
.todo-calendar__avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.todo-calendar__avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    line-height: 1;
}

.todo-calendar__avatar img {
    object-fit: cover;
}

.todo-calendar__more {
    font-size: 0.72rem;
    color: #475569;
}

/* Kommentare TaskEditModal */
/* sorgt dafür, dass Tab-Content die verfügbare Höhe nutzen kann */
.task-edit-dialog .fluent-tabs,
.task-edit-dialog .fluent-tabs-content,
.task-edit-dialog fluent-tab-panel,
.task-edit-dialog .fluent-tab-panel {
    height: 100%;
    min-height: 0;
}

/* wichtig: DialogBody darf nicht “auto” scrollen, sondern muss flexen */
.task-edit-dialog fluent-dialog-body,
.task-edit-dialog .fluent-dialog-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* deine Kommentare-Root-Box soll die Höhe ausfüllen */
.task-edit-dialog .comments-root {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* der Composer bleibt unten kleben */
.task-edit-dialog .comment-composer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: white; /* wichtig, sonst scheint Content durch */
    border-top: 1px solid #e2e8f0; /* slate-200 */
    padding: 0.5rem 0.75rem;
}
/* Ende Kommtare TaskEditModal */

/* Attachments */
/* Root Layout */
.attachments-root {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem 0.25rem;
}


/* ---------------- UPLOAD ---------------- */

.upload-dropzone {
    display: block;
    position: relative;
    border: 2px dashed #3b82f6;
    background: #f8fafc;
    border-radius: 18px;
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .upload-dropzone:hover {
        background: #eff6ff;
        border-color: #2563eb;
    }

.upload-icon {
    color: #2563eb;
    margin-bottom: 0.75rem;
}

.upload-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
}

.upload-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

.upload-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}


/* ---------------- EMPTY STATE ---------------- */

.empty-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
}


/* ---------------- ATTACHMENT LIST ---------------- */

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachment-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border-radius: 16px;
    padding: 0.75rem 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

    .attachment-card:hover {
        box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    }

.file-icon {
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-content {
    flex: 1;
}

.file-name a {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    text-decoration: none;
}

    .file-name a:hover {
        text-decoration: underline;
    }

.file-actions {
    display: flex;
    align-items: center;
}
/* Ende Attachments */

/* Nav collapse toggle button – only visible on desktop (≥901px) */
.nav-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 150ms ease, color 150ms ease;
}

.nav-collapse-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

@media (min-width: 901px) {
    .nav-collapse-btn {
        display: flex;
    }
}

/* ============================================================
 * Floating Layer – global overlay system (portal pattern)
 * Dropdowns rendered here are never clipped by overflow:hidden
 * containers such as FluentTabs or FluentDialog.
 * ============================================================ */

/* Fixed full-viewport root – pointer events are off by default
   so it doesn't block interaction with the page beneath. */
.floating-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000;
}

/* Each individual layer wrapper re-enables pointer events. */
.floating-layer {
    position: absolute;
    pointer-events: auto;
}

/* Positioned panel rendered inside .floating-layer.
   Absolute coordinates are set via inline style from FloatingDropdown.razor. */
.floating-dropdown-panel {
    position: absolute;
    pointer-events: auto;
    animation: floating-dropdown-fadein 0.12s ease;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
}

@keyframes floating-dropdown-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Anchor span wrapper – display inline so it doesn't break layout. */
.floating-dropdown-anchor {
    display: inline-flex;
    cursor: pointer;
}

/* ============================================================ */

@media (max-width: 900px) {
    .task-edit-dialog {
        --dialog-width: 100vw !important;
        --dialog-height: 100dvh !important;
        border-radius: 0 !important;
    }

    .task-edit-dialog::part(control) {
        border-radius: 0 !important;
        margin: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    .task-edit-modal-header {
        gap: 0.75rem;
    }

    .task-edit-modal-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .task-edit-dialog fluent-dialog-body::part(control) {
        padding: 0.75rem;
    }
}

/* Benachrichtigungen-Modal: Dialog bleibt im Viewport, Inhalt scrollt intern. */
.notifications-dialog {
    --dialog-width: min(1040px, calc(100vw - 32px));
    --dialog-height: min(920px, calc(100dvh - 32px));
}

.notifications-dialog::part(control) {
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    height: var(--dialog-height);
    overflow: hidden;
}

.notifications-dialog fluent-dialog-body,
.notifications-dialog .fluent-dialog-body {
    min-width: 0;
    min-height: 0;
}

.notifications-dialog fluent-dialog-body::part(control) {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notifications-modal-scroll {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: hidden;
    overflow-x: hidden;
}

.notifications-modal-content {
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.notifications-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    box-sizing: border-box;
}

@media (min-width: 1200px) {
    .notifications-dialog::part(control) {
        max-height: calc(100dvh - 24px);
    }
}

@media (max-width: 900px) {
    .notifications-dialog {
        --dialog-width: calc(100vw - 16px) !important;
        --dialog-height: calc(100dvh - 16px) !important;
    }

    .notifications-dialog::part(control) {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .notifications-dialog fluent-dialog-body::part(control) {
        padding: 0.75rem !important;
        overflow: hidden !important;
    }

    .notifications-modal-scroll {
        height: 100%;
    }

    .notifications-table-wrap {
        min-height: 0;
    }
}
