
/* --- Main Layout Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 0 20px;
    position: relative;
}

/* Hero / Page Title */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
}

.hero-text h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 14px;
}

.hero-text::after {
    content: '';
    display: block;
    width: 32px;
    height: 4px;
    background: var(--primary-green);
    border-radius: 2px;
    margin-top: 12px;
}

/* Hero Decorative Vector Graphic */
.hero-illustration {
    width: 200px;
    height: 100px;
    position: relative;
    background: radial-gradient(circle, rgba(0,166,90,0.1) 0%, rgba(255,255,255,0) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-illustration i {
    font-size: 50px;
    color: var(--primary-green);
    background: white;
    padding: 16px;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* --- Form Card --- */
.search-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.full-width {
    grid-column: span 3;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.form-group label i.info-icon {
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.input-control {
    width: 100%;
    height: 42px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--text-dark);
    outline: none;
    background-color: #fff;
    transition: border-color 0.2s;
}

.input-control:focus {
    border-color: var(--primary-green);
}

.input-control::placeholder {
    color: #94a3b8;
}

select.input-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2094a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    cursor: pointer;
}

.sub-text {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Custom Input Groups (Search Icon inside, Amount prefix, etc.) */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.date-range-group {
    display: flex;
    gap: 8px;
}

.date-input {
    position: relative;
    flex: 1;
}

.date-input i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}

.currency-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    overflow: hidden;
    height: 42px;
}

.currency-symbol {
    padding: 0 12px;
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 500;
    border-right: 1px solid var(--input-border);
    line-height: 42px;
    font-size: 13px;
}

.currency-input input {
    border: none;
    height: 100%;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    width: 100%;
}

/* Pill Radio Selection */
.pill-group {
    display: flex;
    gap: 10px;
    align-items: center;
    height: 42px;
}

.pill-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.pill-option.active {
    border-color: var(--primary-green);
    background-color: var(--light-green-bg);
    color: var(--primary-dark);
    font-weight: 600;
}

.pill-option input {
    display: none;
}

.pill-option .check-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}

/* Inline Radio Group */
.radio-inline-group {
    display: flex;
    gap: 16px;
    align-items: center;
    height: 42px;
}

.radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.radio-btn.active {
    background-color: var(--light-green-bg);
    color: var(--primary-dark);
    border-color: var(--light-green-bg);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    margin-top: 10px;
}

.checkbox-container input {
    accent-color: var(--primary-green);
    width: 14px;
    height: 14px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
}

.btn-reset {
    background: transparent;
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-search {
    background: var(--primary-green);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Bottom Features Bar --- */
.features-bar {
    background: #eaf6f0;
    border-radius: 16px;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
    font-size: 16px;
}

.feature-text h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.feature-text p {
    font-size: 11px;
    color: var(--text-muted);
}

.divider {
    width: 1px;
    height: 30px;
    background-color: #cbd5e1;
}

/* Floating Sidebar Options */
.floating-sidebar {
    position: fixed;
    left: 10px;
    top: 60%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.floating-sidebar i {
    font-size: 14px;
    color: var(--primary-green);
    cursor: pointer;
    padding: 4px;
}

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
}
/* Select2 - match normal input fields */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--multiple {
    min-height: 44px !important;
    height: 44px !important;
    border: 1px solid #cfd6df !important;
    border-radius: 6px !important;
    background: #fff !important;
    padding: 4px 8px !important;
    box-sizing: border-box;
}

.select2-container .select2-selection--multiple
.select2-selection__rendered {
    padding: 0 !important;
}

.select2-container .select2-search--inline .select2-search__field {
    margin: 3px 0 !important;
    height: 28px !important;
    font-size: 14px !important;
}

.select2-container .select2-selection--multiple
.select2-selection__placeholder {
    color: #8b96a8 !important;
    margin-top: 5px !important;
}
.select2-container--default .select2-search--inline .select2-search__field {
    padding: 5px !important;
}

/* =========================================================
   CPV SEARCH PANEL
========================================================= */

.cpv-field {
    position: relative;
}

.cpv-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #dce3ef;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(20, 40, 80, .14);
    z-index: 9999;
    overflow: hidden;
}

/* Header */

.cpv-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 15px 18px;
    border-bottom: 1px solid #e7ebf2;
    font-size: 12px;
    font-weight: 700;
    color: #8a98ad;
    letter-spacing: .3px;
}

.cpv-header span:last-child {
    padding-left: 10px;
}

/* Content */

.cpv-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 180px;
    max-height: 245px;
}

.cpv-search-results,
.cpv-selected-results {
    padding: 10px 14px;
    overflow-y: auto;
}

.cpv-search-results {
    border-right: 1px solid #e7ebf2;
}

/* CPV checkbox rows */

.cpv-search-results label,
.cpv-search-results .checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 6px;
    margin: 0;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.4;
    color: #718096;
    cursor: pointer;
}

.cpv-search-results label:hover {
    background: #f5f8ff;
}

.cpv-search-results input[type="checkbox"] {
    margin: 1px 0 0;
    accent-color: #24439a;
    flex-shrink: 0;
}

/* Selected CPV */

.cpv-selected-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpv-selected-results > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: #f2f6ff;
    border: 1px solid #c8dbff;
    border-radius: 8px;
    color: #344054;
    font-size: 12px;
}

/* Remove button */

.cpv-remove-btn {
    width: 20px;
    height: 20px;
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 16px;
    line-height: 18px;
    cursor: pointer;
    padding: 0;
}

.cpv-remove-btn:hover {
    color: #dc2626;
}

/* Footer */

.cpv-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e7ebf2;
    background: #fff;
}

/* Done */

.cpv-done-btn {
    min-width: 90px;
    height: 38px;
    border: 0;
    border-radius: 7px;
    background: #24439a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.cpv-done-btn:hover {
    background: #1d367f;
}

/* Cancel */

.cpv-cancel-btn {
    min-width: 78px;
    height: 38px;
    border: 1px solid #d5dce8;
    border-radius: 7px;
    background: #fff;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.cpv-cancel-btn:hover {
    background: #f8fafc;
}
.cpv-content {
    height: 245px;
    overflow: hidden;
}

.cpv-search-results,
.cpv-selected-results {
    height: 100%;
    max-height: 245px;
    overflow-y: auto;
    box-sizing: border-box;
    padding-bottom: 55px; /* prevents content going behind buttons */
}
.cpv-search-results{
        overflow-x: auto;
    height: 300px;
}


/* Fix Select2 multiple values overlapping */
.select2-container--default .select2-selection--multiple {
    min-height: 42px;
    height: auto !important;
    padding: 3px 6px;
}

.select2-container--default .select2-selection--multiple
.select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0;
    padding: 0;
}

.select2-container--default .select2-selection--multiple
.select2-selection__choice {
    margin: 2px 3px 2px 0 !important;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.select2-container--default .select2-search--inline {
    margin: 2px 0;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .features-bar {
        flex-wrap: wrap;
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .search-card {
        padding: 18px 14px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid > .form-group,
    .full-width {
        grid-column: auto !important;
    }

    .pill-group {
        height: auto;
        flex-wrap: wrap;
    }

    .pill-option {
        flex: 1 1 calc(50% - 10px);
        min-height: 40px;
        white-space: normal;
        text-align: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button,
    .features-bar {
        width: 100%;
    }

    .features-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .cpv-panel {
        min-width: 0;
    }
}