/* --- CSS Styles (Copied from v3) --- */
.table-container { 
    width: 100%; 
    overflow-x: auto; 
    padding: 1rem; 
    background: #f4f6fb; 
    border-radius: 16px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); 
    direction: rtl; 
}
#editable-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #fff; 
    text-align: center; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    table-layout: auto; 
}
#editable-table thead { 
    background: linear-gradient(90deg, #667eea, #764ba2); 
    position: sticky; 
    top: 0; 
    z-index: 1; 
}
#editable-table th, #editable-table td { 
    padding: 12px 15px; 
    border: 1px solid #e0e0e0; 
    font-weight: normal; 
    text-align: center; 
    vertical-align: middle; 
    white-space: nowrap; 
}
#editable-table th { 
    color: black; 
    cursor: pointer; 
    font-weight: bold; 
}
#editable-table tbody tr:nth-child(even) { 
    background-color: #f9f9f9; 
}
#editable-table tbody tr:hover { 
    background: #e9e9f5; 
}
td[contenteditable="true"], th[contenteditable="true"] { 
    background: #fef9c3; 
    outline: 2px dashed #a78bfa; 
    cursor: text; 
    white-space: normal; 
}
td[contenteditable="true"]:focus, th[contenteditable="true"]:focus { 
    background: #fff; 
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); 
    white-space: normal; 
}
.table-actions { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-top: 15px; 
    margin-bottom: 20px; 
    align-items: center; 
    direction: rtl; 
    padding: 10px; 
    background-color: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}
.table-actions button, .table-actions select, .table-actions input[type="text"], .table-actions input[type="number"] { 
    padding: 8px 12px; 
    font-weight: 500; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 0.9rem; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    font-family: inherit; 
    background-color: #fff; 
    color: #333; 
}
.table-actions button { 
    background: #667eea; 
    color: #fff; 
    border: none; 
}
.table-actions button:hover { 
    background: #5a67d8; 
    transform: translateY(-1px); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
}
.table-actions button:active { 
    transform: scale(0.98); 
    background: #4c51bf; 
}
#delete-row-button, #delete-col-button { 
    background-color: #ef4444; 
}
#delete-row-button:hover, #delete-col-button:hover { 
    background-color: #dc2626; 
}
#save-table-button { 
    background-color: #22c55e; 
}
#save-table-button:hover { 
    background-color: #16a34a; 
}
#restore-table-button { 
    background-color: #f97316; 
}
#restore-table-button:hover { 
    background-color: #ea580c; 
}
.table-actions input[type="text"] { 
    flex-grow: 1; 
    min-width: 150px; 
}
.table-actions input[type="text"]:focus { 
    border-color: #667eea; 
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2); 
    outline: none; 
}
.table-actions input[type="number"] { 
    width: 65px; 
    padding: 8px 5px; 
    text-align: center; 
}
.table-actions select { 
    padding: 8px 12px; 
    background-color: #fff; 
}
.autosave-status { 
    font-size: 0.85rem; 
    color: #4a5568; 
    margin-right: 10px; 
    padding: 5px 10px; 
    border-radius: 4px; 
    background-color: #e2e8f0; 
}
mark.highlight-match { 
    background-color: #fef08a; 
    color: #713f12; 
    padding: 0.1em 0.2em; 
    border-radius: 3px; 
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1); 
}
.autosave-status.active { 
    color: #166534; 
    background-color: #dcfce7; 
}
.autosave-status.inactive { 
    color: #991b1b; 
    background-color: #fee2e2; 
}
/* --- End CSS --- */
