/* Leave Management Page Styles */
.leave-management-container {
    padding: 1rem;
    height: calc(100vh - 64px);
    overflow-y: auto;
    box-sizing: border-box;
}

/* Header with Country Selector */
.country-selector-card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-with-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

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

.header-text {
    flex: 1;
}

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

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

.country-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.country-selector-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.leave-panels-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    transition: grid-template-columns 0.3s ease;
}

.leave-panels-grid.left-expanded {
    grid-template-columns: 1fr 50px;
}

.leave-panels-grid.right-expanded {
    grid-template-columns: 50px 1fr;
}

@media (max-width: 1024px) {
    .leave-panels-grid {
        grid-template-columns: 1fr;
    }
    
    .header-with-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .country-selector-wrapper {
        width: 100%;
        justify-content: flex-start;
    }
}

.leave-panel {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
    min-width: 0;
    transition: all 0.3s ease;
}

.leave-panel.minimized {
    overflow: hidden;
}

.leave-panel.minimized .leave-panel-body,
.leave-panel.minimized .leave-panel-action-bar,
.leave-panel.minimized .leave-search,
.leave-panel.minimized .leave-panel-actions > *:not(.expand-icon-btn),
.leave-panel.minimized .leave-btn {
    display: none;
}

.leave-panel.minimized .leave-panel-title-row {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.leave-panel.minimized .leave-panel-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}

.leave-panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.leave-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.leave-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.leave-panel-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.leave-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    border: none;
}

.leave-btn svg {
    width: 1rem;
    height: 1rem;
}

.leave-btn-outline {
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
}

.leave-btn-outline:hover:not(:disabled) {
    background: #f9fafb;
}

.leave-btn-primary {
    background: #3b82f6;
    color: white !important;
}

.leave-btn-primary svg {
    color: white !important;
}

.leave-btn-primary .leave-stat-text {
    color: white !important;
}

.leave-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.leave-btn-danger {
    background: #dc2626;
    color: white;
}

.leave-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.leave-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.leave-search {
    position: relative;
}

.leave-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

.leave-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.leave-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.leave-panel-body {
    flex: 1;
    overflow-y: scroll !important;
    overflow-x: scroll !important;
    position: relative;
    min-height: 0;
}

.leave-panel-body::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.leave-panel-body::-webkit-scrollbar-track {
    background: #f7fafc;
}

.leave-panel-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 6px;
}

.leave-panel-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.leave-panel-body .mud-data-grid {
    min-width: max-content;
}

.leave-panel-body .mud-table-container {
    overflow: visible !important;
}

.leave-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.leave-status-approved {
    background: #dbeafe;
    color: #1e40af;
}

.leave-status-exported {
    background: #fee2e2;
    color: #991b1b;
}

.leave-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.leave-status-ignored {
    background: #fef3c7;
    color: #92400e;
}

.leave-panel-action-bar {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.leave-action-button-group {
    display: flex;
    gap: 0.5rem;
}

.leave-action-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.leave-action-btn svg {
    width: 1rem;
    height: 1rem;
}

.leave-action-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.leave-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
}

.leave-empty-text {
    font-size: 0.875rem;
}

.leave-stats-card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-top: 1rem;
}

.leave-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.leave-stats-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.leave-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leave-stat-icon {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.leave-stat-icon.active {
    color: #3b82f6;
}

.leave-stat-text {
    color: #6b7280;
}

.leave-stats-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
}

.leave-icon-button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.leave-icon-button:hover {
    background: #fee2e2;
}

.leave-icon-button svg {
    width: 1rem;
    height: 1rem;
}

/* MudBlazor DataGrid Overrides for Leave Management */
.leave-panel .mud-table-container {
    border: none;
}

.leave-panel .mud-table {
    background: transparent;
    min-width: max-content;
    table-layout: auto !important;
}

.leave-panel .mud-table-head {
    background: #f9fafb;
}

.leave-panel .mud-table-head .mud-table-cell {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
}

.leave-panel .mud-table-body .mud-table-row:hover {
    background: #f9fafb;
}

.leave-panel .mud-table-cell {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.leave-panel .mud-table-pagination {
    padding: 0;
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: white !important;
    z-index: 15;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.leave-panel .mud-table-pagination-toolbar {
    background: white !important;
    padding: 0.75rem;
    width: 100% !important;
    min-width: 100% !important;
    display: flex !important;
    justify-content: flex-start !important;
    flex-direction: row-reverse !important;
}

.leave-panel .mud-table-pagination-actions {
    order: 2 !important;
}

.leave-panel .mud-table-pagination-caption,
.leave-panel .mud-table-pagination-select {
    order: 1 !important;
}

/* Checkbox color overrides */
.leave-panel .mud-checkbox input[type="checkbox"] {
    accent-color: #3b82f6 !important;
}

.leave-panel .mud-checkbox .mud-checked {
    color: #3b82f6 !important;
}

.leave-panel .mud-checkbox-icon {
    color: #3b82f6 !important;
}

.leave-panel .mud-checkbox .mud-button-root {
    color: #3b82f6 !important;
}

.leave-panel .mud-checkbox.mud-checked .mud-button-root {
    color: #3b82f6 !important;
}

.leave-panel .mud-checkbox .mud-icon-root {
    color: #3b82f6 !important;
}

.leave-panel .mud-checkbox.mud-checked .mud-icon-root {
    color: #3b82f6 !important;
}

.leave-panel .mud-checkbox svg {
    fill: #3b82f6 !important;
}

.leave-panel .mud-checkbox.mud-checked svg {
    fill: #3b82f6 !important;
}

.leave-panel .mud-checkbox-default {
    color: #9ca3af !important;
}

.leave-panel .mud-checkbox-default:hover {
    color: #3b82f6 !important;
}

.compact-grid .mud-table-cell {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    width: 1%;
}

.compact-grid .mud-table {
    table-layout: auto !important;
    width: auto !important;
}

/* Sticky right column styling */
.compact-grid .mud-table-cell.mud-table-cell-sticky-right {
    position: sticky !important;
    right: 0 !important;
    background: white !important;
    z-index: 10 !important;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05) !important;
}

.compact-grid .mud-table-head .mud-table-cell.mud-table-cell-sticky-right {
    background: #f9fafb !important;
    z-index: 20 !important;
}

.compact-grid .mud-table-row:hover .mud-table-cell.mud-table-cell-sticky-right {
    background: #f9fafb !important;
}

.leave-panel-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.refresh-icon-btn {
    transition: all 0.2s ease;
    color: #3b82f6 !important;
}

.refresh-icon-btn:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

.expand-icon-btn {
    transition: all 0.2s ease;
    color: #6b7280 !important;
}

.expand-icon-btn:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}
