/* ============================================
   БОКОВАЯ ПАНЕЛЬ АДМИНА / МОДЕРАТОРА
   ============================================ */

/* ===== КНОПКА В ШАПКЕ ===== */
.panel-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}

.panel-btn-admin {
    background: linear-gradient(135deg, rgba(224, 90, 43, 0.15), rgba(255, 118, 67, 0.1));
    color: var(--accent);
    border-color: rgba(224, 90, 43, 0.5);
    box-shadow: 0 0 0 0 var(--accent-glow);
}

.panel-btn-admin:hover {
    background: linear-gradient(135deg, rgba(224, 90, 43, 0.25), rgba(255, 118, 67, 0.2));
    border-color: var(--accent);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-2px);
}

.panel-btn-moderator {
    background: linear-gradient(135deg, rgba(102, 192, 244, 0.15), rgba(102, 192, 244, 0.1));
    color: var(--steam);
    border-color: rgba(102, 192, 244, 0.5);
}

.panel-btn-moderator:hover {
    background: linear-gradient(135deg, rgba(102, 192, 244, 0.25), rgba(102, 192, 244, 0.2));
    border-color: var(--steam);
    box-shadow: 0 4px 20px var(--steam-glow);
    transform: translateY(-2px);
}

/* ===== OVERLAY (затемнение фона) ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ===== БОКОВАЯ ПАНЕЛЬ ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 360px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

html[data-theme="light"] .sidebar {
    background: #ffffff;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.15);
}

.sidebar.open {
    transform: translateX(0);
}

/* ===== ЗАГОЛОВОК ПАНЕЛИ ===== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(224, 90, 43, 0.05), transparent);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-family: inherit;
    padding: 0;
}

html[data-theme="light"] .sidebar-close {
    background: rgba(0, 0, 0, 0.04);
}

.sidebar-close:hover {
    background: rgba(240, 71, 71, 0.15);
    border-color: rgba(240, 71, 71, 0.5);
    color: var(--red);
    transform: rotate(90deg);
}

/* ===== КАТЕГОРИИ ===== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 8px;
    flex: 1;
}

.sidebar-item {
    display: block;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-20px);
}

.sidebar.open .sidebar-item {
    animation: sidebarItemIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.sidebar.open .sidebar-item:nth-child(1) { animation-delay: 0.05s; }
.sidebar.open .sidebar-item:nth-child(2) { animation-delay: 0.1s; }
.sidebar.open .sidebar-item:nth-child(3) { animation-delay: 0.15s; }
.sidebar.open .sidebar-item:nth-child(4) { animation-delay: 0.2s; }
.sidebar.open .sidebar-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes sidebarItemIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.sidebar-item:hover::before {
    transform: scaleY(1);
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(224, 90, 43, 0.4);
    transform: translateX(4px);
}

html[data-theme="light"] .sidebar-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.sidebar-item-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text);
}

.sidebar-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== ПОДВАЛ ПАНЕЛИ ===== */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .sidebar-footer {
    background: rgba(0, 0, 0, 0.02);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .panel-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .panel-btn-admin,
    .panel-btn-moderator {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar {
        width: 320px;
    }
}

@media (max-width: 480px) {
    .panel-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .sidebar {
        width: 100vw;
        max-width: 100vw;
    }

    .sidebar-header {
        padding: 20px;
    }

    .sidebar-nav {
        padding: 12px;
    }
}

/* ============================================
   RCON ПАНЕЛЬ (НЕ ТРОГАЕМ, ОСТАВЛЯЕМ КАК БЫЛО)
   ============================================ */

.rcon-page {
    max-width: 1200px;
    margin: 0 auto;
}

.rcon-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 12px;
    vertical-align: middle;
}

.rcon-status-ok {
    background: rgba(67, 181, 129, 0.2);
    color: var(--green);
    border: 1px solid rgba(67, 181, 129, 0.4);
}

.rcon-status-error {
    background: rgba(240, 71, 71, 0.2);
    color: var(--red);
    border: 1px solid rgba(240, 71, 71, 0.4);
}

.rcon-status-checking {
    background: rgba(250, 166, 26, 0.2);
    color: var(--yellow);
    border: 1px solid rgba(250, 166, 26, 0.4);
}

.rcon-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.rcon-live-section {
    background: #0a0e14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.rcon-live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.rcon-live-controls {
    display: flex;
    gap: 8px;
}

.rcon-live-output {
    height: 400px;
    overflow-y: auto;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.rcon-live-placeholder {
    color: var(--text-dim);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.rcon-live-line {
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    display: flex;
    gap: 10px;
}

.rcon-live-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rcon-live-time {
    color: var(--text-dim);
    flex-shrink: 0;
    font-size: 11px;
}

.rcon-live-text {
    word-break: break-word;
}

.rcon-live-system { color: var(--steam); }
.rcon-live-chat { color: var(--green); }
.rcon-live-player { color: var(--yellow); }
.rcon-live-error { color: var(--red); }
.rcon-live-log { color: var(--text-muted); }

.rcon-command-section {
    margin-bottom: 32px;
}

.rcon-command-form {
    margin-bottom: 16px;
}

.rcon-command-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.rcon-command-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.rcon-prompt {
    padding: 0 12px;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

#rcon-command-input {
    flex: 1;
    padding: 14px 8px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.rcon-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.rcon-btn-execute {
    background: var(--gradient-accent);
    color: white;
    border-color: transparent;
    margin: 6px;
    border-radius: 8px;
}

.rcon-btn-execute:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.rcon-btn-toggle {
    background: rgba(67, 181, 129, 0.15);
    color: var(--green);
    border-color: rgba(67, 181, 129, 0.5);
}

.rcon-btn-toggle:hover, .rcon-btn-toggle.active {
    background: rgba(67, 181, 129, 0.3);
    border-color: var(--green);
}

.rcon-btn-clear {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: var(--border);
}

.rcon-btn-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.rcon-command-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rcon-result-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.rcon-result-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-muted);
}

.rcon-result-time {
    font-size: 12px;
    color: var(--text-dim);
}

.rcon-result-text {
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
}

.rcon-result-text.success { color: var(--green); }
.rcon-result-text.error { color: var(--red); }

.rcon-quick-section {
    margin-bottom: 32px;
}

.rcon-quick-category {
    margin-bottom: 20px;
}

.rcon-quick-cat-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.rcon-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.rcon-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
}

.rcon-quick-btn:hover {
    border-color: var(--border-hover);
    background: rgba(224, 90, 43, 0.08);
    transform: translateY(-2px);
}

.rcon-quick-label {
    font-weight: 600;
    font-size: 14px;
}

.rcon-quick-desc {
    font-size: 12px;
    color: var(--text-dim);
}

.rcon-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.rcon-help-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
}

.rcon-help-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rcon-help-card code {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--steam);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rcon-help-card code:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .rcon-live-output {
        height: 250px;
        font-size: 12px;
    }

    .rcon-live-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .rcon-live-controls {
        justify-content: flex-end;
    }

    .rcon-command-input-wrap {
        flex-wrap: wrap;
    }

    .rcon-btn-execute {
        width: 100%;
        margin: 6px;
    }

    .rcon-quick-grid {
        grid-template-columns: 1fr;
    }
}