:root {
    --eg-blue: #2557d6;
    --eg-orange: #ff7a00;
    --eg-blue-light: #eaf1ff;
    --eg-orange-light: #fff1e6;
    --eg-text: #101828;
    --eg-muted: #64748b;
    --eg-border: #e3e7ef;
}

.profile-page {
    background: #f8f9fb;
    padding: 60px 0 90px;
}
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 991px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.profile-side-card {
    background: #fff;
    border: 1px solid var(--eg-border);
    border-radius: 18px;
    padding: 30px 24px;
    text-align: center;
    position: sticky;
    top: 24px;
    box-shadow: 0 6px 24px rgba(0, 40, 80, 0.05);
}
.profile-avatar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 16px;
}
.profile-avatar-wrap img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--eg-blue-light);
}
.profile-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--eg-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.profile-avatar-edit:hover {
    background: var(--eg-blue);
}
.profile-side-card h5 {
    margin: 0 0 2px;
    font-weight: 700;
    color: var(--eg-text);
}
.profile-side-card .member-since {
    color: var(--eg-muted);
    font-size: 13px;
    margin-bottom: 6px;
}
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--eg-blue-light);
    color: var(--eg-blue);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 22px;
}
.profile-badge i {
    font-size: 12px;
}

.profile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}
.profile-menu li {
    margin-bottom: 4px;
}
.profile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--eg-text);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: 0.2s;
}
.profile-menu a i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    color: var(--eg-muted);
    transition: 0.2s;
}
.profile-menu a:hover,
.profile-menu a.active {
    background: var(--eg-blue-light);
    color: var(--eg-blue);
}
.profile-menu a:hover i,
.profile-menu a.active i {
    color: var(--eg-blue);
}
.profile-menu a.logout {
    color: #e0473c;
}
.profile-menu a.logout i {
    color: #e0473c;
}
.profile-menu a.logout:hover {
    background: #fdeceb;
}
.profile-menu hr {
    border-top: 1px solid var(--eg-border);
    margin: 12px 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
@media (max-width: 576px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
}
.stat-card {
    background: linear-gradient(145deg, #ffffff, #f2f9ff);
    border: 1px solid var(--eg-border);
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    background: var(--eg-blue);
    flex: none;
}
.stat-card:nth-child(2) .stat-icon {
    background: var(--eg-orange);
}
.stat-card:nth-child(3) .stat-icon {
    background: #2bb673;
}
.stat-card .stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--eg-text);
    line-height: 1.1;
}
.stat-card .stat-label {
    font-size: 12.5px;
    color: var(--eg-muted);
}

.profile-content-card {
    background: #fff;
    border: 1px solid var(--eg-border);
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 6px 24px rgba(0, 40, 80, 0.05);
}
.profile-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--eg-border);
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.profile-tabs button {
    border: none;
    background: none;
    padding: 12px 18px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--eg-muted);
    cursor: pointer;
    position: relative;
    top: 1px;
}
.profile-tabs button.active {
    color: var(--eg-blue);
}
.profile-tabs button.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--eg-orange);
    border-radius: 3px 3px 0 0;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

.profile-content-card .form-inner {
    margin-bottom: 22px;
}
.profile-content-card .form-inner label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--eg-text);
    margin-bottom: 8px;
}
.profile-content-card .form-inner label span {
    color: var(--eg-muted);
    font-weight: 400;
}
.profile-content-card .form-inner input:focus,
.profile-content-card .form-inner select:focus,
.profile-content-card .form-inner textarea:focus {
    outline: none;
    border-color: var(--eg-blue);
    background: #fff;
    box-shadow: 0 0 0 3px var(--eg-blue-light);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}
@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.section-title h4 {
    font-weight: 700;
    color: var(--eg-text);
    margin-bottom: 4px;
}
.section-title p {
    color: var(--eg-muted);
    font-size: 13.5px;
    margin: 0;
}

.profile-actions {
    display: flex;
    gap: 14px;
    margin-top: 6px;
}
.primary-btn3 {
    background: var(--eg-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 30px;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    transition: 0.2s;
}
.primary-btn3:hover {
    background: #005490;
}
.btn-outline-eg {
    background: #fff;
    color: var(--eg-text);
    border: 1px solid var(--eg-border);
    border-radius: 10px;
    padding: 13px 26px;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-outline-eg:hover {
    border-color: var(--eg-blue);
    color: var(--eg-blue);
}

.pw-hint {
    font-size: 12.5px;
    color: var(--eg-muted);
    margin-top: -14px;
    margin-bottom: 22px;
}

/* Address Book Styles */
.address-card {
    background: #ffffff;
    border: 1px solid var(--eg-border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.04);
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
    width: 100%;
    max-width: 100%;
}

.address-card:hover {
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.08);
    transform: translateY(-2px);
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--eg-border);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tag-default {
    background: var(--eg-orange-light);
    color: var(--eg-orange);
}

.addr-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.edit-btn {
    color: var(--eg-blue);
    cursor: pointer;
}

.edit-btn:hover {
    background: var(--eg-blue-light);
}

.delete-btn {
    color: #e0473c;
}

.delete-btn:hover {
    background: #fdeceb;
}

.address-body p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--eg-muted);
    margin: 8px 0;
    line-height: 1.5;
}

.address-body i {
    color: var(--eg-orange);
    width: 16px;
    margin-top: 3px;
    font-size: 14px;
}

.address-text {
    font-weight: 500;
    color: var(--eg-text) !important;
}

.pin-text strong {
    color: var(--eg-text);
}

/* Modal Styles */
.eg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 45, 0.55);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;

}
.eg-modal-overlay.show {
    display: flex;
}
.eg-modal-box {
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 20, 50, 0.25);
    animation: egModalIn 0.25s ease;

    position: relative; */

}
@keyframes egModalIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.eg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--eg-border);
}
.eg-modal-header h5 {
    margin: 0;
    font-weight: 700;
    color: #ffff;
}
.eg-modal-header p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #ffff;
}
.eg-modal-close {
    background: var(--eg-blue-light);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--eg-blue);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex: none;
}
.eg-modal-close:hover {
    background: #ffe4c9;
    color: var(--eg-orange);
}
.eg-modal-body {
    padding: 24px 26px 6px;
    overflow-y: auto;
    max-height: calc(90vh - 150px);
    /* padding-right: 10px; */
}
.eg-modal-body .form-inner {
    margin-bottom: 20px;
}
.eg-modal-body .form-inner label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--eg-text);
    margin-bottom: 8px;
}
.eg-modal-body .form-inner input,
.eg-modal-body .form-inner select,
.eg-modal-body .form-inner textarea {
    width: 100%;
    border: 1px solid var(--eg-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--eg-text);
    background: #fbfcfe;
    transition: 0.2s;
}
.eg-modal-body .form-inner input:focus,
.eg-modal-body .form-inner select:focus,
.eg-modal-body .form-inner textarea:focus {
    outline: none;
    border-color: var(--eg-blue);
    background: #fff;
    box-shadow: 0 0 0 3px var(--eg-blue-light);
}
.eg-modal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--eg-text);
    margin-bottom: 20px;
}
.eg-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 26px 26px;
}

/* Select2 tweaks to match the design */
.select2-container {
    width: 100% !important;
}
.select2-container .select2-selection--single {
    height: 48px !important;
    border: 1px solid var(--eg-border) !important;
    border-radius: 10px !important;
    padding: 6px 14px !important;
    background: #fbfcfe !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    color: var(--eg-text);
    padding: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 10px !important;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    border-color: var(--eg-blue) !important;
    box-shadow: 0 0 0 3px var(--eg-blue-light);
}
.select2-dropdown {
    border-radius: 10px !important;
    border-color: var(--eg-border) !important;
}
.select2-search--dropdown .select2-search__field {
    border-radius: 8px !important;
    border: 1px solid var(--eg-border) !important;
    padding: 8px 10px !important;
}
.select2-results__option--highlighted {
    background: var(--eg-blue) !important;
}
