* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
    min-height: 100vh;
}

.navbar {
    background: #1e1e2e;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #313244;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #89b4fa;
}

.logo span {
    color: #f38ba8;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #cdd6f4;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-links a:hover, .nav-links a.active {
    background: #313244;
    color: #89b4fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.status-bar {
    background: #1e1e2e;
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-left: 4px solid #a6e3a1;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 10px;
}

.online-dot {
    width: 12px;
    height: 12px;
    background: #a6e3a1;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.2); }
}

.refresh-btn {
    background: #89b4fa;
    color: #1e1e2e;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: #b4befe;
    transform: scale(1.02);
}

.logout-btn {
    background: #f38ba8;
    color: #1e1e2e;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1e1e2e;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid #313244;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #89b4fa;
}

.stat-card .value {
    font-size: 32px;
    font-weight: bold;
    color: #89b4fa;
}

.stat-card .label {
    font-size: 13px;
    color: #a6adc8;
    margin-top: 10px;
}

.stat-card .icon {
    font-size: 35px;
    margin-bottom: 10px;
}

.section {
    background: #1e1e2e;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #313244;
}

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #89b4fa;
    display: flex;
    align-items: center;
    gap: 10px;
}

.commands-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.command-item {
    background: #313244;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: monospace;
    font-size: 13px;
    transition: all 0.3s;
}

.command-item:hover {
    background: #89b4fa;
    color: #1e1e2e;
}

.ticket-item {
    background: #313244;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ticket-info {
    flex: 1;
}

.ticket-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.ticket-creator {
    font-size: 12px;
    color: #a6adc8;
}

.ticket-priority {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.priority-high { background: #f38ba8; color: #1e1e2e; }
.priority-medium { background: #fab387; color: #1e1e2e; }
.priority-low { background: #a6e3a1; color: #1e1e2e; }

.control-btn {
    background: #89b4fa;
    color: #1e1e2e;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.control-btn:hover {
    background: #b4befe;
}

.control-btn.danger {
    background: #f38ba8;
}

.control-btn.danger:hover {
    opacity: 0.8;
}

.priority-select {
    background: #313244;
    color: #cdd6f4;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
}

.ticket-chat {
    background: #1e1e2e;
    border-radius: 15px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.message {
    background: #313244;
    border-radius: 10px;
    padding: 10px 15px;
    max-width: 80%;
    margin-bottom: 10px;
}

.message-self {
    background: #89b4fa;
    color: #1e1e2e;
    margin-left: auto;
}

.message-bot {
    background: #45475a;
    border-left: 3px solid #89b4fa;
}

.message-system {
    background: #45475a;
    text-align: center;
    max-width: 100%;
    font-style: italic;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.message-author {
    font-weight: bold;
    color: #89b4fa;
}

.message-self .message-author {
    color: #1e1e2e;
}

.ticket-send {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.ticket-send input {
    flex: 1;
    background: #313244;
    border: none;
    padding: 12px;
    border-radius: 10px;
    color: #cdd6f4;
}

.ticket-send input:focus {
    outline: none;
    border: 1px solid #89b4fa;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #6c7086;
    font-size: 12px;
    border-top: 1px solid #313244;
    margin-top: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#adminPage {
    display: none !important;
}

#adminPage.active {
    display: block !important;
}

#developerPage {
    display: none !important;
}

#developerPage.active {
    display: block !important;
}

.role-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.role-badge.user { background: #313244; color: #cdd6f4; }
.role-badge.moderator { background: #fab387; color: #1e1e2e; }
.role-badge.admin { background: #f38ba8; color: #1e1e2e; }
.role-badge.developer { background: #cba6f7; color: #1e1e2e; }

.tab-btn {
    background: #313244;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    color: #cdd6f4;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #89b4fa;
    color: #1e1e2e;
}

.tab-btn:hover {
    transform: scale(1.02);
}

.server-selector {
    background: #1e1e2e;
    border-radius: 12px;
    padding: 10px 15px;
    border: 1px solid #313244;
    min-width: 280px;
}

.server-selector-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-icon {
    font-size: 20px;
}

.guild-select-wrapper {
    position: relative;
    flex: 1;
}

.guild-select {
    background: #313244;
    color: #cdd6f4;
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2389b4fa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.3s;
}

.guild-select:hover {
    background-color: #45475a;
}

.guild-select:focus {
    outline: none;
    border-color: #89b4fa;
    box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.2);
}

.guild-select option {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 10px;
}

.refresh-btn-small {
    background: #313244;
    color: #89b4fa;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn-small:hover {
    background: #45475a;
    transform: rotate(90deg);
}

.server-stats {
    background: #313244;
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    font-size: 12px;
}

.server-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.server-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #45475a;
}

.server-stat-label {
    color: #a6adc8;
}

.server-stat-value {
    font-weight: bold;
    color: #89b4fa;
}

.permission-badge {
    background: #45475a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 5px;
}

.permission-badge.admin {
    background: #f38ba8;
    color: #1e1e2e;
}

.permission-badge.manage {
    background: #fab387;
    color: #1e1e2e;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #313244;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

.role-name.user { color: #cdd6f4; }
.role-name.moderator { color: #fab387; }
.role-name.admin { color: #f38ba8; }
.role-name.developer { color: #cba6f7; }

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ticket-item {
        flex-direction: column;
        text-align: center;
    }
    .message {
        max-width: 95%;
    }
    .server-stats-grid {
        grid-template-columns: 1fr;
    }
    .server-selector {
        min-width: 100%;
    }
    .status-bar {
        flex-direction: column;
        align-items: stretch;
    }
}
/* ========== УВЕДОМЛЕНИЯ ========== */
.notifications-container {
    position: relative;
    display: inline-block;
}

.notifications-btn {
    background: #313244;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    transition: all 0.3s;
}

.notifications-btn:hover {
    background: #45475a;
}

.notifications-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f38ba8;
    color: #1e1e2e;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 400px;
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #313244;
    border-bottom: 1px solid #45475a;
    font-weight: bold;
}

.clear-btn {
    background: none;
    border: none;
    color: #f38ba8;
    cursor: pointer;
    font-size: 12px;
}

.clear-btn:hover {
    text-decoration: underline;
}

.notifications-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #313244;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #313244;
}

.notification-item.unread {
    background: #45475a;
    border-left: 3px solid #89b4fa;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #89b4fa;
}

.notification-message {
    font-size: 13px;
    color: #cdd6f4;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 11px;
    color: #6c7086;
}

.notification-empty {
    padding: 20px;
    text-align: center;
    color: #6c7086;
}

/* Назначенный модератор в тикете */
.ticket-assigned {
    font-size: 11px;
    color: #a6e3a1;
    margin-top: 5px;
}

.ticket-assigned.unassigned {
    color: #f38ba8;
}
/* Для списков модераторов */
#activeModeratorsList .ticket-item,
#excludedModeratorsList .ticket-item {
    margin-bottom: 8px;
}

#activeModeratorsList .control-btn,
#excludedModeratorsList .control-btn {
    padding: 5px 10px;
    font-size: 12px;
}