/* ============================================
   TikTok Dashboard - Design System
   Dark mode, glassmorphism, premium feel
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Colors - TikTok inspired */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.6);
    --bg-card-hover: rgba(26, 26, 46, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);

    --text-primary: #f0f0f5;
    --text-secondary: #8e8ea0;
    --text-muted: #5a5a6e;

    --accent-primary: #fe2c55;
    /* TikTok red/pink */
    --accent-secondary: #25f4ee;
    /* TikTok cyan */
    --accent-gradient: linear-gradient(135deg, #fe2c55 0%, #ff6b81 100%);
    --accent-gradient-cyan: linear-gradient(135deg, #25f4ee 0%, #00c9b7 100%);

    --success: #00d68f;
    --warning: #ffaa00;
    --error: #ff3d71;
    --info: #0095ff;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(254, 44, 85, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238e8ea0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ---------- Layout ---------- */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-smooth);
    z-index: 100;
    position: relative;
    flex-shrink: 0;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.logo i {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-gradient);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-normal);
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(254, 44, 85, 0.08);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-item.active::before {
    height: 24px;
}

.nav-item i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background var(--transition-fast);
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 8px rgba(0, 214, 143, 0.5);
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-bar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 14px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
}

.search-box i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    border: none;
    background: none;
    padding: 8px 0;
    width: 200px;
}

.search-box input:focus {
    box-shadow: none;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(254, 44, 85, 0.25);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-success {
    background: linear-gradient(135deg, #00d68f, #00b377);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff3d71, #ff1744);
    color: white;
}

.btn-cyan {
    background: var(--accent-gradient-cyan);
    color: #0a0a0f;
    font-weight: 700;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-smooth);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:nth-child(1)::after {
    background: var(--accent-gradient);
}

.stat-card:nth-child(2)::after {
    background: var(--accent-gradient-cyan);
}

.stat-card:nth-child(3)::after {
    background: linear-gradient(135deg, #ffaa00, #ff6600);
}

.stat-card:nth-child(4)::after {
    background: linear-gradient(135deg, #00d68f, #00b377);
}

.stat-card:nth-child(5)::after {
    background: linear-gradient(135deg, #7c5cff, #a855f7);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon.red {
    background: rgba(254, 44, 85, 0.12);
    color: var(--accent-primary);
}

.stat-icon.cyan {
    background: rgba(37, 244, 238, 0.12);
    color: var(--accent-secondary);
}

.stat-icon.orange {
    background: rgba(255, 170, 0, 0.12);
    color: var(--warning);
}

.stat-icon.green {
    background: rgba(0, 214, 143, 0.12);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(124, 92, 255, 0.12);
    color: #7c5cff;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- Tables ---------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-glass);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 214, 143, 0.12);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 61, 113, 0.12);
    color: var(--error);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.12);
    color: var(--warning);
}

.badge-info {
    background: rgba(0, 149, 255, 0.12);
    color: var(--info);
}

.badge-muted {
    background: rgba(90, 90, 110, 0.2);
    color: var(--text-muted);
}

.badge-live {
    background: rgba(254, 44, 85, 0.15);
    color: var(--accent-primary);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(20px);
}

.toast.toast-success {
    border-left: 3px solid var(--success);
}

.toast.toast-error {
    border-left: 3px solid var(--error);
}

.toast.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast.toast-info {
    border-left: 3px solid var(--info);
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

.toast-close {
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------- Progress Bar ---------- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ---------- Empty State ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ---------- Loading ---------- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    gap: 12px;
}

/* ---------- Section Header ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ---------- Avatar ---------- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.avatar-sm {
    width: 28px;
    height: 28px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
}

/* ---------- Proxy status indicator ---------- */
.proxy-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.proxy-dot.active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0, 214, 143, 0.4);
}

.proxy-dot.dead {
    background: var(--error);
}

.proxy-dot.slow {
    background: var(--warning);
}

.proxy-dot.unchecked {
    background: var(--text-muted);
}

/* ---------- Upload Dropzone ---------- */
.upload-dropzone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-glass);
    position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(254, 44, 85, 0.04);
    box-shadow: inset 0 0 30px rgba(254, 44, 85, 0.05);
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    transition: color var(--transition-normal);
}

.upload-dropzone:hover .dropzone-icon,
.upload-dropzone.dragover .dropzone-icon {
    color: var(--accent-primary);
}

.dropzone-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.dropzone-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dropzone-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
}

/* ---------- File Preview List ---------- */
.file-preview-list {
    margin-top: 12px;
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: background var(--transition-fast);
}

.file-preview-item:hover {
    background: var(--bg-card-hover);
}

.file-preview-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(254, 44, 85, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-preview-remove {
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    color: var(--error) !important;
}

.file-preview-remove:hover {
    opacity: 1;
}

/* ---------- Upload Progress ---------- */
.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}

/* ---------- Ghost Button ---------- */
.btn-ghost {
    background: transparent;
    color: var(--accent-secondary);
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-ghost:hover {
    background: rgba(37, 244, 238, 0.08);
}

/* ---------- Dashboard Layout ---------- */
.dash-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.dash-card-main {
    flex: 1;
    min-width: 0;
}

.dash-card-half {
    flex: 1;
    min-width: 0;
}

.dash-chart-wrap {
    position: relative;
    height: 180px;
    padding: 8px;
    max-width: 100%;
}

.dash-chart-bar {
    height: 200px;
}

.dash-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 24px 16px;
    font-size: 0.85rem;
}

/* Video Status Mini Grid */
.video-status-grid {
    display: flex;
    gap: 10px;
    padding: 12px;
    flex-wrap: wrap;
}

.video-status-item {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast);
}

.video-status-item:hover {
    transform: translateY(-2px);
}

.video-status-count {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.video-status-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chart-container {
    position: relative;
    height: 260px;
    padding: 8px;
    max-width: 100%;
    overflow: hidden;
}

/* Activity icon info variant */
.activity-icon.activity-info {
    background: rgba(0, 149, 255, 0.12);
    color: #0095ff;
}

/* ---------- Activity List ---------- */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: var(--bg-glass);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: rgba(142, 142, 160, 0.12);
    color: var(--text-muted);
}

.activity-icon.activity-success {
    background: rgba(0, 214, 143, 0.12);
    color: var(--success);
}

.activity-icon.activity-error {
    background: rgba(255, 61, 113, 0.12);
    color: var(--error);
}

.activity-icon.activity-warning {
    background: rgba(255, 170, 0, 0.12);
    color: var(--warning);
}

.activity-icon.activity-muted {
    background: rgba(90, 90, 110, 0.12);
    color: var(--text-muted);
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {

    /* Dashboard rows stack */
    .dash-row {
        flex-direction: column;
        gap: 16px;
    }

    .dash-chart-wrap {
        height: 160px;
    }

    .dash-chart-bar {
        height: 170px;
    }

    .video-status-count {
        font-size: 1rem;
    }

    /* --- Bottom Navigation Bar --- */
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100% !important;
        min-width: 0;
        height: auto;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        padding: 0;
        flex-direction: row;
    }

    .sidebar-header,
    .sidebar-footer,
    .sidebar-toggle,
    .sidebar.collapsed .nav-item span {
        display: none !important;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        padding: 4px 0;
        gap: 0;
    }

    .sidebar-nav .nav-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 4px;
        gap: 2px;
        border-radius: 8px;
        min-width: 0;
        flex: 1;
    }

    .sidebar-nav .nav-item i {
        font-size: 1.1rem;
        width: auto;
        min-width: 0;
    }

    .sidebar-nav .nav-item span {
        display: block !important;
        font-size: 0.6rem;
        opacity: 0.7;
        line-height: 1;
    }

    .sidebar-nav .nav-item.active span {
        opacity: 1;
    }

    /* Main content adjustments */
    .main-content {
        padding-bottom: 68px;
    }

    .mobile-menu-btn {
        display: none !important;
    }

    .search-box {
        display: none;
    }

    .content-area {
        padding: 12px;
        overflow-x: hidden;
        box-sizing: border-box;
        max-width: 100vw;
    }

    .chart-container {
        height: 200px;
    }

    .dash-chart-wrap {
        height: 150px;
    }

    .dash-chart-bar {
        height: 160px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Video status grid on mobile: 3 columns */
    .video-status-grid {
        gap: 8px;
        padding: 10px;
    }

    .video-status-item {
        min-width: 70px;
        padding: 10px 6px;
    }

    .video-status-count {
        font-size: 1.15rem;
    }

    .video-status-label {
        font-size: 0.6rem;
    }

    .card-header {
        padding: 12px;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .modal {
        width: 95%;
        margin: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 200px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header .btn-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card {
        overflow: hidden;
    }

    .btn-group {
        flex-wrap: wrap;
    }
}

/* ---------- Utility ---------- */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w-full {
    width: 100%;
}

.opacity-60 {
    opacity: 0.6;
}