/* Dashboard-specific Styles */

/* Export Dropdown */
.dropdown-menu.show { display: block !important; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item i { width: 14px; height: 14px; }

/* ===== Post Gallery ===== */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}
.post-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.post-card-img {
    width: 100%; height: 160px;
    overflow: hidden; position: relative;
}
.post-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-no-img {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-secondary));
    color: var(--text-muted);
}
.post-card-no-img i { width: 32px; height: 32px; }
.post-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.post-card-page {
    font-size: 11px; font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.post-card-msg {
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.4; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    line-clamp: 3;
}
.post-card-date {
    font-size: 11px; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px; margin-top: 4px;
}

/* ===== Follower Summary ===== */
.follower-summary-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.follower-summary-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex: 1; min-width: 200px;
}
.follower-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.follower-summary-info { display: flex; flex-direction: column; }
.follower-summary-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.follower-summary-change { font-size: 11px; font-weight: 500; }
.follower-summary-change.up { color: #10b981; }
.follower-summary-change.down { color: #ef4444; }

/* ===== Last Post Alert ===== */
.last-post-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}
.last-post-row:last-child { border-bottom: none; }
.last-post-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.last-post-ago {
    font-size: 12px; font-weight: 600; padding: 2px 10px;
    border-radius: 12px;
}
.last-post-ago.green { background: rgba(16,185,129,0.12); color: #10b981; }
.last-post-ago.blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.last-post-ago.orange { background: rgba(245,158,11,0.12); color: #f59e0b; }
.last-post-ago.red { background: rgba(239,68,68,0.12); color: #ef4444; }

/* ===== Orange stat card ===== */
.stat-card.orange { border-color: rgba(245,158,11,0.2); }
.stat-card-icon.orange { background: rgba(245,158,11,0.12); color: #f59e0b; }

@media (max-width: 600px) {
    .post-gallery { grid-template-columns: 1fr; }
    .follower-summary-item { min-width: 100%; }
}

/* ===== Daily Snapshot ===== */
.daily-snapshot {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.snapshot-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.snapshot-date {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 600; color: #e2e8f0;
}
.snapshot-badge {
    font-size: 11px; padding: 4px 12px;
    background: rgba(59,130,246,0.15);
    color: #60a5fa; border-radius: 20px; font-weight: 600;
}
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.snapshot-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}
.snapshot-item:hover { background: rgba(255,255,255,0.08); }
.snapshot-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.snapshot-icon i { width: 20px; height: 20px; }
.snapshot-data { display: flex; flex-direction: column; }
.snapshot-value { font-size: 18px; font-weight: 700; color: #f1f5f9; }
.snapshot-label { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ===== LINE OA ===== */
.line-bot-card {
    background: linear-gradient(135deg, #06C755 0%, #00B900 100%);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.line-bot-header {
    display: flex; align-items: center; gap: 16px;
}
.line-bot-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
}
.line-bot-avatar-placeholder {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.line-bot-avatar-placeholder i { width: 28px; height: 28px; }
.line-bot-info { flex: 1; }
.line-bot-name { font-size: 18px; font-weight: 700; color: white; }
.line-bot-id { font-size: 13px; color: rgba(255,255,255,0.7); }
.line-bot-badge {
    font-size: 12px; padding: 4px 14px;
    background: rgba(255,255,255,0.2);
    color: white; border-radius: 20px; font-weight: 600;
}

.line-demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

@media (max-width: 600px) {
    .line-demo-grid { grid-template-columns: 1fr; }
    .line-bot-header { flex-wrap: wrap; }
}

/* ===== YouTube ===== */
.yt-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}
.yt-video-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.yt-video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 0, 0, 0.3);
}
.yt-video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-tertiary);
}
.yt-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.yt-duration {
    position: absolute;
    bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.yt-video-info {
    padding: 12px;
}
.yt-video-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}
.yt-video-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}
.yt-video-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.yt-video-stats svg { width: 12px; height: 12px; }
.yt-video-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}
.section-header { margin-bottom: 16px; }
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.section-label svg { width: 16px; height: 16px; }
.empty-state-sm {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
}
.empty-state-sm svg { width: 20px; height: 20px; }

@media (max-width: 600px) {
    .yt-video-grid { grid-template-columns: 1fr; }
}

/* Period Comparison */
.stat-card-change.positive { color: #06C755; font-weight: 600; }
.stat-card-change.negative { color: #ef4444; font-weight: 600; }

/* Connection List */
.connection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.connection-item:hover {
    border-color: var(--border-hover);
}

.connection-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.connection-icon svg {
    width: 22px;
    height: 22px;
}

.firebase-icon {
    background-color: #FEF3C7;
    color: #D97706;
}

[data-theme="dark"] .firebase-icon {
    background-color: rgba(217, 119, 6, 0.15);
}

.fb-icon {
    background-color: #E7F0FF;
    color: #1877F2;
}

[data-theme="dark"] .fb-icon {
    background-color: rgba(24, 119, 242, 0.15);
}

.connection-info {
    flex: 1;
    min-width: 0;
}

.connection-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.connection-detail {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* Loading State */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-state svg {
    width: 20px;
    height: 20px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 12px;
}

/* Settings form */
.settings-section {
    margin-bottom: 16px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-input {
    width: 320px;
    max-width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
}

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

.settings-input::placeholder {
    color: var(--text-muted);
}

/* Toggle */
.toggle {
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: #FFFFFF;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.active {
    background-color: var(--accent-blue);
}

.toggle.active::before {
    transform: translateX(20px);
}

/* Notification / Help Box */
.notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 13px;
}

.notification.info {
    background-color: var(--accent-blue-light);
    border-color: rgba(59, 130, 246, 0.2);
}

.notification-icon {
    flex-shrink: 0;
    color: var(--accent-blue);
}

.notification-icon svg {
    width: 18px;
    height: 18px;
}

.notification-content h4 {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Content section animation */
.content-section {
    animation: fadeIn 0.4s ease forwards;
}

/* Simple Bar Chart (follower comparison) */
.simple-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
    padding: 20px 0;
    min-height: 200px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.bar {
    width: 48px;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease;
    min-height: 8px;
}

.bar-label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Engagement Chart */
.engagement-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
    min-height: 180px;
}

.eng-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.eng-bar-wrap {
    display: flex;
    align-items: flex-end;
    height: 150px;
}

.eng-bar {
    width: 36px;
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px 4px 0 0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eng-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.02);
}

.eng-bar-val {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.eng-bar-date {
    font-size: 10px;
    color: var(--text-muted);
}

/* Mini Stats (Ads KPIs) */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.mini-stat {
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.mini-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Spin animation */
.spin {
    animation: spin 1s linear infinite;
}

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

/* Ad Cards */
.ad-cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ad-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

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

.ad-card-img {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ad-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-card-info {
    flex: 1;
    min-width: 0;
}

.ad-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.ad-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ad-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.ad-card-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.ad-card-kpis {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ad-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ad-kpi span {
    font-size: 10px;
    color: var(--text-muted);
}

.ad-kpi strong {
    font-size: 13px;
    color: var(--text-primary);
}

/* Ad Link */
.ad-link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.ad-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Targeting Box */
.targeting-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 8px 12px 12px;
    border: 1px solid var(--border-color);
}

.target-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.target-item {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}

.target-item i {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

/* Chat List */
.chat-list {
    display: flex;
    flex-direction: column;
}

/* ===== Conversation List ===== */
.convo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.convo-item:hover { background: var(--bg-hover); }
.convo-item:last-child { border-bottom: none; }
.convo-item.unread { background: rgba(59, 130, 246, 0.04); }
.convo-item.blocked { opacity: 0.55; }

.convo-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.convo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.convo-info { flex: 1; min-width: 0; }

.convo-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.convo-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.convo-item.unread .convo-name { color: var(--accent-blue); }

.convo-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.convo-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.convo-you {
    color: var(--text-muted);
    font-weight: 500;
}

.convo-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.convo-page {
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 6px;
    border-radius: 4px;
}

.convo-count { color: var(--text-muted); }

.convo-badge {
    background: var(--accent-blue);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.convo-blocked {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-red);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
}

.convo-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.convo-arrow i { width: 16px; height: 16px; }

/* ===== Message Reader Overlay ===== */
.msg-reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.msg-reader {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.msg-reader-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.msg-reader-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    flex: 1;
}

.msg-reader-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

.msg-chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.msg-reader-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-primary);
}

/* ===== Reply Bar ===== */
.msg-reply-bar {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.msg-reply-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.msg-reply-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.msg-reply-input:focus {
    border-color: var(--accent-blue);
}

.msg-reply-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
    flex-shrink: 0;
}

.msg-reply-send:hover { transform: scale(1.05); }
.msg-reply-send:active { transform: scale(0.95); }
.msg-reply-send:disabled { opacity: 0.5; cursor: not-allowed; }
.msg-reply-send i { width: 16px; height: 16px; }

.msg-reply-note {
    font-size: 10px;
    color: var(--text-muted);
    margin: 6px 0 0;
    text-align: center;
}

/* Sent animation */
.msg-sent-new {
    animation: msgSentPop 0.3s ease;
}

@keyframes msgSentPop {
    0% { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Chat Search Bar ===== */
.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.chat-search-icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.chat-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.chat-search-input::placeholder { color: var(--text-muted); }

/* ===== Quick Reply Templates ===== */
.quick-reply-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.quick-reply-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.quick-reply-add {
    border-style: dashed;
    color: var(--text-muted);
}

.quick-reply-add:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: transparent;
}

/* ===== Customer Note ===== */
.sidebar-note {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-note:focus { border-color: var(--accent-blue); }

/* ===== Customer Sidebar ===== */
.msg-reader-sidebar {
    width: 280px;
    border-left: 1px solid var(--border-color);
    background: var(--bg-secondary);
    overflow-y: auto;
    padding: 0;
    flex-shrink: 0;
}

.sidebar-customer {
    text-align: center;
    padding: 24px 16px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    margin: 0 auto 10px;
}

.sidebar-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
}

.sidebar-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.sidebar-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-section-title i { width: 14px; height: 14px; }

.sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.sidebar-label { color: var(--text-secondary); }
.sidebar-value { color: var(--text-primary); font-weight: 500; text-align: right; }

.sidebar-actions {
    padding: 16px;
}

/* ===== Message Bubbles ===== */
.msg-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-date-sep {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 12px 0 8px;
    font-weight: 500;
}

.msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    word-break: break-word;
}

.msg-customer {
    align-self: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.msg-page {
    align-self: flex-end;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-sender {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.7;
}

.msg-page .msg-sender { color: rgba(255, 255, 255, 0.8); }

.msg-text {
    font-size: 14px;
    line-height: 1.5;
}

.msg-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.5;
    text-align: right;
}

.msg-page .msg-time { color: rgba(255, 255, 255, 0.6); }

.msg-img {
    max-width: 240px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 6px;
    cursor: pointer;
    object-fit: cover;
    display: block;
}

.msg-sticker {
    width: 80px;
    height: 80px;
    margin-top: 4px;
    object-fit: contain;
}

.msg-file {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
    transition: background 0.15s;
}

.msg-file:hover { background: rgba(59, 130, 246, 0.2); }
.msg-page .msg-file { background: rgba(255, 255, 255, 0.15); color: white; }
.msg-page .msg-file:hover { background: rgba(255, 255, 255, 0.25); }

/* Message Links */
.msg-link {
    display: inline-block;
    color: var(--accent-blue);
    text-decoration: none;
    word-break: break-all;
    border-bottom: 1px dashed var(--accent-blue);
    transition: opacity 0.15s;
}

.msg-link:hover { opacity: 0.8; }
.msg-page .msg-link { color: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.4); }

/* Link Card — Facebook, Instagram, etc */
.msg-link-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
}

.msg-link-card:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.msg-page .msg-link-card {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.msg-page .msg-link-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.msg-link-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.msg-link-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.msg-page .msg-link-label { color: white; }

.msg-link-url {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.msg-page .msg-link-url { color: rgba(255, 255, 255, 0.6); }

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: default;
}

.chat-item:last-child {
    border-bottom: none;
}

.chat-item:hover {
    background: var(--bg-hover);
}

.chat-item.unread {
    background: var(--accent-blue-light);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    flex-shrink: 0;
}

.chat-msg {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Badge purple */
.badge-purple {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
}

/* Drill-down (Campaign > AdSet > Ad) */
.drill-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drill-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.drill-item.sub {
    border-color: transparent;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.drill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.drill-header:hover {
    background: var(--bg-hover);
}

.drill-toggle {
    flex-shrink: 0;
    width: 20px;
}

.drill-toggle i {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.drill-info {
    flex: 1;
    min-width: 0;
}

.drill-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drill-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12px;
}

.drill-kpis {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 70px;
}

.drill-kpi {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.drill-kpi-label {
    font-size: 10px;
    color: var(--text-muted);
}

.drill-body {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.drill-sub {
    padding: 8px 16px 8px 40px;
}

/* Post Detail Cards */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.post-item:hover {
    border-color: var(--border-hover);
}

.post-image {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.post-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-engagement {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.post-eng-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-eng-item.total {
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
}

.post-eng-icon {
    font-size: 14px;
}

.post-eng-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.post-eng-label {
    font-size: 11px;
    color: var(--text-muted);
}

.post-link {
    font-size: 12px;
    color: var(--accent-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-link:hover {
    text-decoration: underline;
}

.post-link svg {
    width: 14px;
    height: 14px;
}

/* Page Overview Card */
.page-overview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-overview-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.page-overview-img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.page-overview-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--accent-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1877F2;
    flex-shrink: 0;
}

.page-overview-info { min-width: 0; }

.page-overview-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-overview-category {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-overview-stats {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

.page-overview-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.page-overview-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-overview-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Engagement Chart (Facebook daily) */
.engagement-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 130px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.eng-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 18px;
    flex-shrink: 0;
}

.eng-bar-wrap { display: flex; align-items: flex-end; height: 100px; }

.eng-bar {
    width: 14px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #3b82f6, #93c5fd);
    position: relative;
    transition: height 0.3s;
}

.eng-bar-val {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--text-muted);
    white-space: nowrap;
    display: none;
}

.eng-bar-group:hover .eng-bar-val { display: block; }
.eng-bar-group:hover .eng-bar { background: linear-gradient(180deg, #2563eb, #60a5fa); }

.eng-bar-date {
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}

/* Section Headers */
.section-header {
    margin: 28px 0 16px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

.section-label svg { width: 16px; height: 16px; }

.organic-label {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.ads-label {
    background: var(--accent-purple-light);
    color: var(--accent-purple);
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Flex helpers */
.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Empty state compact */
.empty-state-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state-sm svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Sub title within card */
.sub-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Filter Select */
.filter-select {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Filter Row */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Chat List */
.chat-list {
    display: flex;
    flex-direction: column;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.chat-item:last-child { border-bottom: none; }
.chat-item:hover { background: var(--bg-hover); }

.chat-item.unread {
    background: rgba(59, 130, 246, 0.04);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-message {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-item.unread .chat-name { color: var(--accent-blue); }
.chat-item.unread .chat-message { color: var(--text-secondary); font-weight: 500; }

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-page-tag {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.chat-unread {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--accent-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.chat-item.blocked { opacity: 0.6; }
.chat-item.blocked .chat-avatar { background: linear-gradient(135deg, #9ca3af, #6b7280); }

/* Hour Chart */
.hour-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 160px;
    padding-top: 20px;
}

.hour-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.hour-bar-val {
    font-size: 9px;
    color: var(--text-muted);
    height: 14px;
}

.hour-bar {
    width: 100%;
    max-width: 24px;
    border-radius: 4px 4px 0 0;
    background: var(--accent-blue-light);
    transition: height 0.4s ease;
}

.hour-bar.work {
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
}

.hour-bar-label {
    font-size: 9px;
    color: var(--text-muted);
}

/* Stat Card Red */
.stat-card.red .stat-card-icon { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.stat-card-icon.red { background: rgba(220, 38, 38, 0.1); color: #dc2626; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mini-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 12px;
    }

    .filter-bar {
        width: 100%;
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-input {
        width: 100%;
    }

    .connection-item {
        flex-wrap: wrap;
    }

    .simple-bar-chart,
    .engagement-chart {
        gap: 12px;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 20px 10px;
    }

    .bar { width: 36px; }
    .eng-bar { width: 28px; }

    .mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }

    .notification {
        flex-direction: column;
    }

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

    .ad-card-img {
        width: 100%;
        height: 160px;
    }

    .ad-card-kpis {
        gap: 10px;
    }

    .chat-item {
        padding: 10px 12px;
    }

    .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .hide-mobile {
        display: none !important;
    }

    .drill-header {
        gap: 8px;
        padding: 12px;
    }

    .drill-name {
        font-size: 13px;
    }

    .drill-sub {
        padding: 4px 8px 4px 24px;
    }

    .post-item {
        flex-direction: column;
    }

    .post-image {
        width: 100%;
        height: 180px;
    }

    .post-engagement {
        gap: 12px;
    }

    .post-eng-item.total {
        padding-left: 0;
        border-left: none;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid var(--border-color);
    }

    .filter-row {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group {
        min-width: 100%;
    }

    .targeting-box {
        margin: 8px 4px;
        padding: 10px 12px;
    }

    .target-item {
        font-size: 11px;
    }

    .breakdown-btns {
        justify-content: center;
    }

    .hour-chart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-overview-card {
        flex-direction: column;
        gap: 12px;
    }

    .page-overview-stats {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .mini-stats {
        grid-template-columns: 1fr;
    }

    .bar-item { gap: 4px; }
    .bar { width: 28px; }
    .bar-value { font-size: 10px; }
    .bar-label { font-size: 9px; max-width: 60px; }

    .ad-card-img {
        height: 120px;
    }

    .post-image {
        height: 140px;
    }

    .drill-kpis {
        min-width: 50px;
    }

    .drill-kpi {
        font-size: 12px;
    }

    .msg-reader-overlay { padding: 0; }
    .msg-reader { max-height: 100vh; border-radius: 0; max-width: 100%; }
    .convo-avatar { width: 36px; height: 36px; font-size: 14px; }
    .convo-item { padding: 10px 12px; gap: 8px; }

    .msg-reader-sidebar {
        display: none;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 10;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }
    .msg-reader-sidebar.show { display: block; }
    .msg-reader-content { position: relative; }
}

@media (min-width: 769px) {
    #msg-reader-toggle-info { display: none; }
}

/* ===== Comprehensive Mobile Responsive ===== */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .filter-bar { width: 100%; flex-wrap: wrap; gap: 8px; }
    .filter-bar .filter-select,
    .filter-bar input[type="date"] { flex: 1; min-width: 120px; }
    .data-table { font-size: 12px; }
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .line-demo-grid { grid-template-columns: 1fr; }
    .yt-video-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
    .tab { white-space: nowrap; font-size: 12px; padding: 8px 12px; }
    .page-overview-card { flex-direction: column; }
    .page-overview-header { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card-value { font-size: 20px; }
    .yt-video-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .filter-bar .filter-select,
    .filter-bar input[type="date"] { width: 100%; }
    .page-title { font-size: 20px; }
    .page-subtitle { font-size: 12px; }
    .data-card-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .connection-item { flex-wrap: wrap; gap: 8px; }
}
