/* FO Scheduling Request Selection Table */
.requests-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-top: 24px;
}

/* Action Buttons Styling */
.action-button {
    color: black; /* Light Theme */
}

.dark-theme .action-button {
    color: white; /* Dark Theme */
}

.action-button-background {
    background-color: blue; /* Light Theme */
}

.dark-theme .action-button-background {
    background-color: inherit; /* Maintain styling for Dark Theme */
}

/* FO Scheduling Repeater Styles */
.fo-repeater-row {
    display: flex;
    align-items: center;
    min-height: 60px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.fo-repeater-row:hover {
    background-color: #f8fafc;
}

.fo-repeater-row:last-child {
    border-bottom: none;
}

/* Checkbox Container */
.fo-checkbox-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    min-height: 60px !important;
}

.fo-checkbox-container input[type="checkbox"] {
    margin: 0 !important;
    transform: none !important;
}

/* Input Field Styling */
.fo-input-field input {
    border: none !important;
    background: transparent !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: #374151 !important;
    box-shadow: none !important;
}

.fo-input-field input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Hide field labels */
.fo-input-field label {
    display: none !important;
}

/* Search Input Styling */
.requests-search-input {
    margin-bottom: 16px;
}

.requests-search-input input {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 12px 16px;
    font-size: 14px;
}

.requests-search-input input:focus {
    border-color: #153b7c;
    box-shadow: 0 0 0 3px rgba(21, 59, 124, 0.1);
}

/* Checkbox List Container */
.requests-checkbox-list {
    background: white;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-top: none;
}

/* Remove default checkbox list styling */
.requests-checkbox-list .fi-fo-checkbox-list-option {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    position: relative;
    width: 100% !important;
}

.requests-checkbox-list .fi-fo-checkbox-list-option:hover {
    background: transparent !important;
}

.requests-checkbox-list .fi-fo-checkbox-list-option label {
    display: block;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    position: relative;
}

/* Position checkbox properly */
.requests-checkbox-list .fi-fo-checkbox-list-option .fi-checkbox {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin: 0;
}

/* Ensure the checkbox list container takes full width */
.requests-checkbox-list .fi-fo-checkbox-list-options {
    width: 100% !important;
    background: white;
    border-radius: 0 0 8px 8px;
}

/* Make individual option items span full width */
.requests-checkbox-list .fi-fo-checkbox-list-option > * {
    width: 100% !important;
}

/* Selected state styling */
.requests-checkbox-list .fi-fo-checkbox-list-option[data-state="checked"] {
    background: #eff6ff !important;
}

/* Bulk toggle button */
.requests-checkbox-list .fi-fo-checkbox-list-bulk-toggle {
    margin: 16px 20px 0;
    padding: 8px 16px;
    background: #153b7c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.requests-checkbox-list .fi-fo-checkbox-list-bulk-toggle:hover {
    background: #0f2c5c;
}

.fo-requests-table {
    position: relative;
}

/* Search Bar Styling */
.fo-requests-table .fi-fo-checkbox-list-search {
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.fo-requests-table .fi-fo-checkbox-list-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.fo-requests-table .fi-fo-checkbox-list-search input:focus {
    outline: none;
    border-color: #153b7c;
    box-shadow: 0 0 0 3px rgba(21, 59, 124, 0.1);
}

/* FO Scheduling CheckboxList with Table Headers */
[data-field-wrapper="selected_requests"] {
    position: relative;
}

/* Custom table header */
[data-field-wrapper="selected_requests"]::before {
    content: '';
    display: block;
    background: #153b7c;
    height: 48px;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
}

[data-field-wrapper="selected_requests"]::after {
    content: 'Request Number        Applicant               Project                     Date            CDF Amount      USD Amount';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 13px;
    padding: 0 16px 0 80px;
    pointer-events: none;
    z-index: 1;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre;
    letter-spacing: 0.05em;
}

/* Bulk Actions */
.fo-requests-table .fi-fo-checkbox-list-bulk-toggle {
    margin: 16px 20px 0;
    padding: 8px 16px;
    background: #153b7c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.fo-requests-table .fi-fo-checkbox-list-bulk-toggle:hover {
    background: #0f2c5c;
}

/* Options Container */
.fo-requests-table .fi-fo-checkbox-list-options {
    background: white;
    border-radius: 0;
}

/* Individual Request Rows */
.fo-requests-table .fi-fo-checkbox-list-option {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: transparent !important;
    position: relative;
    transition: all 0.2s ease;
}

.fo-requests-table .fi-fo-checkbox-list-option:hover {
    background: #f8fafc !important;
}

.fo-requests-table .fi-fo-checkbox-list-option:last-child {
    border-bottom: none !important;
}

.fo-requests-table .fi-fo-checkbox-list-option label {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
}

/* Checkbox Positioning */
.fo-requests-table .fi-fo-checkbox-list-option .fi-checkbox {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin: 0;
}

/* Request Row Content */
.request-row {
    display: flex;
    align-items: center;
    padding: 16px 20px 16px 50px;
    min-height: 60px;
    transition: all 0.2s ease;
}

.request-cell {
    flex: 1;
    padding-right: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.request-cell.request-number {
    flex: 0 0 180px;
    font-weight: 600;
    color: #1f2937;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.request-cell.applicant-name {
    flex: 0 0 200px;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-cell.project-name {
    flex: 0 0 200px;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-cell.date {
    flex: 0 0 120px;
    color: #6b7280;
    font-size: 13px;
}

.request-cell.amount {
    flex: 0 0 150px;
    text-align: right;
    font-weight: 700;
    color: #059669;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Selected State */
.fo-requests-table .fi-fo-checkbox-list-option[data-state="checked"] {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
}

.fo-requests-table .fi-fo-checkbox-list-option[data-state="checked"] .request-row {
    background: transparent;
}

/* Helper Text */
.fo-requests-table + .fi-fo-field-wrapper-helper-text {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* FO Scheduling View Page Styles */
.fo-scheduling-view {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.fo-scheduling-view .bg-blue-600 {
    background-color: #17418A !important; /* Match theme primary color */
}

.fo-scheduling-view table {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.fo-scheduling-view table thead th {
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 1rem 1rem;
}

.fo-scheduling-view table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.fo-scheduling-view table tbody tr:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fo-scheduling-view table tbody tr:hover td:first-child {
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 600;
}

.fo-scheduling-view .summary-section {
    background: linear-gradient(135deg, #f0f9f4 0%, #ecfdf5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.fo-scheduling-view .total-amount-badge {
    background: linear-gradient(135deg, #17418A 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(23, 65, 138, 0.3);
}

.fo-scheduling-view .info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.fo-scheduling-view .info-card:hover {
    border-color: #17418A;
    box-shadow: 0 4px 12px rgba(23, 65, 138, 0.1);
}

.fo-scheduling-view .signature-section {
    margin-top: 3rem;
    padding-top: 2rem;
}

.fo-scheduling-view .signature-line {
    border-bottom: 2px solid #374151;
    height: 60px;
    margin-bottom: 1rem;
}

/* Print styles */
@media print {
    .fo-scheduling-view {
        max-width: none;
        margin: 0;
        padding: 1rem;
    }
    
    .fo-scheduling-view table {
        box-shadow: none;
    }
    
    .fo-scheduling-view .info-card {
        border: 1px solid #000;
    }
    
    .fo-scheduling-view .signature-line {
        border-bottom: 1px solid #000;
    }
}

/* FO Scheduling Create Page - Table Interface */
.fo-scheduling-create-page {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.fo-scheduling-create-page .fi-section-content-ctn {
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.fo-scheduling-create-page .fi-section-header-ctn {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.fo-scheduling-create-page .fi-section-header-heading {
    color: #153b7c;
    font-weight: 700;
}

/* Table styling for create page */
.fo-scheduling-create-page .fi-ta-table {
    box-shadow: none;
    border: none;
}

.fo-scheduling-create-page .fi-ta-header {
    background: #153b7c;
    border-bottom: 2px solid #0f2c5c;
}

.fo-scheduling-create-page .fi-ta-header-cell {
    color: white;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    padding: 16px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.fo-scheduling-create-page .fi-ta-header-cell:last-child {
    border-right: none;
}

.fo-scheduling-create-page .fi-ta-row {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.fo-scheduling-create-page .fi-ta-row:hover {
    background-color: #f8fafc;
}

.fo-scheduling-create-page .fi-ta-cell {
    padding: 12px;
    vertical-align: middle;
}

/* Checkbox styling */
.fo-scheduling-create-page .fi-ta-selection-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
}

.fo-scheduling-create-page .fi-ta-selection-checkbox:checked {
    background-color: #153b7c;
    border-color: #153b7c;
}

.fo-scheduling-create-page .fi-ta-selection-checkbox:hover {
    border-color: #153b7c;
}

/* Bulk actions styling */
.fo-scheduling-create-page .fi-ta-bulk-actions {
    background: white;
    border: none;
    border-radius: 8px 8px 0 0;
    color: #153b7c;
    font-weight: 600;
}

.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}

.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    color: white;
}

/* Specific button text styling for Create FO Scheduling */
.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn-label,
.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn span,
.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn,
.fo-scheduling-create-page .fi-ta-bulk-actions button,
.fo-scheduling-create-page .fi-ta-bulk-actions button span,
.fo-scheduling-create-page .fi-ta-bulk-actions button .fi-btn-label,
.fo-scheduling-create-page .fi-ta-bulk-actions [data-action="create_fo"],
.fo-scheduling-create-page .fi-ta-bulk-actions [data-action="create_fo"] span {
    color: white !important;
}

.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn:hover .fi-btn-label,
.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn:hover span,
.fo-scheduling-create-page .fi-ta-bulk-actions .fi-btn:hover,
.fo-scheduling-create-page .fi-ta-bulk-actions button:hover,
.fo-scheduling-create-page .fi-ta-bulk-actions button:hover span,
.fo-scheduling-create-page .fi-ta-bulk-actions [data-action="create_fo"]:hover,
.fo-scheduling-create-page .fi-ta-bulk-actions [data-action="create_fo"]:hover span {
    color: white !important;
}

/* Text column styling */
.fo-scheduling-create-page .fi-ta-text {
    font-size: 14px;
    line-height: 1.4;
}

.fo-scheduling-create-page .fi-ta-text-item-label {
    font-weight: 600;
    color: #1f2937;
}

/* Request number styling */
.fo-scheduling-create-page [data-column="request_unique_number"] .fi-ta-text {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 600;
    color: #153b7c;
}

/* Amount styling */
.fo-scheduling-create-page [data-column="total_amount"] .fi-ta-text {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 700;
    color: #059669;
    text-align: right;
}

/* Status badge styling */
.fo-scheduling-create-page .fi-badge {
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 8px;
}

/* Empty state styling */
.fo-scheduling-create-page .fi-ta-empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.fo-scheduling-create-page .fi-ta-empty-state-heading {
    color: #153b7c;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}

.fo-scheduling-create-page .fi-ta-empty-state-description {
    color: #6b7280;
    font-size: 14px;
}

/* Header actions (Cancel button) */
.fo-scheduling-create-page .fi-header-actions .fi-btn {
    transition: all 0.2s ease;
}

.fo-scheduling-create-page .fi-header-actions .fi-btn:hover {
    transform: translateY(-1px);
}

/* Selection count indicator */
.fo-scheduling-create-page .fi-ta-selection-indicator {
    background: white;
    color: #153b7c;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid #153b7c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .request-selection-grid .fi-checkbox-list {
        grid-template-columns: 1fr;
    }
    
    .request-selection-grid .request-card {
        padding-left: 2.5rem;
    }
    
    .request-selection-grid .fi-checkbox {
        top: 0.75rem;
        left: 0.75rem;
    }
    
    .fo-scheduling-view {
        padding: 1rem;
    }
    
    .fo-scheduling-view table {
        font-size: 0.875rem;
    }
    
    .fo-scheduling-view table thead th,
    .fo-scheduling-view table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .fo-scheduling-create-page .fi-ta-cell {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .fo-scheduling-create-page .fi-ta-header-cell {
        padding: 12px 8px;
        font-size: 12px;
    }
}
