/* Полоса загрузки при старте (медленный Wi‑Fi) */
.app-boot-status {
    padding: 10px 16px;
    text-align: center;
    font-size: 0.9rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.app-boot-status--hidden {
    display: none !important;
}
.app-boot-status--error {
    background: rgba(231, 76, 60, 0.12);
    color: var(--error-color);
}

:root {
    /* Светлая тема (по умолчанию) */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-inverse: #ffffff;
    --border-color: #e0e0e0;
    --accent-color: #667eea;
    --accent-hover: #5568d3;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* Темная тема */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: #2d2d44;
    --bg-tertiary: #1e1e2e;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-inverse: #ffffff;
    --border-color: #3d3d5c;
    --accent-color: #7c8aff;
    --accent-hover: #9ba3ff;
    --success-color: #4ade80;
    --error-color: #f87171;
    --warning-color: #fbbf24;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    margin-bottom: 40px;
    padding: 30px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    color: var(--text-inverse);
    flex-wrap: wrap;
    gap: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.design-switcher {
    display: flex;
    gap: 4px;
}

.design-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-inverse);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.design-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.design-btn.active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

#sendStatsBtn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 10px 20px;
    color: var(--text-inverse);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

#sendStatsBtn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.report-send-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.report-period-select {
    max-width: 220px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-inverse, #fff);
    font-size: 0.9em;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.report-period-select option {
    color: #111;
    background: #fff;
}

#sendReportsNowBtn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 10px 18px;
    color: var(--text-inverse, #fff);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

#sendReportsNowBtn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sendReportsNowBtn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

#sendStatsBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-icon {
    display: block;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg);
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-color);
    box-shadow: 0 4px 12px var(--shadow);
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.main-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px var(--shadow);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    margin-bottom: 40px;
}

section h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group textarea {
    flex: 1 1 100%;
    width: 100%;
    min-height: 4.5em;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    line-height: 1.45;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.relay-template-label {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.95em;
}

.relay-template-hint {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 4px !important;
    margin-bottom: 4px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.telegram-send-btn {
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
}

.telegram-send-btn:hover {
    background: #006ba3;
    transform: scale(1.05);
}

.telegram-send-btn:active {
    transform: scale(0.95);
}

.streamers-controls {
    margin-bottom: 20px;
}

.search-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-controls {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.sort-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.95em;
}

.sort-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.sort-checkbox-label:hover {
    background: var(--bg-secondary);
}

.sort-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.sort-checkbox:checked + span {
    font-weight: 600;
    color: var(--accent-color);
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.streamers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.streamer-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.streamer-card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-2px);
}

.streamer-card.streaming {
    border-color: #27ae60;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.streamer-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.streamer-avatar-container {
    flex-shrink: 0;
    position: relative;
}

.streamer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
}

.streamer-avatar:hover {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.streamer-avatar.streaming {
    border-color: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
    animation: pulse-avatar 2s infinite;
}

.streamer-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5em;
    border: 3px solid #e0e0e0;
    flex-shrink: 0;
}

.streamer-name-container {
    flex: 1;
    min-width: 0;
}

.streamer-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.streamer-display-name {
    color: #000 !important;
}

.streamer-original-name {
    color: #666 !important;
    font-size: 0.85em;
    margin-left: 5px;
}

.nickname-edit-input {
    color: #000 !important;
    background: rgba(255, 255, 255, 0.95) !important;
}

.streamer-platform {
    font-size: 0.9em;
    color: #666;
    background: #e0e0e0;
    padding: 4px 10px;
    border-radius: 12px;
}

.streamer-info {
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.info-label {
    color: #666;
}

.info-value {
    font-weight: 600;
    color: #333;
}

.prediction-preview {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 5px;
    border-left: 3px solid #667eea;
}

.prediction-preview .info-label {
    color: #667eea;
    font-weight: 600;
}

.prediction-preview .info-value {
    color: #764ba2;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.online {
    background: #27ae60;
    box-shadow: 0 0 8px #27ae60;
    animation: pulse 2s infinite;
}

.streamer-display-name.nickname-editing {
    display: inline-block;
    min-width: 120px;
    max-width: 280px;
    padding: 2px 6px;
    border: 2px solid #667eea;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    outline: none;
    cursor: text;
}

.streamer-display-name.nickname-saving {
    opacity: 0.75;
}

.status-indicator.offline {
    background: #95a5a6;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.streamer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.streamer-actions .btn {
    flex: 1;
    min-width: 100px;
    font-size: 0.9em;
    padding: 8px 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 1.1em;
}

.help-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    line-height: 1.5;
}

.help-text a {
    color: #667eea;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.api-status {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    display: none;
}

.api-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.api-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.api-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.settings-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.hidden-settings {
    display: none;
}

.hidden-settings.visible {
    display: block;
}

/* Не используем type=password и -webkit-text-security:
   оба варианта триггерят менеджер паролей Chrome/Яндекс.Браузера. */
.secret-field {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.02em;
}

.digest-photobank {
    margin: 14px 0 8px;
    padding: 12px 0 4px;
    border-top: 1px solid rgba(128, 128, 128, 0.25);
}
.digest-photobank-page .digest-photobank-actions {
    margin-top: 4px;
}
.digest-photobank-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.digest-photobank-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}
.digest-upload-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}
.digest-photobank-count {
    opacity: 0.8;
    font-size: 0.9rem;
}
.digest-photobank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.digest-photobank-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(128, 128, 128, 0.2);
    display: flex;
    flex-direction: column;
}
.digest-photobank-item.is-inactive {
    opacity: 0.55;
}
.digest-photobank-item.is-inactive img {
    filter: grayscale(0.35);
}
.digest-photobank-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.digest-photo-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.digest-photo-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
}
.digest-photo-window {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: rgba(180, 100, 20, 0.9);
    color: #fff;
}
.digest-photobank-item.is-active .digest-photo-status {
    background: rgba(30, 130, 70, 0.9);
}
.digest-photobank-item.is-inactive .digest-photo-status {
    background: rgba(90, 90, 90, 0.85);
}
.digest-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}
.digest-photo-actions .btn {
    width: 100%;
}
.digest-photobank-empty {
    opacity: 0.7;
    font-size: 0.95rem;
    padding: 16px 0;
}

.toggle-settings-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0.7;
}

.toggle-settings-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.monthly-statistics-section {
    margin-top: 40px;
}

.month-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-selector label {
    font-weight: 600;
    color: #333;
}

.month-selector input[type="month"] {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
}

.month-selector input[type="month"]:focus {
    outline: none;
    border-color: #667eea;
}

.tables-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.stat-table-wrapper {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.stat-table-wrapper h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.stat-table-container {
    overflow-x: auto;
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.stat-table tbody tr:hover {
    background-color: #f0f0f0;
}

.stat-table tbody tr:last-child {
    border-bottom: none;
}

.stat-table td {
    padding: 12px 15px;
    color: #333;
}

.stat-table td:first-child {
    font-weight: 600;
    color: #667eea;
}

.stat-table .rank {
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: #764ba2;
}

.stat-table .rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.stat-table .rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.stat-table .rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a857 100%);
    color: #333;
}

.stat-table .duration-cell {
    position: relative;
    font-weight: 600;
    border-radius: 6px;
    padding: 8px 12px;
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

/* Цветовая индикация длительности - от коротких (синий) к длинным (красный) */
.duration-very-short {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.duration-short {
    background: linear-gradient(135deg, #b3e5fc 0%, #81d4fa 100%);
    color: #0277bd;
}

.duration-medium {
    background: linear-gradient(135deg, #80deea 0%, #4dd0e1 100%);
    color: #00838f;
}

.duration-long {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    color: #f57f17;
}

.duration-very-long {
    background: linear-gradient(135deg, #ffcc80 0%, #ffb74d 100%);
    color: #e65100;
}

.duration-extreme {
    background: linear-gradient(135deg, #ffab91 0%, #ff8a65 100%);
    color: #bf360c;
}

.empty-table-message {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

.online-section {
    margin-bottom: 0;
}

.online-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.online-section-header h2 {
    margin: 0 0 0.35rem;
}

.online-section-hint {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
    max-width: 42rem;
    line-height: 1.45;
}

.online-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.online-stats .stat-card {
    min-width: 120px;
    text-align: center;
    padding: 0.75rem 1rem;
}

.online-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    gap: 1.25rem;
}

.online-player-card {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.online-player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
}

.online-player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0e0e10;
}

.online-player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.online-player-fallback {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    color: #e8e8ef;
}

.online-player-fallback-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.online-player-fallback p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.92rem;
    max-width: 22rem;
}

.online-player-meta {
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.9), rgba(255, 255, 255, 0.95));
}

.online-player-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.online-player-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #14532d;
    line-height: 1.25;
}

.online-player-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    font-size: 0.88rem;
    color: #166534;
}

.online-player-viewers {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: #14532d;
    background: rgba(34, 197, 94, 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
}

.online-player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.online-player-actions .btn {
    text-decoration: none;
}

[data-theme="dark"] .online-player-card {
    background: #14161c;
    border-color: rgba(34, 197, 94, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .online-player-meta {
    background: linear-gradient(180deg, rgba(20, 83, 45, 0.35), rgba(20, 22, 28, 0.95));
}

[data-theme="dark"] .online-player-name,
[data-theme="dark"] .online-player-viewers {
    color: #bbf7d0;
}

[data-theme="dark"] .online-player-status {
    color: #86efac;
}

[data-theme="dark"] .online-section-hint {
    color: #9ca3af;
}

.online-streamers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.online-streamer-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 3px solid #27ae60;
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
    position: relative;
    overflow: hidden;
}

.online-streamer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #27ae60, #2ecc71, #27ae60);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.online-streamer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.online-streamer-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.online-streamer-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #27ae60;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.5);
    animation: pulse-avatar 2s infinite;
}

.online-streamer-info {
    flex: 1;
}

.online-streamer-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #155724;
    margin-bottom: 5px;
}

.online-streamer-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #27ae60;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.online-streamer-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    animation: pulse 1.5s infinite;
}

.online-streamer-status-indicator.warn {
    background: #f39c12;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.9);
}

.online-player-card-warn {
    outline: 1px solid rgba(230, 126, 34, 0.45);
}

.online-category-warn {
    color: #e67e22;
    font-weight: 600;
}

.online-streamer-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.online-streamer-detail {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.online-streamer-detail-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.online-streamer-detail-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #155724;
}

.online-streamer-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.online-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.online-empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.online-empty-state-text {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.online-empty-state-subtext {
    font-size: 0.9em;
    color: #999;
}

.analytics-section {
    margin-bottom: 0;
}

.analytics-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.control-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.analytics-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.3s;
    background: white;
}

.analytics-select:focus {
    outline: none;
    border-color: #667eea;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.chart-wrapper {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
}

.chart-wrapper h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }

    .analytics-controls {
        flex-direction: column;
    }
}

.achievements-section {
    margin-bottom: 0;
}

.achievements-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.achievements-filter {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievements-filter label {
    font-weight: 600;
    color: #333;
}

.streamer-achievements-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e0e0e0;
}

.streamer-achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.streamer-achievements-header h3 {
    color: #667eea;
    font-size: 1.3em;
    margin: 0;
    border: none;
    padding: 0;
}

.achievements-count {
    background: #667eea;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievements-category {
    margin-bottom: 30px;
}

.achievements-category h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.streamer-achievements-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.streamer-achievements-list .achievements-category {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.streamer-achievements-list .achievements-category h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.streamer-achievements-list .achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.streamer-achievements-list .achievements-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.achievement-card.compact {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
}

.achievement-card.compact .achievement-icon {
    font-size: 2em;
    margin-bottom: 0;
    flex-shrink: 0;
}

.achievement-card.compact .achievement-info {
    flex: 1;
    min-width: 0;
}

.achievement-card.compact .achievement-name {
    font-size: 1em;
    margin-bottom: 4px;
    line-height: 1.2;
}

.achievement-card.compact .achievement-description {
    display: none;
}

.achievement-card.compact .achievement-reward.compact {
    font-size: 0.75em;
    margin-top: 4px;
    opacity: 0.7;
}

.achievement-card.compact .achievement-progress.compact {
    margin-top: 6px;
}

.achievement-card.compact .achievement-progress.compact .achievement-progress-bar {
    height: 4px;
    margin-bottom: 2px;
}

.achievement-card.compact .achievement-progress-text {
    font-size: 0.7em;
    opacity: 0.8;
}

.achievement-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 3px solid #e0e0e0;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.achievement-card.unlocked {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.achievement-card.unlocked::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 15px;
}

.achievement-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.achievement-card.unlocked .achievement-name {
    color: #764ba2;
}

.achievement-description {
    color: #666;
    font-size: 0.95em;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.5;
}

.achievement-progress {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.achievement-progress-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.achievement-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.achievement-card.unlocked .achievement-progress-fill {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
}

.achievement-reward {
    margin-top: 10px;
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
    text-align: center;
}

.achievement-card.unlocked .achievement-reward {
    color: #764ba2;
}

.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    min-width: 300px;
    border: 3px solid #ffd700;
}

.achievement-notification.show {
    transform: translateX(0);
}

.achievement-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-notification-icon {
    font-size: 3em;
}

.achievement-notification-text {
    flex: 1;
}

.achievement-notification-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.achievement-notification-name {
    font-size: 1em;
    color: #764ba2;
    font-weight: 600;
}

.streamer-profile-section {
    margin-bottom: 0;
}

.streamer-profile-header {
    margin-bottom: 30px;
}

.back-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #5568d3;
    transform: translateX(-3px);
}

.streamer-profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.streamer-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.streamer-profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3em;
    font-weight: bold;
    border: 5px solid white;
}

.streamer-profile-details {
    flex: 1;
}

.streamer-profile-name {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.streamer-profile-platform {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.streamer-profile-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.streamer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.streamer-stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    text-align: center;
}

.streamer-stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.streamer-stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.streamer-prediction-section {
    margin-bottom: 40px;
}

.streamer-prediction-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.streamer-prediction-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.streamer-viewer-suspicion-section {
    margin-bottom: 40px;
}

.streamer-viewer-suspicion-section h3 {
    color: #c0392b;
    margin-bottom: 16px;
    font-size: 1.45em;
    border-bottom: 2px solid rgba(192, 57, 43, 0.35);
    padding-bottom: 10px;
}

.streamer-viewer-suspicion-card {
    border-radius: 16px;
    padding: 22px 26px;
    background: #1e1e2e;
    color: #e8e8ef;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.streamer-viewer-suspicion-card .suspicion-score-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px 20px;
    margin-bottom: 14px;
}

.streamer-viewer-suspicion-card .suspicion-score {
    font-size: 2.1em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.streamer-viewer-suspicion-card .suspicion-level {
    font-size: 1.05em;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

.suspicion-level-none { background: rgba(46, 204, 113, 0.25); color: #2ecc71; }
.suspicion-level-low { background: rgba(241, 196, 15, 0.25); color: #f1c40f; }
.suspicion-level-medium { background: rgba(230, 126, 34, 0.28); color: #e67e22; }
.suspicion-level-high { background: rgba(231, 76, 60, 0.3); color: #e74c3c; }

.streamer-viewer-suspicion-card .suspicion-meta {
    font-size: 0.88em;
    opacity: 0.85;
    margin-bottom: 12px;
}

.streamer-viewer-suspicion-card .suspicion-reasons {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.55;
}

.streamer-viewer-suspicion-card .suspicion-reasons li {
    margin-bottom: 6px;
}

.streamer-viewer-suspicion-card .suspicion-disclaimer {
    margin-top: 16px;
    font-size: 0.82em;
    opacity: 0.75;
    line-height: 1.45;
}

.streamer-viewer-suspicion-card .suspicion-loading,
.streamer-viewer-suspicion-card .suspicion-error {
    opacity: 0.85;
    font-size: 0.95em;
}

.streamer-bot-suspicion-section {
    margin-bottom: 40px;
}

.streamer-bot-suspicion-section h3 {
    color: #ff5b5b;
    margin-bottom: 16px;
    font-size: 1.45em;
    border-bottom: 2px solid rgba(255, 91, 91, 0.35);
    padding-bottom: 10px;
}

.streamer-bot-suspicion-card {
    border-radius: 16px;
    padding: 22px 26px;
    background: #1e1e2e;
    color: #e8e8ef;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bot-suspicion-loading,
.bot-suspicion-error {
    opacity: 0.85;
    font-size: 0.95em;
}

.bot-suspicion-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 14px;
}

.bot-suspicion-main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: baseline;
}

.bot-suspicion-percent {
    font-size: 2.1em;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ff5b5b;
}

.bot-suspicion-counts {
    font-size: 0.92em;
    opacity: 0.85;
}

.bot-suspicion-meta {
    font-size: 0.88em;
    opacity: 0.85;
    margin-bottom: 12px;
}

.bot-suspicion-suspects {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.55;
}

.bot-suspicion-suspects li {
    margin-bottom: 6px;
}

.bot-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 91, 91, 0.18);
    border: 1px solid rgba(255, 91, 91, 0.35);
    color: #ffecec;
    font-size: 0.92em;
    font-weight: 600;
}

.prediction-no-data,
.prediction-streaming {
    text-align: center;
    padding: 40px 20px;
}

.prediction-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.prediction-text {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
}

.prediction-subtext {
    font-size: 0.9em;
    opacity: 0.8;
}

.prediction-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.prediction-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.prediction-date {
    flex: 1;
    min-width: 250px;
}

.prediction-day {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

.prediction-datetime {
    font-size: 1.3em;
    margin-bottom: 8px;
    opacity: 0.95;
}

.prediction-time-until {
    font-size: 1.1em;
    opacity: 0.85;
    font-style: italic;
}

.prediction-confidence {
    min-width: 200px;
}

.confidence-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.confidence-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.confidence-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.confidence-value {
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
}

.prediction-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.prediction-detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 0.85em;
    opacity: 0.8;
}

.detail-value {
    font-size: 1.1em;
    font-weight: 600;
}

.streamer-charts-section {
    margin-bottom: 40px;
}

.streamer-charts-section h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.streamer-charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.streamer-charts-container .chart-wrapper h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.streamer-achievements-section {
    margin-bottom: 40px;
}

.streamer-achievements-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.streamer-sessions-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.streamer-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.streamer-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.streamer-session-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.streamer-session-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

[data-theme="dark"] .streamer-session-item.selected {
    border-color: var(--accent-color);
    background: rgba(124, 138, 255, 0.15);
}

.session-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
    flex-shrink: 0;
    margin-right: 10px;
}

.streamer-session-item.short-session {
    opacity: 0.7;
    border-color: #f39c12;
    background: #fff9e6;
}

[data-theme="dark"] .streamer-session-item.short-session {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
}

.short-session-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: #f39c12;
    color: white;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    vertical-align: middle;
}

[data-theme="dark"] .short-session-badge {
    background: #f39c12;
    color: #1a1a2e;
}

.streamer-session-info {
    flex: 1;
}

.streamer-session-date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

[data-theme="dark"] .streamer-session-date {
    color: #e8e8ef;
}

.streamer-session-time {
    color: #666;
    font-size: 0.9em;
}

.streamer-session-duration {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.85em;
    min-width: auto;
}

.streamer-session-item .btn-small {
    margin-left: 10px;
    flex-shrink: 0;
}

.dashboard-section {
    margin-bottom: 40px;
}

.dashboard-table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.dashboard-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dashboard-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-table th:first-child {
    width: 60px;
    text-align: center;
}

.dashboard-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.dashboard-table tbody tr:hover {
    background-color: #f8f9fa;
}

.dashboard-table tbody tr:last-child {
    border-bottom: none;
}

.dashboard-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.dashboard-table .avatar-cell {
    text-align: center;
    padding: 8px;
}

.dashboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-avatar:hover {
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.dashboard-avatar.streaming {
    border-color: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
    animation: pulse-avatar 2s infinite;
}

@keyframes pulse-avatar {
    0%, 100% {
        box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(39, 174, 96, 0.8);
    }
}

.dashboard-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    border: 3px solid #e0e0e0;
}

.dashboard-name {
    font-weight: 600;
    color: #333;
    font-size: 1.05em;
}

.dashboard-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.dashboard-status.online {
    background: #d4edda;
    color: #155724;
}

.dashboard-status.offline {
    background: #f8d7da;
    color: #721c24;
}

.dashboard-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dashboard-status-indicator.online {
    background: #27ae60;
    box-shadow: 0 0 6px #27ae60;
}

.dashboard-status-indicator.offline {
    background: #95a5a6;
}

.dashboard-time {
    font-weight: 600;
    color: #667eea;
}

.dashboard-total-time {
    color: #666;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .input-group input,
    .input-group .btn {
        width: 100%;
    }

    .streamers-list {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tables-container {
        grid-template-columns: 1fr;
    }

    .stat-table {
        font-size: 0.9em;
    }

    .stat-table th,
    .stat-table td {
        padding: 8px 10px;
    }

    .dashboard-table {
        font-size: 0.85em;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 8px 10px;
    }

    .dashboard-avatar {
        width: 40px;
        height: 40px;
    }

    .dashboard-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
}

/* Календарь активности */
.activity-calendar-section {
    margin-bottom: 40px;
}

.calendar-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calendar-month-label {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 0.9em;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
}

.calendar-day:hover:not(.empty) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
    border-color: var(--accent-color);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: var(--accent-color);
}

.calendar-day.active .calendar-day-indicator {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
}

.calendar-day-number {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-primary);
}

.calendar-day.active .calendar-day-number {
    color: var(--accent-color);
    font-weight: 600;
}

/* Быстрые действия */
.quick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Топ стримеров */
.top-streamers-section {
    margin-bottom: 40px;
}

.top-streamers-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.top-tab-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.top-tab-btn:hover {
    border-color: var(--accent-color);
}

.top-tab-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.top-streamers-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-streamer-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.top-streamer-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.top-streamer-rank {
    font-size: 1.5em;
    min-width: 50px;
    text-align: center;
}

.top-streamer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.top-streamer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-streamer-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5em;
}

.top-streamer-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.top-streamer-value {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--accent-color);
}

/* Сравнение стримеров */
.compare-section {
    margin-bottom: 40px;
}

.compare-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.compare-results {
    margin-top: 20px;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
}

.compare-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

.compare-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.compare-header h3 {
    flex: 1;
    margin: 0;
    color: var(--text-primary);
}

.compare-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.compare-vs {
    font-size: 2em;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
}

.compare-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.compare-stat {
    text-align: center;
}

.compare-stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.compare-stat-value {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--accent-color);
}

/* Стили для модального окна скриншотов */
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.screenshot-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.screenshot-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.2s;
    user-select: none;
}

.screenshot-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.screenshot-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.screenshot-nav-btn-prev {
    left: 20px;
}

.screenshot-nav-btn-next {
    right: 20px;
}

.screenshot-nav-btn[style*="opacity: 0.3"] {
    cursor: not-allowed;
    pointer-events: none;
}

.screenshot-modal-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    cursor: default;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .screenshot-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .screenshot-nav-btn-prev {
        left: 10px;
    }
    
    .screenshot-nav-btn-next {
        right: 10px;
    }
}

/* Таблица лидеров по зрителям */
.leaders-section {
    margin-bottom: 40px;
    padding: 20px;
}

.period-selector-group {
    margin-bottom: 20px;
}

.period-selector-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.leaders-section .sort-controls {
    margin-top: 20px;
    margin-bottom: 20px;
}

.leaders-section .sort-checkbox-group {
    margin-top: 10px;
}

.leaders-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.leaders-table {
    margin-top: 20px;
    overflow-x: auto;
}

.leaders-table-content {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow);
}


.leaders-table-content th.highlight-column,
.leaders-table-content td.highlight-column {
    background: rgba(102, 126, 234, 0.3);
    font-weight: 600;
    color: var(--text-inverse);
    border-left: 3px solid var(--accent-color);
    border-right: 3px solid var(--accent-color);
}

.leaders-table-content th.highlight-column {
    background: rgba(102, 126, 234, 0.5);
    color: var(--text-inverse);
    border-bottom: 2px solid var(--accent-color);
}

.leaders-table-content tbody tr:hover td.highlight-column {
    background: rgba(102, 126, 234, 0.4);
    color: var(--text-inverse);
}

/* Для темной темы - более яркое выделение */
[data-theme="dark"] .leaders-table-content th.highlight-column,
[data-theme="dark"] .leaders-table-content td.highlight-column {
    background: rgba(124, 138, 255, 0.4);
    color: var(--text-inverse);
}

[data-theme="dark"] .leaders-table-content th.highlight-column {
    background: rgba(124, 138, 255, 0.6);
}

[data-theme="dark"] .leaders-table-content tbody tr:hover td.highlight-column {
    background: rgba(124, 138, 255, 0.5);
}


.leaders-table-content thead {
    background: var(--bg-primary);
    color: var(--text-inverse);
}

.leaders-table-content th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
}

.leaders-table-content tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.leaders-table-content tbody tr:hover {
    background: var(--bg-tertiary);
}

.leaders-table-content tbody tr:last-child {
    border-bottom: none;
}

.leaders-table-content td {
    padding: 15px;
    color: var(--text-primary);
}

.leaders-table-content .rank {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--accent-color);
    text-align: center;
    width: 60px;
}

.leaders-table-content .streamer-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 10px;
}


.leaders-table-content .primary-stat {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--accent-color);
}

.leaders-table-content .secondary-stat {
    color: var(--text-secondary);
}

.leaders-table-content .sessions-count {
    text-align: center;
    color: var(--text-secondary);
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 30px;
    overflow-y: auto;
}

/* Карточка автоархива по центру экрана */
.inactive-archive-modal {
    z-index: 10050;
    background: rgba(15, 18, 28, 0.55);
    backdrop-filter: blur(4px);
}

.inactive-archive-card {
    max-width: 420px;
    width: min(92vw, 420px);
    border-radius: 22px;
    overflow: hidden;
    animation: inactiveArchivePop 0.28s ease;
}

@keyframes inactiveArchivePop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.inactive-archive-card-body {
    padding: 28px 28px 24px;
    text-align: center;
}

.inactive-archive-avatar-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    position: relative;
}

.inactive-archive-avatar,
.inactive-archive-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.inactive-archive-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(145deg, #4a5568, #2d3748);
    color: #fff;
}

.inactive-archive-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.inactive-archive-status {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 10px;
}

.inactive-archive-hint {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin: 0 0 22px;
    line-height: 1.45;
}

.inactive-archive-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.inactive-archive-actions .btn {
    min-width: 120px;
    padding: 10px 18px;
    font-weight: 600;
}

.inactive-archive-progress {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-height: 1.2em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-entry {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.history-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-message {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.history-time {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Стили для формы добавления стрима */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Стили для страницы баллов */
.points-section {
    max-width: 1400px;
    margin: 0 auto;
}

.points-controls {
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.points-controls .control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.points-controls label {
    font-weight: 600;
    color: var(--text-primary);
}

.points-controls .analytics-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.points-controls .analytics-select:hover {
    border-color: var(--accent-color);
}

.points-controls .analytics-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.points-summary {
    margin-bottom: 40px;
}

.points-summary h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5em;
}

.points-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
}

.points-table thead {
    background: var(--accent-color);
    color: var(--text-inverse);
}

.points-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
}

.points-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.points-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.points-table tbody tr:last-child {
    border-bottom: none;
}

.points-table td {
    padding: 16px;
    color: var(--text-primary);
}

.points-table .rank-col {
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.points-table .points-col {
    width: 150px;
    text-align: center;
    font-size: 1.2em;
    color: var(--accent-color);
}

.points-table .sessions-col {
    width: 120px;
    text-align: center;
}

.points-table .rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.1em;
}

.points-table .rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.points-table .rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.points-table .rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a55d 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.points-details {
    margin-top: 40px;
}

.points-details h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5em;
}

.points-recent-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 24px;
    margin-bottom: 16px;
}

.points-recent-controls .analytics-select {
    min-width: 220px;
    max-width: 100%;
}

.points-streamer-filter-summary {
    color: var(--text-secondary);
    font-size: 0.95em;
    padding-bottom: 6px;
}

.points-recent-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.points-recent-page-label {
    color: var(--text-secondary);
    font-size: 0.95em;
    min-width: 10em;
    text-align: center;
}

.points-streamer-name-link,
.recent-stream-streamer-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: var(--accent-color);
    cursor: pointer;
    text-align: left;
}

.points-streamer-name-link:hover,
.recent-stream-streamer-link:hover {
    text-decoration: underline;
}

.recent-stream-streamer-link {
    font-size: 1.2em;
    color: var(--text-primary);
}

.recent-stream-streamer-link:hover {
    color: var(--accent-color);
}

.content-creator-add {
    margin-bottom: 20px;
}

.content-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.content-form-wrap {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.content-form-wrap h3 {
    margin-bottom: 14px;
    color: var(--text-primary);
}

.content-rubric {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.92em;
    display: grid;
    gap: 6px;
}

.content-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.content-video-url-group {
    grid-column: 1 / -1;
}

.content-submit-group {
    align-self: end;
}

.recent-streams-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.recent-stream-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recent-stream-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

.recent-stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.recent-stream-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.recent-stream-suspicion-badge {
    flex-shrink: 0;
    line-height: 1;
    font-size: 1.15em;
}

.session-suspicion-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35em;
    color: #27ae60;
    font-weight: 800;
}

.session-suspicion-mid,
.session-suspicion-high {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.88em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    cursor: default;
}

.session-suspicion-mid {
    color: #c96500;
    background: rgba(230, 126, 34, 0.18);
}

.session-suspicion-high {
    color: #c0392b;
    background: rgba(231, 76, 60, 0.2);
}

.session-suspicion-sym {
    font-weight: 900;
}

.streamer-session-suspicion-inline {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    line-height: 1;
}

.recent-stream-streamer {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

.recent-stream-points {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--accent-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 6px 12px;
    border-radius: 8px;
}

.recent-stream-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-stream-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.recent-stream-detail .detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.recent-stream-detail .detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.webcam-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.webcam-checkbox-label:hover {
    color: var(--accent-color);
}

.webcam-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.recent-stream-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Стили для модального окна деталей баллов */
.points-details-info {
    padding: 20px 0;
}

.points-details-streamer,
.points-details-date {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--text-primary);
}

.points-details-breakdown {
    margin-top: 20px;
}

.points-details-breakdown h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.2em;
}

.archive-hint {
    margin: 0 0 16px;
    color: var(--text-secondary, #666);
    font-size: 0.95em;
    line-height: 1.4;
}

.archive-subname {
    font-size: 0.85em;
    color: var(--text-secondary, #888);
    margin-top: 2px;
}

.points-viewers-chart-wrap {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.points-viewers-chart-wrap h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1.15em;
}

.points-viewers-chart-status {
    font-size: 0.9em;
    color: var(--text-secondary, #666);
    margin-bottom: 10px;
}

.points-viewers-chart-box {
    position: relative;
    height: 280px;
    width: 100%;
}

.suspicious-follower-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    width: min(920px, calc(100vw - 24px));
    pointer-events: none;
}

.suspicious-follower-banner-inner {
    pointer-events: auto;
    background: #fff8eb;
    border: 1px solid #f0c36d;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 12px 14px 10px;
    color: #5c3d0a;
}

.suspicious-follower-banner-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.suspicious-follower-banner-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh;
    overflow: auto;
}

.suspicious-follower-alert-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.suspicious-follower-alert-text {
    flex: 1 1 240px;
    font-size: 0.95em;
    line-height: 1.35;
}

.suspicious-follower-alert-meta {
    color: #7a5a20;
    font-size: 0.9em;
}

.suspicious-follower-alert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suspicious-follower-banner-close {
    margin-top: 8px;
}

.follower-growth-alerts {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(42vh, 380px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.follower-growth-alerts-head {
    flex: 0 0 auto;
    margin-top: 10px;
}

.follower-growth-modal-content {
    max-height: 92vh !important;
}

.follower-growth-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 8px 20px 16px;
}

.follower-growth-modal-body .points-viewers-chart-wrap {
    flex: 0 0 auto;
}

.follower-growth-modal-body .follower-growth-alerts {
    flex: 1 1 auto;
    min-height: 140px;
}

.follower-growth-note {
    margin: 0 0 6px;
    color: var(--text-secondary, #666);
    font-size: 0.95em;
}

.follower-growth-btn {
    margin-left: 8px;
}

.followers-rejected {
    color: #b45309;
    font-weight: 600;
    white-space: nowrap;
}

.points-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.points-breakdown-item:last-child {
    border-bottom: none;
}

.points-label {
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.points-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.points-value.points-yes {
    color: var(--success-color);
}

.points-value.points-no {
    color: var(--text-secondary);
}

.points-breakdown-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--accent-color);
    font-size: 1.3em;
    text-align: center;
    color: var(--accent-color);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .recent-streams-list {
        grid-template-columns: 1fr;
    }
    
    .points-table {
        font-size: 0.9em;
    }
    
    .points-table th,
    .points-table td {
        padding: 12px 8px;
    }
    
    .recent-stream-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .recent-stream-points {
        font-size: 1.1em;
    }

    .content-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Стили для страницы тестирования рейтинга */
.rating-test-section {
    padding: 20px;
}

.rating-test-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.rating-test-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-test-controls label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
}

.rating-test-info {
    margin-bottom: 30px;
}

.info-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 20px;
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.variant-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.variant-description code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
}

.rating-test-table {
    margin-bottom: 40px;
}

.rating-test-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
}

.rating-test-table thead {
    background: var(--accent-color);
    color: var(--text-inverse);
}

.rating-test-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.rating-test-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.rating-test-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.rating-test-table tbody tr:last-child {
    border-bottom: none;
}

.rating-test-table td {
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9em;
}

.rating-test-table .rank-col {
    width: 60px;
    text-align: center;
}

.rating-test-table .rating-col {
    width: 180px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-color);
}

.rating-test-table .avg-points-col {
    width: 120px;
    text-align: center;
}

.rating-test-table .sessions-col {
    width: 100px;
    text-align: center;
}

.rating-test-table .total-points-col {
    width: 120px;
    text-align: center;
}

.rating-test-table .followers-col {
    width: 120px;
    text-align: center;
}

.rating-test-table .details-col {
    width: 120px;
    text-align: center;
    font-size: 0.85em;
}

.rating-test-comparison {
    margin-top: 40px;
}

.rating-test-comparison h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.comparison-table {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    padding: 12px;
    text-align: left;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.comparison-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.comparison-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Адаптивность для тестовой страницы */
@media (max-width: 768px) {
    .rating-test-controls {
        flex-direction: column;
    }
    
    .rating-test-table {
        overflow-x: auto;
    }
    
    .rating-test-table table {
        min-width: 800px;
    }
    
    .comparison-table {
        overflow-x: auto;
    }
    
    .comparison-table table {
        min-width: 600px;
    }
}

/* История эфира (онлайн/оффлайн) */
.activity-history-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.activity-history-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.activity-history-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.activity-history-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.activity-history-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-history-item:last-child {
    border-bottom: none;
}

.activity-history-item .activity-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-right: 8px;
}

.activity-history-status {
    font-size: 0.85rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1.2;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-success {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.12);
    color: rgba(46, 204, 113, 0.95);
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recording-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.recording-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.recording-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.recording-card-actions {
    display: flex;
    gap: 8px;
}

.recording-segments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 960px;
}

.recording-segment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.85rem;
}



/* Manual per-stream project requirements. */
.session-requirements { margin-top: 0.65rem; min-width: 0; }
.session-requirements-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; }
.session-requirements-controls label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.session-requirements-controls input { width: 16px; height: 16px; }
.session-links-result { font-size: 0.85rem; margin-top: 0.5rem; overflow-wrap: anywhere; }
.session-links-result summary { cursor: pointer; }
.session-links-result ul { margin: 0.5rem 0; padding-left: 1.3rem; }
.session-links-result p { margin: 0.4rem 0; }
.recent-stream-details > .session-requirements { grid-column: 1 / -1; }

.last-reviewed-stream { outline: 3px solid #e5a50a; outline-offset: 3px; }
.last-review-badge { display: inline-block; background: #ffdf80; color: #3c2a00; padding: 5px 10px; border-radius: 6px; font-weight: 700; margin: 4px 8px 8px 0; }
.last-review-bookmark { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; margin: 12px 0; border: 2px solid #e5a50a; border-radius: 10px; }
.last-review-bookmark[hidden] { display: none; }
