/* ==========================================================================
   Mars Business Advisory - EPP Form & Modal Redesign (UI-UX Pro Max Standard)
   Style Palette: Modern High-Contrast Light Theme (White background, Dark text)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --epp-font-main: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --epp-font-heading: 'Outfit', 'IBM Plex Sans', sans-serif;
    
    /* Color Palette - High Contrast Light Mode */
    --epp-bg-page: #F8FAFC;
    --epp-bg-modal: #FFFFFF;
    --epp-bg-card: #FFFFFF;
    --epp-bg-card-subtle: #F1F5F9;
    --epp-bg-input: #FFFFFF;
    
    --epp-border-light: #E2E8F0;
    --epp-border-hover: #CBD5E1;
    --epp-border-focus: #4F46E5;
    
    --epp-primary: #4F46E5;
    --epp-primary-hover: #4338CA;
    --epp-primary-gradient: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    
    --epp-secondary: #0284C7;
    --epp-success: #10B981;
    --epp-warning: #F59E0B;
    --epp-danger: #EF4444;
    
    --epp-text-main: #0F172A;      /* Primary dark text */
    --epp-text-regular: #1E293B;   /* Regular body text */
    --epp-text-muted: #475569;     /* Muted/Label dark text */
    
    --epp-shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
    --epp-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --epp-radius: 12px;
}

/* Base Form Fonts & Styling Overrides for EPP */
._epp_ {
    font-family: var(--epp-font-main) !important;
    background-color: var(--epp-bg-page);
}

/* --------------------------------------------------------------------------
   Filter & Action Toolbar Header
   -------------------------------------------------------------------------- */
.filter {
    background: #FFFFFF !important;
    border: 1px solid var(--epp-border-light);
    border-radius: var(--epp-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    right: auto !important;
    top: auto !important;
}

.filter .each_filter {
    display: flex;
    align-items: center;
}

.filter .btn_long.blue {
    background: var(--epp-primary-gradient) !important;
    color: #FFFFFF !important;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-family: var(--epp-font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto !important;
}

.filter .btn_long.blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, #4338CA 0%, #5B21B6 100%) !important;
}

.search_filter {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    width: auto !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search_filter > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search_filter label.label {
    font-size: 13px;
    font-weight: 600;
    color: var(--epp-text-muted);
    margin: 0;
    white-space: nowrap;
    width: auto !important;
}

.search_filter .selector, 
.search_filter select,
.search_filter input[type="text"] {
    background: #F8FAFC !important;
    border: 1px solid var(--epp-border-hover) !important;
    color: var(--epp-text-main) !important;
    border-radius: 8px !important;
    height: 38px !important;
    line-height: 38px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    margin-bottom: 0 !important;
    width: auto !important;
    transition: all 0.2s ease;
}

.search_filter input[type="text"]:focus,
.search_filter select:focus {
    border-color: var(--epp-border-focus) !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

.search_filter #btn_search {
    background: #0284C7 !important;
    color: #FFFFFF !important;
    border: none;
    border-radius: 8px;
    padding: 0 18px;
    height: 38px;
    line-height: 38px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.search_filter #btn_search:hover {
    background: #0369A1 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* --------------------------------------------------------------------------
   Modal Overlays & Popups (Light Theme System)
   -------------------------------------------------------------------------- */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.popup.sub_popup {
    z-index: 1100;
}

.popup .bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99;
}

.popup_holder {
    position: relative;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    z-index: 100;
    margin: auto;
    top: 0 !important;
    background: #FFFFFF;
    border: 1px solid var(--epp-border-light);
    border-radius: 20px;
    box-shadow: var(--epp-shadow-lg);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: eppModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes eppModalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Close Button */
.btn_close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    line-height: 34px;
    text-align: center;
    border-radius: 50%;
    background: #F1F5F9;
    border: 1px solid var(--epp-border-light);
    color: var(--epp-text-muted);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    z-index: 110;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn_close:hover {
    background: var(--epp-danger) !important;
    border-color: var(--epp-danger) !important;
    color: #FFFFFF !important;
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.popup_content {
    width: 100% !important;
    background: #FFFFFF !important;
    border: none !important;
    padding: 28px 32px !important;
    overflow-y: auto;
    max-height: calc(90vh - 20px);
    box-sizing: border-box;
}

/* Modal Form Headers */
.popup_content h2 {
    font-family: var(--epp-font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--epp-text-main);
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid #F1F5F9;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.popup_content h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--epp-primary-gradient);
    border-radius: 2px;
}

.popup_content h3 {
    font-family: var(--epp-font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--epp-text-main);
    margin-bottom: 16px;
    background: transparent !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Main Status Selector Header */
.main_status {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    background: #F8FAFC;
    border: 1px solid var(--epp-border-light);
    border-radius: var(--epp-radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.main_status::before {
    content: 'Application Status';
    font-size: 13px;
    font-weight: 700;
    color: var(--epp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main_status select,
.main_status .select2-container {
    max-width: 280px;
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   Card-Based Form Section Layouts (.input_group) - Light Theme
   -------------------------------------------------------------------------- */
.input_group {
    background: #FFFFFF !important;
    border: 1px solid var(--epp-border-light) !important;
    border-radius: var(--epp-radius);
    padding: 20px 24px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    overflow: visible !important;
}

.input_group:hover {
    border-color: var(--epp-border-hover) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Column Grid Alignment Inside Cards */
._1column, ._2column, ._3column {
    position: relative;
    display: block !important;
    margin: 0 0 16px 0 !important;
    padding: 0;
    vertical-align: top;
}

.input_group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.input_group > h3 {
    width: 100%;
}

.input_group > ._1column {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.input_group > ._2column:not(._2column_Remark) {
    width: calc(50% - 8px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.input_group > ._3column {
    width: calc(33.333% - 11px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

._2column_Remark {
    width: 100% !important;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px !important;
}

/* Responsive Column Handling */
@media (max-width: 768px) {
    .input_group > ._2column,
    .input_group > ._3column {
        width: 100% !important;
    }
    
    .popup_holder {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .popup_content {
        padding: 20px !important;
    }
}

/* --------------------------------------------------------------------------
   Input Controls, Labels, Selects & Textareas Styling (Light Mode)
   -------------------------------------------------------------------------- */
label.label {
    width: 100% !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--epp-text-muted) !important;
    margin-bottom: 6px !important;
    display: block !important;
    letter-spacing: 0.2px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    background: #FFFFFF !important;
    border: 1px solid var(--epp-border-hover) !important;
    border-radius: 8px !important;
    color: var(--epp-text-main) !important;
    font-family: var(--epp-font-main) !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    line-height: 1.5 !important;
    height: 42px;
    margin-bottom: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none !important;
}

textarea {
    height: auto !important;
    min-height: 90px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--epp-border-focus) !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Select2 Custom Styling Overrides - Light Mode */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    background-color: #FFFFFF !important;
    border: 1px solid var(--epp-border-hover) !important;
    border-radius: 8px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--epp-text-main) !important;
    line-height: 40px !important;
    padding-left: 14px !important;
    font-size: 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--epp-text-muted) transparent transparent transparent !important;
}

.select2-dropdown {
    background-color: #FFFFFF !important;
    border: 1px solid var(--epp-border-light) !important;
    border-radius: 8px !important;
    box-shadow: var(--epp-shadow-lg) !important;
    z-index: 1200 !important;
}

.select2-results__option {
    color: var(--epp-text-regular) !important;
    font-size: 14px !important;
    padding: 8px 14px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--epp-primary) !important;
    color: #FFFFFF !important;
}

/* File Input Custom Upload Zone */
input[type="file"] {
    padding: 8px !important;
    background: #F8FAFC !important;
    border: 1px dashed var(--epp-border-hover) !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 12px !important;
    color: var(--epp-text-muted) !important;
}

input[type="file"]:hover {
    border-color: var(--epp-border-focus) !important;
    background: #F1F5F9 !important;
}

/* Thumbnails and Upload Previews */
.showThumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.thumbnail {
    width: 70px !important;
    height: 70px !important;
    border-radius: 8px !important;
    border: 1px solid var(--epp-border-light) !important;
    background: #F8FAFC !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.thumbnail ._images {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail .btn_close {
    width: 18px !important;
    height: 18px !important;
    line-height: 16px !important;
    font-size: 10px !important;
    top: 2px !important;
    right: 2px !important;
}

/* --------------------------------------------------------------------------
   Sub-tables inside Forms - Light Theme
   -------------------------------------------------------------------------- */
.input_group .table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #FFFFFF !important;
    border: 1px solid var(--epp-border-light) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    margin: 12px 0 !important;
    box-shadow: none !important;
}

.input_group .table .row {
    background: transparent !important;
    border-bottom: 1px solid var(--epp-border-light);
    transition: background 0.15s ease;
}

.input_group .table .row:hover:not(.header) {
    background: #F8FAFC !important;
}

.input_group .table .row.header {
    background: #F1F5F9 !important;
}

.input_group .table .cell {
    padding: 10px 14px !important;
    color: var(--epp-text-regular) !important;
    font-size: 13px !important;
    border-right: 1px solid var(--epp-border-light) !important;
}

.input_group .table .header .cell {
    font-family: var(--epp-font-heading);
    font-weight: 700 !important;
    color: var(--epp-text-main) !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Action Buttons */
.btn {
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.btn.blue {
    background: #0284C7 !important;
    color: #FFFFFF !important;
}

.btn.blue:hover {
    background: #0369A1 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}

.btn.green, .submit {
    background: var(--epp-primary-gradient) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
}

.btn.green:hover, .submit:hover {
    background: linear-gradient(135deg, #4338CA 0%, #5B21B6 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
}

/* Submit Button Bar */
.popup_content .submit {
    width: 100% !important;
    max-width: 240px;
    height: 46px;
    font-size: 15px !important;
    border-radius: 10px !important;
    margin: 20px auto 0 auto !important;
    display: block !important;
}

/* Locked Summary & Info Fields - High Contrast Light Mode */
.lockField {
    background: #F1F5F9 !important;
    border: 1px solid var(--epp-border-hover) !important;
    color: var(--epp-primary) !important;
    font-family: var(--epp-font-heading);
    font-weight: 700 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.summary_holder {
    background: #EEF2FF;
    border: 1px dashed #A5B4FC;
    border-radius: var(--epp-radius);
    padding: 16px 20px;
    color: #1E1B4B;
    font-size: 14px;
    font-weight: 600;
}

/* Field Hint Badges & Formatting Notes */
.field_hint_badge {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #0EA5E9 !important;
    margin-top: 4px;
    margin-bottom: 4px;
}

.field_hint_badge.required_hint {
    color: #E11D48 !important;
}

/* Invalid Input Highlighting */
.field_error_input {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Error Summary Card System */
.error_summary_card {
    background: #FEF2F2 !important;
    border: 1px solid #FCA5A5 !important;
    border-left: 4px solid #EF4444 !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
    margin: 16px 0 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}

.error_summary_title {
    font-family: var(--epp-font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #991B1B !important;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.error_summary_list {
    margin: 0 !important;
    padding-left: 20px !important;
    color: #991B1B !important;
    font-size: 13px;
}

.error_summary_list li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    color: #991B1B !important;
    padding: 10px 14px !important;
    font-weight: 600;
    margin-top: 12px;
    display: none;
}

/* --------------------------------------------------------------------------
   Refined Layout System for Add Settlement / Refund Form & Dialogs
   -------------------------------------------------------------------------- */
.popup_content.popup_settlement,
.popup_content.popup_collectmoney,
.popup_content.popup_merchant,
.popup_content.popup_remark,
.popup_content.popup_closecase,
.popup_content.popup_creditcard {
    max-width: 840px !important;
    margin: 0 auto;
    padding: 32px !important;
}

.popup_header_bar {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #F1F5F9;
}

.popup_header_bar h2 {
    font-size: 22px !important;
    margin-bottom: 6px !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.popup_subtitle {
    font-size: 13px;
    color: var(--epp-text-muted);
    margin: 0;
}

.form_grid_wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form_card_section {
    background: #FFFFFF;
    border: 1px solid var(--epp-border-light);
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease;
}

.form_card_section:hover {
    border-color: var(--epp-border-hover);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.section_badge_header {
    font-family: var(--epp-font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--epp-text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--epp-border-light);
}

.form_row_grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form_field_group {
    display: flex;
    flex-direction: column;
}

.form_field_group.full_width {
    grid-column: span 2;
}

.form_field_group label.label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--epp-text-muted) !important;
    margin-bottom: 6px !important;
}

.form_field_group label.label i {
    color: var(--epp-primary);
    font-size: 12px;
}

.form_action_footer {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--epp-border-light);
}

.form_action_footer .submit {
    min-width: 220px;
    height: 48px;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    margin: 0 !important;
}

@media (max-width: 640px) {
    .form_row_grid {
        grid-template-columns: 1fr;
    }
    .form_field_group.full_width {
        grid-column: span 1;
    }
}

