/* The module's own styles. The host links this once:
   <link rel="stylesheet" href="_content/Promisoft.Dashboard.Modules.Tasks/tasks-module.css" />
   Colours come from the shell's theme variables, never hard-coded, so the module follows
   light/dark and the installation's accent by construction. */

.requests-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* The conversation, under a divider: the request above, its history below. */
.requests-thread {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid color-mix(in srgb, currentcolor 15%, transparent);
}

.requests-thread h4 {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}

.requests-thread-empty {
    margin: 0 0 0.75rem;
    opacity: 0.7;
}

.requests-comment {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    background: color-mix(in srgb, currentcolor 6%, transparent);
}

.requests-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.requests-comment-head span {
    opacity: 0.7;
}

.requests-comment p {
    margin: 0;
    white-space: pre-wrap;
}

.requests-comment-new {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.requests-comment-new > :first-child {
    width: 100%;
}

/* ------------------------------------------------------------- kanban ------ */
/* Board built on the official DevExpress example (blazor-kanban-board, T1312597),
   restyled light: no filled column boxes - the three lanes share the full width,
   separated by faint dashed lines, so the cards get the space and the eye. The
   structural selectors (kanban-layout-grid, kanban-column-grid, kanban-drag-anchor,
   kanban-drag-hint, kanban-header-cell, kanban-data-cell) are what the DxKanban
   component tags - keep their names in sync with it. */

.tasks-kanban {
    width: 100%;
}

/* The picker sits in a toolbar item template; give it a usable width. */
.kanban-project-picker {
    min-width: 16rem;
}

/* A card reads like paper in both themes: light surface, dark ink - deliberate. */
.dx-card {
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
    border-radius: 0.3rem;
    background-color: #fff !important;
    color: #1c1c1c;
    margin: 0 !important;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-height: 4.25rem;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    cursor: pointer;
    text-align: left;
}

/* Lanes: barely tinted, evenly padded top and bottom, split by a faint dashed line.
   The tint is what gives the white cards an edge in the light theme, where they would
   otherwise sit invisible on a near-white page; mixing from currentcolor keeps it a
   whisper in both themes instead of the filled grey box we started from. */
.kanban-data-cell {
    background: color-mix(in srgb, currentcolor 5%, transparent);
    padding: 1rem 1.25rem !important;
    vertical-align: top;
}

.kanban-data-cell:not(:last-child),
.kanban-header-cell:not(:last-child) {
    border-right: 1px dashed color-mix(in srgb, currentcolor 25%, transparent) !important;
}

.kanban-header-cell {
    background: transparent !important;
    font-weight: 600;
}

.kanban-drag-hint .dxbl-grid-row-drag-hint-drag-anchor {
    display: none;
}

.kanban-drag-hint {
    padding: 0;
    width: 15rem;
}

.kanban-drag-anchor > * {
    pointer-events: none;
}

.kanban-layout-grid {
    border: none;
    height: 34rem;
}

.kanban-layout-grid > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > .dxbl-grid-table {
    border-collapse: separate;
    border-spacing: 0;
    border: none;
}

.kanban-layout-grid .dxbl-grid-empty-data-area {
    padding: 0.5rem;
}

.kanban-layout-grid .dxbl-grid-empty-row {
    border: none;
}

.kanban-column-grid {
    height: 30rem;
    background: transparent;
    border: none;
}

.kanban-column-grid .kanban-drag-anchor {
    padding: 0;
}

.kanban-column-grid .kanban-drag-anchor + td {
    padding: 0 !important;
}

.kanban-column-grid .kanban-drag-anchor + td * {
    padding: 0 !important;
}

.kanban-column-grid .dxbl-grid-indent-cell-size {
    width: 100% !important;
}

.kanban-column-grid .dxbl-grid-indent-cell-size + col {
    width: 0px !important;
}

.kanban-column-grid .dxbl-grid-header-row {
    display: none;
}

.kanban-column-grid .dxbl-scroll-viewer {
    background: transparent !important;
}

.kanban-column-grid .dxbl-grid-table {
    border: none !important;
    border-spacing: 0 1rem;
    border-collapse: separate;
}

.kanban-column-grid .dxbl-grid-table tr {
    background: transparent !important;
}

.kanban-column-grid .dxbl-grid-table td {
    background: transparent !important;
}

/* --- the card's interior (our CardTemplate) --- */
.kanban-card-priority {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 6px;
    width: 5px;
    border-radius: 2px;
}

.kanban-priority-high { background-color: #ef7d59; }
.kanban-priority-normal { background-color: #86c285; }
.kanban-priority-low { background-color: #8fb4d9; }

.kanban-card-subject {
    font-weight: 600;
    padding-right: 1.5rem; /* room for the lock on colleagues' cards */
    text-align: left;
    padding-bottom: 0.5rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8125rem;
}

/* People appear as initials, never as their login. */
.kanban-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #e4e7ec;
    color: #3a3f47;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.kanban-card-due {
    margin-left: auto; /* the date holds the right edge, whatever precedes it */
    opacity: 0.6;
}

/* A colleague's card keeps full colour; the lock is the signal. */
.kanban-card-lock {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.45;
}

/* The number that says more than the column: progress, beside the person. */
.kanban-card-progress {
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #eef1f5;
    color: #3a3f47;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ---------- Gantt (/gantt) ---------- */
/* DxTreeList carries the structure (hierarchy, collapse, frozen left columns, one
   horizontal scroll for header and body); these rules only make the timeline column
   behave like a canvas: no padding, fixed row height, absolutely positioned bars. */

.gantt-treelist {
    --gantt-row-height: 34px;
    --gantt-weekend: color-mix(in srgb, currentcolor 6%, transparent);
    --gantt-gridline: color-mix(in srgb, currentcolor 12%, transparent);
    border: none;
}

/* The bars are placed in absolute pixels from the column's left edge, so the cell must
   not add any of its own. */
.gantt-timeline-cell,
.gantt-timeline-header {
    padding: 0 !important;
    text-align: left !important;
    vertical-align: top !important;
}

.gantt-cell {
    position: relative;
    height: var(--gantt-row-height);
    /* background-image/position come from the page: one repeating gradient for the
       weekend shade and the week gridlines, phase-shifted to the axis's first weekday. */
}

/* --- the scale, inside the timeline column's header --- */
.gantt-scale {
    position: relative;
}

.gantt-months {
    display: flex;
    height: 24px;
}

.gantt-month {
    flex: none;
    overflow: hidden;
    white-space: nowrap;
    padding-left: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 24px;
    border-left: 1px solid color-mix(in srgb, currentcolor 20%, transparent);
    text-transform: capitalize;
}

.gantt-weeks {
    position: relative;
    height: 22px;
}

.gantt-week-tick {
    position: absolute;
    top: 0;
    height: 100%;
    padding-left: 0.2rem;
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 22px;
    opacity: 0.6;
    border-left: 1px dashed color-mix(in srgb, currentcolor 25%, transparent);
}

/* --- what a row draws --- */
/* Where we are: the one vertical line that answers before any bar does. */
.gantt-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef7d59;
    opacity: 0.7;
}

.gantt-bar {
    position: absolute;
    top: 6px;
    height: 20px;
    border-radius: 6px;
    overflow: hidden;
}

/* Priority speaks through the bar's colour, the board's palette verbatim. */
.gantt-priority-high { background: color-mix(in srgb, #ef7d59 30%, transparent); }
.gantt-priority-normal { background: color-mix(in srgb, #86c285 30%, transparent); }
.gantt-priority-low { background: color-mix(in srgb, #8fb4d9 30%, transparent); }

.gantt-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 6px 0 0 6px;
}

.gantt-priority-high .gantt-bar-fill { background: #ef7d59; }
.gantt-priority-normal .gantt-bar-fill { background: #86c285; }
.gantt-priority-low .gantt-bar-fill { background: #8fb4d9; }

.gantt-bar-caption {
    position: relative;
    display: block;
    padding-left: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 20px;
    color: #1c1c1c;
    mix-blend-mode: luminosity;
}

/* A summary spans work rather than being work: slimmer and quieter than the bars it
   covers, so the eye reads the activities first. */
.gantt-summary {
    position: absolute;
    top: 13px;
    height: 8px;
    border-radius: 4px;
    background: color-mix(in srgb, currentcolor 22%, transparent);
    overflow: hidden;
}

.gantt-summary-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 4px 0 0 4px;
    background: color-mix(in srgb, currentcolor 55%, transparent);
}

/* One date is a point, not a span: a diamond on the day. */
.gantt-milestone {
    position: absolute;
    top: 11px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    border-radius: 2px;
}

.gantt-priority-high.gantt-milestone { background: #ef7d59; }
.gantt-priority-normal.gantt-milestone { background: #86c285; }
.gantt-priority-low.gantt-milestone { background: #8fb4d9; }

/* --- rows by kind --- */
.gantt-row-project { font-weight: 700; }

.gantt-row-area { font-weight: 600; }

/* The virtual holder and the no-area tail are scaffolding, not content. */
.gantt-row-container { font-style: italic; opacity: 0.75; }

/* --- legend --- */
.gantt-legend {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.8;
}

.gantt-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.gantt-legend-bar {
    width: 26px;
    height: 10px;
    border-radius: 4px;
    background: #86c285;
}

.gantt-legend-milestone {
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
    border-radius: 2px;
    background: #86c285;
}

.gantt-legend-none {
    width: 26px;
    height: 10px;
    border-radius: 4px;
    border: 1px dashed color-mix(in srgb, currentcolor 40%, transparent);
}

/* The work-area tree inside the project popup: a real tree, because nesting is what the
   reader is there to see. Bounded so a deep one scrolls instead of pushing the buttons
   off the dialog. */
.areas-tree {
    border: none;
    max-height: 16rem;
}

.areas-target {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.8125rem;
    opacity: 0.75;
}

/* Save and Cancel side by side under the area editor, which stacks its fields. */
.areas-edit-actions {
    display: flex;
    gap: 0.5rem;
}

/* The project dialog grew a whole tree; without this its lower half - the area editor
   and the buttons - falls off the bottom of the viewport with no way to reach it. */
.projects-popup .dxbl-modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* The three row actions belong on one line whatever the column's width. */
.areas-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.1rem;
}
