.client-sheet {
    margin-top: 24px;
    overflow: hidden;
}
.sheet-toolbar,
.sheet-status,
.sheet-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
}
.sheet-toolbar {
    border-bottom: 1px solid var(--line);
}
.sheet-toolbar .input-wrap {
    flex: 1;
    min-width: 220px;
    max-width: 480px;
}
.sheet-toolbar input {
    width: 100%;
}
.sheet-status {
    justify-content: space-between;
    background: var(--canvas);
}
.sheet-status > [role="status"] {
    font-weight: 500;
}
.sheet-hint {
    color: var(--muted);
    font-size: var(--text-sm);
    padding: 0 20px 16px;
    margin: 0;
    background: var(--canvas);
}
.sheet-scroll {
    overflow: auto;
    max-height: calc(100dvh - 360px);
    min-height: 240px;
    overscroll-behavior: contain;
}
.sheet-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}
.sheet-table th,
.sheet-table td {
    padding: 0;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    vertical-align: middle;
}
.sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--nav-active);
    min-width: 210px;
    width: 230px;
    font-weight: 600;
}
.sheet-table .sheet-row-number {
    position: sticky;
    left: 0;
    background: var(--canvas);
    width: 66px;
    min-width: 66px;
    text-align: center;
    color: var(--muted);
    z-index: 1;
}
.sheet-table thead .sheet-row-number {
    z-index: 3;
}
.sheet-row-number label {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
}
.sheet-row-number input {
    accent-color: var(--accent-hover);
    width: 16px;
    height: 16px;
}
.sheet-column-title {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 48px;
    padding: 4px 7px 4px 12px;
}
.sheet-column-title > .btn {
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    flex: 1;
    color: var(--ink);
    min-width: 0;
    white-space: normal;
    font-weight: 600;
}
.sheet-column-title > span {
    flex: 1;
}
.sheet-column-title > .icon {
    width: 15px;
    min-width: 15px;
    color: var(--muted);
}
.sheet-column-title .icon-button {
    flex-shrink: 0;
    width: 32px;
    height: 36px;
}
.sheet-cell-wrap {
    display: flex;
    align-items: center;
    min-height: 48px;
}
.sheet-cell {
    background: none;
    border: 0;
    color: var(--ink);
    padding: 12px;
    text-align: left;
    width: 100%;
    min-height: 48px;
    cursor: text;
    line-height: 1.5;
    font-size: var(--text-base);
    overflow: hidden;
}
.sheet-cell > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre;
}
.sheet-cell:hover {
    background: var(--accent-soft);
}
.sheet-cell:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: -2px;
    background: var(--accent-soft);
}
.sheet-cell-pending {
    box-shadow: inset 3px 0 var(--accent-strong);
}
.sheet-placeholder {
    color: var(--muted);
}
.sheet-secret .sheet-cell {
    font-family: var(--mono);
}
.sheet-show {
    flex-shrink: 0;
    margin-right: 4px;
    width: 36px;
    height: 40px;
}
.sheet-table tr.selected td,
.sheet-table tr.selected th {
    background: var(--accent-soft);
}
.sheet-table .sheet-empty {
    height: 220px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    white-space: normal;
}
.sheet-footer {
    border-top: 1px solid var(--line);
    justify-content: space-between;
    color: var(--muted);
    font-size: var(--text-sm);
}
.client-sheet .registry-pagination {
    border-top: 1px solid var(--line);
}
@media (max-width: 767px) {
    .client-sheet {
        margin-top: 16px;
    }
    .sheet-toolbar,
    .sheet-status,
    .sheet-footer {
        padding: 12px;
    }
    .sheet-status .action-row {
        width: 100%;
    }
    .sheet-status .action-row > .btn {
        flex: 1;
    }
    .sheet-hint {
        padding: 0 12px 12px;
    }
    .sheet-scroll {
        max-height: 65dvh;
    }
    .sheet-table thead th {
        width: 210px;
    }
    .sheet-toolbar .input-wrap {
        max-width: none;
        width: 100%;
        flex-basis: 100%;
    }
    .sheet-column-title .icon-button,
    .sheet-show {
        min-width: 44px;
        min-height: 44px;
    }
}
.sheet-cell-editor {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    max-height: 180px;
    margin: 0;
    padding: 11px;
    border: 2px solid var(--accent-strong);
    border-radius: 0;
    outline: none;
    resize: vertical;
    font: inherit;
    line-height: 1.5;
    color: var(--ink);
    background: var(--surface);
}
.sheet-draft-row .sheet-cell {
    min-height: 44px;
}
.sheet-draft-row .sheet-row-number {
    font-weight: 400;
}
.sheet-draft-row .sheet-cell:empty {
    display: block;
}
.sheet-table .sheet-draft-row td {
    background: var(--surface);
}
