@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #12131a;
    --bg-card: rgba(22, 24, 37, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
    border: 2px solid var(--bg-secondary);
}
::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Main Container Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.menu-item.active {
    background: var(--accent-glow);
    color: #60a5fa;
    border-left: 3px solid #3b82f6;
}

.menu-item i {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: #2a2d3d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: rgba(10, 11, 16, 0.5);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.status-badge-container {
    display: flex;
    gap: 16px;
    align-items: center;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.connecting {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

/* Content Views */
.content-view {
    padding: 32px;
    flex-grow: 1;
    overflow-y: auto;
    display: none;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

#crm.content-view.active {
    display: flex !important;
    flex-direction: column;
}

#chat.content-view.active {
    display: flex !important;
    flex-direction: column;
    height: calc(100vh - 70px);
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    flex: 1 1 100% !important;
}

#chat .chat-hub {
    display: flex !important;
    height: 100% !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    overflow: hidden;
}

/* Collapsed Sidebar */
.app-container.sidebar-collapsed .sidebar {
    width: 0px !important;
    min-width: 0px !important;
    overflow: hidden !important;
    padding: 0 !important;
    border-right: none !important;
    display: none !important;
}

/* Fullscreen Mode */
.app-container.fullscreen-mode .sidebar {
    display: none !important;
}

.app-container.fullscreen-mode .top-bar {
    display: none !important;
}

.app-container.fullscreen-mode .main-content {
    width: 100vw !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
}

.app-container.fullscreen-mode .content-view.active {
    height: 100vh !important;
    width: 100vw !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
}

.app-container.fullscreen-mode #chat.content-view.active {
    height: 100vh !important;
    width: 100vw !important;
}

.app-container.fullscreen-mode #chat .chat-hub {
    height: 100vh !important;
    width: 100vw !important;
}

/* Hidden Chat Profile Panel */
.chat-profile-panel.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Grid & Cards System */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.card-stat:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

/* Dashboard Charts Grid */
.grid-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .grid-charts {
        grid-template-columns: 1fr;
    }
}

.chart-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 360px;
}

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

.chart-title {
    font-size: 1rem;
    font-weight: 600;
}

.chart-wrapper {
    position: relative;
    flex-grow: 1;
    height: 100%;
}

/* Channel Configuration Cards */
.grid-channels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.channel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
}

.channel-card:hover {
    border-color: var(--border-hover);
}

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

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

.channel-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
}

.zalo-color { background-color: #0068ff; }
.zalo-oa-color { background: linear-gradient(135deg, #0056cc 0%, #0099ff 100%); }
.fb-color { background-color: #1877f2; }
.tele-color { background-color: #24A1DE; }
.wa-color { background-color: #25D366; }

.channel-name {
    font-weight: 600;
    font-size: 1rem;
}

.channel-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.channel-badge.connected {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.channel-badge.disconnected {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.channel-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Modal and connection QR simulation */
.qr-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.qr-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.qr-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    width: 400px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    transform: translateY(20px);
    transition: var(--transition);
}

.qr-modal.active .qr-container {
    transform: translateY(0);
}

.qr-box {
    width: 220px;
    height: 220px;
    background-color: white;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contact Manager Styles */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.01);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.dropzone:hover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.02);
}

.dropzone i {
    font-size: 2.5rem;
    color: var(--accent);
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow-y: auto;
    max-height: 800px;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background-color: #12131a !important;
    padding: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255,255,255,0.01);
}

/* Campaign Creator & Wizard Layout */
.campaign-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .campaign-layout {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control, select, textarea {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select {
    color-scheme: light !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    padding: 12px;
}

select option {
    background-color: #ffffff !important;
    color: #111827 !important;
}

.variables-helper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.var-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    cursor: pointer;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Campaign Progress & Log Panel */
.log-panel {
    background-color: #07080c;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-family: monospace;
    font-size: 0.8rem;
    height: 250px;
    overflow-y: auto;
    color: #a7f3d0;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-entry {
    border-bottom: 1px solid rgba(255,255,255,0.02);
    padding-bottom: 4px;
}

.log-entry.success { color: var(--success); }
.log-entry.error { color: var(--danger); }
.log-entry.info { color: #60a5fa; }

/* Progress bar container */
.progress-container {
    margin-top: 16px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.3s ease;
}

/* Live Chat Hub */
.chat-hub {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-card);
    height: calc(100vh - 150px);
    overflow: hidden;
}

@media (max-width: 1200px) {
    .chat-hub {
        grid-template-columns: 280px 1fr;
    }
    .chat-profile-panel {
        display: none;
    }
}

.chat-sidebar {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-search {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-filters {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.chat-filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.chat-filter-btn.active {
    background-color: var(--accent-glow);
    color: #60a5fa;
    border-color: var(--accent);
}

.chat-users-list {
    flex-grow: 1;
    overflow-y: auto;
    list-style: none;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    transition: var(--transition);
}

.chat-user-item:hover, .chat-user-item.active {
    background-color: rgba(255,255,255,0.03);
}

.chat-user-item.active {
    border-left: 3px solid var(--accent);
}

.chat-user-meta {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.chat-user-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-user-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-user-last-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 0% !important;
    flex-grow: 1 !important;
    min-width: 0;
    height: 100%;
    background-color: rgba(10, 11, 16, 0.2);
    border-right: 1px solid var(--border-color);
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(18, 19, 26, 0.5);
}

.chat-body {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-bubble {
    max-width: 65%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.message-bubble.incoming {
    align-self: flex-start;
    background-color: rgba(255,255,255,0.05);
    border-bottom-left-radius: 2px;
}

.message-bubble.outgoing {
    align-self: flex-end;
    background: var(--accent-gradient);
    border-bottom-right-radius: 2px;
}

.message-meta {
    font-size: 0.7rem;
    opacity: 0.6;
    display: block;
    text-align: right;
    margin-top: 4px;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toolbar-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.chat-footer {
    padding: 12px 24px 24px 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-wrapper {
    flex-grow: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
}

/* Chat Profile Panel (Zalo OA / Telegram style) */
.chat-profile-panel {
    background-color: rgba(18, 19, 26, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    gap: 24px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-details-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

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

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-tags-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.profile-tag.primary {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.quick-replies-menu {
    position: absolute;
    bottom: 70px;
    left: 24px;
    width: 320px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 50;
    display: none;
}

.quick-replies-menu.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.quick-reply-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.quick-reply-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: var(--accent);
}

/* Split pane dragging resizers */
.pane-resizer {
    background-color: var(--border-color) !important;
    position: relative;
}
.pane-resizer:hover, .pane-resizer.active {
    background-color: var(--accent) !important;
    width: 6px !important;
}

/* Right Profile Panel Custom Fields */
.profile-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.profile-input-wrapper i {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.profile-input-wrapper input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

.profile-note-item {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.profile-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Premium Connected Accounts Styling */
.connected-accounts-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    transition: all 0.2s ease-in-out;
}

.mini-account-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.mini-account-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mini-account-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.mini-account-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.mini-account-type {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Custom Channel Dropdown Styling with Real Avatars */
.custom-channel-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.custom-channel-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    max-width: 140px;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.custom-channel-btn:hover {
    border-color: var(--accent);
    background-color: rgba(255,255,255,0.05);
}

.custom-channel-btn img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.custom-channel-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 240px;
    max-height: 320px;
    overflow-y: auto;
    background-color: #1e1e2d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    padding: 6px 0;
}

.custom-channel-menu.show {
    display: block;
}

.custom-dropdown-group-label {
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.03);
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.custom-dropdown-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}

.custom-dropdown-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
}

.custom-dropdown-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

