/**
 * Nexus ZG - UI Components Styles
 * Styles for User Panel, Profile Cards, Server Settings, Message Composer
 */

@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&display=swap");

:root {
    --ui-bg: #0b0d10;
    --ui-panel: #15181d;
    --ui-panel-2: #1b1f25;
    --ui-input: #101318;
    --ui-border: rgba(255, 255, 255, 0.06);
    --ui-text: #e7e9ee;
    --ui-muted: rgba(231, 233, 238, 0.68);
    --ui-accent: #4c82d8;
    --ui-accent-hover: #3f73c8;
    --ui-accent-soft: rgba(76, 130, 216, 0.16);
    --ui-danger: #d36868;
    --ui-success: #3e9b6b;
    --ui-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    --ui-radius-lg: 12px;
    --ui-radius-md: 10px;
    --ui-font: "Sora", "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ==========================================
   1. USER PANEL STYLES
   ========================================== */

#user-panel {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    background: rgba(17, 18, 20, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 100;
    flex-shrink: 0;
}

#sidebar {
    position: relative;
    padding-bottom: 52px !important;
}

.user-avatar-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    flex: 1;
    min-width: 0;
}

.user-avatar-section:hover {
    background: rgba(255, 255, 255, 0.08);
}

.avatar-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.avatar-wrapper img,
#user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-fallback,
#user-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #5865F2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.status-dot,
#user-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #111214;
    background: #3ba55c;
}

.status-dot.online {
    background: #3ba55c;
}

.status-dot.idle {
    background: #faa61a;
}

.status-dot.dnd {
    background: #ed4245;
}

.status-dot.offline {
    background: #747f8d;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.username,
#user-display-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.discriminator,
#user-discrim {
    font-size: 12px;
    color: #b9bbbe;
}

.user-controls {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.control-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #b9bbbe;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.control-btn.muted {
    color: #ed4245;
    background: rgba(237, 66, 69, 0.1);
}

.control-btn.muted:hover {
    background: rgba(237, 66, 69, 0.2);
}

/* ==========================================
   2. SETTINGS MENU (DROPDOWN)
   ========================================== */

.settings-menu {
    position: fixed;
    width: 200px;
    background: var(--ui-panel);
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    z-index: 1001;
    padding: 6px 8px;
    font-family: var(--ui-font);
    animation: menuSlide 0.15s ease;
}

@keyframes menuSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-menu.hidden {
    display: none;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ui-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.12s ease;
}

.settings-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-text);
}

.settings-menu-item.danger {
    color: var(--ui-danger);
}

.settings-menu-item.danger:hover {
    background: rgba(211, 104, 104, 0.12);
    color: var(--ui-danger);
}

.settings-menu-item.admin {
    color: var(--ui-text);
    font-weight: 600;
}

.settings-menu-item.admin:hover {
    background: rgba(76, 130, 216, 0.12);
}

.settings-menu-separator {
    height: 1px;
    background: var(--ui-border);
    margin: 6px 0;
}

/* ==========================================
   3. PROFILE CARD STYLES
   ========================================== */

.profile-card {
    position: fixed;
    width: 340px;
    background: var(--ui-panel);
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
    z-index: 1000;
    overflow: hidden;
    font-family: var(--ui-font);
    color: var(--ui-text);
    animation: cardPop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cardPop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.profile-card.hidden {
    display: none;
}

.profile-banner {
    height: 60px;
    background: #1c2026;
}

.profile-header {
    position: relative;
    height: 32px;
}

.profile-avatar {
    position: absolute;
    top: -40px;
    left: 16px;
    width: 80px;
    height: 80px;
    border: 6px solid var(--ui-panel);
    border-radius: 50%;
    background: var(--ui-panel);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar .avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--ui-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
}

.profile-avatar .status-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 4px solid var(--ui-panel);
}

.status-badge.online {
    background: #3ba55c;
}

.status-badge.idle {
    background: #faa61a;
}

.status-badge.dnd {
    background: #ed4245;
}

.status-badge.offline {
    background: #747f8d;
}

.profile-body {
    padding: 8px 16px 16px;
}

.profile-name-section {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.profile-username {
    font-size: 20px;
    font-weight: 700;
    color: var(--ui-text);
    margin: 0;
}

.profile-tag {
    font-size: 16px;
    color: var(--ui-muted);
}

.profile-badges {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--ui-border);
}

.badge.verified {
    background: rgba(76, 130, 216, 0.2);
    color: var(--ui-text);
}

.badge.admin {
    background: rgba(211, 104, 104, 0.2);
    color: var(--ui-text);
}

.badge.moderator {
    background: rgba(62, 155, 107, 0.2);
    color: var(--ui-text);
}

.badge.vip {
    background: rgba(212, 168, 91, 0.2);
    color: var(--ui-text);
}

.profile-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ui-border);
}

.profile-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--ui-muted);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-bio {
    font-size: 14px;
    color: var(--ui-muted);
    line-height: 1.4;
    margin: 0;
}

.profile-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.role-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #2f3136;
    border-radius: 4px;
    font-size: 12px;
    color: #dcddde;
}

.role-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.no-roles {
    font-size: 13px;
    color: #72767d;
    font-style: italic;
}

.profile-actions {
    margin-top: 16px;
}

.btn-dm {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background: var(--ui-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 6px 16px rgba(76, 130, 216, 0.22);
}

.btn-dm:hover {
    background: var(--ui-accent-hover);
}

/* ==========================================
   4. SERVER SETTINGS MODAL STYLES
   ========================================== */

.server-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 10, 0.78);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ui-font);
    color: var(--ui-text);
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.server-settings-modal.hidden {
    display: none;
}

.server-settings-container {
    width: min(92vw, 980px);
    height: min(84vh, 720px);
    background: var(--ui-panel);
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    display: flex;
    overflow: hidden;
    box-shadow: var(--ui-shadow);
}

.server-settings-sidebar {
    width: 230px;
    background: var(--ui-panel-2);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--ui-border);
}

.settings-sidebar-header {
    padding: 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1px solid var(--ui-border);
}

.settings-tabs {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ui-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.12s ease;
    margin-bottom: 2px;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-text);
}

.settings-tab.active {
    background: var(--ui-accent-soft);
    color: var(--ui-text);
    box-shadow: inset 0 0 0 1px rgba(76, 130, 216, 0.3);
}

.settings-tab svg {
    flex-shrink: 0;
}

.server-settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ui-panel);
    min-width: 0;
}

.settings-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--ui-border);
}

.settings-content-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ui-text);
}

.settings-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ui-text);
}

.settings-content-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Settings Form Elements */
.settings-section {
    margin-bottom: 0;
    padding: 16px;
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-text);
    margin: 0 0 6px 0;
}

.settings-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.settings-input,
.settings-textarea,
.settings-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--ui-input);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    color: var(--ui-text);
    font-size: 13px;
    min-height: 40px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-input:focus,
.settings-textarea:focus,
.settings-select:focus {
    border-color: rgba(76, 130, 216, 0.6);
    box-shadow: 0 0 0 2px rgba(76, 130, 216, 0.18);
}

.settings-textarea {
    min-height: 88px;
    resize: vertical;
}

.settings-select {
    cursor: pointer;
}

/* Section helpers */
.settings-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.settings-section-desc {
    font-size: 12px;
    color: var(--ui-muted);
    margin-top: -4px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.settings-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-border);
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #323844;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle input:checked+.toggle-slider {
    background: var(--ui-accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(16px);
}

/* Buttons */
.settings-actions {
    margin-top: 8px;
    padding: 14px 0 6px;
    border-top: 1px solid var(--ui-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(0deg, var(--ui-panel) 70%, rgba(21, 24, 29, 0.2));
}

.btn-primary {
    height: 40px;
    padding: 0 18px;
    background: var(--ui-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 6px 16px rgba(76, 130, 216, 0.22);
}

.btn-primary:hover {
    background: var(--ui-accent-hover);
}

.btn-secondary {
    height: 36px;
    padding: 0 16px;
    background: transparent;
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-secondary.danger {
    color: var(--ui-danger);
    border-color: rgba(211, 104, 104, 0.4);
}

.btn-secondary.danger:hover {
    background: rgba(211, 104, 104, 0.12);
    border-color: rgba(211, 104, 104, 0.6);
}

/* Roles List */
.roles-header {
    margin-bottom: 16px;
}

.roles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--ui-panel-2);
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.role-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.role-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-name {
    flex: 1;
    font-size: 14px;
    color: var(--ui-text);
    font-weight: 500;
}

.role-count {
    font-size: 12px;
    color: var(--ui-muted);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.04);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-edit-btn {
    padding: 6px 10px;
    background: transparent;
    color: var(--ui-muted);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.12s ease;
}

.role-item:hover .role-edit-btn {
    opacity: 1;
}

.role-edit-btn:hover {
    background: rgba(76, 130, 216, 0.14);
    color: var(--ui-text);
}

/* Channels List */
.channels-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.members-list,
.bots-list,
.logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bots-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logs-list {
    margin-top: 8px;
}

.channel-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.channel-item-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.channel-icon {
    width: 18px;
    color: var(--ui-muted);
    text-align: center;
}

.channel-name {
    flex: 1;
    font-size: 13px;
    color: var(--ui-text);
}

.channel-edit-btn,
.channel-delete-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-muted);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.12s ease;
}

.channel-item-row:hover .channel-edit-btn,
.channel-item-row:hover .channel-delete-btn {
    opacity: 1;
}

.channel-edit-btn:hover {
    background: rgba(76, 130, 216, 0.12);
    color: var(--ui-text);
}

.channel-delete-btn {
    border-color: rgba(211, 104, 104, 0.3);
    color: var(--ui-danger);
}

.channel-delete-btn:hover {
    background: rgba(211, 104, 104, 0.12);
}

/* Icon Upload */
.icon-upload-area {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.icon-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--ui-input);
    border: 1px solid var(--ui-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--ui-muted);
    overflow: hidden;
}

.icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading & Empty States */
.loading,
.no-data {
    text-align: center;
    padding: 24px;
    color: var(--ui-muted);
    font-size: 14px;
}

/* ==========================================
   4b. SETTINGS MODALS & PANELS
   ========================================== */

.ui-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 10, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10010;
    font-family: var(--ui-font);
    color: var(--ui-text);
    animation: modalFade 0.16s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ui-modal-panel {
    width: min(92vw, 720px);
    max-height: 90vh;
    background: var(--ui-panel);
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ui-modal-panel-sm {
    width: min(92vw, 460px);
}

.ui-modal-panel-lg {
    width: min(92vw, 760px);
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ui-border);
}

.ui-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ui-text);
}

.ui-modal-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.ui-modal-section {
    padding: 14px 16px;
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ui-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.ui-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--ui-border);
    background: var(--ui-panel);
}

.ui-modal-actions-left,
.ui-modal-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ui-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
}

.ui-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ui-text);
}

.ui-permission-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.ui-permission-grid {
    padding: 12px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ui-permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.ui-permission-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.ui-permission-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ui-permission-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
}

.ui-permission-desc {
    font-size: 11px;
    color: var(--ui-muted);
}

.perm-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.perm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.perm-toggle span {
    position: absolute;
    inset: 0;
    background: #323844;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.perm-toggle span::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.perm-toggle input:checked + span {
    background: var(--ui-accent);
}

.perm-toggle input:checked + span::before {
    transform: translateX(16px);
}

.channel-type-group {
    display: flex;
    gap: 8px;
}

.channel-type-btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}

.channel-type-btn.active {
    background: var(--ui-accent-soft);
    border-color: rgba(76, 130, 216, 0.4);
    color: var(--ui-text);
}

.perm-select {
    min-width: 140px;
}

.color-input {
    width: 64px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.role-modal {
    z-index: 10020;
}

.channel-settings-modal {
    z-index: 10030;
}

.create-channel-modal {
    z-index: 10010;
}

.settings-content-body::-webkit-scrollbar,
.settings-tabs::-webkit-scrollbar,
.roles-list::-webkit-scrollbar,
.channels-list::-webkit-scrollbar,
.ui-modal-body::-webkit-scrollbar,
.ui-permission-list::-webkit-scrollbar {
    width: 6px;
}

.settings-content-body::-webkit-scrollbar-thumb,
.settings-tabs::-webkit-scrollbar-thumb,
.roles-list::-webkit-scrollbar-thumb,
.channels-list::-webkit-scrollbar-thumb,
.ui-modal-body::-webkit-scrollbar-thumb,
.ui-permission-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.settings-content-body::-webkit-scrollbar-thumb:hover,
.settings-tabs::-webkit-scrollbar-thumb:hover,
.roles-list::-webkit-scrollbar-thumb:hover,
.channels-list::-webkit-scrollbar-thumb:hover,
.ui-modal-body::-webkit-scrollbar-thumb:hover,
.ui-permission-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 1100px) {
    .server-settings-container {
        width: 96vw;
        height: 88vh;
    }
}

@media (max-width: 900px) {
    .server-settings-container {
        flex-direction: column;
        height: 92vh;
    }

    .server-settings-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 8px 12px;
    }

    .settings-sidebar-header {
        display: none;
    }

    .settings-tabs {
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding: 8px;
    }

    .settings-tab {
        margin-bottom: 0;
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .ui-modal-panel,
    .ui-modal-panel-lg,
    .ui-modal-panel-sm {
        width: 94vw;
    }

    .settings-content-body {
        padding: 18px;
    }
}

/* ==========================================
   5. MESSAGE COMPOSER ENHANCEMENTS
   ========================================== */

#composer-area {
    padding: 0 16px 24px 16px;
    position: relative;
    min-height: 68px;
    flex-shrink: 0;
}

#composer-area.disabled {
    opacity: 0.6;
}

#composer-inner {
    background: rgba(56, 58, 64, 0.7);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

#composer-inner:focus-within {
    background: rgba(64, 68, 75, 0.9);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

#msg-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #dcddde;
    font-size: 15px;
    outline: none;
}

#msg-input::placeholder {
    color: #72767d;
}

#msg-input:disabled {
    cursor: not-allowed;
}

.composer-icons {
    display: flex;
    gap: 4px;
}

.icon-btn-small {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #b9bbbe;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: color 0.1s ease;
}

.icon-btn-small:hover {
    color: #dcddde;
}

.composer-disabled-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    font-size: 14px;
    color: #ed4245;
    font-weight: 500;
    pointer-events: none;
}

.composer-disabled-overlay.hidden {
    display: none;
}

/* ==========================================
   6. MEMBER LIST ENHANCEMENTS
   ========================================== */

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.member-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.member-avatar {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #5865F2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar .status-dot {
    width: 10px;
    height: 10px;
    border: 2px solid #2f3136;
}

.member-name {
    flex: 1;
    font-size: 14px;
    color: #96989d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-item:hover .member-name {
    color: #dcddde;
}

.member-role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ==========================================
   7. GENERAL UI POLISH
   ========================================== */

/* Smooth transitions globally */
* {
    box-sizing: border-box;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5865F2;
    outline-offset: 2px;
}

/* Scrollbar styling */
.settings-tabs::-webkit-scrollbar,
.settings-content-body::-webkit-scrollbar,
.roles-list::-webkit-scrollbar {
    width: 8px;
}

.settings-tabs::-webkit-scrollbar-track,
.settings-content-body::-webkit-scrollbar-track,
.roles-list::-webkit-scrollbar-track {
    background: transparent;
}

.settings-tabs::-webkit-scrollbar-thumb,
.settings-content-body::-webkit-scrollbar-thumb,
.roles-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.settings-tabs::-webkit-scrollbar-thumb:hover,
.settings-content-body::-webkit-scrollbar-thumb:hover,
.roles-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
