/* design_system/features_board.css — Features board hierarchical editor */

.features-board {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-surface);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.board-row {
    display: grid;
    grid-template-columns: 28px 36px minmax(220px, 1fr) 140px 110px 110px 140px 92px 96px;
    align-items: center;
    column-gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.1s;
}
.board-row--with-extra-columns {
    grid-template-columns:
        28px
        36px
        minmax(280px, 2.5fr)
        minmax(110px, 0.9fr)
        minmax(100px, 0.85fr)
        minmax(100px, 0.85fr)
        minmax(120px, 0.9fr)
        minmax(88px, 0.8fr)
        96px;
    column-gap: clamp(0.5rem, 1.6vw, 1.1rem);
}
.board-row--minimal-columns {
    grid-template-columns:
        28px
        36px
        minmax(300px, 3.5fr)
        minmax(120px, 1.1fr)
        minmax(120px, 1.1fr)
        96px;
    column-gap: clamp(0.6rem, 2vw, 1.25rem);
}
.board-row:last-child { border-bottom: none; }
.board-row .cell { display: flex; align-items: center; min-width: 0; }
.board-row .cell-title { gap: 0.5rem; }
.board-row .cell-actions { justify-content: flex-end; gap: 0.35rem; }
.board-row .cell-drag {
    justify-content: center;
    color: var(--color-text-muted);
}
.board-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: inherit;
    cursor: grab;
    line-height: 1;
}
.board-drag-handle:hover {
    color: var(--color-accent);
    background: var(--color-accent-soft);
}
.board-drag-handle:active {
    cursor: grabbing;
}
.board-drag-icon {
    display: block;
    flex-shrink: 0;
}
.board-sortable-ghost {
    opacity: 0.88;
    background: var(--color-accent-soft);
    box-shadow: inset 0 0 0 1px var(--color-border);
}
.board-row .cell-cost {
    justify-content: flex-end;
    color: var(--color-text-muted);
}
.board-row--task .cell-cost {
    font-size: 0.9rem;
}
.board-task-cost {
    color: var(--color-text);
    font-weight: 600;
}
.board-row--header {
    background: var(--color-bg-alt);
    padding: 0.65rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.board-row--feature { background: var(--color-bg-alt); font-weight: 600; }
.board-row--feature:hover { background: rgba(248, 249, 250, 0.95); }
.board-row--feature .board-feature-total-cost {
    color: var(--color-text);
    font-weight: 700;
    font-size: 0.95rem;
}
.board-row--task {
    padding-left: 1.25rem;
    align-items: start;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}
.board-row--task:hover { background: var(--color-bg-alt); }
.board-row--task .cell:not(.cell-title) { padding-top: 0.3rem; }
.board-row--task .cell-title {
    padding-left: 1.5rem;
    align-items: flex-start;
}
.board-row--task-excluded { opacity: 0.55; }
.board-row--task-excluded .cell-title .board-input,
.board-row--task-excluded .board-task-cost { text-decoration: line-through; }
.board-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.board-checkbox .checkbox-custom { width: 16px; height: 16px; }

/* Board task "to develop": real checkbox must receive clicks. Global rule sets
   pointer-events: none on all checkboxes (for custom-styled forms); here we
   overlay an invisible hit target so change + autosave always fire. */
.board-row--task .board-checkbox input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    pointer-events: auto;
}
.board-row--new { color: var(--color-text-muted); padding: 0.4rem 0.75rem 0.4rem 1.25rem; }
.board-row--new .cell-title { padding-left: 1.5rem; }
.board-row--new-feature .cell-title { padding-left: 0; }
.board-row--empty { padding: 1.25rem; color: var(--color-text-muted); }
.feature-requests {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
}
.feature-requests__title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.4rem 0.75rem;
}
.board-row--request,
.board-row--request-new {
    grid-template-columns: 28px 36px minmax(220px, 1fr) 140px 140px 96px;
}

.board-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    color: var(--color-text-muted);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.board-toggle:hover { color: var(--color-accent); background: var(--color-accent-soft); }
.board-toggle-icon { display: inline-block; transition: transform 0.15s ease; font-size: 0.9rem; }
.feature-group.is-collapsed .board-toggle-icon { transform: rotate(-90deg); }

.board-add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.board-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.95rem;
    color: var(--color-text);
    transition: border-color 0.15s, background 0.15s;
}
.board-input:hover { border-color: var(--color-border); background: #fff; }
.board-input:focus { outline: none; border-color: var(--color-accent); background: #fff; }
.board-input--title { font-weight: 600; }
.board-input--task-title {
    resize: none;
    overflow: hidden;
    field-sizing: content;
    min-height: 2.1rem;
    line-height: 1.35;
    font-weight: 500;
}
.board-input--number { max-width: 100%; }
.board-input--select { appearance: none; padding-right: 1.5rem; cursor: pointer; }

.board-chip {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.board-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    font-size: 0.95rem;
}
.board-action-link:hover { background: var(--color-bg-alt); color: var(--color-accent); }
.board-action-link--danger:hover { color: var(--red); background: rgba(192, 57, 43, 0.08); }

.board-error {
    display: block;
    margin-top: 0.25rem;
    color: var(--red);
    font-size: 0.85rem;
}

.feature-body { background: #fff; }
.feature-group.is-collapsed .feature-body { display: none; }

.costs-summary-details {
    margin-top: 1rem;
    border-top: 1px solid rgba(46, 125, 50, 0.2);
    padding-top: 0.75rem;
}

.costs-summary-details__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    color: var(--color-text);
}

.costs-summary-details__summary::-webkit-details-marker {
    display: none;
}

.costs-summary-details__chevron {
    color: var(--color-text-muted);
    transition: transform 0.15s ease;
}

.costs-summary-details[open] .costs-summary-details__chevron {
    transform: rotate(180deg);
}

.costs-summary-details__body {
    margin-top: 0.75rem;
}

.costs-summary-details__list {
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.costs-summary-details__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    font-size: 0.95rem;
}

.costs-summary-details__row dt {
    margin: 0;
    color: var(--color-text-muted);
    font-weight: 500;
}

.costs-summary-details__row dd {
    margin: 0;
    font-weight: 700;
}

.costs-summary-details__row--emphasis dt,
.costs-summary-details__row--emphasis dd {
    color: rgb(46, 125, 50);
    font-weight: 800;
}

.costs-summary-details__row--muted dd {
    font-weight: 600;
    color: var(--color-text);
}

.costs-summary-details__section-label {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.costs-summary-details__unavailable {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.task-title-stack {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    min-width: 0;
}
.board-row-description {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0.5rem;
}

/* Modal (HTML5 dialog) */
