* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme */
    --bg-primary: #09090b;
    --bg-secondary: #0c0c0e;
    --bg-tertiary: #121215;
    --bg-elevated: #18181b;
    --bg-hover: #1f1f23;
    --bg-active: #27272a;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-soft: rgba(139, 92, 246, 0.12);
    --accent-muted: rgba(139, 92, 246, 0.25);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --border: #27272a;
    --border-subtle: #1f1f23;
    --twitch: #9147ff;
    --twitch-soft: rgba(145, 71, 255, 0.12);
    --kick: #53fc18;
    --kick-soft: rgba(83, 252, 24, 0.12);
    --youtube: #ff0000;
    --youtube-soft: rgba(255, 0, 0, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

/* Light Theme */
.theme-light {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --bg-elevated: #ffffff;
    --bg-hover: #f4f4f5;
    --bg-active: #e4e4e7;
    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-dim: #a1a1aa;
    --border: #e4e4e7;
    --border-subtle: #f4f4f5;
    --accent-soft: rgba(139, 92, 246, 0.08);
    --success-soft: rgba(34, 197, 94, 0.08);
    --warning-soft: rgba(245, 158, 11, 0.08);
    --danger-soft: rgba(239, 68, 68, 0.08);
    --twitch-soft: rgba(145, 71, 255, 0.08);
    --kick-soft: rgba(83, 252, 24, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, #c084fc 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-item.active .nav-icon {
    color: var(--accent);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    width: 100%;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-dark .theme-icon.sun { display: block; }
.theme-dark .theme-icon.moon { display: none; }
.theme-light .theme-icon.sun { display: none; }
.theme-light .theme-icon.moon { display: block; }

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-icon svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.session-details {
    display: flex;
    flex-direction: column;
}

.session-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.session-time {
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
}

.stat-card.highlight .stat-icon {
    background: var(--accent-soft);
}

.stat-card.highlight .stat-icon svg {
    color: var(--accent);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card.highlight .stat-value {
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

/* ==================== QUICK STATUS BAR (Simplified) ==================== */
.quick-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    gap: 24px;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.quick-stat svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
}

.quick-stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.quick-stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mode-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.mode-indicator .mode-icon {
    display: flex;
    align-items: center;
}

.mode-indicator .mode-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
}

.mode-indicator .mode-name {
    font-weight: 600;
    color: var(--accent);
}

.mode-indicator .mode-cooldown {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

/* Beginner Mode Toggle */
.beginner-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.beginner-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.beginner-toggle input {
    display: none;
}

.beginner-toggle input:checked + .toggle-label {
    color: var(--accent);
}

.beginner-toggle input:checked ~ .toggle-label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 6px;
}

/* Advanced Stats Bar (collapsible) */
.advanced-stats {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 300px;
    margin-left: auto;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.advanced-stats .stat-card {
    padding: 12px 16px;
}

.advanced-stats .stat-value {
    font-size: 1.25rem;
}

/* Hide advanced elements in beginner mode */
body.beginner-mode .advanced-stat,
body.beginner-mode .advanced-stats,
body.beginner-mode .preset-dashboard-indicator,
body.beginner-mode .smart-mode-dashboard-indicator {
    display: none !important;
}

body.beginner-mode .mode-indicator .mode-cooldown {
    display: none;
}

/* Mode Toggle in Card Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.mode-btn.compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn.compact svg {
    width: 14px;
    height: 14px;
}

.mode-btn.compact:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mode-btn.compact.active {
    background: var(--accent);
    color: white;
}

.mode-btn.compact.active svg {
    color: white;
}

/* Hype level colors */
.stat-value.hype-low {
    color: var(--text-muted);
}

.stat-value.hype-medium {
    color: var(--warning);
}

.stat-value.hype-high {
    color: var(--success);
}

.stat-value.hype-extreme {
    color: var(--danger);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Panels / Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: visible;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--danger);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-tertiary);
}

.activity-item.hype {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
}

.activity-item.clip {
    background: var(--success-soft);
    border-left: 3px solid var(--success);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.activity-item.hype .activity-icon {
    background: var(--accent-muted);
}

.activity-item.hype .activity-icon svg {
    color: var(--accent);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-kick {
    background: var(--kick);
    color: #000;
    border-color: var(--kick);
}

.btn-kick:hover {
    background: #45d614;
    border-color: #45d614;
}

.btn-youtube {
    background: var(--youtube);
    color: #fff;
    border-color: var(--youtube);
}

.btn-youtube:hover {
    background: #cc0000;
    border-color: #cc0000;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
}

.btn-icon.btn-sm {
    padding: 6px;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Authenticated button with avatar */
.btn-authenticated {
    padding: 6px 12px 6px 6px;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.btn-authenticated:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--twitch);
}

.auth-name {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kick authenticated button */
.btn-kick-authenticated {
    padding: 6px 12px 6px 6px;
    gap: 8px;
    border: 1px solid var(--kick);
    background: rgba(83, 252, 24, 0.1);
}

.btn-kick-authenticated:hover {
    background: rgba(83, 252, 24, 0.2);
}

.kick-avatar {
    border-color: var(--kick) !important;
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.75rem;
    gap: 4px;
}

.btn-small svg {
    width: 14px;
    height: 14px;
}

.btn-full {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-input {
    flex: 1;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox & Toggle */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox-content {
    flex: 1;
}

.form-checkbox-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-checkbox-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-active);
    border-radius: 24px;
    transition: all 0.2s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: white;
}

/* Slider */
.form-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-active);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.form-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 8px;
}

.slider-value {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.875rem;
}

/* Channel List */
.channel-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.tag.danger {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

.tag-remove {
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.15s ease;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-remove svg {
    width: 14px;
    height: 14px;
}

/* Keyword Tags */
.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.keyword-remove {
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.keyword-remove:hover {
    background: var(--accent);
    color: white;
}

.keyword-remove svg {
    width: 12px;
    height: 12px;
}

/* Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
}

.status-dot.connected,
.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.disconnected,
.status-dot.offline {
    background: var(--danger);
}

.status-dot.live {
    background: var(--danger);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* Platform Badges */
.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.platform-badge.twitch {
    background: var(--twitch-soft);
    color: var(--twitch);
}

.platform-badge.kick {
    background: var(--kick-soft);
    color: var(--kick);
}

.platform-badge.youtube {
    background: var(--youtube-soft);
    color: var(--youtube);
}

/* Clips */
.clips-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.clips-filters {
    display: flex;
    gap: 12px;
}

.clips-actions {
    display: flex;
    gap: 8px;
}

.clips-grid {
    display: grid;
    gap: 16px;
}

.clips-list {
    display: grid;
    gap: 12px;
}

/* Clip Card */
.clip-card {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 16px;
    padding: 16px;
    padding-left: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    transition: all 0.15s ease;
    position: relative;
}

.clip-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.clip-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.clip-card.starred {
    border-color: var(--warning);
}

.clip-checkbox {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.clip-card:hover .clip-checkbox,
.clip-card.selected .clip-checkbox {
    opacity: 1;
}

.clip-preview {
    position: relative;
    width: 180px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.clip-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-preview-placeholder svg {
    width: 32px;
    height: 32px;
    color: var(--text-dim);
}

.clip-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.clip-quality {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.clip-quality.high {
    background: var(--success);
    color: white;
}

.clip-quality.good {
    background: var(--accent);
    color: white;
}

.clip-quality.manual {
    background: var(--text-dim);
    color: white;
}

.clip-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.clip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.clip-channel {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
}

.clip-channel:hover {
    color: var(--accent);
}

.clip-score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.clip-score svg {
    width: 12px;
    height: 12px;
}

.clip-score.high {
    background: var(--success-soft);
    color: var(--success);
}

.clip-trigger {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.clip-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.clip-meta-item svg {
    width: 14px;
    height: 14px;
}

.clip-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.clip-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Enhanced Clip Card */
.clip-card-enhanced {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 16px;
    padding: 16px;
    padding-left: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    transition: all 0.15s ease;
    position: relative;
}

.clip-card-enhanced:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.clip-card-enhanced.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.clip-card-enhanced.starred {
    border-color: var(--warning);
}

.clip-card-enhanced.deleted {
    opacity: 0.7;
}

.clip-card-enhanced .clip-checkbox {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.clip-card-enhanced:hover .clip-checkbox,
.clip-card-enhanced.selected .clip-checkbox {
    opacity: 1;
}

.clip-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clip-card-actions .btn-small {
    padding: 6px 10px;
    font-size: 0.75rem;
}

.clip-card-actions .btn-ghost {
    padding: 6px;
}

.clip-card-actions svg {
    width: 16px;
    height: 16px;
}

/* Star Button */
.star-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-muted);
}

.star-btn:hover {
    background: var(--bg-hover);
    color: var(--warning);
}

.star-btn.starred {
    color: var(--warning);
}

.star-btn svg {
    width: 18px;
    height: 18px;
}

/* Starred button in activity items */
.btn.starred,
.btn-icon.starred {
    color: var(--warning);
}

.btn.starred svg,
.btn-icon.starred svg {
    fill: currentColor;
}

/* Clip Channel Name */
.clip-channel-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.clip-channel-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.clip-channel-name a:hover {
    color: var(--accent);
}

/* Clip Trigger Info */
.clip-trigger-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Clip Meta Row */
.clip-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.clip-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Clip Note Preview */
.clip-note-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Clip Timestamp Info */
.clip-timestamp-info {
    font-size: 0.8rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* Clip Quality Badge */
.clip-quality-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--text-dim);
    color: white;
}

.clip-quality-badge.high {
    background: var(--success);
}

.clip-quality-badge.viral {
    background: var(--accent);
}

.clip-quality-badge.farming {
    background: var(--twitch);
}

/* Clip Deleted Badge */
.clip-deleted-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Session Group */
.session-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.session-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.session-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.session-stat svg {
    width: 14px;
    height: 14px;
}

.session-clips {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-download-btn:hover {
    background: var(--bg-active);
    color: var(--text-primary);
    border-color: var(--accent);
}

.session-download-btn svg {
    width: 14px;
    height: 14px;
}

/* Bulk Actions */
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.bulk-bar.hidden {
    display: none;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--accent);
}

.bulk-info svg {
    width: 18px;
    height: 18px;
}

.bulk-actions {
    display: flex;
    gap: 8px;
}

/* Trash Bar */
.trash-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.trash-bar.hidden {
    display: none;
}

.trash-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.trash-info svg {
    width: 18px;
    height: 18px;
    color: var(--danger);
}

/* Clip Stats */
.clip-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.clip-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
}

.clip-stat-card.highlight {
    background: var(--accent-soft);
    border-color: var(--accent-muted);
}

.clip-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.clip-stat-card.highlight .clip-stat-value {
    color: var(--accent);
}

.clip-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-dim);
}

.empty-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-hint {
    font-size: 0.8rem;
}

/* Viewer Stats Container */
#viewerStats {
    display: grid;
    gap: 8px;
}

/* Viewer Items */
.viewer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.viewer-channel {
    font-weight: 500;
    font-size: 0.85rem;
}

.viewer-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.viewer-count.live {
    color: var(--success);
    font-weight: 600;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--danger);
    color: white;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.offline-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--bg-hover);
    color: var(--text-dim);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.channel-status.live {
    background: var(--danger);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1001;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.settings-grid .card-full {
    grid-column: span 2;
}

/* Channels Grid */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .clip-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-grid,
    .channels-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid .card-full {
        grid-column: span 1;
    }
    
    .quick-status-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .mode-indicator .mode-cooldown {
        display: none;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 64px;
    }

    .logo-text,
    .nav-label,
    .theme-toggle span,
    .connection-status span:last-child {
        display: none;
    }

    .sidebar-header {
        padding: 16px;
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .theme-toggle {
        justify-content: center;
        padding: 12px;
    }

    .connection-status {
        justify-content: center;
    }

    .main-content {
        margin-left: 64px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .clip-card {
        grid-template-columns: 140px 1fr;
    }

    .clip-actions {
        position: absolute;
        top: 12px;
        right: 12px;
        flex-direction: row;
    }
    
    .quick-status-bar {
        padding: 10px 16px;
    }
    
    .status-left {
        gap: 12px;
    }
    
    .quick-stat {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .quick-stat-label {
        display: none;
    }
    
    .beginner-toggle .toggle-label {
        display: none;
    }
    
    .advanced-stats {
        display: none;
    }
}

@media (max-width: 600px) {
    .quick-status-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .status-left, .status-right {
        justify-content: center;
    }
    
    .mode-indicator {
        justify-content: center;
    }
}

.channel-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease-in-out;
}

.channel-card.live {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-soft);
}

.channel-card.disabled {
    opacity: 0.5;
}

.channel-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.channel-card.live .channel-avatar {
    border-color: var(--accent);
}

.channel-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.channel-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.channel-name a:hover {
    color: var(--accent);
}

.status-indicator {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator.live {
    color: var(--accent);
}

.status-indicator.offline {
    color: var(--text-muted);
}

.channel-card-body {
    font-size: 0.875rem;
}

.channel-title {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-game {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.channel-card-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.channel-card-notice a {
    color: var(--accent);
    text-decoration: underline;
}

.channel-card-notice.warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.channel-card-notice.warning svg {
    stroke: #f59e0b;
}

.btn-pulse:not(.btn-authenticated):not(.btn-kick-authenticated) {
    animation: btn-pulse-glow 2s ease-in-out infinite;
}

@keyframes btn-pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

.channel-card-settings {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.channel-mode-select {
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.channel-mode-select:hover {
    border-color: var(--accent);
}

.channel-mode-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.channel-webhook-btn {
    margin-left: auto;
    padding: 4px 6px;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.channel-webhook-btn:hover {
    opacity: 1;
}

.channel-webhook-btn.has-webhook {
    opacity: 1;
    color: #5865F2;
}

.webhook-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.webhook-status.valid {
    background: rgba(6, 214, 160, 0.1);
    color: #06d6a0;
    border: 1px solid rgba(6, 214, 160, 0.2);
}

.webhook-status.invalid {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.webhook-status.validating {
    background: rgba(58, 134, 255, 0.1);
    color: #3a86ff;
    border: 1px solid rgba(58, 134, 255, 0.2);
}

.webhook-status strong {
    font-weight: 600;
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

.viewer-count svg {
    width: 16px;
    height: 16px;
}

/* Calibration States */
.channel-card.calibrating {
    border-color: var(--warning);
    background: var(--warning-soft);
}

.calibration-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.calibration-badge.calibrating {
    background: var(--warning-soft);
    color: var(--warning);
}

.calibration-badge.ready {
    background: var(--success-soft);
    color: var(--success);
}

.calibrating-hint {
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 500;
}

/* Warmup States */
.channel-card.warmup {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.calibration-badge.warmup {
    background: var(--danger-soft);
    color: var(--danger);
    animation: warmup-pulse 1.5s ease-in-out infinite;
}

.warmup-hint {
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 600;
    animation: warmup-pulse 1.5s ease-in-out infinite;
}

.warmup-banner {
    background: linear-gradient(135deg, var(--danger-soft), rgba(239, 68, 68, 0.2));
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 0 24px 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warmup-banner.hidden {
    display: none;
}

.warmup-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.9rem;
}

.warmup-banner-content svg {
    animation: warmup-pulse 1.5s ease-in-out infinite;
}

.warmup-channel {
    background: var(--danger-soft);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes warmup-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.activity-thumbnail {
    width: 80px;
    height: 45px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.activity-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-score.normal {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.clip-score.good {
    background: var(--success-soft);
    color: var(--success);
}

.clip-score.high {
    background: var(--warning-soft);
    color: var(--warning);
}

.clip-score.viral {
    background: var(--danger-soft);
    color: var(--danger);
    text-shadow: 0 0 5px var(--danger);
}

/* Clip Theme Badges */
.clip-theme-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}

.clip-theme-badge.theme-funny {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.clip-theme-badge.theme-shocked {
    background: rgba(255, 69, 0, 0.15);
    color: #ff6347;
}

.clip-theme-badge.theme-sus {
    background: rgba(153, 50, 204, 0.15);
    color: #ba55d3;
}

.clip-theme-badge.theme-emotional {
    background: rgba(65, 105, 225, 0.15);
    color: #6495ed;
}

.clip-theme-badge.theme-hype {
    background: rgba(255, 107, 53, 0.15);
    color: #ff6b35;
}

/* Status Badge */
.status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-hover);
    color: var(--text-muted);
}

.status-badge.enabled {
    background: var(--success-soft);
    color: var(--success);
}

.status-badge.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-badge.error {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ==================== ONBOARDING WIZARD ==================== */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.onboarding-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(139, 92, 246, 0.15);
    animation: onboardingSlideIn 0.4s ease;
}

@keyframes onboardingSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.onboarding-content {
    flex: 1;
    padding: 48px 40px 32px;
    overflow-y: auto;
    position: relative;
}

.onboarding-step {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: stepFadeIn 0.3s ease;
}

.onboarding-step.active {
    display: flex;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.onboarding-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent) 0%, #c084fc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
}

.onboarding-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.onboarding-icon.twitch {
    background: linear-gradient(135deg, var(--twitch) 0%, #b266ff 100%);
    box-shadow: 0 8px 32px rgba(145, 71, 255, 0.3);
}

.onboarding-icon.channel {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
}

.onboarding-icon.success {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
    animation: successPulse 1.5s ease infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.onboarding-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.onboarding-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 360px;
}

.onboarding-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.onboarding-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Onboarding Buttons */
.onboarding-btn-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
}

.onboarding-btn-large.twitch {
    background: var(--twitch);
    color: white;
}

.onboarding-btn-large.twitch:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(145, 71, 255, 0.4);
}

.onboarding-btn-large svg {
    width: 24px;
    height: 24px;
}

/* Onboarding Input */
.onboarding-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 16px;
    margin-top: 24px;
    width: 100%;
    max-width: 300px;
    transition: border-color 0.2s ease;
}

.onboarding-input-group:focus-within {
    border-color: var(--accent);
}

.onboarding-input-prefix {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}

.onboarding-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 12px 0;
    outline: none;
}

.onboarding-input::placeholder {
    color: var(--text-dim);
}

/* Onboarding Options (Mode selection) */
.onboarding-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 24px;
}

.onboarding-options.compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.onboarding-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.onboarding-option:hover {
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

.onboarding-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.onboarding-option .option-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-option .option-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent);
}

.onboarding-option .option-content {
    flex: 1;
}

.onboarding-option .option-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.onboarding-option .option-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.onboarding-option .option-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compact option cards (stream type) */
.onboarding-option-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.onboarding-option-small:hover {
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

.onboarding-option-small.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.onboarding-option-small .option-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-option-small .option-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-secondary);
}

.onboarding-option-small.selected .option-icon svg {
    stroke: var(--accent);
}

.onboarding-option-small .option-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Onboarding Summary */
.onboarding-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
    text-align: left;
    width: 100%;
}

.onboarding-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.onboarding-summary-item:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.onboarding-summary-item .summary-icon {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.onboarding-summary-item .summary-icon svg,
.summary-svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
}

.onboarding-summary-item .summary-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.onboarding-summary-item .summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Onboarding Navigation */
.onboarding-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.onboarding-dots {
    display: flex;
    gap: 8px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.onboarding-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

.onboarding-dot.completed {
    background: var(--success);
}

.onboarding-buttons {
    display: flex;
    gap: 12px;
}

.onboarding-btn {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-btn.primary {
    background: var(--accent);
    color: white;
}

.onboarding-btn.primary:hover {
    background: var(--accent-hover);
}

.onboarding-btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.onboarding-btn.secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .onboarding-modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .onboarding-content {
        padding: 32px 24px 24px;
    }

    .onboarding-nav {
        padding: 16px 24px;
        flex-direction: column;
        gap: 16px;
    }

    .onboarding-options.compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .onboarding-title {
        font-size: 1.5rem;
    }
}

/* ==================== TOOLTIPS ==================== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: help;
    margin-left: 6px;
    position: relative;
    vertical-align: middle;
    transition: all 0.15s ease;
}

.tooltip-icon:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--accent);
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before,
.tooltip-icon.tooltip-active::after,
.tooltip-icon.tooltip-active::before {
    opacity: 1;
    visibility: visible;
}

/* Tooltip positioning fixes for edge cases */
.card-title .tooltip-icon::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    white-space: normal;
    text-align: left;
}

.card-title .tooltip-icon::before {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Ensure card headers don't clip tooltips */
.card-header {
    overflow: visible;
}

.card-title {
    overflow: visible;
}

/* Mobile tooltip behavior */
@media (max-width: 768px) {
    .tooltip-icon::after {
        max-width: 200px;
        font-size: 0.75rem;
    }
}

/* ==================== SMART MODE ==================== */
.smart-mode-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.smart-mode-toggle {
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius);
    padding: 12px 16px !important;
}

.smart-mode-toggle:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.smart-mode-status {
    margin-top: 12px;
}

.smart-mode-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--success-soft);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--success);
}

.smart-mode-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: smartModePulse 2s ease-in-out infinite;
}

@keyframes smartModePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#smartModeExplanation {
    flex: 1;
    color: var(--text-primary);
}

/* Disabled manual settings when Smart Mode is on */
#manualSettingsSection.disabled {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

#manualSettingsSection.disabled::before {
    content: 'Smart Mode is handling these settings automatically';
    display: block;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
}

/* Smart Mode dashboard indicator */
.smart-mode-dashboard-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.smart-mode-dashboard-indicator svg {
    width: 14px;
    height: 14px;
}

.smart-mode-dashboard-indicator .smart-settings {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== STREAM TYPE PRESETS ==================== */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.preset-card:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.preset-card.selected {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.preset-card.selected .preset-icon {
    transform: scale(1.1);
}

.preset-icon {
    font-size: 2rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.preset-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preset-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.preset-settings-preview {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.preset-setting-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    padding: 2px 6px;
    background: var(--bg-active);
    border-radius: 4px;
    color: var(--text-secondary);
}

.preset-setting-tag .tag-icon {
    width: 10px;
    height: 10px;
    stroke: currentColor;
}

.preset-card.selected .preset-setting-tag {
    background: var(--accent-muted);
    color: var(--accent);
}

.preset-card.selected .preset-setting-tag .tag-icon {
    stroke: var(--accent);
}

.preset-active-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.preset-badge-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-badge-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent);
}

.preset-active-badge span:first-child {
    font-size: 1rem;
}

/* Auto-detected indicator */
.preset-auto-detected {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--success-soft);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 12px;
}

.preset-auto-detected svg {
    width: 14px;
    height: 14px;
}

/* Preset in dashboard indicator */
.preset-dashboard-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.preset-dashboard-indicator .preset-icon {
    font-size: 1rem;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.preset-dashboard-indicator .preset-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
}

.preset-dashboard-indicator .preset-label {
    color: var(--text-muted);
}

.preset-dashboard-indicator .preset-value {
    font-weight: 500;
    color: var(--text-primary);
}

.preset-dashboard-indicator.auto-detected {
    background: var(--success-soft);
    border-color: rgba(34, 197, 94, 0.2);
}

.preset-dashboard-indicator.auto-detected .preset-value {
    color: var(--success);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preset-card {
        padding: 12px 8px;
    }
    
    .preset-icon {
        font-size: 1.5rem;
    }
    
    .preset-name {
        font-size: 0.8rem;
    }
    
    .preset-desc {
        display: none;
    }
}
/* ==================== ADD CHANNEL MODAL ==================== */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.tab-item {
    padding: 10px 16px;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    padding-top: 16px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ==================== PHASE 2: QUALITY INSIGHTS ==================== */

/* Feedback Buttons */
.clip-feedback-buttons {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.feedback-btn:hover {
    transform: translateY(-1px);
}

.feedback-btn.great {
    border-color: var(--success);
    color: var(--success);
}

.feedback-btn.great:hover {
    background: var(--success-soft);
}

.feedback-btn.not-viral {
    border-color: var(--danger);
    color: var(--danger);
}

.feedback-btn.not-viral:hover {
    background: var(--danger-soft);
}

/* Feedback Status */
.clip-feedback-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    margin: 8px 12px;
}

.clip-feedback-status.great {
    background: var(--success-soft);
    color: var(--success);
}

.clip-feedback-status.not-viral {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Clip Details Modal */
.clip-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.clip-details-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.clip-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.clip-details-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.clip-details-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.clip-details-header .close-btn:hover {
    color: var(--text-primary);
}

.clip-details-body {
    padding: 20px;
}

.detail-thumbnail {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.clip-detail-section {
    margin-bottom: 20px;
}

.clip-detail-section h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Score Breakdown Grid */
.score-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.breakdown-item.combo {
    grid-column: span 2;
    background: var(--accent-soft);
}

.breakdown-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-item.combo .breakdown-value {
    color: var(--accent);
}

.total-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--accent-soft);
    border-radius: var(--radius);
    font-weight: 600;
}

.total-score .score-value {
    font-size: 20px;
    color: var(--accent);
}

/* Classification */
.classification-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.classification-label {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.classification-label.viral {
    background: var(--success-soft);
    color: var(--success);
}

.classification-label.funny {
    background: var(--warning-soft);
    color: var(--warning);
}

.classification-label.hype {
    background: var(--accent-soft);
    color: var(--accent);
}

.classification-label.discard {
    background: var(--danger-soft);
    color: var(--danger);
}

.confidence {
    font-size: 12px;
    color: var(--text-muted);
}

.classification-reasons {
    list-style: none;
    padding: 0;
    margin: 0;
}

.classification-reasons li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.classification-reasons li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    gap: 8px;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.metadata-item span:first-child {
    color: var(--text-muted);
}

.metadata-item span:last-child {
    color: var(--text-primary);
}

.trigger-reason {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-family: monospace;
}

.clip-details-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clip-details-footer .clip-feedback-buttons {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* ==================== THEME SVG ICONS ==================== */
.theme-svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.theme-funny .theme-svg { stroke: #22c55e; }
.theme-shocked .theme-svg { stroke: #f59e0b; }
.theme-sus .theme-svg { stroke: #8b5cf6; }
.theme-emotional .theme-svg { stroke: #3b82f6; }
.theme-hype .theme-svg { stroke: #ef4444; }

/* Smart mode dashboard indicator SVG */
.smart-mode-dashboard-indicator svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
    margin-right: 6px;
}

/* ==================== PRESET & QUALITY MODE ICONS ==================== */
.preset-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-secondary);
}

.preset-card.selected .preset-icon svg {
    stroke: var(--accent);
}

.quality-mode-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.quality-mode-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
}

.quality-mode-option input:checked + .quality-mode-content .quality-mode-icon {
    background: var(--accent-soft);
}

.quality-mode-option input:checked + .quality-mode-content .quality-mode-icon svg {
    stroke: var(--accent);
}

.quality-mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-mode-option {
    cursor: pointer;
}

.quality-mode-option input {
    display: none;
}

.quality-mode-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.quality-mode-option:hover .quality-mode-content {
    border-color: var(--text-muted);
}

.quality-mode-option input:checked + .quality-mode-content {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.quality-mode-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quality-mode-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.quality-mode-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Hype stat in quick status bar */
.quick-stat.hype-stat .quick-stat-value {
    color: var(--accent);
}

/* ==================== PHASE 3: SETTINGS TABS ==================== */
.settings-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.settings-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-tab.active {
    background: var(--bg-elevated);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.settings-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.settings-tab.active svg {
    stroke: var(--accent);
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-grid .card-full {
    grid-column: 1 / -1;
}

/* Mobile responsive for settings tabs */
@media (max-width: 768px) {
    .settings-tabs {
        gap: 2px;
        padding: 3px;
    }
    
    .settings-tab {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .settings-tab svg {
        width: 16px;
        height: 16px;
    }
    
    .settings-tab span {
        display: none;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .settings-tab {
        padding: 10px 14px;
    }
}

/* ==================== CLIP EDITOR MODAL ==================== */

.clip-editor-modal .modal-content.modal-large {
    max-width: 900px;
    width: 95%;
}

.editor-body {
    padding: 0 !important;
}

.editor-video-container {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
    max-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-video {
    width: 100%;
    height: 100%;
    max-height: 450px;
    background: #000;
}

.editor-loading,
.editor-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-secondary);
}

.editor-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.editor-error {
    color: var(--text-muted);
}

.editor-error svg {
    color: var(--danger);
}

.editor-error.hidden {
    display: none;
}

.editor-info {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.editor-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--bg-secondary);
    text-align: center;
}

.editor-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.editor-title-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.editor-title-section .input-group {
    margin-top: 8px;
}

.editor-footer {
    display: flex;
    justify-content: space-between !important;
    align-items: center;
    background: var(--bg-tertiary);
}

.editor-actions-left,
.editor-actions-right {
    display: flex;
    gap: 10px;
}

.editor-actions-left .btn,
.editor-actions-right .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile responsive for editor */
@media (max-width: 768px) {
    .clip-editor-modal .modal-content.modal-large {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .editor-info {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .editor-info-row:nth-child(4),
    .editor-info-row:nth-child(5) {
        display: none;
    }
    
    .editor-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .editor-actions-left,
    .editor-actions-right {
        width: 100%;
    }
    
    .editor-actions-left .btn,
    .editor-actions-right .btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==================== ADMIN DASHBOARD ==================== */

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
}

.admin-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.admin-tab.active {
    background: var(--accent);
    color: white;
}

/* Admin Tab Content */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.admin-stat-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.admin-stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.admin-stat-icon svg {
    width: 28px;
    height: 28px;
}

.admin-stat-icon.users {
    background: var(--accent-soft);
    color: var(--accent);
}

.admin-stat-icon.tenants {
    background: var(--success-soft);
    color: var(--success);
}

.admin-stat-icon.subscriptions {
    background: var(--warning-soft);
    color: var(--warning);
}

.admin-stat-icon.clips {
    background: var(--twitch-soft);
    color: var(--twitch);
}

.admin-stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.admin-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Admin Toolbar */
.admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-search {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}

.admin-search svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.admin-search input {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
}

.admin-search input:focus {
    outline: none;
}

.admin-search input::placeholder {
    color: var(--text-muted);
}

.admin-select {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.admin-select:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-date-input {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
}

.admin-date-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Admin Tables */
.admin-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--bg-tertiary);
}

.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: var(--bg-hover);
}

.admin-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
}

/* Admin Table Cells */
.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.admin-user-name {
    font-weight: 500;
}

.admin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.admin-status-badge.active {
    background: var(--success-soft);
    color: var(--success);
}

.admin-status-badge.inactive {
    background: var(--danger-soft);
    color: var(--danger);
}

.admin-status-badge.trialing {
    background: var(--accent-soft);
    color: var(--accent);
}

.admin-status-badge.past_due {
    background: var(--warning-soft);
    color: var(--warning);
}

.admin-status-badge.canceled,
.admin-status-badge.paused {
    background: var(--bg-active);
    color: var(--text-muted);
}

.admin-role-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-active);
    color: var(--text-secondary);
}

.admin-role-badge.super-admin {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Admin Action Buttons */
.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-action-btn {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.admin-action-btn.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

.admin-action-btn svg {
    width: 14px;
    height: 14px;
}

/* Admin Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.admin-pagination-btn {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-pagination-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.admin-pagination-info {
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Admin Modals */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-modal.active {
    display: flex;
}

.admin-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.admin-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

/* Admin Detail Sections */
.admin-detail-section {
    margin-bottom: 24px;
}

.admin-detail-section:last-child {
    margin-bottom: 0;
}

.admin-detail-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.admin-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-detail-label {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.admin-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-detail-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.admin-toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.admin-toggle-label {
    font-size: 14px;
    color: var(--text-primary);
}

/* Section header for admin */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title svg {
    color: var(--accent);
}

/* ==================== ANALYTICS STYLES ==================== */

.analytics-period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.analytics-period-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analytics-period-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.analytics-period-btn.active {
    background: var(--accent);
    color: white;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.analytics-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analytics-card-icon svg {
    width: 24px;
    height: 24px;
}

.analytics-card-icon.clips {
    background: var(--accent-soft);
    color: var(--accent);
}

.analytics-card-icon.success {
    background: var(--success-soft);
    color: var(--success);
}

.analytics-card-icon.users {
    background: var(--twitch-soft);
    color: var(--twitch);
}

.analytics-card-icon.avg {
    background: var(--warning-soft);
    color: var(--warning);
}

.analytics-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.analytics-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.analytics-card-label {
    font-size: 13px;
    color: var(--text-muted);
}

.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 1000px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

.analytics-chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.analytics-chart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.analytics-chart-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.analytics-chart-body {
    padding: 20px;
    min-height: 200px;
}

.analytics-loading,
.analytics-empty,
.analytics-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    color: var(--text-muted);
    font-size: 14px;
}

.analytics-error {
    color: var(--danger);
}

/* Bar Charts */
.analytics-bar-chart {
    display: flex;
    gap: 8px;
}

.analytics-bar-chart.vertical {
    flex-direction: row;
    align-items: flex-end;
    height: 160px;
    padding-bottom: 24px;
}

.analytics-bar-chart.horizontal {
    flex-direction: column;
    gap: 10px;
}

.analytics-bar-item {
    display: flex;
    position: relative;
}

.analytics-bar-item.vertical {
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.analytics-bar-item.horizontal {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.analytics-bar {
    background: var(--accent);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.analytics-bar.vertical {
    width: 100%;
    min-height: 4px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.analytics-bar.horizontal {
    height: 24px;
    min-width: 4px;
}

.analytics-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    height: 24px;
}

.analytics-bar-wrapper .analytics-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

.analytics-bar-wrapper .analytics-bar-value {
    position: relative;
    z-index: 1;
    padding-left: 8px;
}

.analytics-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 2px 0;
}

.analytics-bar-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-bar-item.vertical .analytics-bar-label {
    position: absolute;
    bottom: -20px;
    transform: rotate(-45deg);
    transform-origin: top left;
    max-width: 60px;
}

.analytics-bar-item.horizontal .analytics-bar-label {
    min-width: 90px;
    text-align: right;
}

/* Heatmap */
.analytics-heatmap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
}

.analytics-heatmap-cell {
    aspect-ratio: 1;
    background: color-mix(in srgb, var(--accent) calc(var(--intensity) * 100%), var(--bg-tertiary));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: transform 0.2s ease;
}

.analytics-heatmap-cell:hover {
    transform: scale(1.1);
}

.analytics-heatmap-hour {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Legend */
.analytics-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analytics-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.analytics-legend-label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.analytics-legend-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
/* ==================== WEBHOOK STYLES ==================== */

.webhooks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webhook-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 16px;
}

.webhook-item.disabled {
    opacity: 0.6;
}

.webhook-item.circuit-open {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--danger-soft) 100%);
}

.webhook-info {
    flex: 1;
    min-width: 0;
}

.webhook-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.webhook-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.webhook-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.webhook-status-badge.enabled {
    background: var(--success-soft);
    color: var(--success);
}

.webhook-status-badge.disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.webhook-status-badge.circuit-open {
    background: var(--danger-soft);
    color: var(--danger);
}

.webhook-url {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', monospace;
    word-break: break-all;
    margin-bottom: 8px;
}

.webhook-events {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.webhook-event-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 4px;
}

.webhook-last-delivery {
    font-size: 12px;
    color: var(--text-muted);
}

.webhook-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.webhook-actions .btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.webhook-actions .btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Webhook Events Selection */
.webhook-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.webhook-event-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.webhook-event-option:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.webhook-event-option input[type="checkbox"] {
    margin-top: 2px;
}

.webhook-event-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.webhook-event-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.webhook-event-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Webhook Test Result */
.webhook-test-result {
    padding: 16px;
}

.webhook-test-status {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius);
}

.webhook-test-status.success {
    background: var(--success-soft);
    border: 1px solid var(--success);
}

.webhook-test-status.error {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
}

.test-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.webhook-test-status.success .test-status-icon {
    background: var(--success);
    color: white;
}

.webhook-test-status.error .test-status-icon {
    background: var(--danger);
    color: white;
}

.test-status-icon svg {
    width: 24px;
    height: 24px;
}

.test-status-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.webhook-test-status.success .test-status-text h4 {
    color: var(--success);
}

.webhook-test-status.error .test-status-text h4 {
    color: var(--danger);
}

.test-status-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Webhook Logs */
.webhook-logs-content {
    max-height: 400px;
    overflow-y: auto;
}

.webhook-log-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.webhook-log-item:last-child {
    border-bottom: none;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.log-event {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.log-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
}

.log-status.delivered {
    background: var(--success-soft);
    color: var(--success);
}

.log-status.failed {
    background: var(--danger-soft);
    color: var(--danger);
}

.log-status.retrying {
    background: var(--warning-soft);
    color: var(--warning);
}

.log-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.log-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.log-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 8px;
    padding: 8px;
    background: var(--danger-soft);
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', monospace;
}

.no-logs {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Modal large size */
.modal-large .modal-content {
    max-width: 700px;
}
