/* The Document templates designer - a spreadsheet-style grid where a checkbox per cell is the
   selection mechanism (not a click/drag gesture or a modifier key - both proved unreliable over a
   Blazor Server circuit), then Merge/Split/type into the checked cells. See
   DocumentTemplateDesigner.razor. */

.doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.doc-toolbar .btn[data-active="true"] {
    background: var(--color-accent-emphasis);
    border-color: var(--color-accent-emphasis);
    color: var(--color-fg-on-emphasis);
}

.doc-grid-wrapper {
    overflow-x: auto;
}

.doc-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.doc-grid-cell {
    border: 1px solid var(--color-border-muted);
    padding: 6px 8px;
    font-size: 12px;
    min-width: 28px;
    height: 32px;
    vertical-align: top;
    overflow: hidden;
}

.doc-grid-empty {
    background: var(--color-canvas-subtle);
}

.doc-grid-cell:hover {
    background: var(--color-accent-subtle);
}

.doc-grid-checkbox {
    display: block;
    margin: 0 0 4px;
    cursor: pointer;
}

/* box-shadow rather than outline: outlines on <td> are unreliable across browsers once the table
   uses border-collapse, sometimes not painting at all - box-shadow doesn't have that problem. The
   !important beats .doc-grid-empty's own background so an empty cell highlights exactly as
   visibly as an occupied one. */
.doc-grid-cell[data-selected="true"] {
    background: var(--color-accent-muted) !important;
    box-shadow: inset 0 0 0 2px var(--color-accent-emphasis);
    position: relative;
    z-index: 1;
}

.doc-grid-cell[data-emphasis="true"] .doc-grid-text-preview {
    font-weight: 700;
    font-size: 14px;
}

.doc-grid-field-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-subtle);
    color: var(--color-fg-muted);
    font-size: 11px;
}

.doc-grid-text-preview {
    white-space: pre-wrap;
    word-break: break-word;
}
