/* ── CSS custom properties (light / dark) ─────────────────── */
:root {
    --iq-text-primary:   rgba(0,0,0,0.87);
    --iq-text-high:      rgba(0,0,0,0.65);
    --iq-text-secondary: rgba(0,0,0,0.55);
    --iq-text-tertiary:  rgba(0,0,0,0.45);
    --iq-text-disabled:  rgba(0,0,0,0.35);
    --iq-text-label:     rgba(0,0,0,0.6);
    --iq-bg-page:        #F4F5F7;
    --iq-bg-surface:     #ffffff;
    --iq-bg-hover:       rgba(0,0,0,0.05);
    --iq-bg-hover2:      rgba(0,0,0,0.06);
    --iq-border:         rgba(0,0,0,0.23);
    --iq-border-subtle:  rgba(0,0,0,0.1);
    --iq-divider:        rgba(0,0,0,0.12);
    --iq-divider-subtle: rgba(0,0,0,0.06);
}

[data-theme="dark"] {
    --iq-text-primary:   rgba(255,255,255,0.87);
    --iq-text-high:      rgba(255,255,255,0.65);
    --iq-text-secondary: rgba(255,255,255,0.55);
    --iq-text-tertiary:  rgba(255,255,255,0.45);
    --iq-text-disabled:  rgba(255,255,255,0.35);
    --iq-text-label:     rgba(255,255,255,0.6);
    --iq-bg-page:        #121212;
    --iq-bg-surface:     #1E1E1E;
    --iq-bg-hover:       rgba(255,255,255,0.05);
    --iq-bg-hover2:      rgba(255,255,255,0.06);
    --iq-border:         rgba(255,255,255,0.23);
    --iq-border-subtle:  rgba(255,255,255,0.1);
    --iq-divider:        rgba(255,255,255,0.12);
    --iq-divider-subtle: rgba(255,255,255,0.06);
}

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--iq-bg-page);
}

/* ── Light sidebar ────────────────────────────────────────── */
.iq-light-drawer .mud-nav-link {
    color: rgba(0,0,0,0.6) !important;
    border-radius: 6px;
    margin: 1px 8px;
    font-size: 0.875rem;
    transition: background 0.12s, color 0.12s;
}
.iq-light-drawer .mud-nav-link .mud-icon-root {
    color: rgba(0,0,0,0.4) !important;
    transition: color 0.12s;
}
.iq-light-drawer .mud-nav-link:hover {
    color: rgba(0,0,0,0.85) !important;
    background: rgba(0,0,0,0.04) !important;
}
.iq-light-drawer .mud-nav-link:hover .mud-icon-root {
    color: rgba(0,0,0,0.6) !important;
}
.iq-light-drawer .mud-nav-link.active {
    color: #4F46E5 !important;
    background: rgba(99,102,241,0.1) !important;
    font-weight: 600;
}
.iq-light-drawer .mud-nav-link.active .mud-icon-root {
    color: #4F46E5 !important;
}

/* ── Dark sidebar (ClickUp style) ─────────────────────────── */
.iq-dark-drawer .mud-nav-link {
    color: rgba(255,255,255,0.65) !important;
    border-radius: 6px;
    margin: 1px 8px;
    font-size: 0.875rem;
    transition: background 0.12s, color 0.12s;
}
.iq-dark-drawer .mud-nav-link .mud-icon-root {
    color: rgba(255,255,255,0.4) !important;
    transition: color 0.12s;
}
.iq-dark-drawer .mud-nav-link:hover {
    color: rgba(255,255,255,0.95) !important;
    background: rgba(255,255,255,0.08) !important;
}
.iq-dark-drawer .mud-nav-link:hover .mud-icon-root {
    color: rgba(255,255,255,0.7) !important;
}
.iq-dark-drawer .mud-nav-link.active {
    color: #FFFFFF !important;
    background: rgba(255,255,255,0.15) !important;
    font-weight: 600;
}
.iq-dark-drawer .mud-nav-link.active .mud-icon-root {
    color: #FFFFFF !important;
}
/* NavGroup header in dark drawer */
.iq-dark-drawer .mud-nav-group-header,
.iq-dark-drawer .mud-nav-group-header button {
    color: rgba(255,255,255,0.65) !important;
}
.iq-dark-drawer .mud-nav-group-header .mud-icon-root {
    color: rgba(255,255,255,0.4) !important;
}
.iq-dark-drawer .mud-nav-group-header:hover,
.iq-dark-drawer .mud-nav-group-header button:hover {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.95) !important;
}

/* ── Mini rail ───────────────────────────────────────────── */
.iq-rail-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    flex-shrink: 0;
}

.iq-rail-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
}

.iq-rail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    flex-shrink: 0;
}

.iq-rail-item:hover {
    background: rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.9);
}

.iq-rail-active {
    background: rgba(255,255,255,0.15) !important;
    color: #FFFFFF !important;
}

/* ── Rail: light mode overrides ──────────────────────────── */
.iq-light-drawer .iq-rail-item {
    color: rgba(0,0,0,0.5);
}

.iq-light-drawer .iq-rail-item:hover {
    background: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.85);
}

.iq-light-drawer .iq-rail-active {
    background: rgba(99,102,241,0.12) !important;
    color: #4F46E5 !important;
}

.iq-rail-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* ── Flyout panel ──────────────────────────────────────────── */
.iq-flyout {
    position: fixed;
    left: 56px;
    min-width: 180px;
    background: var(--iq-bg-surface);
    border: 1px solid var(--iq-border-subtle);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 6px;
    z-index: 9999;
}

.iq-flyout-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--iq-text-disabled);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 10px 4px;
}

.iq-flyout-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--iq-text-high);
    text-decoration: none !important;
    transition: background 0.1s, color 0.1s;
    cursor: pointer;
    white-space: nowrap;
}

.iq-flyout-item:hover {
    background: var(--iq-bg-hover);
    color: var(--iq-text-primary);
}

.iq-flyout-active {
    background: rgba(99,102,241,0.1) !important;
    color: #4F46E5 !important;
    font-weight: 600;
}

/* ── Navbar horizontal links ─────────────────────────────── */
.iq-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--iq-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.iq-nav-link:hover {
    background: var(--iq-bg-hover);
    color: var(--iq-text-primary);
}

.iq-nav-link.active {
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.08);
    font-weight: 600;
}

/* ── Avatar activator hover ───────────────────────────────── */
.iq-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 12px;
    border-radius: 40px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.iq-dark-appbar .iq-user-btn:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.12);
}

.iq-user-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

/* ── Table row pointer ───────────────────────────────────── */
.cursor-pointer {
    cursor: pointer;
}

/* ── Testo troncato a 3 righe su schermi piccoli ─────────── */
@media (max-width: 599px) {
    .iq-clamp-mobile {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ── Task grid: layout desktop ───────────────────────────── */
.iq-tg-hdr   { display: grid; grid-template-columns: 20px 1fr 85px 85px 34px 78px 34px; gap: 0 6px; align-items: center; }
.iq-tg-phase { display: grid; grid-template-columns: 32px 1fr 85px 85px 34px 78px 34px; gap: 0 6px; align-items: center; }
.iq-tg-row   { display: grid; grid-template-columns: 1fr 85px 85px 34px 78px 34px; gap: 0 6px; align-items: center; }

/* ── Task grid: responsive mobile ────────────────────────── */
@media (max-width: 960px) {
    .iq-tg-hdr   { grid-template-columns: 20px 1fr 34px 78px 34px; }
    .iq-tg-phase { grid-template-columns: 32px 1fr 34px 78px 34px; }
    .iq-tg-row   { grid-template-columns: 1fr 34px 78px 34px; }
    .iq-hide-sm  { display: none !important; }
    .iq-desc-mobile {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

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

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
    }

/* ── Job Detail: pannello sinistro collassabile ──────────────────────── */
.iq-detail-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.iq-detail-left {
    width: 41.66%;
    min-width: 300px;
    flex-shrink: 0;
    overflow: hidden;
    opacity: 1;
    padding-right: 16px;
    transition: width 0.3s ease, min-width 0.3s ease, padding-right 0.3s ease, opacity 0.2s ease;
}

.iq-detail-left.collapsed {
    width: 0;
    min-width: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
}

.iq-detail-divider {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2px;
}

.iq-detail-right {
    flex: 1;
    min-width: 0;
    padding-left: 16px;
}

@media (max-width: 959px) {
    .iq-detail-layout { flex-direction: column; }
    .iq-detail-left {
        width: 100%;
        min-width: 0;
        padding-right: 0;
        max-height: 4000px;
        transition: max-height 0.4s ease, opacity 0.25s ease, padding-right 0s;
    }
    .iq-detail-left.collapsed {
        width: 100%;
        min-width: 0;
        max-height: 0;
        opacity: 0;
        padding-right: 0;
        pointer-events: none;
    }
    .iq-detail-divider {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        margin: 4px 0;
        padding: 0;
    }
    .iq-detail-right {
        width: 100%;
        padding-left: 0;
    }
}

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

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

code {
    color: #c02d76;
}

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

/* ── Quill editor dark mode ──────────────────────────────── */
[data-theme="dark"] .ql-toolbar.ql-snow {
    background: #2A2A2A;
    border-color: var(--iq-divider) !important;
}
[data-theme="dark"] .ql-container.ql-snow {
    background: var(--iq-bg-surface);
    border-color: var(--iq-divider) !important;
}
[data-theme="dark"] .ql-editor {
    color: var(--iq-text-primary);
}
[data-theme="dark"] .ql-editor.ql-blank::before {
    color: var(--iq-text-disabled);
}
[data-theme="dark"] .ql-toolbar .ql-stroke {
    stroke: var(--iq-text-secondary);
}
[data-theme="dark"] .ql-toolbar .ql-fill {
    fill: var(--iq-text-secondary);
}
[data-theme="dark"] .ql-toolbar button:hover .ql-stroke {
    stroke: var(--iq-text-primary);
}
[data-theme="dark"] .ql-toolbar button.ql-active .ql-stroke {
    stroke: #7C3AED;
}
[data-theme="dark"] .ql-toolbar .ql-picker-label {
    color: var(--iq-text-secondary);
}

/* ── Task description (HTML da Quill in contesti compatti) ── */
.iq-task-description p { margin: 0 0 2px; }
.iq-task-description p:last-child { margin-bottom: 0; }
.iq-task-description ol,
.iq-task-description ul { margin: 2px 0; padding-left: 20px; }
.iq-task-description li { margin: 0; }
.iq-task-description .ql-ui { display: none; }

/* ── Comment body (HTML da Quill con mention) ── */
.iq-comment-body { line-height: 1.5; font-size: 0.875rem; }
.iq-comment-body p { margin: 0 0 2px; }
.iq-comment-body p:last-child { margin-bottom: 0; }
.iq-comment-body ol,
.iq-comment-body ul { margin: 2px 0; padding-left: 20px; }
.iq-comment-body li { margin: 0; }
.iq-comment-body .ql-ui { display: none; }

/* ── Mention chip (quill-mention) ── */
.mention {
    display: inline-block;
    background: rgba(25, 118, 210, 0.12);
    color: #1565c0;
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 600;
    font-size: 0.85em;
    white-space: nowrap;
}
[data-theme="dark"] .mention {
    background: rgba(144, 202, 249, 0.15);
    color: #90caf9;
}

/* ── Mention dropdown ── */
.iq-mention-item { transition: background 0.1s; }
.iq-mention-item.active { background: rgba(0,0,0,0.06) !important; }
[data-theme="dark"] .iq-mention-item.active { background: rgba(255,255,255,0.08) !important; }

/* ── Editor commenti (bubble theme override) ── */
#comment-new-editor .ql-editor,
#comment-edit-editor .ql-editor {
    padding: 8px 10px;
    min-height: 56px;
}
#comment-new-editor .ql-editor.ql-blank::before,
#comment-edit-editor .ql-editor.ql-blank::before {
    font-style: normal;
    color: var(--iq-text-disabled);
    font-size: 0.875rem;
}