/* Goldhorse Ewealth Management - Common Styles */

:root {
    --primary-color: #4A90E2;
    --secondary-color: #5CB3FF;
    --success-color: #28A745;
    --danger-color: #DC3545;
    --warning-color: #F59E0B;
    --info-color: #17A2B8;
    --light-bg: #F8F9FA;
    --border-color: #E5E7EB;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background-color: #f5f5f5;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #1C3A52;
    color: white;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
    font-size: 70%;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo img {
    width: 100px;
    height: auto;
    margin-bottom: 0.25rem;
}

.sidebar-logo-text {
    display: none;
}

/* New stacked logos */
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo-top {
    width: 84px; /* smaller top logo */
    height: auto;
}

.sidebar-logo-bottom {
    width: 140px; /* larger bottom eWealth logo */
    height: auto;
    margin-top: 6px;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid white;
}

.sidebar-menu-item i {
    width: 20px;
    margin-right: 12px;
}

.sidebar-submenu {
    background: rgba(0, 0, 0, 0.1);
    padding-left: 2rem;
}

/* Sidebar Chat Entry (pinned above user section) */
.sidebar-chat-entry {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 88px; /* keep above the user block at bottom */
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-chat-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #111827;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-chat-button i { color: #111827; }

.sidebar-chat-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Top Navigation */
.top-nav {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    width: 400px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 0.5rem;
}

.top-nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.nav-icon-btn:hover {
    background: #e5e7eb;
}

/* Golden Chat Button for Top Nav */
.nav-chat-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #111827;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-chat-button i {
    color: #111827;
}

.nav-chat-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Content Container */
.content-container {
    padding: 2rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Button Styles */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #3A7BC8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: #f9fafb;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

tr:hover {
    background: #f9fafb;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.success {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.warning {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.danger {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Stats Card */
.stats-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stats-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stats-change.positive {
    color: var(--success-color);
}

.stats-change.negative {
    color: var(--danger-color);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Utility Classes */
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-secondary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Top Bar - Fixed Header */
.top-bar {
    background: white;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #E5E7EB;
}

.page-header {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.page-content {
    padding: 2rem;
    background: #F8F9FA;
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.notification-btn:hover {
    background: #E5E7EB;
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #2C5282 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .search-bar {
        width: 200px;
    }
    
    .top-bar {
        padding: 1rem 1.5rem;
    }
    
    .page-content {
        padding: 1.5rem;
    }
}

