/* shared table styles */

/* Tabulator Styles */

/* Container for tables - apply this to wrap tabulator tables */
.table-container {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    height: 100% !important;
}

.tabulator {
    background: rgb(219, 219, 219) !important;
    border: 1px solid var(--color-border-subtle) !important;
    overflow: hidden !important;
    /* Table takes 100% of container height */
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.tabulator-header {
    background: white !important;
    border-bottom: 1px solid var(--color-border-strong) !important;
}

.tabulator-header .tabulator-col {
    background: white !important;
    color: black !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    padding: 0.4rem 0.75rem !important;
}

/* Edit mode - prominent borders on headers */
.tabulator.edit .tabulator-header .tabulator-col {
    border-right: 1px solid var(--color-border) !important;
}

.tabulator.edit .tabulator-header .tabulator-col:last-child {
    border-right: none !important;
}

/* Read mode - soft gray borders on headers */
.tabulator.read .tabulator-header .tabulator-col {
    border-right: 1px solid #f3f4f6 !important;
}

.tabulator.read .tabulator-header .tabulator-col:last-child {
    border-right: none !important;
}

.tabulator-header .tabulator-col:hover {
    background: #7a29120e !important;
}

.tabulator-row {
    background: white !important;
    border-bottom: 1px solid var(--color-border) !important;
    transition: background 0.2s ease !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Re-enable text selection inside editable inputs */
.tabulator-row .tabulator-cell input,
.tabulator-row .tabulator-cell textarea,
.tabulator-row .tabulator-cell select {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

.tabulator-row:hover {
    background: #7a29120e !important;
}

.tabulator-row:nth-child(even) {
    background: #ffffff !important;
}
.atbulinator-row:nth-child(odd) {
    background: #ffffff !important;
}

.tabulator-row:nth-child(even):hover {
    background: #7a29120e !important;
}

.tabulator-row.tabulator-selected {
    background: #7a291220 !important;
}

.tabulator-row.tabulator-selected:hover {
    background: #7a291230 !important;
}

.tabulator-row.tabulator-selected .tabulator-cell {
    font-weight: 500 !important;
}

.tabulator-cell {
    padding: var(--space-075) var(--space-100) !important;
    font-size: 0.875rem !important;
    color: #374151 !important;
}

/* Edit mode - prominent borders between cells */
.tabulator.edit .tabulator-cell {
    border-right: 1px solid var(--color-border) !important;
}

.tabulator.edit .tabulator-cell:last-child {
    border-right: none !important;
}

/* Read mode - soft gray borders between cells */
.tabulator.read .tabulator-cell {
    border-right: 1px solid #f3f4f6 !important;
}

.tabulator.read .tabulator-cell:last-child {
    border-right: none !important;
}

.tabulator-footer {
    background: white !important;
    color: black !important;
    border-top: 1px solid var(--color-border-strong) !important;
    padding: 0.25rem var(--space-050) !important;
}

.tabulator-col {
    border-right: none !important;
}

.tabulator-tableHolder {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    background: rgb(138, 138, 138);
}

/* Custom scrollbar styling for Tabulator tables */
.tabulator *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tabulator *::-webkit-scrollbar-track {
    background: var(--color-bg-muted);
    border-radius: 3px;
}

.tabulator *::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.tabulator *::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* Firefox scrollbar */
.tabulator,
.tabulator * {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) var(--color-bg-muted);
}

.tabulator-placeholder {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.tabulator .tabulator-footer .tabulator-page {
    border-radius: 0 !important;
}
.tabulator .tabulator-footer .tabulator-page:hover {
    background: #7a291256 !important;
}
.tabulator .tabulator-footer .tabulator-page:disabled {
    background: #7a29120e !important;
    color: #9ca3af !important;
}
.tabulator .tabulator-footer .tabulator-page.active {
    background: white !important;
    color: var(--color-primary) !important;
}

.tabulator.tabulator-editing {
    border: 1px solid var(--color-border-strong) !important;
}

/* Reduce padding for text inputs in table rows */
.tabulator-row .tabulator-cell input[type="text"],
.tabulator-row .tabulator-cell input[type="number"],
.tabulator-row .tabulator-cell select {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
} 