/* ===================================
   V.I.S.I.O.N. — Shopee Video SEO System
   Main Stylesheet
   =================================== */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-hover: #243049;
    --text-primary: #f0f4ff;
    --text-secondary: #8892b0;
    --text-muted: #5a6580;
    --accent-blue: #667eea;
    --accent-purple: #764ba2;
    --accent-pink: #f093fb;
    --accent-green: #43e97b;
    --accent-orange: #f5576c;
    --accent-cyan: #4facfe;
    --border-color: #2a3550;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* Layout */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    color: var(--accent-blue);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mode-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-color);
    border-radius: 24px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h2 {
    font-size: 20px;
    font-weight: 600;
}

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

.header-right {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #38f9d7);
    color: #000;
}

/* Views */
.view {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent-blue);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.kpi-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-change {
    font-size: 11px;
    font-weight: 500;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card canvas {
    max-height: 280px;
}

/* Bottom Row */
.bottom-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.activity-card, .videos-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.activity-card h3, .videos-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
}

.activity-action {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

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

.activity-status {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-running { background: rgba(79, 172, 254, 0.15); color: var(--accent-cyan); }
.status-failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.video-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-hover);
    border-radius: 8px;
    font-size: 12px;
}

.video-mini .icon { font-size: 18px; }
.video-mini .name { font-weight: 600; }
.video-mini .status { color: var(--text-muted); font-size: 10px; }

/* Products */
.products-container, .videos-container, .keywords-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.products-header, .videos-header, .keywords-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.add-product-form, .create-video-form {
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.products-grid, .videos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.product-card, .video-card {
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.product-card:hover, .video-card:hover {
    border-color: var(--accent-blue);
}

.product-header, .video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.product-name, .video-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.product-category, .video-product {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.product-price, .video-stats {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.product-affiliate, .video-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-delete {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-preview {
    background: linear-gradient(135deg, var(--accent-cyan), #0ea5e9);
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-preview:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.keyword-card {
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.keyword-card:hover {
    border-color: var(--accent-blue);
}

.keyword-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.keyword-actions {
    display: flex;
    gap: 8px;
}

.keyword-text {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.keyword-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* Analytics */
.analytics-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.analytics-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.analytics-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.analytics-table-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

/* Logs */
.logs-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.logs-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logs-controls input,
.logs-controls select {
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.logs-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-hover);
    border-radius: 10px;
}

.log-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

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

.logs-list {
    max-height: 600px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

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

.log-agent {
    font-weight: 600;
    min-width: 80px;
}

.log-time {
    color: var(--text-muted);
    min-width: 140px;
    font-size: 11px;
}

.log-action {
    flex: 1;
}

/* Workflow */
.workflow-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border-color);
}

.workflow-header {
    margin-bottom: 24px;
}

.workflow-header h3 {
    font-size: 20px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.workflow-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.workflow-pipeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

/* Progress summary bar */
.workflow-progress {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 24px;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.progress-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

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

.progress-right {
    text-align: right;
}

.progress-percent {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-state {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.5);
}

/* Phases */
.workflow-phases {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.workflow-phase {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.workflow-phase.phase-done {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(56, 249, 215, 0.04));
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.phase-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.phase-title {
    flex: 1;
}

.phase-number {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.phase-title h4 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.phase-label {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 14px;
}

.phase-count {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    background: var(--bg-hover);
    border-radius: 99px;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.workflow-phase.phase-done .phase-count {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
}

.phase-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

/* Step Cards */
.workflow-step {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.workflow-step::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--border-color);
    transition: background 0.3s ease;
}

.workflow-step:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.workflow-step.running {
    border-color: var(--accent-cyan);
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.06), rgba(0, 242, 254, 0.06));
    animation: stepPulse 1.5s ease-in-out infinite;
}

.workflow-step.running::before { background: var(--accent-cyan); }

.workflow-step.completed {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(56, 249, 215, 0.05));
}

.workflow-step.completed::before { background: var(--success); }

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(79, 172, 254, 0); }
}

.step-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.step-body {
    flex: 1;
    min-width: 0;
}

.step-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.step-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    background: none;
    width: auto;
    height: auto;
    display: inline;
    padding: 0;
    margin: 0;
}

.step-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.step-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.step-agent {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.step-status {
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 99px;
    display: inline-block;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

.step-check {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s ease;
}

.workflow-step.completed .step-check {
    opacity: 1;
    transform: scale(1);
}

.workflow-controls {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .phase-steps { grid-template-columns: 1fr; }
    .progress-head { flex-direction: column; align-items: flex-start; }
    .progress-right { text-align: left; }
    .progress-state { justify-content: flex-start; }
}

/* Settings */
.settings-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.settings-container h3 {
    margin-bottom: 24px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.settings-card {
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.settings-card h4 {
    font-size: 15px;
    margin-bottom: 16px;
}

.settings-form .form-group {
    margin-bottom: 12px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--danger);
    color: white;
}

.toast-info {
    background: var(--accent-blue);
    color: white;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.video-preview-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-hover);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 2px dashed var(--border-color);
    position: relative;
    overflow: hidden;
}

.video-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.video-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--accent-cyan);
    animation: pulse 2s ease-in-out infinite;
}

.video-placeholder p {
    font-size: 16px;
    font-weight: 500;
}

.video-details h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.video-details p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-hover);
    border-radius: 10px;
}

.video-meta span {
    font-size: 13px;
    color: var(--text-secondary);
}

.video-meta strong {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .kpi-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}
