/* =====================================================
   WP - Wealth Portal
   Modern Bootstrap 5 Portal - Clean & Professional
   ===================================================== */

/* ----- CSS Variables ----- */
:root {
    /* Primary Brand */
    --wp-navy: #1e3a5f;
    --wp-navy-dark: #0f2744;
    --wp-navy-light: #2d4a6f;
    
    /* Sidebar */
    --wp-sidebar: #3c4a54;
    --wp-sidebar-dark: #2f3b44;
    
    /* Accent */
    --wp-blue: #3b82f6;
    --wp-blue-hover: #2563eb;
    
    /* Status Colors */
    --wp-green: #10b981;
    --wp-green-dark: #059669;
    --wp-orange: #f59e0b;
    --wp-orange-dark: #d97706;
    --wp-red: #ef4444;
    
    /* Grays */
    --wp-gray-50: #f9fafb;
    --wp-gray-100: #ecf0f1;
    --wp-gray-200: #e5e7eb;
    --wp-gray-300: #d1d5db;
    --wp-gray-400: #9ca3af;
    --wp-gray-500: #6b7280;
    --wp-gray-600: #4b5563;
    --wp-gray-700: #374151;
    
    /* Layout */
    --wp-sidebar-width: 250px;
    --wp-topbar-height: 60px;
    --wp-radius: 4px;
    --wp-radius-sm: 4px;
}

/* ----- Base ----- */
body {
    background-color: var(--wp-gray-100);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ----- Sidebar ----- */
.wp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--wp-sidebar-width);
    background: linear-gradient(180deg, var(--wp-sidebar) 0%, var(--wp-sidebar-dark) 100%);
    z-index: 1040;
    overflow-y: auto;
}

.wp-sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.wp-sidebar-name {
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 15px 0;
}

.wp-sidebar-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #fff;
    background-color: var(--wp-sidebar);
    background-size: cover;
    background-position: center;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-sidebar-avatar i {
    font-size: 32px;
    color: rgba(255,255,255,0.4);
}

/* Adviser "ear" for client view */
.wp-sidebar-header.client-view {
    position: relative;
}

.wp-adviser-ear {
    position: absolute;
    top: 60px;
    left: 60px;
    z-index: 10;
}

.wp-adviser-ear-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-size: cover;
    background-position: center;
    background-color: var(--wp-sidebar);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.wp-adviser-ear:hover .wp-adviser-ear-photo {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.wp-sidebar-nav {
    padding: 15px 0;
}

.wp-sidebar-nav .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wp-sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 12px;
    font-size: 16px;
}

.wp-sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: rgba(0,0,0,0.3);
}

.wp-sidebar-nav .nav-link.active {
    color: #fff;
    background-color: #000;
}

/* ----- Top Bar ----- */
.wp-topbar {
    position: fixed;
    top: 0;
    left: var(--wp-sidebar-width);
    right: 0;
    height: var(--wp-topbar-height);
    background-color: var(--wp-navy);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.wp-brand {
    font-size: 26px;
    color: #fff;
    text-decoration: none;
}

.wp-brand:hover {
    color: #fff;
    text-decoration: none;
}

.wp-brand strong {
    font-weight: 700;
}

.wp-brand span {
    font-weight: 300;
}

/* ----- Search ----- */
.wp-search {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.wp-search-wrapper {
    position: relative;
}

.wp-search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
}

.wp-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--wp-radius-sm);
    background-color: rgba(255,255,255,0.1);
    font-size: 15px;
    color: #fff;
    transition: all 0.2s ease;
}

.wp-search input:focus {
    outline: none;
    border-color: var(--wp-blue);
    background-color: #fff;
    color: #333;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.wp-search input::placeholder {
    color: rgba(255,255,255,0.5);
}

.wp-search input:focus::placeholder {
    color: var(--wp-gray-400);
}

/* ----- Top Bar Icons ----- */
.wp-topbar-icons {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.wp-topbar-icons .btn {
    width: 42px;
    height: 42px;
    border-radius: var(--wp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: transparent;
    border: none;
    position: relative;
    transition: all 0.2s ease;
    font-size: 18px;
}

.wp-topbar-icons .btn:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.wp-topbar-icons .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    padding: 3px 6px;
}

.wp-topbar-avatar-btn {
    padding: 0 !important;
    width: 42px !important;
    height: 42px !important;
}

.wp-topbar-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
}

/* ----- Main Content ----- */
.wp-main {
    margin-left: var(--wp-sidebar-width);
    padding-top: var(--wp-topbar-height);
    min-height: 100vh;
}

.wp-breadcrumb {
    background-color: #fff;
    border-bottom: 1px solid var(--wp-gray-200);
    padding: 12px 20px;
}

.wp-breadcrumb .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    font-size: 14px;
}

.wp-breadcrumb .breadcrumb a {
    color: var(--wp-blue);
    text-decoration: none;
}

.wp-breadcrumb .breadcrumb a:hover {
    text-decoration: underline;
}

.wp-content {
    padding: 20px;
}

/* ----- Dashboard Tabs - Free floating pills ----- */
.wp-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wp-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--wp-gray-500);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wp-tab:hover {
    color: var(--wp-gray-700);
    background-color: var(--wp-gray-100);
    text-decoration: none;
}

.wp-tab.active {
    color: #fff;
    background-color: #0d6efd;
}

.wp-tab.active:hover {
    background-color: #0b5ed7;
    color: #fff;
}

.wp-tab i {
    font-size: 14px;
}

.wp-tab-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* ----- Stat Cards ----- */
.wp-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.wp-stat-card {
    border-radius: var(--wp-radius);
    padding: 25px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.wp-stat-card.green {
    background: linear-gradient(135deg, var(--wp-green) 0%, var(--wp-green-dark) 100%);
}

.wp-stat-card.orange {
    background: linear-gradient(135deg, var(--wp-orange) 0%, var(--wp-orange-dark) 100%);
}

.wp-stat-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.wp-stat-value {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 5px;
}

.wp-stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.wp-stat-icon {
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 40px;
    opacity: 0.3;
}

/* ----- Cards ----- */
.wp-card {
    background: #fff;
    border-radius: var(--wp-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.wp-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--wp-gray-200);
    font-weight: 600;
    color: var(--wp-navy);
    display: flex;
    align-items: center;
}

.wp-card-header i {
    margin-right: 10px;
    color: var(--wp-blue);
}

.wp-card-body {
    padding: 20px;
}

/* ----- Client Grid ----- */
.wp-client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.wp-client-card {
    background: #fff;
    border-radius: var(--wp-radius);
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.wp-client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    text-decoration: none;
}

.wp-client-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background-color: var(--wp-gray-200);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-client-avatar i {
    font-size: 40px;
    color: var(--wp-gray-400);
}

.wp-client-name {
    font-weight: 600;
    color: var(--wp-navy);
    margin-bottom: 5px;
}

.wp-client-meta {
    font-size: 13px;
    color: var(--wp-gray-400);
}

/* ----- Buttons ----- */
.btn-wp-primary {
    background-color: var(--wp-blue);
    border-color: var(--wp-blue);
    color: #fff;
    border-radius: var(--wp-radius-sm);
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-wp-primary:hover {
    background-color: var(--wp-blue-hover);
    border-color: var(--wp-blue-hover);
    color: #fff;
}

.btn-wp-success {
    background-color: var(--wp-green);
    border-color: var(--wp-green);
    color: #fff;
    border-radius: var(--wp-radius-sm);
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-wp-success:hover {
    background-color: var(--wp-green-dark);
    border-color: var(--wp-green-dark);
    color: #fff;
}

/* ----- Filter Bar ----- */
.wp-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wp-filter-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wp-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-search-input {
    position: relative;
}

.wp-search-input input {
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--wp-gray-200);
    border-radius: var(--wp-radius);
    font-size: 14px;
    width: 200px;
    background: #fff;
}

.wp-search-input input:focus {
    outline: none;
    border-color: var(--wp-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wp-search-input i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wp-gray-400);
    font-size: 14px;
}

.wp-filter-btn {
    padding: 8px 12px;
    border: 1px solid var(--wp-gray-200);
    border-radius: var(--wp-radius);
    background: #fff;
    color: var(--wp-gray-600);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wp-filter-btn:hover {
    background: var(--wp-gray-50);
    border-color: var(--wp-gray-300);
    color: var(--wp-gray-700);
}

.wp-filter-btn.active {
    background: var(--wp-gray-100);
    border-color: var(--wp-gray-300);
}

.wp-view-toggle {
    display: flex;
}

.wp-view-toggle .wp-filter-btn {
    border-radius: 0;
}

.wp-view-toggle .wp-filter-btn:first-child {
    border-radius: var(--wp-radius) 0 0 var(--wp-radius);
}

.wp-view-toggle .wp-filter-btn:last-child {
    border-radius: 0 var(--wp-radius) var(--wp-radius) 0;
    border-left: none;
}

/* ----- Clients Grid ----- */
.wp-clients-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.wp-client-card {
    background: #fff;
    border-radius: var(--wp-radius);
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.wp-client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    text-decoration: none;
}

.wp-client-photo {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--wp-gray-100);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-client-photo i {
    font-size: 48px;
    color: var(--wp-gray-300);
}

.wp-client-info {
    padding: 12px;
    text-align: center;
}

.wp-client-name {
    font-weight: 600;
    color: var(--wp-navy);
    font-size: 14px;
    margin-bottom: 4px;
}

.wp-client-meta {
    font-size: 12px;
    color: var(--wp-gray-400);
}

/* ----- Avatar Initials Fallback ----- */
.wp-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 28px;
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.lp-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .wp-sidebar {
        transform: translateX(-100%);
    }
    
    .wp-topbar {
        left: 0;
    }
    
    .wp-main {
        margin-left: 0;
    }
    
    .wp-stats {
        grid-template-columns: 1fr;
    }
    
    .wp-tab-actions {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
    }
    
    .wp-clients-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wp-filter-left {
        width: 100%;
    }
    
    .wp-filter-right {
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .wp-clients-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1201px) and (max-width: 1400px) {
    .wp-clients-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
