/* Employee Changes Page Styles */

.audit-changes-container {
    width: 100% !important;
    max-width: none !important;
    padding: 1rem !important;
    box-sizing: border-box;
    overflow: hidden;
    height: calc(100vh - 64px);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.header-icon {
    color: #3b82f6 !important;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
}

.header-title {
    color: #111827 !important;
    font-weight: 600 !important;
    margin: 0 0 0.25rem 0 !important;
    font-size: 1.5rem !important;
    line-height: 2rem !important;
}

.page-subtitle {
    color: #6b7280 !important;
    margin: 0 !important;
    font-size: 0.875rem !important;
}

/* Data Grid Container */
.audit-changes-container .mud-data-grid {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    height: calc(100% - 6rem) !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e5e7eb !important;
}

/* Toolbar Styles - ONLY target the ToolBarContent toolbar, not pagination toolbar */
.audit-changes-container .mud-data-grid > .mud-toolbar {
    background: #f9fafb !important;
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid #e5e7eb !important;
    min-height: auto !important;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.country-filter {
    min-width: 150px;
}

.search-field {
    min-width: 200px;
}

.refresh-button,
.export-button {
    transition: all 0.2s ease;
}

.export-button .button-icon {
    margin-right: 0.5rem;
}

.loading-spinner {
    margin-right: 0.5rem;
}

/* Table Container */
.audit-changes-container .mud-table-container {
    overflow-x: auto !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-height: calc(100vh - 280px) !important;
}

.audit-changes-container .mud-table {
    width: 100% !important;
    /* use fixed layout so table fills available space and columns distribute remaining width */
    table-layout: fixed !important;
}

/* Table Header */
.audit-changes-container .mud-table-head {
    background: #f9fafb !important;
}

.audit-changes-container .mud-table-head .mud-table-row {
    background: #f9fafb !important;
    border-bottom: 2px solid #e5e7eb !important;
}

.audit-changes-container .mud-table-head .mud-table-cell {
    background: #f9fafb !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.75rem !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Left align headers by default */
.audit-changes-container .mud-table-head .mud-table-cell {
    text-align: left !important;
}

/* Table Body */
.audit-changes-container .mud-table-body .mud-table-row {
    background: white !important;
    border-bottom: 1px solid #f3f4f6 !important;
    transition: background-color 0.15s ease !important;
}

.audit-changes-container .mud-table-body .mud-table-row:hover {
    background: #f9fafb !important;
}

.audit-changes-container .mud-table-body .mud-table-cell {
    padding: 0.5rem 0.75rem !important;
    color: #374151 !important;
    font-size: 0.75rem !important;
    border: none !important;
    vertical-align: middle !important;
    text-align: left !important;
}

/* Selected Rows */
.audit-changes-container .mud-table-body .mud-table-row.mud-selected {
    background: #eff6ff !important;
}

.audit-changes-container .mud-table-body .mud-table-row.mud-selected:hover {
    background: #dbeafe !important;
}

/* Column Widths - Auto sizing for better fit */
.audit-changes-container .mud-table-cell:nth-child(1) {
    min-width: 40px !important;
}

.audit-changes-container .mud-table-cell:nth-child(2),
.audit-changes-container .mud-table-cell:nth-child(3),
.audit-changes-container .mud-table-cell:nth-child(4) {
    min-width: 100px !important;
}

.audit-changes-container .mud-table-cell:nth-child(5),
.audit-changes-container .mud-table-cell:nth-child(6),
.audit-changes-container .mud-table-cell:nth-child(7),
.audit-changes-container .mud-table-cell:nth-child(8),
.audit-changes-container .mud-table-cell:nth-child(9),
.audit-changes-container .mud-table-cell:nth-child(10),
.audit-changes-container .mud-table-cell:nth-child(11),
.audit-changes-container .mud-table-cell:nth-child(12) {
    /*min-width: 80px !important;*/
    text-align: left !important;
}

/* Sticky header for Actions column */
audit-changes-container .mud-table-head .mud-table-cell:nth-child(13) {
    position: sticky !important;
    right: 0 !important;
    background: #f9fafb !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem !important;
    box-sizing: border-box !important;
}

/* Change Indicators */
.change-indicator {
    color: #3b82f6 !important;
}

/* Action Button */
.action-button {
    transition: all 0.2s ease;
    color: #3b82f6 !important;
}

.action-button:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

/* Loading Progress */
.audit-changes-container .mud-progress-linear {
    background-color: #3b82f6 !important;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .audit-changes-container {
        padding: 0.75rem !important;
    }
    
    .country-filter,
    .search-field {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .audit-changes-container {
        padding: 0.5rem !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .audit-changes-container .mud-table-cell {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
    
    .audit-changes-container .mud-data-grid > .mud-toolbar {
        padding: 1rem !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .toolbar-header {
        width: 100%;
    }
    
    .country-filter,
    .search-field {
        margin: 0;
        min-width: 100px;
    }
}
