:root {
    /* Modern SaaS Dark Theme */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent-primary: #3b82f6;
    --accent-secondary: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --glass-bg: #18181b;
    --glass-border: #27272a;
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    
    /* Sidebar & surfaces */
    --sidebar-bg: #09090b;
    --brand-color: #ffffff;
    --nav-color: #a1a1aa;
    --input-bg: #09090b;
    --input-color: #ffffff;
    --topbar-bg: transparent;
    --card-surface: #18181b;
    --dropdown-bg: #18181b;
    
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --focus-ring: 0 0 0 2px rgba(59, 130, 246, 0.5);
    --border-radius: 8px;
}

[data-theme="light"] {
    /* Modern SaaS Light Theme */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #09090b;
    --text-secondary: #71717a;
    --glass-bg: #ffffff;
    --glass-border: #e4e4e7;
    --glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    
    /* Sidebar & surfaces - light overrides */
    --sidebar-bg: #fafafa;
    --brand-color: #09090b;
    --nav-color: #71717a;
    --input-bg: #ffffff;
    --input-color: #09090b;
    --topbar-bg: rgba(250,250,250,0.8);
    --card-surface: #ffffff;
    --dropdown-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

/* Glassmorphism / SaaS Surface Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 3rem;
}

.brand i {
    color: var(--accent-primary);
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.nav-links li i {
    font-size: 1.4rem;
}

.nav-links li:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.nav-links li.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}

.nav-links li.active i {
    color: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 2rem 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--bg-primary) 50%, transparent 100%);
    z-index: 10;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    min-width: 200px;
    z-index: 20;
    border-radius: 12px;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: rgba(99, 102, 241, 0.1);
}

.dropdown:hover .dropdown-content, .dropdown:focus-within .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease;
}

.date-display {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
    cursor: pointer;
    transition: var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
}

/* View Sections */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #e0e0ff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header .section-title {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    outline: none;
}

.btn:focus-visible {
    box-shadow: var(--focus-ring);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

.btn-block {
    width: 100%;
    padding: 14px;
    margin-top: 1rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.btn-small:hover {
    background: rgba(255,255,255,0.2);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent-primary);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Goals Grid */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.goal-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.goal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.goal-strategy {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.goal-progress {
    margin-top: auto;
}

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

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.post-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.post-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.platform-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.platform-Facebook { background: rgba(24, 119, 242, 0.2); color: #1877f2; }
.platform-Zalo { background: rgba(0, 104, 255, 0.2); color: #0068ff; }
.platform-TikTok { background: rgba(254, 44, 85, 0.2); color: #fe2c55; }
.platform-YouTube { background: rgba(255, 0, 0, 0.2); color: #ff0000; }

.post-details h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.post-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-draft { background: rgba(160, 160, 176, 0.2); color: var(--text-secondary); }
.status-scheduled { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.status-published { background: rgba(16, 185, 129, 0.2); color: var(--success); }

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    height: calc(100vh - 160px);
}

.kanban-column {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.kanban-column h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column h3 .count {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.task-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background: var(--card-bg);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.task-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-card:active {
    cursor: grabbing;
}

.task-card h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.task-goal-tag {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.task-actions {
    display: flex;
    gap: 4px;
}
.task-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
}
.task-actions button:hover {
    color: white;
}

/* Modals & Side Panels */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Side Panel Mode for Settings */
#settingsModal.active {
    background: rgba(0, 0, 0, 0.2);
    justify-content: flex-end;
}

#settingsModal .modal-content {
    max-width: 450px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-right: none;
    animation: sidePanelSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

#settingsModal .modal-body {
    flex: 1;
    overflow-y: auto;
}

#settingsModal .modal-footer {
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    margin-top: auto;
}

@keyframes sidePanelSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger);
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--input-color);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
}

select option {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Utilities */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-content { grid-template-columns: 1fr; }
    .kanban-board { grid-template-columns: 1fr; height: auto; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; padding: 1rem; flex-direction: row; justify-content: space-between; align-items: center; border-right: none; border-bottom: 1px solid var(--glass-border); }
    .brand { margin-bottom: 0; }
    .nav-links { flex-direction: row; }
    .nav-links span { display: none; }
    .main-content { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #3b82f6, #2dd4bf);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.project-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.project-deadline {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.deadline-overdue { color: var(--danger); }
.deadline-warning { color: var(--warning); }
.deadline-normal { color: var(--success); }
.deadline-none { color: var(--text-secondary); }

.project-tasks {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.project-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 0.85rem;
}
.project-task-item.completed {
    opacity: 0.5;
}

.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }

/* Facebook Preview Styles */
.fb-preview-container {
    background: #ffffff;
    border-radius: 8px;
    color: #050505;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.fb-header {
    display: flex;
    padding: 12px 16px;
    align-items: center;
}

.fb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e4e6eb;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #65676b;
}

.fb-info {
    flex: 1;
}

.fb-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #050505;
    margin-bottom: 2px;
}

.fb-meta {
    font-size: 0.8rem;
    color: #65676b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fb-content {
    padding: 0 16px 12px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    background: #f0f2f5;
    display: block;
}

.fb-image-placeholder {
    width: 100%;
    height: 250px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    font-size: 0.9rem;
    border-top: 1px solid #e4e6eb;
    border-bottom: 1px solid #e4e6eb;
}

.fb-footer {
    padding: 10px 16px;
    border-top: 1px solid #ced0d4;
    display: flex;
    justify-content: space-between;
    color: #65676b;
    font-weight: 600;
    font-size: 0.9rem;
}

.fb-action {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    padding: 6px 0;
    border-radius: 4px;
    cursor: pointer;
}

.fb-action:hover {
    background: #f0f2f5;
}

/* Facebook Multi-Image Grid */
.fb-grid {
    display: grid;
    gap: 2px;
    width: 100%;
}
.fb-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 1 image */
.fb-grid-1 { grid-template-columns: 1fr; }
.fb-grid-1 img { max-height: 400px; }

/* 2 images */
.fb-grid-2 { grid-template-columns: 1fr 1fr; height: 300px; }

/* 3 images (1 big top, 2 small bottom) */
.fb-grid-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 250px 125px; }
.fb-grid-3 img:nth-child(1) { grid-column: span 2; }

/* 4 images (1 big top, 3 small bottom) */
.fb-grid-4 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 250px 100px; }
.fb-grid-4 img:nth-child(1) { grid-column: span 3; }

/* 5+ images (1 big top, 3 small bottom with overlay) */
.fb-grid-5 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 250px 100px; }
.fb-grid-5 img:nth-child(1) { grid-column: span 3; }
.fb-grid-5 .more-images-overlay {
    position: relative;
    cursor: pointer;
}
.fb-grid-5 .more-images-overlay::after {
    content: '+' attr(data-count);
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Customers Grid */
.customers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.customer-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.customer-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.5);
}

.customer-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.customer-name {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-contact {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.customer-contact div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.customer-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--glass-border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.appt-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.appt-badge.pending { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.appt-badge.completed { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.appt-badge.cancelled { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Deadline Highlight */
.deadline-actions {
    border: 2px solid var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(20, 20, 30, 0.6));
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.deadline-actions .card-header h2 {
    color: var(--warning);
    font-weight: 700;
}

/* ============================================
   NÂNG CẤP MỚI — CRM Kim Tài v2
   ============================================ */

/* --- Toast Notification (Undo xóa) --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: rgba(30, 30, 45, 0.95);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: all;
    animation: toastIn 0.3s ease;
    min-width: 280px;
    max-width: 420px;
}
.toast.toast-success { border-color: rgba(16,185,129,0.5); }
.toast.toast-warning { border-color: rgba(245,158,11,0.5); }
.toast.toast-undo { border-color: rgba(99,102,241,0.5); }
.toast-undo-btn {
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.5);
    color: #a5b4fc;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
}
.toast-undo-btn:hover { background: rgba(99,102,241,0.4); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}
.toast.removing { animation: toastOut 0.3s ease forwards; }

/* --- Auto-Save Indicator --- */
#autosave-indicator {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    color: #10b981;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
#autosave-indicator.saving {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.3);
    color: var(--warning);
    opacity: 1;
}
#autosave-indicator.saved { opacity: 1; }
#autosave-indicator.hidden { opacity: 0; }

/* --- Badge thông báo hẹn --- */
.nav-badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    box-shadow: 0 0 8px rgba(239,68,68,0.6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* --- Post Filter Bar --- */
.post-filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}
.filter-chip {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.filter-chip:hover { background: rgba(255,255,255,0.1); color: white; }
.filter-chip.active {
    background: rgba(99,102,241,0.2);
    border-color: var(--accent-primary);
    color: white;
}
.filter-chip.active-fb { background: rgba(24,119,242,0.2); border-color: #1877f2; color: #60a5fa; }
.filter-chip.active-zalo { background: rgba(0,104,255,0.2); border-color: #0068ff; color: #93c5fd; }
.filter-chip.active-tiktok { background: rgba(254,44,85,0.2); border-color: #fe2c55; color: #fca5a5; }
.filter-chip.active-green { background: rgba(16,185,129,0.2); border-color: #10b981; color: #6ee7b7; }
.filter-chip.active-yellow { background: rgba(245,158,11,0.2); border-color: #f59e0b; color: #fcd34d; }
.filter-search {
    flex: 1;
    min-width: 180px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: white;
    padding: 5px 16px;
    font-size: 0.85rem;
    outline: none;
}
.filter-search:focus { border-color: var(--accent-primary); }

/* --- Customer Tag Badge --- */
.cust-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.cust-tag-lead { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.cust-tag-consulting { background: rgba(245,158,11,0.2); color: #fcd34d; }
.cust-tag-closed { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.cust-tag-care { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* --- Customer Filter --- */
.cust-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* --- Zalo Campaign Progress --- */
.zalo-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    margin-bottom: 6px;
    font-size: 0.88rem;
    border: 1px solid var(--glass-border);
    animation: toastIn 0.2s ease;
}
.zalo-result-item.success { border-color: rgba(16,185,129,0.3); }
.zalo-result-item.error { border-color: rgba(239,68,68,0.3); }
.zalo-result-item.sending { border-color: rgba(245,158,11,0.3); }

/* --- Weekly Summary Card --- */
.weekly-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.weekly-metric {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.weekly-metric .wm-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.weekly-metric .wm-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Keyboard shortcut hint --- */
.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.kbd {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 0.78rem;
}

/* --- Zalo Campaign Result List --- */
#zaloResultList {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
}
.zalo-realtime-bar {
    height: 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    margin-top: 8px;
}
.zalo-realtime-fill {
    height: 100%;
    background: linear-gradient(90deg, #0068ff, #00b4ff);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ============================================================
   LIGHT MODE - COMPREHENSIVE OVERRIDES
   Fix toan bo contrast cho che do sang
   ============================================================ */

/* Nav links text */
[data-theme="light"] .nav-links li {
    color: var(--nav-color);
}
[data-theme="light"] .nav-links li:hover,
[data-theme="light"] .nav-links li.active {
    color: #0f172a;
    background: linear-gradient(90deg, rgba(99,102,241,0.12) 0%, transparent 100%);
}

/* Inputs, textareas, selects */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: var(--input-bg) !important;
    color: var(--input-color) !important;
    border-color: rgba(0,0,0,0.15) !important;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
    border-color: var(--accent-primary) !important;
    background: rgba(255,255,255,0.9) !important;
}

/* Dropdown menus */
[data-theme="light"] .dropdown-content {
    background: var(--dropdown-bg) !important;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
[data-theme="light"] .dropdown-content a {
    color: #0f172a !important;
}
[data-theme="light"] .dropdown-content a:hover {
    background: rgba(99,102,241,0.08);
    color: var(--accent-primary) !important;
}

/* Topbar */
[data-theme="light"] .topbar {
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
}
[data-theme="light"] .date-display {
    color: var(--text-secondary);
}

/* Cards va stat cards */
[data-theme="light"] .stat-card,
[data-theme="light"] .glass {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
[data-theme="light"] .stat-icon {
    background: rgba(99,102,241,0.1);
}
[data-theme="light"] .stat-info h3 {
    color: var(--text-secondary);
}
[data-theme="light"] .stat-value {
    color: var(--text-primary);
}

/* Post items, action items, project cards */
[data-theme="light"] .post-item,
[data-theme="light"] .action-item,
[data-theme="light"] .project-card,
[data-theme="light"] .customer-item {
    background: rgba(255,255,255,0.8) !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: var(--text-primary);
}
[data-theme="light"] .post-item:hover,
[data-theme="light"] .action-item:hover {
    background: rgba(255,255,255,0.95) !important;
}

/* Modal */
[data-theme="light"] .modal-content {
    background: rgba(255,255,255,0.97) !important;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-primary);
}
[data-theme="light"] .modal-header {
    border-bottom-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .modal-body label {
    color: var(--text-primary);
}

/* Section titles */
[data-theme="light"] .section-title,
[data-theme="light"] .section-header .section-title {
    background: linear-gradient(to right, #1e293b, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .card-header h2,
[data-theme="light"] .card-header h3,
[data-theme="light"] .project-title,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    background: none !important;
}

/* Badges & tags */
[data-theme="light"] .badge,
[data-theme="light"] .post-status {
    opacity: 0.9;
}

/* Buttons icon */
[data-theme="light"] .btn-icon {
    color: var(--text-secondary);
    background: rgba(0,0,0,0.05);
}
[data-theme="light"] .btn-icon:hover {
    background: rgba(0,0,0,0.1);
    color: var(--text-primary);
}

/* Avatar */
[data-theme="light"] .avatar {
    background: rgba(99,102,241,0.12);
    color: var(--accent-primary);
}

/* Toast */
[data-theme="light"] .toast {
    background: rgba(255,255,255,0.95);
    color: #0f172a;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Zalo progress bar background */
[data-theme="light"] .zalo-realtime-bar {
    background: rgba(0,0,0,0.08);
}

/* Kanban columns */
[data-theme="light"] .kanban-col {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.08);
}
[data-theme="light"] .kanban-col-header {
    color: var(--text-primary);
}

/* Filter chips */
[data-theme="light"] .filter-chip {
    background: rgba(0,0,0,0.06);
    color: var(--text-secondary);
    border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .filter-chip.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Search input */
[data-theme="light"] .search-box input {
    background: rgba(0,0,0,0.06) !important;
    color: var(--text-primary) !important;
}
/* ============================================================
   NNG C?P TNH NANG v7 (Desktop & Mobile Sync)
   ============================================================ */

/* 1. Filter Bar */
.filter-bar { display: flex; gap: 10px; padding: 10px 15px; margin-bottom: 15px; border-radius: 8px; flex-wrap: wrap; }
.filter-bar select { background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--glass-border); padding: 6px 12px; border-radius: 6px; outline: none; }
[data-theme="light"] .filter-bar select { color: #000; background: rgba(0,0,0,0.05); }

/* 2. Thumbnail bi dang */
.post-thumbnail { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; margin-right: 12px; }
.post-thumbnail-placeholder { width: 56px; height: 56px; border-radius: 8px; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--text-secondary); margin-right: 12px; }

/* 3. Sales Funnel Bar */
.sales-funnel-bar { display: flex; gap: 15px; padding: 15px; margin-bottom: 20px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.funnel-item { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255,255,255,0.05); }
.funnel-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
#funnel-prospect .funnel-icon { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
#funnel-consulting .funnel-icon { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
#funnel-closed .funnel-icon { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.funnel-info h4 { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }
.funnel-info p { margin: 0; font-size: 1.2rem; font-weight: bold; }

/* 4. Drag & Drop Kanban */
.kanban-tasks-list { min-height: 150px; padding-bottom: 20px; }
.task-card.dragging { opacity: 0.5; border: 2px dashed var(--accent-primary); }
.kanban-tasks-list.drag-over { background: rgba(255, 255, 255, 0.05); border-radius: 8px; }

/* 5. Countdown / Urgent Badge */
.urgent-badge { animation: blink 1s linear infinite; color: #ef4444; font-weight: bold; }
@keyframes blink { 50% { opacity: 0.5; } }
/* 6. Calendar Grid View */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 15px; }
.calendar-cell { min-height: 80px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 8px; padding: 5px; display: flex; flex-direction: column; gap: 4px; transition: background 0.2s; cursor: pointer; position: relative; }
.calendar-cell:hover { background: rgba(255,255,255,0.08); }
.calendar-cell.today { border: 2px solid var(--accent-primary); background: rgba(99,102,241,0.1); }
.calendar-cell.different-month { opacity: 0.3; }
.calendar-cell-date { font-size: 0.85rem; font-weight: 600; text-align: right; margin-bottom: 5px; color: var(--text-secondary); }
.calendar-cell.today .calendar-cell-date { color: var(--accent-primary); }
.calendar-event-badge { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.cal-badge-fb { background: #1877f2; }
.cal-badge-zalo { background: #0068ff; }
.cal-badge-tiktok { background: #fe2c55; }
.cal-badge-yt { background: #ff0000; }
.calendar-event-list { display: flex; flex-direction: column; gap: 2px; }
.calendar-event-item { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0,0,0,0.3); padding: 2px 4px; border-radius: 4px; display: flex; align-items: center; }
.calendar-header-cell { text-align: center; font-weight: 600; font-size: 0.9rem; padding-bottom: 5px; color: var(--text-secondary); }
[data-theme="light"] .calendar-cell { background: rgba(0,0,0,0.03); }
[data-theme="light"] .calendar-cell:hover { background: rgba(0,0,0,0.08); }
[data-theme="light"] .calendar-event-item { background: rgba(255,255,255,0.8); color: #000; border: 1px solid rgba(0,0,0,0.1); }

/* Customer Kanban */
.kanban-customers-list { min-height: 200px; padding: 10px; }
.kanban-customers-list .customer-card { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: grab; display: flex; align-items: center; gap: 10px; transition: all 0.2s; position: relative;}
.kanban-customers-list .customer-card:active { cursor: grabbing; opacity: 0.8; }
.kanban-customers-list .customer-card:hover { background: rgba(255,255,255,0.1); border-color: var(--accent-primary); }
.kanban-customers-list .customer-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.kanban-customers-list .customer-info { flex: 1; overflow: hidden; }
.kanban-customers-list .customer-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.kanban-customers-list .customer-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; flex-wrap: wrap;}

/* Timeline */
#cdInteractionsList::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.1); }
.interaction-item { position: relative; padding-left: 40px; margin-bottom: 15px; }
.interaction-item .icon { position: absolute; left: 0; top: 0; width: 32px; height: 32px; background: #1e1e2d; border: 2px solid var(--accent-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2; font-size: 0.9rem; }
.interaction-item .date { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; }
.interaction-item .notes { font-size: 0.9rem; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; border-left: 2px solid var(--glass-border); }

.vip-badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; font-weight: bold; }
.vip-gold { background: rgba(250, 204, 21, 0.2); color: #facc15; border: 1px solid #facc15; }
.vip-silver { background: rgba(156, 163, 175, 0.2); color: #9ca3af; border: 1px solid #9ca3af; }
.vip-bronze { background: rgba(217, 119, 6, 0.2); color: #d97706; border: 1px solid #d97706; }

/* ============================================================
   NEW FEATURES V11 — Timeline KH, Dashboard Tuan, AI Zalo
   ============================================================ */

/* Timeline KH */
#cdInteractionsList .interaction-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
    margin-bottom: 8px;
    font-size: 0.88rem;
}

/* AI Zalo result fade in */
#aiZaloSuggestResult {
    animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Weekly dashboard grid */
.weekly-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.weekly-metric {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.07);
}

.wm-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.wm-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* PDF export btn */
.section-header .btn-secondary i.ph-file-pdf {
    color: #ef4444;
}

/* Birthday Zalo btn */
.birthday-zalo-btn {
    background: #0068ff;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.birthday-zalo-btn:hover { opacity: 0.85; }

/* Print styles for PDF */
@media print {
    .sidebar, .topbar, .modal, #toast-container,
    #autosave-indicator, #server-ip-widget { display: none !important; }
    .main-content { margin: 0; padding: 20px; }
    .view-section { display: block !important; }
}

/* ============================================================
   MODULE: PARTNERS MLM — v12
   ============================================================ */

/* Stats bar */
.partner-stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.pstat-card {
    flex: 1;
    min-width: 120px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px 18px;
    transition: transform 0.2s;
}
.pstat-card:hover { transform: translateY(-2px); }
.pstat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}
.pstat-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Filter tabs */
.partner-filter-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 4px;
}
.ptab {
    padding: 7px 16px;
    border-radius: 7px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.ptab:hover { color: white; background: rgba(255,255,255,0.08); }
.ptab.active { background: rgba(255,255,255,0.12); color: white; font-weight: 600; }
.ptab-riway.active  { background: #6366f133; color: #818cf8; }
.ptab-itd.active    { background: #f59e0b33; color: #fbbf24; }
.ptab-dropii.active { background: #10b98133; color: #34d399; }

/* Partner card */
.partner-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.2s;
}
.partner-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Partner modal tabs */
.pmtab {
    flex: 1;
    padding: 8px 12px;
    border-radius: 7px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}
.pmtab:hover { color: white; background: rgba(255,255,255,0.08); }
.pmtab.active { background: rgba(255,255,255,0.12); color: white; font-weight: 600; }
.pmtab-riway.active  { background: #6366f133; color: #818cf8; }
.pmtab-itd.active    { background: #f59e0b33; color: #fbbf24; }
.pmtab-dropii.active { background: #10b98133; color: #34d399; }

/* Network tree */
.tree-node { transition: background 0.15s; }

/* Responsive: stack tree below on small screens */
@media (max-width: 900px) {
    #partners > div:last-child {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   FIX: Select dropdown text color in dark mode (Partner Modal)
   ============================================================ */

#partnerModal select,
#partnerModal select option,
#partnerDetailModal select,
#partnerDetailModal select option {
    background-color: #1e2130;
    color: #e5e7eb;
}

/* Global fix for all selects in dark mode */
.dark-mode select,
.dark-mode select option,
select option {
    background-color: #1e2130;
    color: #e5e7eb;
}

/* Specifically target partner form selects */
#pRiwaySponsor, #pRiwayRank,
#pItdSponsor,   #pItdRank,
#pDropiiSponsor, #pDropiiRank,
#pLinkedCustomerId,
#treeCompanyFilter {
    background-color: rgba(255,255,255,0.08);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    width: 100%;
    appearance: auto;
}

#pRiwaySponsor option, #pRiwayRank option,
#pItdSponsor option,   #pItdRank option,
#pDropiiSponsor option, #pDropiiRank option,
#pLinkedCustomerId option,
#treeCompanyFilter option {
    background-color: #1a1d2e;
    color: #e5e7eb;
}
