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;
}

/* ── AI Conversation Log ────────────────────────────────────────────────────── */
.ai-log__row {
    cursor: pointer;
}

.ai-log__json-pre {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.78rem;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── AI Draft Panel ─────────────────────────────────────────────────────────── */
.ai-draft { border-color: var(--bs-primary-border-subtle); }
.ai-draft__header { background-color: var(--bs-primary-bg-subtle); font-weight: 600; }
.ai-draft__text { white-space: pre-wrap; }
.ai-draft__actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ── AI Admins ──────────────────────────────────────────────────────────────── */
.ai-admin__add-input { max-width: 260px; }

/* ── Rich text editor ──────────────────────────────────────────────────────── */
.ai-html-editor { min-height: 220px; }

/* ── App shell ─────────────────────────────────────────────────────────────── */
/* sidebar language switcher */
.lang-switch { color: rgba(255, 255, 255, 0.6); }
.lang-link { color: rgba(255, 255, 255, 0.55); text-decoration: none; font-weight: 600; padding: 0 0.25rem; }
.lang-link:hover { color: rgba(255, 255, 255, 0.9); }
.lang-active { color: #ffffff; text-decoration: underline; }
.lang-sep { color: rgba(255, 255, 255, 0.3); }

.app-main {
    margin-left: 250px;
    min-height: 100vh;
    background-color: #f8f9fa;
    min-width: 0;          /* let the flex item shrink instead of pushing the page wide */
    overflow-x: hidden;    /* the page itself never scrolls horizontally */
}

/* ── Tickets ─────────────────────────────────────────────────────────────────── */
.tickets-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tickets-list-wrap { min-width: 0; }

.tickets__list-scroll {
    max-height: calc(100vh - 19rem);
    min-height: 280px;
    overflow: auto;
}

/* column sizing — sums comfortably below typical content width, so all columns show */
.tickets__th-check  { width: 36px;  min-width: 36px; }
.tickets__th-id     { width: 64px;  min-width: 50px; }
.tickets__th-ref    { width: 96px;  min-width: 78px; }
.tickets__th-title  { min-width: 200px; }
.tickets__th-org    { width: 172px; min-width: 110px; }
.tickets__th-status { width: 104px; min-width: 84px; }
.tickets__th-agent  { width: 124px; min-width: 84px; }
.tickets__th-prio   { width: 56px;  min-width: 48px; }
.tickets__row       { cursor: pointer; }

/* ID cell opens the ticket in iTop (new tab); styled as a link so it reads as clickable */
.tickets__id-link { color: #0056A0; font-weight: 600; text-decoration: none; }
.tickets__id-link:hover { text-decoration: underline; }

/* inline-editable title cell (hover reveals the pencil) */
.tickets__title-cell { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.tickets__title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tickets__title-edit { flex: 0 0 auto; opacity: 0; color: #6c757d; line-height: 1; transition: opacity .12s; }
.tickets__row:hover .tickets__title-edit { opacity: 1; }

/* hover preview of a ticket's description (cursor-anchored, non-interactive) */
.tickets__hover-preview {
    position: fixed;
    z-index: 1080;
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
    padding: 12px 14px;
    overflow: hidden;
    pointer-events: none;        /* never steal the mouse → no hover flicker */
    font-size: 0.8125rem;
    color: #333333;
}
.tickets__hover-preview-head {
    font-weight: 600;
    color: #0056A0;
    margin-bottom: 6px;
}
.tickets__hover-preview-body { overflow-wrap: anywhere; }
.tickets__hover-preview-body img { max-width: 100%; height: auto; }
.tickets__hover-preview-body p { margin-bottom: 0.4rem; }

/* details — full-width focused view (replaces the list while a ticket is open) */
.tickets-detail-view {
    max-width: 1120px;
    margin: 0 auto;
    animation: tickets-fade-in 0.15s ease-out;
}
.tickets__detail-card { width: 100%; }
@keyframes tickets-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tickets__edit-description { min-height: 100px; }
.tickets__description-input { resize: none; }
.tickets__description-content {
    min-height: 100px;
    font-size: 0.875rem;
    overflow-wrap: anywhere;   /* break long URLs etc. instead of widening the panel */
    word-break: break-word;
}
.tickets__description-content img { max-width: 100%; height: auto; }
.tickets__log-content {
    font-size: 0.875rem;
    white-space: pre-wrap;       /* preserve caselog line breaks (plain text) */
    overflow-wrap: anywhere;
    max-height: 320px;
    overflow-y: auto;
}

/* resizable / truncating table (moved out of the page's inline <style>) */
.resizable-table { table-layout: fixed; width: 100%; }
.resizable-th {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}
.resize-handle:hover,
.resize-handle.resizing { background: rgba(255, 255, 255, 0.3); }
.resizable-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.description-content p { margin-bottom: 0.5rem; }
.description-content p:last-child { margin-bottom: 0; }

