.jexcel_container {
    display: inherit !important;
}

.jexcel_content {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Override jspreadsheet inline styles */
.jexcel_content[style*="max-height"] {
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Force override of any inline max-height */
div.jexcel_content {
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Override specific inline styles from jspreadsheet */
.jexcel_content[style*="max-height: 300px"] {
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Target the exact inline style pattern */
.jexcel_content[style*="overflow-y: auto"] {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Most specific override for jspreadsheet containers */
.jexcel_container .jexcel_content,
.jexcel_container div.jexcel_content {
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.jexcel {
    table-layout: auto !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    overflow: visible !important;
}

/* Header row styling */
.jexcel > thead > tr > td {
    background-color: #eef2f9 !important;
    color: #4a4a4a !important;
    text-align: center !important;
    font-weight: 500 !important;
    padding: 12px 8px !important;
    border: 1px solid #e0e0e0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* First column (row numbers) styling */
.jexcel > tbody > tr > td:first-child {
    background-color: #eef2f9 !important;
    color: #4a4a4a !important;
    text-align: center !important;
    font-weight: 500 !important;
    border: 1px solid #e0e0e0 !important;
    padding: 12px 8px !important;
}

/* Data cells styling */
.jexcel > tbody > tr > td {
    background-color: #ffffff !important;
    color: #4a4a4a !important;
    text-align: center !important;
    border: 1px solid #e0e0e0 !important;
    padding: 12px 8px !important;
}

/* Remove default borders and override with custom ones */
.jexcel > tbody > tr > td:not(:first-child) {
    border-left: 1px solid #e0e0e0 !important;
    border-right: 1px solid #e0e0e0 !important;
    border-top: 1px solid #e0e0e0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Readonly cells styling */
.jexcel > tbody > tr > td.readonly {
    background-color: #eef2f9 !important;
    color: #4a4a4a !important;
    text-align: center !important;
    font-weight: 500 !important;
}

/* Override any existing readonly background */
.readonly {
    background-color: #eef2f9 !important;
    color: #4a4a4a !important;
    font-weight: 500 !important;
}

/* Remove default styling that conflicts */
table.jexcel tr td {
    color: #4a4a4a !important;
    table-layout: auto !important;
}

table.jexcel tr td.readonly:nth-of-type(2) {
    color: #4a4a4a !important;
}

table.jexcel tr td.readonly:not(:nth-of-type(2)) {
    color: #4a4a4a !important;
}

table.jexcel tr td.result {
    color: #4a4a4a !important;
}

table.jexcel tr td.disabled {
    color: transparent !important;
    background-color: #eef2f9 !important;
}

/* Target readonly disabled cells specifically */
table.jexcel tr td.readonly.disabled,
.jexcel > tbody > tr > td.readonly.disabled {
    color: transparent !important;
    background-color: #eef2f9 !important;
    text-align: center !important;
}

table.jexcel tr td:last-child {
    width: 1% !important;
    white-space: nowrap !important;
}

/* Prevent padding changes when cells are selected or edited */
.jexcel > tbody > tr > td.selected,
.jexcel > tbody > tr.selected > td,
.jexcel > thead > tr > td.selected,
.jexcel > tbody > tr > td.jexcel_cursor,
.jexcel > tbody > tr > td.editing,
.jexcel > tbody > tr > td:focus,
.jexcel > tbody > tr > td > input,
.jexcel > tbody > tr > td > input:focus,
.jexcel > tbody > tr > td > textarea,
.jexcel > tbody > tr > td > textarea:focus {
    padding: 12px 8px !important;
    box-sizing: border-box !important;
}

/* Ensure input elements don't change cell padding */
.jexcel > tbody > tr > td > input,
.jexcel > tbody > tr > td > textarea {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* Override any jspreadsheet default padding for editing states */
.jexcel > tbody > tr > td.edition {
    padding: 12px 8px !important;
}

/* More specific rules to override jspreadsheet defaults */
table.jexcel > tbody > tr > td,
table.jexcel > tbody > tr > td.selected,
table.jexcel > tbody > tr.selected > td,
table.jexcel > tbody > tr > td.jexcel_cursor,
table.jexcel > tbody > tr > td.editing,
table.jexcel > tbody > tr > td:focus,
table.jexcel > tbody > tr > td.edition {
    padding: 12px 8px !important;
    box-sizing: border-box !important;
}

/* Override jspreadsheet input styling completely */
table.jexcel > tbody > tr > td > input,
table.jexcel > tbody > tr > td > textarea,
table.jexcel > tbody > tr > td > select {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

/* Force consistent padding for all cell states */
.jexcel_container .jexcel > tbody > tr > td,
.jexcel_container .jexcel > tbody > tr > td.selected,
.jexcel_container .jexcel > tbody > tr.selected > td,
.jexcel_container .jexcel > tbody > tr > td.jexcel_cursor,
.jexcel_container .jexcel > tbody > tr > td.editing,
.jexcel_container .jexcel > tbody > tr > td:focus,
.jexcel_container .jexcel > tbody > tr > td.edition {
    padding: 12px 8px !important;
    box-sizing: border-box !important;
}

/* Override the editor class and inline styles */
.jexcel > tbody > tr > td.editor,
.jexcel_container .jexcel > tbody > tr > td.editor {
    padding: 12px 8px !important;
    box-sizing: border-box !important;
}

/* Override input inline styles that cause huge padding */
.jexcel > tbody > tr > td.editor > input,
.jexcel_container .jexcel > tbody > tr > td.editor > input,
table.jexcel > tbody > tr > td.editor > input {
    width: 100% !important;
    height: 100% !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-sizing: border-box !important;
    font-size: inherit !important;
    line-height: inherit !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Ensure the editor cell maintains proper dimensions */
.jexcel > tbody > tr > td.editor {
    position: relative !important;
    overflow: visible !important;
}

/* Remove box shadow from jexcel content */
.jexcel_content {
    box-shadow: none !important;
}

/* Ensure table border is always visible during overflow */
.jexcel_content {
    overflow: auto !important;
    position: relative !important;
    max-height: 300px !important;
}

/* Make sure the table itself maintains its border */
.jexcel {
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

/* Ensure table content scrolls while border stays fixed */
.jexcel_content .jexcel {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* Force rounded corners to appear */
.jexcel_content {
    border-radius: 8px !important;
    overflow: auto !important;
}

.jexcel_content .jexcel,
table.jexcel {
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Ensure the container has rounded corners */
.jexcel_container .jexcel_content {
    border-radius: 8px !important;
    overflow: auto !important;
}

/* Override any jspreadsheet default border-radius */
.jexcel_content table,
.jexcel_content .jexcel,
.jexcel_content table.jexcel {
    border-radius: 8px !important;
    overflow: hidden !important;
}

.selected {
    background-color: transparent !important;
    border: 1px solid #007bff !important;
}