.table {
    font-size: var(--table-font-size, 13px);
    font-family: var(--table-font-family, 'Segoe UI', Tahoma, sans-serif);
}

.table thead {
    border-top: 1px solid #e0e0e0;
}

.table tbody {
    border-top: none !important;
}

.table-bordered> :not(caption)>* {
    border-width: 0;
}

.table-bordered> :not(caption)>*>* {
    border-width: 1px;
}

.table-focusable:focus {
    outline: none !important;
    box-shadow: none !important;
}

.table td,
.table th {
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    line-height: 1;
    vertical-align: middle !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.table thead th {
    background: linear-gradient(to bottom, #ffffff, #eaf4ff);
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    height: 34px !important;
    font-weight: normal !important;
    position: sticky;
    top: 0;
    z-index: 1;
}

.th-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    user-select: none;
    z-index: 2;
}

.th-resizer:hover,
.th-resizer.active {
    background-color: rgba(34, 138, 214, 0.3);
}

.table-gray thead th {
    background: #6087a9;
    color: #fff;
    border-bottom: 1px solid #0d0f10;
}

.table th.head,
td.head {
    background: #f5f5f5;
    border-right: 1px solid #bdbdbd;
    text-align: left;
}

.table tbody tr {
    height: 29px !important;
    cursor: pointer !important;
}

.table tbody tr:not(.selected):not(.selected-light):hover>* {
    background-color: #fffefe !important;
}

.table tbody tr.focused>* {
    background-color: #f0f0f0 !important;
}

tbody.selectable tr.selected {
    background-color: #e8f0fe;
}

.table tbody tr.selected>* {
    background-color: #228ad6 !important;
    color: white !important;
}

table tbody tr.selected-light>* {
    background-color: #e9f7ff !important;
}

.table tbody tr.locked>* {
    background-color: #efefef !important;
    cursor: default !important;
}

.table tbody tr.locked:hover>* {
    background-color: #efefef !important;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #808080;
    font-size: 15px;
}

.icon-btn:hover {
    color: #dc3545;
}

/* ===== TABLE: COMMON CELL STYLES ===== */
.result-empty {
    padding: 12px;
    color: #999;
    font-size: 12px;
    text-align: center;
}

.te-row-num {
    color: #999;
    font-size: 12px;
    text-align: right;
    width: 3rem;
    min-width: 3rem;
    padding-right: 6px !important;
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6 !important;
}

.te-null {
    color: #bbb;
    font-style: italic;
}

.te-bit-check {
    margin: 0 auto !important;
    cursor: pointer;
    pointer-events: auto !important;
}

.table tbody tr.selected .te-null {
    color: rgba(255,255,255,0.6);
}

.table tbody tr.selected .te-row-num {
    background-color: #1b6faa !important;
    color: rgba(255,255,255,0.7) !important;
}

/* ===== TABLE EDITOR: EDITABLE GRID ===== */
.te-table {
    width: max-content;
}

.te-cell {
    cursor: text;
    min-width: 60px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.te-cell-edited {
    background-color: #fff9c4 !important;
}

.te-cell-new {
    background-color: #e8f5e9 !important;
}

.te-row-deleted {
    text-decoration: line-through;
    opacity: 0.5;
}

.te-row-deleted .te-cell {
    background-color: #ffebee !important;
    cursor: default;
}

.te-row-new {
    background-color: #e8f5e9 !important;
}

.te-row-new:hover td {
    background-color: #c8e6c9 !important;
}
