/* ==========================================================================
   SGML Member Portal - Profile Page (Modern Enterprise UI)
   ========================================================================== */

.profile-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

/* 1. Header Card */
.profile-header-card {
    background: #ffffff;
    border: 1px solid #e9e5ef;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 4px 16px rgba(30, 20, 40, 0.03);
    position: relative;
    overflow: hidden;
}

.profile-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #9828c8, #6d28d9);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.user-identity {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f3e8ff, #ede9fe);
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(152, 40, 200, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #9828c8;
    flex-shrink: 0;
}

.user-details h1 {
    font-size: 22px;
    font-weight: 800;
    color: #171321;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.member-code-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    background: #f8f7fb;
    border: 1px solid #e2e8f0;
    color: #4b4552;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.user-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #686174;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-status-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.status-badge.active, .status-badge.approved, .status-badge.verified {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-badge.pending, .status-badge.in_review, .status-badge.in-review {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.status-badge.rejected, .status-badge.inactive, .status-badge.suspended {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 2. Horizontal Tab Navigation */
.profile-tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #ede9fe;
    padding: 0 4px;
    overflow-x: unset;
    scrollbar-width: thin;
}

.profile-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #686174;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
}

.profile-tab-btn:hover {
    color: #9828c8;
    background: rgba(243, 232, 255, 0.4);
}

.profile-tab-btn.active {
    color: #9828c8;
    font-weight: 750;
    border-bottom-color: #9828c8;
    background: rgba(243, 232, 255, 0.5);
}

.tab-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    background: #ede9fe;
    color: #6d28d9;
}

/* 3. Tab Content Area */
.tab-content-container {
    min-height: 400px;
}

/* 4. Enterprise Section Cards */
.profile-card {
    background: #ffffff;
    border: 1px solid #e9e5ef;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f0f5;
}

.card-title {
    font-size: 16px;
    font-weight: 750;
    color: #171321;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.card-subtitle {
    font-size: 13px;
    color: #716b80;
    margin-top: 2px;
}

/* 5. Clean Key-Value Data Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px 24px;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-label {
    font-size: 12px;
    font-weight: 600;
    color: #716b80;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.data-value {
    font-size: 14px;
    font-weight: 600;
    color: #171321;
    word-break: break-word;
}

.data-value.empty {
    color: #94a3b8;
    font-style: italic;
    font-weight: 400;
}

/* 6. Address Cards Grid */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.address-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.address-card.default-address {
    border-color: #9828c8;
    background: #fcfaff;
}

.address-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.address-type-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    background: #ede9fe;
    color: #6d28d9;
    border-radius: 6px;
}

.address-body {
    font-size: 13px;
    line-height: 1.6;
    color: #332f3d;
}

.address-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #f1f0f5;
    padding-top: 12px;
}

/* 7. Bank Accounts Grid */
.bank-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.bank-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.bank-card.primary {
    border-color: #9828c8;
    background: linear-gradient(180deg, #ffffff 0%, #fcfaff 100%);
}

.bank-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bank-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3e8ff;
    color: #9828c8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bank-name {
    font-size: 15px;
    font-weight: 750;
    color: #171321;
}

.bank-acc-num {
    font-size: 16px;
    font-family: 'Consolas', monospace;
    font-weight: 700;
    letter-spacing: 1px;
    color: #171321;
    margin: 4px 0;
}

/* 8. Documents Table & Grid */
.documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.documents-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8f7fb;
    color: #686174;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #e9e5ef;
}

.documents-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f0f5;
    color: #171321;
    vertical-align: middle;
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f3e8ff;
    color: #9828c8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-name {
    font-weight: 650;
    color: #171321;
}

.doc-meta {
    font-size: 11px;
    color: #716b80;
}

/* 9. Timeline & Activity Feed */
.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    padding-left: 20px;
}

.timeline-feed::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 7px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #9828c8;
    position: absolute;
    left: -20px;
    top: 3px;
    z-index: 2;
}

.timeline-body {
    background: #f8f7fb;
    border: 1px solid #ede9fe;
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 700;
    color: #171321;
}

.timeline-time {
    font-size: 11px;
    color: #8b8291;
}

.timeline-desc {
    font-size: 12px;
    color: #686174;
}

/* 10. Shimmer Skeleton Loading */
.skeleton-box {
    background: linear-gradient(90deg, #f1f0f5 25%, #e6e3ed 50%, #f1f0f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 6px; }
.skeleton-title { height: 22px; width: 40%; margin-bottom: 12px; }
.skeleton-card { height: 160px; border-radius: 14px; }

/* 11. Clean Buttons & Interactive Elements */
.btn-outline-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 650;
    color: #4b4552;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-sm:hover {
    border-color: #9828c8;
    color: #9828c8;
    background: #fdf8ff;
}

.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #9828c8, #6d28d9);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(152, 40, 200, 0.2);
    transition: all 0.2s;
}

.btn-primary-sm:hover {
    box-shadow: 0 6px 16px rgba(152, 40, 200, 0.3);
    transform: translateY(-1px);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #686174;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    border-color: #9828c8;
    color: #9828c8;
    background: #f3e8ff;
}

.btn-icon-sm.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fee2e2;
}

/* 12. Modals & Dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f0f5;
}

.modal-title {
    font-size: 18px;
    font-weight: 750;
    color: #171321;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #716b80;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f1f0f5;
}

/* 13. Empty & Error States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #716b80;
}

.empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.6;
}

.empty-title {
    font-size: 15px;
    font-weight: 700;
    color: #171321;
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 13px;
    color: #716b80;
    max-width: 320px;
    margin: 0 auto 16px auto;
}
.confirmation-card{max-width:430px;text-align:center}.confirmation-symbol{display:grid;place-items:center;width:48px;height:48px;margin:0 auto 14px;border-radius:50%;background:#fff0f2;color:#c43c4b;font-size:22px;font-weight:800}.confirmation-card>p{margin:7px 0 0;color:#716b80;font-size:13px}.confirmation-actions{justify-content:center}.confirmation-error{margin:13px 0 0}.btn-danger-sm{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:6px 15px;border:1px solid #fecaca;border-radius:8px;background:#c43c4b;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.btn-danger-sm:disabled{opacity:.55;cursor:not-allowed}

@media (max-width: 900px) {
    .profile-page { gap: 18px; }
    .profile-tabs-nav {
        overflow-x: auto;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .profile-tab-btn { padding: 11px 14px; }
    .documents-table { min-width: 650px; }
    .profile-card:has(.documents-table) { overflow-x: auto; }
}

@media (max-width: 600px) {
    .profile-header-card { padding: 20px 16px; border-radius: 14px; }
    .header-inner,
    .user-identity { align-items: flex-start; }
    .user-identity { gap: 13px; width: 100%; }
    .avatar-wrapper { width: 52px; height: 52px; font-size: 20px; }
    .user-details { min-width: 0; }
    .user-details h1 { font-size: 18px; gap: 6px; }
    .user-meta-row { align-items: flex-start; flex-direction: column; gap: 7px; }
    .meta-item { max-width: 100%; word-break: break-word; }
    .header-status-group { width: 100%; flex-wrap: wrap; }
    .profile-tabs-nav { gap: 2px; }
    .profile-tab-btn { padding: 10px 11px; font-size: 12px; }
    .profile-card { padding: 18px 14px; border-radius: 13px; }
    .card-header { align-items: flex-start; flex-direction: column; gap: 12px; }
    .details-grid,
    .address-grid,
    .bank-cards-grid { grid-template-columns: minmax(0, 1fr); }
    .bank-card,
    .address-card { padding: 16px; }
    .bank-acc-num { font-size: 14px; word-break: break-all; }
    .modal-overlay { padding: 8px; align-items: flex-start; }
    .modal-dialog { max-height: calc(100dvh - 16px); padding: 20px 14px; border-radius: 14px; }
    .modal-footer { align-items: stretch; flex-direction: column-reverse; }
    .modal-footer > button { justify-content: center; width: 100%; }
    .timeline-feed { padding-left: 15px; }
}
