/* Floating staff task card. Loaded after the CRM shell and workspace styles. */
body {
    --my-task-width: 380px;
    --my-task-top: 60px;
}

.my-task-sidebar {
    inset: calc(var(--my-task-top) + 12px) 16px auto auto;
    width: var(--my-task-width);
    padding: 0;
    display: block;
    z-index: 940;
    background: transparent;
    border: 0;
}

.my-task-sidebar .my-task-panel {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: calc(100vh - var(--my-task-top) - 28px);
    max-height: calc(100dvh - var(--my-task-top) - 28px);
    border: 1px solid #d5e0e7;
    border-radius: 12px;
    background: #f3f7fa;
    box-shadow: 0 8px 28px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
}

.my-task-sidebar .my-task-header {
    flex: 0 0 auto;
    padding: 14px 16px 10px;
    border: 0;
    background: #eaf1f6;
}

.my-task-sidebar .my-task-header h2 { color: #101828; }
.my-task-sidebar .my-task-header span { color: #606f83; font-size: 12px; }

.my-task-sidebar .my-task-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 6px 10px;
    color: #344054;
    background: #fff;
    border-color: #bdcbd6;
}

.my-task-sidebar .my-task-close span { margin: 0; color: inherit; font-size: 13px; }
.my-task-sidebar .my-task-close .my-task-close-icon { font-size: 22px; line-height: 1; }
.my-task-sidebar .my-task-close::before,
.my-task-sidebar .my-task-close::after { content: none; }
.my-task-sidebar .my-task-close:hover { background: #f3f7fa; border-color: #97aabd; }
.my-task-sidebar :is(button, input, select, a, [tabindex]):focus-visible {
    outline: 2px solid #315d8e;
    outline-offset: 2px;
}

.my-task-sidebar .my-task-tabs {
    flex: 0 0 auto;
    padding: 0 12px;
    gap: 16px;
    background: #f3f7fa;
}

.my-task-sidebar .my-task-tabs button {
    min-height: 38px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #606f83;
}

.my-task-sidebar .my-task-tabs button.is-active {
    border-bottom-color: #00876b;
    color: #006f58;
}

.my-task-sidebar .my-task-tabs button.is-active span { background: #e7f5f0; color: #006f58; }

.my-task-sidebar .my-task-form {
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    background: #f3f7fa;
    padding: 12px;
}

.my-task-sidebar .my-task-title-field { grid-column: 1 / -1; }
.my-task-sidebar .my-task-assignee-field { grid-column: 1; }
.my-task-sidebar .my-task-form label { font-size: 12px; font-weight: 400; text-transform: none; }
.my-task-sidebar .my-task-form :is(input, select) { margin: 0; font-size: 13px; }
.my-task-sidebar .my-task-form button { background: #00876b; border-color: #00876b; }
.my-task-sidebar .my-task-form button:hover { background: #006f58; border-color: #006f58; }
.my-task-sidebar .my-task-error { flex: 0 0 auto; }

.my-task-results { flex: 0 1 auto; min-height: 0; display: flex; }
.my-task-sidebar .my-task-list { width: 100%; padding: 0; background: #f3f7fa; }

.my-task-sidebar .my-task-row {
    padding: 12px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #e4e7ec;
    border-left: 3px solid transparent;
    border-radius: 0;
    background: #f8fafc;
}

.my-task-sidebar .my-task-row:last-child { border-bottom: 0; }
.my-task-sidebar .my-task-row:hover,
.my-task-sidebar .my-task-row:focus-within { background: #edf3f7; }
.my-task-sidebar .my-task-row.is-current { background: #edf8f4; border-left-color: #00876b; }
.my-task-sidebar .my-task-title { font-size: 13px; line-height: 1.45; }
.my-task-sidebar .my-task-details { color: #606f83; line-height: 1.45; }
.my-task-sidebar .my-task-date,
.my-task-sidebar .my-task-meta { font-size: 12px; line-height: 1.45; color: #606f83; }
.my-task-sidebar .my-task-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.my-task-sidebar .my-task-meta span { white-space: normal; overflow-wrap: anywhere; }
.my-task-sidebar .my-task-assignee-chip { max-width: none; border: 0; padding: 0; background: transparent; color: #606f83; font-weight: 400; font-size: 12px; }
.my-task-sidebar .my-task-source-link { font-size: 12px; font-weight: 500; color: #006f58; }
.my-task-sidebar .my-task-check input { accent-color: #00876b; }

.my-task-resizer {
    position: absolute;
    z-index: 1;
    left: -5px;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
    touch-action: none;
}

.my-task-resizer::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 3px;
    height: 28px;
    border-radius: 3px;
    background: #a0adba;
}

.my-task-resizer:hover::after,
.my-task-resizer:focus-visible::after { background: #00876b; }
body.is-resizing-my-tasks { cursor: col-resize; user-select: none; }
.my-task-trigger[aria-expanded="true"] { background: #e7f5f0; color: #006f58; }

@media (max-width: 1099px) {
    body.has-my-task-sidebar { overflow: hidden; }
    .my-task-sidebar {
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        z-index: 1100;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
        background: rgba(16, 24, 40, 0.16);
    }
    .my-task-sidebar .my-task-panel {
        width: min(480px, 100%);
        max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
    .my-task-resizer { display: none; }
    .my-task-sidebar .my-task-close { min-height: 44px; }
    .my-task-sidebar .my-task-form :is(input, select, button),
    .my-task-sidebar .my-task-tabs button { min-height: 44px; }
    .my-task-sidebar .my-task-form :is(input, select) { font-size: 16px; }
    .my-task-sidebar .my-task-check { width: 44px; height: 44px; margin: -10px; }
    .my-task-sidebar .my-task-source-link { min-height: 44px; align-items: center; margin-top: 0; }
}

@media print {
    body.has-my-task-sidebar { overflow: visible; }
    .my-task-sidebar { display: none !important; }
}
