/* =====================================================
   EXCEL-LIKE TABLE
   ===================================================== */

#richTextEditor .excel-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    margin: 12px 0;
    background: white;
    border: 1px solid #cbd5e1;
}

#richTextEditor table.excel-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    min-width: max-content;
    background: white;
}


/* Corner */

#richTextEditor .excel-corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 40;

    width: 46px;
    min-width: 46px;
    height: 32px;

    background: #e5e7eb;

    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
}


/* A B C D */

#richTextEditor .excel-column-header {
    position: sticky;
    top: 0;
    z-index: 30;

    width: 100px;
    min-width: 100px;
    height: 32px;

    padding: 0;

    background: #f3f4f6;

    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;

    text-align: center;

    font-size: 12px;
    font-weight: 600;

    color: #374151;

    user-select: none;
}


/* 1 2 3 4 */

#richTextEditor .excel-row-header {
    position: sticky;
    left: 0;
    z-index: 20;

    width: 46px;
    min-width: 46px;
    height: 32px;

    padding: 0;

    background: #f3f4f6;

    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;

    text-align: center;

    font-size: 12px;
    font-weight: 500;

    color: #4b5563;

    user-select: none;
}


/* Cells */

#richTextEditor .excel-cell {
    width: 100px;
    min-width: 100px;
    height: 32px;

    padding: 5px 7px;

    background: white;

    border-right: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;

    vertical-align: middle;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    outline: none;

    user-select: text;
}


/* Active cell */

#richTextEditor .excel-cell.excel-active-cell {
    position: relative;

    box-shadow:
        inset 0 0 0 2px #2563eb;

    z-index: 10;
}


/* Active A/B/C header */

#richTextEditor
.excel-column-header.excel-active-header,

#richTextEditor
.excel-row-header.excel-active-header {
    background: #dbeafe;

    color: #1d4ed8;

    font-weight: 700;
}


/* Hover */

#richTextEditor .excel-cell:hover {
    background: #f8fafc;
}


/* Selected table */

#richTextEditor
.excel-table-wrapper.excel-selected {
    box-shadow:
        0 0 0 2px #3b82f6;
}


/* Resize cursor */

#richTextEditor .excel-column-header {
    cursor: default;
}
