:root {
    --bg-servers: #1e1f22;
    --bg-channels: #2b2d31;
    --bg-chat: #313338;
    --bg-members: #2b2d31;
    --text-primary: #dbdee1;
    --text-muted: #949ba4;
    --blurple: #5865f2;
    --hover: #35373c;
    --active: #3f4147;
    --separator: rgba(255,255,255,0.1);
    --separator-soft: rgba(255,255,255,0.05);
}

[data-theme="light"] {
    --bg-servers: #e3e5e8;
    --bg-channels: #f2f3f5;
    --bg-chat: #ffffff;
    --bg-members: #f2f3f5;
    --text-primary: #313338;
    --text-muted: #5c5e66;
    --hover: #e8e9eb;
    --active: #dbdee1;
    --separator: rgba(0,0,0,0.2);
    --separator-soft: rgba(0,0,0,0.1);
}

[data-theme="light"] .modal-content label:not(.btn) {
    color: var(--text-primary);
}

[data-theme="light"] .modal-content .fw-bold {
    color: var(--text-primary);
}

[data-theme="light"] .modal-content .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="light"] .bg-dark {
    background-color: #ebedef !important;
}

[data-theme="light"] .text-white {
    color: #313338 !important;
}

[data-theme="light"] .btn-outline-light {
    color: #313338;
    border-color: #dbdee1;
}

[data-theme="light"] .btn-outline-light:hover {
    background-color: #ebedef;
    color: #313338;
}

[data-theme="light"] .list-group-item.bg-dark {
    background-color: #ffffff !important;
    color: #313338 !important;
}

[data-theme="light"] .nav-link.text-white {
    color: #313338 !important;
}

[data-theme="light"] .nav-link.text-white.active {
    color: var(--blurple) !important;
}

[data-theme="light"] .btn-outline-secondary {
    color: #5c5e66;
    border-color: #dbdee1;
}

[data-theme="light"] .btn-outline-secondary:hover {
    background-color: #f2f3f5;
    color: #313338;
    border-color: #c7ccd1;
}

[data-theme="dark"] .btn-outline-secondary {
    color: #b5bac1;
    border-color: #4e5058;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #4e5058;
    color: #ffffff;
}

[data-theme="light"] .btn-check:checked + .btn-outline-secondary {
    background-color: var(--blurple) !important;
    border-color: var(--blurple) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-check:checked + .btn-outline-secondary {
    background-color: var(--blurple) !important;
    border-color: var(--blurple) !important;
    color: #ffffff !important;
}

[data-theme="light"] .voice-controls {
    background-color: #ebedef !important;
    border-top: 1px solid rgba(0,0,0,0.05);
}

[data-theme="light"] .reaction-badge {
    background-color: #f2f3f5;
    border-color: #dbdee1;
}

[data-theme="light"] .reaction-badge:hover {
    background-color: #e3e5e8;
}

[data-theme="light"] .emoji-picker {
    background-color: #ffffff;
    border-color: #dbdee1;
}

[data-theme="light"] .emoji-picker span:hover {
    background-color: #f2f3f5;
}

[data-theme="light"] .message-img-preview {
    background-color: #f2f3f5;
}

[data-theme="light"] .user-info:hover {
    background-color: #e3e5e8;
}

[data-theme="light"] .channels-header, [data-theme="light"] .chat-header {
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

[data-theme="light"] .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #dbdee1;
}

[data-theme="light"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #c7ccd1;
}

[data-theme="light"] .perm-tri-state {
    background-color: #e3e5e8;
}

[data-theme="light"] .perm-tri-state .btn {
    color: #5c5e66;
}

[data-theme="light"] .perm-tri-state .btn:hover {
    background-color: #dbdee1;
}

[data-theme="light"] .list-group-item {
    color: #313338 !important;
}

[data-theme="light"] .text-muted {
    color: #5c5e66 !important;
}

[data-theme="light"] .message-item:hover {
    background-color: rgba(0,0,0,0.02);
}

[data-theme="light"] .user-panel {
    background-color: #ebedef;
}

[data-theme="light"] .form-control {
    background-color: #ffffff;
    border: 1px solid #dbdee1;
}

[data-theme="light"] .modal-content {
    background-color: #ffffff;
    color: #313338;
}

[data-theme="light"] .modal-header, [data-theme="light"] .modal-footer {
    border-color: #dbdee1;
}

[data-theme="light"] .btn-close {
    filter: invert(1);
}

[data-theme="light"] .search-input {
    background-color: #dbdee1;
}

[data-theme="light"] .search-results-dropdown {
    background-color: #ffffff;
}

[data-theme="light"] .channel-category {
    color: #5c5e66;
}

[data-theme="light"] .dm-status-indicator {
    border-color: #f2f3f5;
}

[data-theme="light"] hr {
    border-color: #dbdee1 !important;
}

[data-theme="light"] .upload-progress-container {
    background-color: #f2f3f5;
}

[data-theme="light"] .chat-input-wrapper {
    background-color: #ebedef;
}

[data-theme="light"] .chat-input::placeholder {
    color: #5c5e66;
}

[data-theme="light"] .rich-embed {
    background: rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .voice-controls {
    background-color: #ebedef !important;
}

[data-theme="light"] .attachment-link:hover {
    background-color: #dbdee1 !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-servers);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.discord-app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Servers Sidebar */
.servers-sidebar {
    width: 72px;
    background-color: var(--bg-servers);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    flex-shrink: 0;
}

.server-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-chat);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
}

.server-icon:hover {
    border-radius: 16px;
    background-color: var(--blurple);
}

.server-icon.active {
    border-radius: 16px;
    background-color: var(--blurple);
}

/* Channels Sidebar */
.channels-sidebar {
    width: auto;
    min-width: 240px;
    max-width: 400px;
    background-color: var(--bg-channels);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.channels-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    font-weight: bold;
}

.channels-list {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

.channel-item {
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    text-decoration: none;
    white-space: nowrap;
}

.channel-item:hover {
    background-color: var(--hover);
    color: var(--text-primary);
}

.channel-item.active {
    background-color: var(--active);
    color: var(--text-primary);
}

.server-icon.add-btn {
    color: #23a559;
}

.server-icon.add-btn:hover {
    background-color: #23a559;
    color: white;
}

.category-wrapper.collapsed .category-group {
    display: none;
}

.category-wrapper.collapsed .category-collapse-toggle {
    transform: rotate(-90deg);
}

.channel-category {
    color: var(--text-muted);
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 4px;
    padding: 6px 8px 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

.channel-category .channel-settings-btn,
.channel-category .add-channel-btn {
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 1.2em;
    cursor: pointer;
}

.channel-category:hover .channel-settings-btn,
.channel-category:hover .add-channel-btn {
    opacity: 1;
}

.channel-item-container .channel-settings-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.channel-item-container:hover .channel-settings-btn {
    opacity: 1;
}

.category-group .channel-item-container {
    margin-left: 8px;
}

.category-group {
    min-height: 5px;
}

.channel-item-container.separator-item {
    cursor: default;
}
.channel-item-container.separator-item:hover {
    background-color: transparent !important;
}
.channel-item-container.separator-item .channel-settings-btn {
    opacity: 0;
}
.channel-item-container.separator-item:hover .channel-settings-btn {
    opacity: 0.7 !important;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: var(--blurple) !important;
}

.role-drag-handle:hover {
    opacity: 1 !important;
    color: var(--blurple);
}

.member-context-menu {
    animation: menuFadeIn 0.1s ease-out;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.member-menu-action:hover {
    background-color: var(--blurple) !important;
    color: white !important;
}


.add-channel-btn {
    cursor: pointer;
    font-size: 1.2em;
    margin-right: 8px;
    line-height: 1;
}

.add-channel-btn:hover {
    color: var(--text-primary);
}

/* Modals */
.modal-content {
    background-color: var(--bg-channels);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--bg-servers);
}

.modal-footer {
    border-top: 1px solid var(--bg-servers);
}

.form-control {
    background-color: var(--bg-servers);
    border: none;
    color: var(--text-primary);
}

.form-control:focus {
    background-color: var(--bg-servers);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(88, 101, 242, 0.25);
}

/* User Panel */
.user-panel {
    height: 52px;
    background-color: #232428;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 0;
}

.user-info:hover {
    background-color: var(--hover);
}

.user-actions {
    display: flex;
    gap: 4px;
}

/* Chat Area */
.chat-container {
    flex: 1;
    background-color: var(--bg-chat);
    display: flex;
    flex-direction: column;
}

.chat-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    font-weight: bold;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-item {
    display: flex;
    gap: 16px;
    padding: 4px 0;
    transition: background-color 0.1s;
}

.message-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.message-avatar {
    width: 40px;
    height: 40px;
    background-color: #4e5058;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.typing-indicator {
    padding: 0 16px 8px 16px;
    font-size: 0.75em;
    color: var(--text-muted);
    height: 20px;
    font-style: italic;
}

.avatar-pick {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.avatar-pick:hover {
    border-color: var(--blurple);
}

.avatar-pick.selected {
    border-color: var(--blurple);
    box-shadow: 0 0 10px var(--blurple);
}

.message-content {
    flex: 1;
}

.message-author {
    font-weight: bold;
    font-size: 0.95em;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.message-text {
    font-size: 0.95em;
    line-height: 1.4;
    color: var(--text-primary);
}

.message-time {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-left: 8px;
    font-weight: normal;
}

/* Input Area */
.chat-input-container {
    padding: 0 16px 24px 16px;
}

.chat-input-wrapper {
    background-color: #383a40;
    border-radius: 8px;
    padding: 11px 16px;
    display: flex;
}

.chat-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 1em;
}

/* Members Sidebar */
.members-sidebar {
    width: 240px;
    background-color: var(--bg-members);
    padding: 24px 8px;
    display: flex;
    flex-direction: column;
}

.members-sidebar.hidden {
    display: none;
}

@media (max-width: 992px) {
    .members-sidebar {
        display: none;
    }
    .members-sidebar.show {
        display: flex;
        position: absolute;
        right: 0;
        top: 48px;
        bottom: 0;
        z-index: 100;
        box-shadow: -2px 0 10px rgba(0,0,0,0.5);
    }
}

/* Reactions */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.reaction-badge {
    background-color: #2b2d31;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.1s;
}

.reaction-badge:hover {
    border-color: #5865f2;
    background-color: #35373c;
}

.reaction-badge.active {
    background-color: rgba(88, 101, 242, 0.15);
    border-color: #5865f2;
}

.reaction-badge .count {
    color: #5865f2;
    font-weight: bold;
}

.reaction-badge.active .count {
    color: white;
}

.add-reaction-btn {
    opacity: 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2em;
    line-height: 1;
    padding: 0 4px;
    transition: opacity 0.2s;
}

.message-item:hover .add-reaction-btn,
.message-item:hover .message-actions-menu {
    opacity: 1;
}

.message-actions-menu {
    opacity: 0;
    display: flex;
    gap: 8px;
    margin-left: auto;
    transition: opacity 0.2s;
}

.action-btn {
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
}

.action-btn:hover {
    color: var(--text-primary);
}

.action-btn.delete:hover {
    color: #f23f42;
}

/* Search bar */
.search-container {
    margin-left: auto;
    position: relative;
    width: 200px;
}

.search-input {
    background-color: var(--bg-servers);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text-primary);
    font-size: 0.85em;
    width: 100%;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background-color: var(--bg-channels);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    padding: 8px;
    border-bottom: 1px solid var(--bg-servers);
    cursor: pointer;
}

.search-result-item:hover {
    background-color: var(--hover);
}

.search-result-author {
    font-weight: bold;
    font-size: 0.85em;
}

.search-result-text {
    font-size: 0.8em;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* DM Specific */
.dm-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted);
}

.dm-user-item:hover {
    background-color: var(--hover);
    color: var(--text-primary);
}

.dm-user-item.active {
    background-color: var(--active);
    color: var(--text-primary);
}

.dm-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-channels);
}

.dm-status-online { background-color: #23a559; }
.dm-status-offline { background-color: #80848e; }

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #1e1f22;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #4e5058;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


.emoji-picker {
    position: fixed;
    background-color: #1e1f22;
    border: 1px solid #313338;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 10000;
}

.emoji-picker span {
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.1s;
}

.emoji-picker span:hover {
    background-color: #35373c;
}

/* File Upload */
.upload-btn-label {
    margin-right: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.upload-btn-label:hover {
    color: var(--text-primary);
}

.message-img-preview {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    background-color: #2b2d31;
}

.attachment-link {
    transition: background 0.2s;
}

.attachment-link:hover {
    background-color: #3f4147 !important;
}

/* Rich Embeds */
.rich-embed {
    transition: transform 0.2s;
}

.rich-embed:hover {
    transform: scale(1.01);
}

.embed-title {
    color: #00a8fc !important;
}

.embed-title:hover {
    text-decoration: underline !important;
}

.embed-image img {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Voice active state */
.voice-item.active {
    background-color: rgba(35, 165, 89, 0.1);
    color: #23a559 !important;
}

.voice-user {
    padding: 2px 4px;
    border-radius: 4px;
}

.voice-user .message-avatar {
    background-color: var(--bg-servers);
    border: 1px solid var(--separator);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    padding: 10px;
    background: #000;
    width: 100%;
}

.video-grid video {
    width: 100%;
    aspect-ratio: 16/9;
    background: #2b2d31;
    border-radius: 8px;
    object-fit: cover;
}

.voice-controls {
    border-top: 1px solid var(--separator-soft);
    background-color: #232428 !important;
}

/* Roles Management */
#roles-list .list-group-item:hover {
    background-color: var(--separator-soft) !important;
}

.nav-tabs .nav-link.active {
    border-bottom: 2px solid var(--blurple) !important;
    color: var(--text-primary) !important;
}

.nav-tabs .nav-link {
    font-size: 0.9em;
    font-weight: 500;
    padding: 12px;
}

.presence-indicator {
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* Mobile & Transitions */
@media (max-width: 768px) {
    .servers-sidebar {
        width: 60px;
    }
    .channels-sidebar {
        width: 200px;
    }
    .server-icon {
        width: 40px;
        height: 40px;
    }
}

.message-item {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.channel-item-container:hover .channel-settings-btn {
    opacity: 1 !important;
}

.channel-settings-btn {
    opacity: 0;
    transition: opacity 0.2s;
    padding: 2px;
}

.channel-settings-btn:hover {
    color: var(--text-normal) !important;
}

/* Progress Bar */
.upload-progress-container {
    padding: 8px 16px;
    background-color: rgba(0,0,0,0.1);
    border-top: 1px solid var(--separator-soft);
}

.progress-bar {
    transition: width 0.1s linear;
}

/* Mentions */
.mention {
    background-color: rgba(88, 101, 242, 0.3);
    color: #fff;
    font-weight: 500;
    padding: 0 2px;
    border-radius: 3px;
    cursor: pointer;
}

.mention:hover {
    background-color: var(--blurple);
}

.message-item.mentioned {
    background-color: rgba(250, 166, 26, 0.05);
    border-left: 2px solid #faa61a;
}

/* Pinned Messages */
.message-item.pinned {
    background-color: rgba(88, 101, 242, 0.05);
    border-left: 2px solid var(--blurple);
}

/* Emotes Tab in Settings */
#settings-emotes-sidebar button {
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    color: var(--text-muted) !important;
}

#settings-emotes-sidebar button:hover {
    background-color: var(--hover) !important;
    color: var(--text-primary) !important;
}

#settings-emotes-sidebar button.active {
    background-color: var(--active) !important;
    color: white !important;
}

.role-emoji-item {
    transition: transform 0.1s, background-color 0.2s;
    border: 1px solid transparent;
}

.role-emoji-item:hover {
    transform: scale(1.2);
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--blurple);
    z-index: 1;
}

.role-emoji-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#custom-emote-upload-zone .btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.pinned-badge {
    font-size: 0.7em;
    color: var(--blurple);
    background-color: rgba(88, 101, 242, 0.1);
    padding: 1px 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.action-btn.pin.active {
    color: var(--blurple);
}

/* Announcement Style */
.announcement-style {
    background-color: rgba(88, 101, 242, 0.05);
    border: 1px solid rgba(88, 101, 242, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px !important;
}

.announcement-style .message-text {
    font-size: 1.1em;
    font-weight: 500;
}

/* Rules Style */
.rule-item {
    transition: transform 0.2s;
    cursor: grab;
}

.rule-item:active {
    cursor: grabbing;
}

.rule-item:hover {
    transform: translateX(5px);
}

/* Forum Style */
.thread-item {
    transition: background-color 0.2s;
}

.thread-item:hover {
    background-color: #35373c !important;
}

/* YouTube Embed */
.youtube-embed {
    overflow: hidden;
    position: relative;
    max-width: 560px;
}

.youtube-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Solution Style */
.message-item.is-solution {
    background-color: rgba(35, 165, 89, 0.05);
    border-left: 2px solid #23a559;
}

.action-btn.mark-solution.active {
    color: #23a559;
}

/* Forum Filters */
.forum-filters .btn {
    border-radius: 20px;
    margin-right: 5px;
    border: none;
    background-color: var(--bg-servers);
    color: var(--text-muted);
    font-size: 0.8em;
    padding: 4px 12px;
}
.forum-filters .btn:hover {
    background-color: var(--hover);
    color: var(--text-primary);
}
.forum-filters .btn.active {
    background-color: var(--active);
    color: var(--text-primary);
}

/* Permission Tri-state Toggles */
.perm-tri-state {
    background-color: #1e1f22;
    padding: 2px;
    border-radius: 4px;
    display: inline-flex;
}

.perm-tri-state .btn {
    padding: 4px 10px;
    font-size: 0.85rem;
    border: none !important;
    border-radius: 4px !important;
    color: #b5bac1;
    transition: all 0.2s;
}

.perm-tri-state .btn:hover {
    background-color: #35373c;
    color: white;
}

.perm-tri-state .btn-outline-danger:checked + label {
    background-color: #f23f42 !important;
    color: white !important;
}

.perm-tri-state .btn-outline-secondary:checked + label {
    background-color: #4e5058 !important;
    color: white !important;
}

.perm-tri-state .btn-outline-success:checked + label {
    background-color: #23a559 !important;
    color: white !important;
}

#channel-permissions-roles-list .list-group-item.active {
    background-color: rgba(78, 80, 88, 0.6) !important;
    color: white !important;
}

#channel-permissions-roles-list .list-group-item {
    border-radius: 4px !important;
    margin: 0 8px;
    width: auto;
    color: #dbdee1 !important;
}

/* Modal text visibility fixes */
[data-theme="dark"] .modal-content .text-muted {
    color: #dbdee1 !important; /* Lighter than before */
}

[data-theme="dark"] .modal-content .small {
    color: #dbdee1;
}

[data-theme="dark"] .modal-content label:not(.btn) {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-content .fw-bold {
    color: #ffffff;
}

.permission-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.permission-item:last-child {
    border-bottom: none;
}


