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

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #0a0a15;
    color: #fff;
    min-height: 100vh;
}

/* ========== СТРАНИЦА ВХОДА ========== */
body:not(.admin-body) {
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('assets/bg.jpg') center/cover no-repeat fixed;
    overflow: hidden;
}
body:not(.admin-body)::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.girl {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: auto;
    z-index: 2;
    pointer-events: none;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.6));
}
@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-15px); }
}

.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 45px 40px;
    background: rgba(20, 15, 35, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 105, 180, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 105, 180, 0.2);
    animation: fadeIn 0.8s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card h1 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ff69b4, #b06bff, #7c5cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-card .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 35px;
}

.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.input-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}
.input-group input:focus {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.1);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
}

.login-btn {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: linear-gradient(90deg, #ff69b4, #b06bff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.4);
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.6);
}

.error {
    color: #ff4d6d;
    text-align: center;
    font-size: 14px;
    margin-top: 15px;
    min-height: 20px;
}

/* ========== АДМИН-ПАНЕЛЬ ========== */
.admin-body {
    display: flex;
    background: #0d0d1a;
}
.admin-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(15, 15, 30, 0.95);
    border-right: 1px solid rgba(124, 92, 255, 0.2);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}
.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-header h2 {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #7c5cff, #b06bff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-header span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    cursor: pointer;
}
.nav-item:hover {
    background: rgba(124, 92, 255, 0.1);
    color: #fff;
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.2), rgba(176, 107, 255, 0.1));
    color: #fff;
    border-left: 3px solid #7c5cff;
}
.nav-item .icon { font-size: 20px; }

.sidebar-footer {
    padding: 20px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.logout-btn {
    display: block;
    padding: 12px 16px;
    color: #ff4d6d;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    text-align: center;
}
.logout-btn:hover {
    background: rgba(255, 77, 109, 0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d1a;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: rgba(15, 15, 30, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}
.top-bar h1 {
    font-size: 26px;
    font-weight: 700;
}
.settings-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.settings-btn:hover {
    background: rgba(124, 92, 255, 0.2);
    border-color: #7c5cff;
    transform: rotate(90deg);
}

.content {
    flex: 1;
    padding: 32px;
}

.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    transition: all 0.3s;
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 92, 255, 0.5);
}
.stat-icon { font-size: 40px; }
.stat-info h3 {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-info p {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #7c5cff, #b06bff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-tab {
    text-align: center;
    padding: 80px 20px;
    opacity: 0.7;
}
.empty-tab .empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}
.empty-tab h2 {
    font-size: 28px;
    margin-bottom: 10px;
}
.empty-tab p { font-size: 16px; }

#logOutput {
    background: rgba(0, 0, 0, 0.4);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #b06bff;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Модалка */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: rgba(20, 15, 35, 0.98);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(124, 92, 255, 0.3);
    max-width: 440px;
    width: 90%;
    animation: fadeIn 0.3s ease;
}
.modal-content h2 {
    margin-bottom: 25px;
    font-size: 24px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.btn-primary {
    flex: 1;
    padding: 14px;
    background: linear-gradient(90deg, #7c5cff, #b06bff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124, 92, 255, 0.5);
}
.btn-secondary {
    flex: 1;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar-header h2, .sidebar-header span { display: none; }
    .nav-item span:not(.icon) { display: none; }
    .nav-item { justify-content: center; }
    .girl { width: 180px; }
    .login-card { padding: 30px 24px; margin: 20px; }
    .content { padding: 20px; }
    .top-bar { padding: 16px 20px; }
    .top-bar h1 { font-size: 20px; }
}
/* ========== ЧАТЫ ========== */
.chats-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
}
.chats-list {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow-y: auto;
    padding: 10px;
}
.chat-item {
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}
.chat-item:hover { background: rgba(124, 92, 255, 0.1); }
.chat-item.active {
    background: rgba(124, 92, 255, 0.2);
    border-color: rgba(124, 92, 255, 0.5);
}
.chat-item .name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    color: #fff;
}
.chat-item .username {
    font-size: 12px;
    color: #b06bff;
    margin-bottom: 6px;
}
.chat-item .preview {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-item .time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.chat-view {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-view .empty-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.5;
    font-size: 16px;
}
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 30, 0.6);
}
.chat-header h3 { font-size: 18px; margin-bottom: 4px; }
.chat-header p { font-size: 13px; color: #b06bff; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-msg.user {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.chat-msg.bot {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.4), rgba(176, 107, 255, 0.3));
    color: #fff;
}
.chat-msg .msg-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 6px;
    display: block;
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 30, 0.6);
}
.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    outline: none;
}
.chat-input input:focus { border-color: #7c5cff; }
.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(90deg, #7c5cff, #b06bff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.chat-input button:hover { transform: translateY(-2px); }

/* ========== УПРАВЛЕНИЕ БОТОМ ========== */
.bot-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.action-btn {
    padding: 12px 24px;
    background: linear-gradient(90deg, #7c5cff, #b06bff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(124, 92, 255, 0.5); }

.users-table-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.users-table th {
    background: rgba(15, 15, 30, 0.8);
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.users-table tr:hover { background: rgba(124, 92, 255, 0.05); }
.users-table .btn-sm {
    padding: 6px 12px;
    margin: 2px;
    background: rgba(124, 92, 255, 0.2);
    border: 1px solid rgba(124, 92, 255, 0.4);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.users-table .btn-sm:hover { background: rgba(124, 92, 255, 0.4); }
.users-table .btn-sm.danger {
    background: rgba(255, 77, 109, 0.2);
    border-color: rgba(255, 77, 109, 0.4);
}
.users-table .btn-sm.success {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.4);
}
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}
.badge.active { background: rgba(0, 255, 136, 0.2); color: #00ff88; }
.badge.blocked { background: rgba(255, 77, 109, 0.2); color: #ff4d6d; }

/* ========== ЛОГИ ========== */
.logs-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}
.log-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}
.log-tab.active { background: linear-gradient(90deg, #7c5cff, #b06bff); border-color: transparent; }
.log-refresh {
    margin-left: auto;
    padding: 10px 20px;
    background: rgba(124, 92, 255, 0.2);
    border: 1px solid rgba(124, 92, 255, 0.4);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
}

.log-output {
    background: rgba(0, 0, 0, 0.5);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #b06bff;
    height: calc(100vh - 280px);
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* ========== SIDEBAR FOOTER ========== */
.restart-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 200, 0, 0.15);
    border: 1px solid rgba(255, 200, 0, 0.4);
    border-radius: 12px;
    color: #ffc800;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}
.restart-btn:hover { background: rgba(255, 200, 0, 0.25); }

.loading { padding: 20px; text-align: center; opacity: 0.5; }

@media (max-width: 900px) {
    .chats-layout { grid-template-columns: 1fr; }
    .chat-view { display: none; }
    .chat-view.mobile-active { display: flex; }
}
