/* Dashboard Styles - Unified Theme Implementation */

:root {
    /* Global Reset */
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

:root {
    /* Dashboard specific aliases - Fallback to global style.css variables */
    --text-main: var(--text);
    --text-muted: var(--muted);
    --primary: var(--accent);
    --primary-hover: var(--accent-hover);
    --primary-light: var(--accent-2);
    --radius: 12px;
    --transition: all 0.2s ease;
    --ringing: 0 0 0 2px color-mix(in oklab, var(--accent) 60%, transparent);
}

/* --- THEME SELECTOR --- */
.theme-selector {
    position: relative;
    display: inline-block;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 220px;
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    backdrop-filter: blur(20px);
}

.theme-selector.active .theme-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    color: #949ba4;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.theme-option:hover {
    background: var(--glass-hover);
    color: var(--text-main);
}

.theme-option.active {
    background: var(--glass);
    color: var(--accent);
}

.theme-option i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
}

/* --- LANGUAGE SELECTOR (Custom Dropdown) --- */
.lang-selector-container {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 10px;
}

.lang-selector-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.lang-selector-btn i {
    transition: transform 0.2s ease;
}

.lang-selector-container.active .lang-selector-btn i {
    transform: rotate(180deg);
}

.lang-selector-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.lang-selector-container.active .lang-selector-btn {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.lang-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 2100;
    display: none;
    max-height: 250px;
    overflow-y: auto;
    backdrop-filter: blur(16px);
}

.lang-selector-container.active .lang-dropdown {
    display: block;
    animation: fadeIn 0.2s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lang-option:hover {
    background: var(--glass-hover);
    color: var(--text-main);
}

.lang-option.active {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    font-weight: 600;
}

.lang-flag {
    width: 22px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.lang-flag svg {
    width: 100%;
    height: auto;
    display: block;
}

body {
    font-family: 'Inter', 'Noto Sans', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 10% -10%, var(--grad-1), transparent 60%),
        radial-gradient(900px 600px at 110% 10%, var(--grad-2), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

/* --- STYLISH SCROLLBARS (Global) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 10px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox support */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0, 0, 0, 0.2);
}

/* --- OVERLAYS --- */
.overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    opacity: 0.95;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.hidden {
    display: none !important;
}

.login-card,
.modal-card {
    background: #1e1e24;
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--hard-shadow, var(--shadow));
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

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

.login-card {
    text-align: center;
}

.login-card h1 {
    margin: 1rem 0 0.5rem;
    font-size: 2rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn-discord {
    background: #5865F2;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    transition: var(--transition);
    width: 100%;
}

.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- LAYOUT --- */
.app-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    /* Reduced from 1.5rem to move content up */
    height: 100%;
    /* Fixed sidebar height to 100% of its parent (.app-layout) */
    overflow: hidden;
    backdrop-filter: blur(16px);
}

/* Explicit Scrollbar for Sidebar & Guild List */
.sidebar::-webkit-scrollbar,
.guild-list::-webkit-scrollbar,
.content-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.guild-list::-webkit-scrollbar-thumb,
.content-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 10px;
}

.sidebar-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 0.5rem;
    /* Reduced from 1rem to move server list up */
}

.guild-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.5rem;
    padding-bottom: 3rem;
    /* Fix for hidden last servers */
}

.sidebar-header {
    margin-bottom: 1rem;
    /* Reduced from 2rem to move server list up */
}

.sidebar-header img {
    height: 32px;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Custom Scrollbars for Guild List */
.guild-list::-webkit-scrollbar {
    width: 5px;
}

.guild-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.guild-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.guild-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.guild-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    width: 100%;
    font-size: 0.9rem;
}

.guild-item:hover,
.guild-item.active {
    background: var(--glass-hover);
    color: var(--text);
}

.guild-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-left: 2px solid var(--primary);
}

.guild-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-card);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ef4444;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
    /* Critical for nested scrollbars */
}

.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.content-scroll {
    flex: 1;
    overflow-y: auto !important;
    max-height: calc(100vh - 100px);
    /* Ensure it doesn't push page height */
    padding: 1.5rem;
    margin: 1.5rem 1.5rem 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* TABS */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    overflow-x: auto;
    /* Allow scroll on mobile */
    scrollbar-width: none;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    /* Pill shape */
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--hard-shadow, 0 4px 12px rgba(99, 102, 241, 0.3));
}

.tab-pane,
.tab-content {
    display: none;
    animation: fadein 0.2s ease;
}

.tab-pane.active,
.tab-content.active {
    display: block;
}

/* LISTS & ITEMS */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.item-list::-webkit-scrollbar {
    width: 6px;
}

.item-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--hard-shadow);
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.list-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.list-item:hover::before {
    opacity: 1;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-info h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.item-info small {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-edit:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* FORMS & GRID */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
    transition: z-index 0s;
    overflow: visible;
    box-shadow: var(--hard-shadow);
}

/* Fix for Dropdowns: Lift card when focused (e.g. typing in search) */
.card:focus-within {
    z-index: 100;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h4 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.row-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.row-group .form-group {
    flex: 1;
    min-width: 0;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition);
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

small {
    display: block;
    margin-top: 0.4rem;
    color: #64748b;
    font-size: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

/* CHIPS */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.role-chip.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.role-chip input {
    display: none;
}

/* ACTIONS */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--hard-shadow, 0 4px 12px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.actions-right {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* TOAST */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10000;
}

.toast {
    background: var(--panel);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--hard-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.3));
    backdrop-filter: blur(8px);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: #22c55e;
}

.toast.error {
    border-color: #ef4444;
}

/* Base styles for the new elements (MUST BE BEFORE MEDIA QUERIES) */
.mobile-only {
    display: none !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-bot-badge {
    font-size: 0.65rem;
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    width: fit-content;
    font-weight: 600;
    margin-top: 2px;
}

.custom-bot-banner {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.custom-bot-banner i {
    font-size: 0.8rem;
    color: #8b5cf6;
}

.custom-bot-banner.show {
    display: flex;
}

/* Compact bot badge on mobile */
@media (max-width: 540px) {
    .custom-bot-banner .banner-text {
        display: none !important;
    }

    .custom-bot-banner {
        padding: 0 !important;
        border-radius: 50% !important;
        width: 32px !important;
        height: 32px !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        border-width: 2px !important;
    }
}

/* End of global styles */

/* --- ROLE PING ENHANCEMENTS --- */

/* ENHANCED INPUTS */
.input-field {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-radius: 8px;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.role-chip.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.role-chip input {
    display: none;
}

/* ACTIONS */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--hard-shadow, 0 4px 12px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.actions-right {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* TOAST */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10000;
}

.toast {
    background: var(--panel);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--hard-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.3));
    backdrop-filter: blur(8px);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: #22c55e;
}

.toast.error {
    border-color: #ef4444;
}

/* Base styles for the new elements (MUST BE BEFORE MEDIA QUERIES) */
.mobile-only {
    display: none !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-bot-badge {
    font-size: 0.65rem;
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    width: fit-content;
    font-weight: 600;
    margin-top: 2px;
}

.custom-bot-banner {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.custom-bot-banner i {
    font-size: 0.8rem;
    color: #8b5cf6;
}

.custom-bot-banner.show {
    display: flex;
}

/* Compact bot badge on mobile */
@media (max-width: 540px) {
    .custom-bot-banner .banner-text {
        display: none !important;
    }

    .custom-bot-banner {
        padding: 0 !important;
        border-radius: 50% !important;
        width: 32px !important;
        height: 32px !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        border-width: 2px !important;
    }
}

/* End of global styles */

/* --- ROLE PING ENHANCEMENTS --- */

/* ENHANCED INPUTS */
.input-field {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

select.input-field option {
    background-color: var(--bg-2);
    color: var(--text-main);
}

/* Custom Scrollbar for Select Multiple */
select[multiple] {
    padding: 0.5rem;
    height: auto;
    max-height: 200px;
    background: rgba(15, 23, 42, 0.4);
}

select[multiple] option {
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.1s;
}

select[multiple] option:hover {
    background: rgba(255, 255, 255, 0.05);
}

select[multiple] option:checked {
    background: var(--primary);
    /* linear-gradient not supported on option in some browsers */
    color: white;
}

/* Global Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent), var(--accent-2));
    border-radius: 10px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Modal Scrolling Fix */
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
    /* Space for scrollbar */
    margin-right: -0.5rem;
    /* Align scrollbar to edge */
}

/* Ensure modal content wrapper handles flex layout correctly */
.modal-card {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* Prevent modal from exceeding viewport height */
}

/* Ensure Role Ping Modals are large enough */
.modal-card.w-large {
    width: 90%;
    max-width: 800px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.checkbox-group:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.checkbox-group input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    margin: 0;
    font-size: 1rem;
    cursor: pointer;
}

/* Feature Card Grid for Vocal Hub Buttons */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    user-select: none;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-card.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: var(--hard-shadow, 0 4px 12px rgba(99, 102, 241, 0.2));
}

.feature-icon {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.feature-info {
    display: flex;
    flex-direction: column;
}

.feature-info strong {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.feature-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.feature-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    transition: var(--transition);
}

.feature-card.active .feature-check {
    background: var(--primary);
    border-color: var(--primary);
}

/* Hide actual checkbox but keep it accessible for form submission if needed */
.feature-card input[type="checkbox"] {
    display: none;
}

/* --- DISCORD PREVIEW --- */
.discord-preview-box {
    background: #313338;
    /* Discord dark theme bg */
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #dbdee1;
    line-height: 1.375rem;
    font-size: 1rem;
}

.discord-message {
    display: flex;
    gap: 1rem;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #5865F2;
    flex-shrink: 0;
    margin-top: 2px;
}

.discord-content {
    flex: 1;
    min-width: 0;
}

.discord-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2px;
}

.discord-username {
    font-weight: 500;
    color: #f2f3f5;
    font-size: 1rem;
}

.discord-bot-tag {
    background: #5865F2;
    color: white;
    font-size: 0.625rem;
    padding: 0 0.275rem;
    border-radius: 3px;
    line-height: 1.3;
    font-weight: 500;
    display: flex;
    align-items: center;
    height: 15px;
    margin-top: 1px;
}

.discord-timestamp {
    color: #949ba4;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    font-weight: 400;
}

.discord-markup {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: #dbdee1;
    margin-bottom: 0.5rem;
}

/* Markdown Styles */
.d-bold {
    font-weight: 700;
}

.d-italic {
    font-style: italic;
}

.d-underline {
    text-decoration: underline;
}

.d-strike {
    text-decoration: line-through;
}

.d-code {
    background: #2b2d31;
    padding: 2px 4px;
    /* Fix padding */
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 0.85em;
}

.d-codeblock {
    background: #2b2d31;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #1e1f22;
    font-family: Consolas, monospace;
    font-size: 0.85em;
    margin-top: 4px;
    display: block;
    white-space: pre;
    overflow-x: auto;
}

.d-quote {
    display: flex;
    margin: 4px 0;
}

.d-quote-bar {
    width: 4px;
    border-radius: 4px;
    background: #4e5058;
    margin-right: 8px;
}

/* Embed Styles */
.discord-embed {
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto;
    max-width: 520px;
    background: #2b2d31;
    border-radius: 4px;
    border-left: 4px solid #1e1f22;
    /* Default border color */
    padding: 8px 16px 16px 12px;
    margin-top: 8px;
    gap: 8px;
}

.discord-embed.has-thumbnail {
    grid-template-columns: auto 80px;
}

.discord-embed-provider {
    font-size: 0.75rem;
    color: #b5bac1;
    margin-bottom: 4px;
}

.discord-embed-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.discord-embed-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* --- Custom Dropdown --- */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.custom-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-top: 0.5rem;
    /* max-height depends on content, but limit it */
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 9999;
    animation: fadeIn 0.1s ease;
}

.custom-dropdown-list.active {
    display: block;
}

.custom-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-main);
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-dropdown-item:hover,
.custom-dropdown-item.focused {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.custom-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.discord-embed-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    display: block;
    text-decoration: none;
}

.discord-embed-desc {
    font-size: 0.875rem;
    color: #dbdee1;
    white-space: pre-wrap;
    line-height: 1.375rem;
}

.discord-embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.discord-embed-field {
    min-width: 100%;
}

.discord-embed-field.inline {
    min-width: fit-content;
    flex: 1;
}

.discord-embed-field-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.discord-embed-field-value {
    font-size: 0.875rem;
    color: #dbdee1;
    white-space: pre-wrap;
}

.discord-embed-image {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
    grid-column: 1 / -1;
}

.discord-embed-image img {
    max-width: 100%;
    display: block;
}

.discord-embed-thumbnail {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin-left: 16px;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    object-fit: cover;
}

.discord-embed-thumbnail img {
    width: 100%;
    height: 100%;
}

.discord-embed-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #b5bac1;
    margin-top: 8px;
    grid-column: 1 / -1;
}

.discord-embed-footer img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Disabled Card Style for Modules */
.disabled-card {
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px dashed var(--border-color);
}

/* Role Chips (Multi-select) */
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    user-select: none;
}

.role-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.role-chip.selected {
    background: rgba(88, 101, 242, 0.2);
    border-color: var(--primary);
    color: var(--primary-light);
}

.role-chip input[type="checkbox"] {
    display: none;
}

/* Scrollable Role List Styling */
.role-list-scrollable::-webkit-scrollbar {
    width: 6px;
}

.role-list-scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.role-list-scrollable::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Module Cards (Recrutement, etc) */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    transition: var(--transition);
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* General Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.full-width {
    width: 100%;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RULES MODULE STYLES --- */
.card-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.card-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--hard-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.card-info {
    flex: 1;
}

.card-info h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.card-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-success {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-blue {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-gray {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}


/* BUTTONS */
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 1rem;
}


/* --- MODULE HEADERS --- */
.module-header {
    margin-bottom: 2.5rem;
}

.module-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.module-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 600px;
    line-height: 1.5;
}

/* --- GIVEAWAYS MODULE STYLES --- */

/* Tabs Header (Fix spacing) */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

/* Grid Layout for Cards */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

/* Updated Card Styles */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-body p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.card-body strong {
    color: var(--text-muted);
    font-weight: 500;
}

.card-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Badge Tweaks */
.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Discord Channel Tag Style */
.discord-channel {
    background: rgba(88, 101, 242, 0.1);
    color: #5865F2;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- CREATE FORM REDESIGN --- */

.create-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.create-left {
    flex: 1;
    min-width: 0;
}

.create-right {
    width: 380px;
    flex-shrink: 0;
    display: none;
    /* Hidden on mobile by default */
}

@media (min-width: 1200px) {
    .create-right {
        display: block;
    }
}

.preview-sticky {
    position: sticky;
    top: 2rem;
}

.preview-title {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* DURATION GROUP */
.duration-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
}

.d-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.d-input input {
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.2rem;
    width: 100%;
}

.d-input input:focus {
    box-shadow: none;
    color: var(--primary);
}

.d-input span {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.d-input:not(:last-child)::after {
    content: ':';
    position: absolute;
    right: -4px;
    top: 20%;
    color: var(--text-muted);
    font-weight: bold;
}

/* INPUT WITH BUTTON */
.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-with-btn button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
}

/* COLOR PICKER */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 8px;
}

.color-picker-wrapper input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.color-picker-wrapper span {
    font-family: monospace;
    color: var(--text-muted);
}

/* ACTION BAR */
.action-bar {
    position: sticky;
    bottom: 2rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin-top: 2rem;
    z-index: 10;
    text-align: center;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: block;
}

/* --- EMERGENCY FIXES FOR TICKET MODULE --- */
/* Force tab content visibility when active */
.tab-content.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

/* Ensure Settings Grid is visible */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* Ensure Cards are visible */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    opacity: 1 !important;
    visibility: visible !important;
}

/* LOGS MODULE PREMIUM UI */

/* Custom Toggle Switch (iOS style) */
.toggle-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space between text and toggle */
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
    width: 100%;
    /* Fill container */
}

/* Hide default checkbox */
.toggle-switch-label input {
    appearance: none;
    -webkit-appearance: none;
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    position: relative;
    transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    /* Prevent shrinking */
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch-label input:checked+.toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch-label input:checked+.toggle-slider::after {
    transform: translateX(20px);
}

.toggle-text {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Logs Grid Improvements */
.logs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    /* Slightly wider cards */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.log-card {
    background: rgba(15, 20, 36, 0.6);
    /* Semi-transparent dark */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(10px);
}

.log-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.log-card.active-border {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.15);
}

.log-card .card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem;
}

.log-card .card-body {
    padding: 1.25rem;
    flex: 1;
    /* Stretch to fill */
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
}

.log-event-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Preview Section */
.logs-preview-container {
    background: #313338;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid #1e1f22;
    font-family: 'gg sans', 'Noto Sans', sans-serif;
    color: #dbdee1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logs-preview-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #949ba4;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #1e1f22;
    padding-bottom: 0.5rem;
}

/* Back Button Style */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateX(-2px);
}

/* --- MODULE CARDS --- */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

@media (max-width: 1000px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.module-card {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 1.25rem 1rem !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 140px;
    justify-content: center;
    box-shadow: var(--hard-shadow) !important;
}

.module-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), var(--hard-shadow) !important;
}

.module-card .icon {
    width: 100px;
    height: 100px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.module-card:hover .icon {
    transform: scale(1.1);
}

.module-card .icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.module-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.module-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.empty-placeholder {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateX(-2px);
}

/* Improve Control Cards */
.setting-control-card {
    display: block;
    width: 100%;
}


/* Ignore Section Improvements */
.ignore-section-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 20, 36, 0.4);
    border-radius: 12px;
}

.ignore-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ignore-group:last-child {
    margin-bottom: 0;
}

.ignore-input-row {
    display: flex;
    gap: 0.8rem;
}

.ignore-input-row .form-select,
.ignore-input-row .form-control {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 42px;
    /* Taller inputs */
}

.ignore-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-height: 42px;
    /* Prevent collapse */
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.ignore-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    color: #dee0fc;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.ignore-item:hover {
    background: rgba(88, 101, 242, 0.25);
    transform: translateY(-1px);
}

.ignore-item i {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ignore-item i:hover {
    opacity: 1;
    color: #ff5f5f;
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* === MULTI-SELECT CLEAN DESIGN === */
.multi-select-container {
    position: relative;
    /* Container acts as the wrapper */
    background: transparent;
    border: none;
    padding: 0;
    min-height: auto;
    display: block;
}

.multi-select-container input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s;
    margin-bottom: 8px;
    /* Space between input and tags */
}

.multi-select-container input:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 2px;
}

.tag {
    background: rgba(40, 45, 60, 0.8);
    /* Neutral dark pill */
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    /* Pill shape */
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag:hover {
    background: rgba(50, 55, 75, 1);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.tag i {
    margin-left: 2px;
    font-size: 0.85rem;
    opacity: 0.5;
    cursor: pointer;
}

.tag i:hover {
    opacity: 1;
    color: #ff5f5f;
}

.dropdown-list {
    position: absolute;
    width: 100%;
    top: 48px;
    /* Just below input (approx height) - will adjust dynamically or via CSS */
    top: 42px;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    visibility: hidden;
}

.dropdown-list.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* Scrollbar */
.dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 0.95rem;
    transition: background 0.15s;
    border-left: 2px solid transparent;
}

.dropdown-item:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #fff;
    border-left-color: var(--primary);
}

.role-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* --- TICKET STATS DASHBOARD --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    transition: opacity 0.3s;
}

.stat-card:hover .stat-icon {
    opacity: 1;
}

.charts-row .card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    background: #1e1f22;
    /* darker header */
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Explicit layout fixes for forms */
.form-group {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
}

#support-roles-area {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

/* Ensure nothing focuses horizontal split */
.card .form-group {
    display: block !important;
}

/* --- STATISTICS CARDS STYLE (Tickets, etc.) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: var(--hard-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: currentColor;
    /* Uses color from class */
    opacity: 0.8;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Specific Colors via classes */
.stat-total {
    color: #f0b232;
}

.stat-open {
    color: #3ba55d;
}

.stat-closed {
    color: #ed4245;
}

.stat-info {
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.stat-info h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 0.5rem;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.15;
    transform: rotate(-10deg);
    transition: all 0.3s ease;
    color: currentColor;
    /* Matches the parent color */
}

.stat-card:hover .stat-icon {
    opacity: 0.3;
    transform: rotate(0deg) scale(1.1);
}

/* --- AutoThread & Selection Cards (Restored) --- */
.selection-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.selection-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.selection-card.active-card {
    background: rgba(88, 101, 242, 0.2);
    border: 2px solid #5865F2;
    /* Thicker border */
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.3);
    /* Glow effect */
    transform: translateY(-2px);
}

.selection-card.active-card:hover {
    background: rgba(88, 101, 242, 0.25);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
}

.at-toggle {
    width: 48px;
    height: 26px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 99px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.at-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.at-toggle.checked {
    background: #23a559;
}

.at-toggle.checked::after {
    transform: translateX(22px);
    background: #fff;
}

.channel-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.channel-icon {
    font-size: 1.3rem;
    color: #72767d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-card .channel-icon {
    color: #fff;
}

.channel-name {
    font-weight: 500;
    color: #dcddde;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.active-card .channel-name {
    color: #fff;
    font-weight: 600;
}

/* Custom Select (Channel Selector used by core.js) */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    user-select: none;
}

.custom-select.open .custom-select-trigger {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: rgba(0, 0, 0, 0.3);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 9999;
    display: none;
    flex-direction: column;
    box-shadow: var(--hard-shadow, 0 10px 25px rgba(0, 0, 0, 0.5));
    max-height: 300px;
    overflow: hidden;
    animation: fadeIn 0.1s ease;
}

.custom-select-list-items {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.custom-select-list-items::-webkit-scrollbar {
    width: 6px;
}

.custom-select-list-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-select-list-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.custom-select-list-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.custom-select.open .custom-select-options {
    display: flex;
}

.custom-select-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 2;
}

.custom-select-search input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-main);
    font-size: 0.9rem;
}

.custom-select-search input:focus {
    border-color: var(--primary);
    outline: none;
}

.custom-select-option {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.95rem;
}

.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.custom-select-option.selected {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    font-weight: 500;
}

.custom-select-group-label {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    /* Make clickable through if needed, but labels usually aren't */
    margin-top: 2px;
}

.custom-select-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Grid 2 columns */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    overflow: visible;
    /* Ensure dropdowns are not clipped */
}

/* === STATS MODAL STYLES (Root Level Fix) === */

.selection-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.selection-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.selection-card.active-card {
    background: rgba(88, 101, 242, 0.2) !important;
    border: 2px solid #5865F2 !important;
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.3) !important;
    transform: translateY(-2px);
}

.selection-card.active-card:hover {
    background: rgba(88, 101, 242, 0.25) !important;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4) !important;
}

.channel-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.channel-icon {
    font-size: 1.3rem;
    color: #72767d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selection-card.active-card .channel-icon {
    color: #fff;
}

.channel-name {
    font-weight: 500;
    color: #dcddde;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.selection-card.active-card .channel-name {
    color: #fff;
    font-weight: 600;
}

/* Toggle Switch Global */
.toggle-switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.toggle-switch-label input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 99px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch-label input:checked+.toggle-slider {
    background: #23a559;
}

.toggle-switch-label input:checked+.toggle-slider::after {
    transform: translateX(22px);
    background: #fff;
}

.toggle-text {
    color: var(--text-main);
    font-weight: 500;
}

/* === Role Scroll List === */
.role-scroll-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
}

.role-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.role-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.role-item.selected {
    background: rgba(88, 101, 242, 0.15);
    border-left: 3px solid #5865F2;
}

.role-item .role-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.role-item.selected .role-checkbox {
    background: #5865F2;
    border-color: #5865F2;
}

.role-item.selected .role-checkbox::after {
    content: '✓';
    font-size: 12px;
    color: white;
}

@media (max-width: 480px) {
    .top-bar h2 {
        font-size: 1.1rem !important;
    }
}

/* --- DISCORD MOCKUP (IA Module) --- */
.ia-discord-mockup {
    background: #2b2d31;
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
    color: #dbdee1;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.ia-mockup-section {
    margin-bottom: 2rem;
}

.ia-mockup-section h4 {
    color: #949ba4;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.ia-mockup-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ia-mockup-role {
    background: #1e1f22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ia-mockup-role:hover {
    background: #35373c;
    border-color: rgba(255, 255, 255, 0.2);
}

.ia-mockup-category {
    margin-top: 1.5rem;
}

.ia-mockup-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #949ba4;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.ia-mockup-category-header:hover {
    color: #dbdee1;
}

.ia-mockup-channel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #949ba4;
    transition: all 0.2s;
}

.ia-mockup-channel:hover {
    background: #35373c;
    color: #dbdee1;
}

.ia-mockup-channel i {
    font-size: 1.2rem;
    width: 1.2rem;
    text-align: center;
    color: #80848e;
}

.ia-editable-name {
    outline: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.ia-editable-name:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ia-editable-name:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.ia-json-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: #ef4444;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ia-json-warning i {
    font-size: 1.8rem;
}

.ia-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* --- GLOBAL ROLE SELECTOR PREMIUM STYLES --- */
.role-selector-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.selected-tags {
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px inset rgba(255, 255, 255, 0.05);
}

.selected-tags .tag {
    animation: tagAppear 0.2s ease-out;
    cursor: default;
    user-select: none;
    transition: transform 0.1s;
}

.selected-tags .tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.selected-tags .tag i:hover {
    color: #ef4444;
    opacity: 1 !important;
}

@keyframes tagAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

.role-scroll-list {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.role-item {
    transition: all 0.2s;
    border: 1px solid transparent;
}

.role-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

.role-item.selected {
    background: rgba(88, 101, 242, 0.1) !important;
}

.role-checkbox {
    transition: all 0.2s;
}

.role-item:hover .role-checkbox {
    border-color: var(--primary);
}

.role-item .role-name {
    font-size: 0.95rem;
    font-weight: 500;
}


/* --- EMBED STUDIO PREMIUM --- */
.builder-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sub-tabs {
    display: flex;
    gap: 10px;
    padding: 8px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.sub-tabs .tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.sub-tabs .tab-btn i {
    font-size: 1rem;
    opacity: 0.7;
}

.sub-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.sub-tabs .tab-btn.active i {
    opacity: 1;
}

.sub-tabs .tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 1.5rem 0;
}

.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.discord-preview-box {
    background: #313338;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ghost-input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #dbdee1 !important;
    resize: none;
    font-size: 0.9375rem;
    line-height: 1.375rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ghost-input:focus {
    box-shadow: none !important;
}

.discord-embed {
    border-left: 4px solid #5865F2;
    background: #2b2d31;
    border-radius: 4px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 520px;
    transition: border-color: 0.2s;
}

.discord-embed-title {
    color: #00a8fc;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

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

.discord-embed-desc {
    color: #dbdee1;
    font-size: 0.875rem;
    line-height: 1.125rem;
    white-space: pre-wrap;
}

.discord-field {
    margin-top: 4px;
}

.discord-field-name {
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.discord-field-value {
    color: #dbdee1;
    font-size: 0.875rem;
}

.discord-embed-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #949ba4;
    font-weight: 500;
}

.embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.action-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.v2-comp-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.v2-comp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.form-grid-2 {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
}

.builder-column {
    flex: 1;
    min-width: 0;
}

.preview-column {
    width: 780px;
    flex-shrink: 0;
    max-width: 100%;
}

@media (max-width: 1600px) {
    .form-grid-2 {
        flex-direction: column;
    }

    .preview-column {
        width: 100%;
    }
}

.form-grid-stacked {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.form-grid-stacked .builder-column,
.form-grid-stacked .preview-column {
    width: 100%;
}

.form-grid-stacked .preview-column {
    margin-top: 1rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* V2 Layout Specific Fixes */
.v2-layout-card .grid-2 .form-group {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.v2-layout-card .grid-2 .form-group label {
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
}

#form-embed-v2 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

#form-embed-v2 .card {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.v2-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
    justify-content: flex-start;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.v2-actions-bar .btn {
    flex: 1;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 1600px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .preview-column {
        position: relative;
        top: 0;
    }
}

.preview-column {
    position: sticky;
    top: 20px;
    height: fit-content;
    z-index: 100;
    overflow: visible !important;
}

.sticky-top {
    overflow: visible !important;
    z-index: 101;
}

.action-card {
    overflow: visible !important;
    position: relative;
    z-index: 50;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    margin-bottom: 250px !important;
    /* Give room for the channel dropdown */
}

/* --- V2 LAYOUTS (EMBED STUDIO) --- */
.v2-layout-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.v2-layout-card:hover {
    border-color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

.v2-layout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.v2-layout-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v2-layout-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

.v2-layout-body {
    padding: 1.5rem;
}

.v2-sub-item {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    margin-bottom: 10px !important;
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    gap: 15px !important;
    transition: all 0.2s ease;
}

.v2-sub-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(4px);
}

.v2-item-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.v2-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.v2-item-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.v2-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-item-ctrl-group {
    display: flex;
    gap: 6px;
}

.v2-item-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.v2-item-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.v2-item-btn.delete-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.v2-item-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(124, 58, 237, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Select Menu Options styling */
.v2-sm-opts-container {
    margin-top: 10px;
}

.v2-sm-opt-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.v2-sm-opt-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.v2-sm-opt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.v2-sm-opt-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.v2-sm-opt-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-normal);
}

.v2-sm-opt-title i {
    opacity: 0.6;
    width: 12px;
    transition: transform 0.2s;
}

.v2-sm-opt-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.1);
}

@media (max-width: 580px) {
    .v2-sm-opt-body {
        grid-template-columns: 1fr;
    }
}

.v2-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.v2-add-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.v2-add-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    color: var(--primary);
    border-style: solid;
}

/* =========================================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ========================================================= */

/* --- Mobile sidebar toggle button --- */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
    transition: transform 0.2s;
}

.sidebar-toggle:active {
    transform: scale(0.9);
}

/* --- Tablet & small desktop (≤900px) --- */
@media (max-width: 900px) {
    .sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 10000;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }

    .sidebar.open~.sidebar-backdrop,
    .sidebar-backdrop.active {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .top-bar {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .top-bar h2 {
        font-size: 1.2rem;
    }

    .content-scroll {
        padding: 1rem;
        margin: 0 0.5rem 0.5rem;
    }

    .tabs-nav {
        gap: 0.3rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
    }

    .tab-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.82rem;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-card {
        max-width: 95%;
        padding: 1.5rem;
    }

    .control-grid,
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- Phone (≤580px) --- */
@media (max-width: 580px) {
    body {
        font-size: 14px;
    }

    .top-bar {
        padding: 0.8rem;
    }

    .top-bar h2 {
        font-size: 1rem;
    }

    .content-scroll {
        padding: 0.75rem;
        margin: 0 0.25rem 0.25rem;
        border-radius: 12px;
    }

    .tabs-nav {
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }

    .list-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .btn-small {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    .login-card,
    .modal-card {
        padding: 1.2rem;
        border-radius: 16px;
    }

    .login-card h1 {
        font-size: 1.5rem;
    }

    .item-info h5 {
        font-size: 0.95rem;
    }

    .guild-item {
        padding: 0.4rem;
        font-size: 0.85rem;
    }

    .guild-icon {
        width: 24px;
        height: 24px;
    }
}

/* --- REDESIGN LAYOUT --- */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropbtn {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.nav-dropbtn:hover {
    background: var(--glass);
    color: var(--text);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--panel);
    min-width: 220px;
    box-shadow: var(--shadow);
    z-index: 1000;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0.5rem 0;
    top: 100%;
    margin-top: 5px;
}

.nav-dropdown-content a {
    color: var(--text);
    padding: 10px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-dropdown-content a:hover {
    background-color: var(--glass);
    color: var(--accent);
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown.open .nav-dropdown-content {
    display: block;
}

.guilds-grid-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.guilds-grid-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.guilds-grid-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.guilds-grid-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.guilds-grid-status {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--glass);
    margin-top: auto;
}

.guilds-grid-status.active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

@media (max-width: 900px) {
    #topbar-nav:not(.hidden) {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--panel);
        border-top: 1px solid var(--border);
        padding: 10px;
        justify-content: space-around;
        z-index: 9999;
        overflow-x: auto;
        gap: 1rem;
    }

    #topbar-nav.hidden {
        display: none !important;
    }

    .nav-dropdown-content {
        top: auto;
        bottom: 100%;
        margin-bottom: 15px;
        margin-top: 0;
    }

    .mobile-hide {
        display: none !important;
    }

    .main-content {
        padding-bottom: 80px !important;
    }
}

/* App Layout for new sidebar */
@media (min-width: 993px) {
    .app-layout {
        display: flex;
        flex-direction: row;
        height: 100vh;
    }

    .sidebar {
        width: 260px;
        background: var(--panel);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        z-index: 100;
        position: relative;
        transform: none !important;
    }
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* SIDEBAR ENHANCEMENTS */
.category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-content {
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#sidebar-search:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.sidebar-category.collapsed .category-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--glass);
    color: var(--text-main);
}

.sidebar-link.active {
    background: rgba(88, 101, 242, 0.15);
    color: var(--primary);
}

.server-dropdown-container {
    position: relative;
    display: inline-block;
}

.server-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    max-width: calc(100vw - 3rem);
    max-height: 400px;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    margin-top: 8px;
    padding: 0.5rem;
}

.server-dropdown-list.open {
    display: block;
}

.server-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.server-dropdown-item:hover {
    background: var(--glass);
}

.server-dropdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* GUILD CARDS (Central Grid) */
.guild-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.guild-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent);
    pointer-events: none;
}

.guild-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.03);
}

.guild-card-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}

.guild-card-icon-wrapper img,
.guild-card-initials {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.guild-card-initials {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.guild-bot-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 3px solid var(--panel);
}

.guild-card-info {
    flex: 1;
}

.guild-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.guild-card-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.guild-card-action {
    width: 100%;
    margin-top: 0.5rem;
}

.guild-card-action .btn {
    width: 100%;
    border-radius: 12px;
    padding: 10px;
    font-weight: 600;
}

.guild-card.needs-invite {
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.01);
}

.guild-card.needs-invite:hover {
    opacity: 1;
}

@media (max-width: 992px) {
    .app-layout {
        flex-direction: column !important;
        overflow-x: hidden !important;
    }

    /* SIDEBAR MOBILE */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 100000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        background: #0f172a !important;
        border-right: 1px solid var(--border) !important;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.7) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
    }

    .sidebar.mobile-show {
        transform: translateX(0) !important;
    }

    /* TOP BAR MOBILE */
    .top-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
        background: #111827 !important;
        border-bottom: 1px solid var(--border) !important;
        padding: 0 1.25rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        height: 64px !important;
        min-height: 64px !important;
        box-sizing: border-box !important;
    }

    .header-left {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        flex-shrink: 0 !important;
    }

    .server-dropdown-container {
        min-width: 0 !important;
        max-width: fit-content !important;
    }

    #topbar-current-server {
        padding: 4px 8px !important;
        gap: 4px !important;
    }

    /* Hide server name on mobile to save space for icons/badge */
    @media (max-width: 540px) {
        #topbar-server-name {
            display: none !important;
        }
    }

    .mobile-only {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .btn-icon.mobile-only {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: var(--text-main) !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
    }

    .btn-icon.mobile-only:active {
        transform: scale(0.95) !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }

    /* Hide server name on very small mobile to save space */
    @media (max-width: 400px) {
        #topbar-server-name {
            display: none !important;
        }
    }

    .main-content {
        margin-top: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* GUILD LIST MOBILE (VERTICAL & COMPACT) */
    .guild-list {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        gap: 0.4rem !important;
        padding: 0.5rem !important;
        border-right: none !important;
        max-height: calc(100vh - 160px) !important;
    }

    .guild-list::-webkit-scrollbar {
        width: 5px !important;
    }

    .guild-list::-webkit-scrollbar-thumb {
        background: var(--primary) !important;
        border-radius: 5px !important;
    }

    .guild-item {
        margin: 0 !important;
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 0.4rem 0.6rem !important;
        gap: 0.6rem !important;
    }

    .guild-item .guild-icon {
        width: 24px !important;
        height: 24px !important;
    }

    .guild-item .guild-name {
        display: block !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Handle Beta Banner overlap on mobile header */
@media (max-width: 992px) {
    #dev-banner+#app .top-bar {
        top: 44px !important;
        /* Adjust based on banner height */
    }
}
/* HIDE REDUNDANT UI ELEMENTS */
button[onclick='backToHub()'] {
    display: none !important;
}

#view-modules {
    display: none !important;
}

/* MOBILE OVERRIDES (FORCE) */
@media (max-width: 768px) {
    #view-server-select h1, #view-welcome h1 { font-size: 1.8rem !important; }
    #view-server-select p, #view-welcome p { font-size: 0.95rem !important; }
    #view-server-select, #view-welcome { padding: 1.5rem 1rem !important; }
    #guild-grid { grid-template-columns: 1fr !important; gap: 0.8rem !important; }
    .guild-card { padding: 1rem !important; flex-direction: row !important; text-align: left !important; gap: 1rem !important; border-radius: 12px !important; }
    .guild-card-icon-wrapper { width: 50px !important; height: 50px !important; }
    .guild-card-initials { font-size: 1rem !important; border-radius: 12px !important; }
    .guild-card-icon-wrapper img { border-radius: 12px !important; }
    .guild-card-name { font-size: 1rem !important; max-width: 180px !important; }
    .guild-card-action { display: none !important; }
    #view-welcome > div { padding: 2rem 1rem !important; }
    .beta-banner { padding: 6px 12px !important; font-size: 0.75rem !important; }
    .beta-banner i, .beta-banner span { margin: 0 !important; }
}

.mobile-hide { display: flex; }
@media (max-width: 992px) {
    .mobile-hide { display: none !important; }
}

/* FORCE HIDE BACK BUTTONS */
.module-header .btn-icon[onclick*='backToHub'] {
    display: none !important;
}

/* HUB WELCOME MOBILE FIXES */
@media (max-width: 768px) {
    .welcome-card { padding: 2rem 1rem !important; border-radius: 16px !important; margin: 0 10px !important; }
    .welcome-rocket-wrapper { width: 60px !important; height: 60px !important; margin-bottom: 1rem !important; }
    .welcome-rocket-wrapper i { font-size: 1.8rem !important; }
    .welcome-card h1 { font-size: 1.6rem !important; margin-bottom: 0.5rem !important; }
    .welcome-card p { font-size: 0.9rem !important; margin-bottom: 1.5rem !important; }
    .welcome-actions { flex-direction: column !important; width: 100% !important; gap: 0.75rem !important; }
    .welcome-actions .btn-glass { width: 100% !important; min-width: 0 !important; padding: 1rem !important; }
}

/* TOPBAR NAV HINT */
.topbar-nav-hint {
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    animation: hintFloat 2s infinite ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
    z-index: 100;
}

.topbar-nav-hint::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent var(--primary) transparent transparent;
}

@keyframes hintFloat {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(8px); }
}

.topbar-hint-trigger.selected .topbar-nav-hint {
    display: none !important;
}

@media (max-width: 992px) {
    .topbar-nav-hint { display: none !important; }
}

/* --- Statistics Module Modern Styling --- */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stats-chart-container {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .stats-overview-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Stats Time Range Bar --- */
.stats-range-bar {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 4px;
}

.stats-range-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.stats-range-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.stats-range-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}

@media (max-width: 480px) {
    .stats-range-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* AUTO-RESPONSES PREMIUM UI */
.ar-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.ar-premium-tabs .tab-btn {
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ar-premium-tabs .tab-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

.ar-premium-tabs .tab-btn.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.glass-card {
    background: rgba(30,30,35,0.6);
    backdrop-filter: blur(10px);
}

.ar-premium-card .ar-card-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ar-premium-card:hover .ar-card-actions {
    opacity: 1;
}

/* --- MODERN TOGGLES --- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .3s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; }
input:checked + .slider { background-color: #10b981; }
input:focus + .slider { box-shadow: 0 0 1px #10b981; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

/* --- AUTO-RESPONSES REDESIGN CLASSES --- */
.ar-channels-modern-list .list-item { background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.05); border-radius: 0; box-shadow: none; }
.ar-channels-modern-list .list-item:hover { transform: none; background: rgba(255,255,255,0.02); }
.ar-channels-modern-list .list-item.selected-chan { background: rgba(139, 92, 246, 0.1); border-left: 3px solid #8b5cf6; padding-left: 17px; }
.ar-channels-modern-list .list-item:last-child { border-bottom: none; }

/* =========================================================
   📱 MOBILE FIRST REFACTOR (Dashboard)
   ========================================================= */

@media (max-width: 768px) {
    /* --- 1. TABLES TO CARDS --- */
    /* Transforms dense data-tables into stackable cards */
    .data-table, 
    .data-table tbody, 
    .data-table tr, 
    .data-table td {
        display: block;
        width: 100%;
    }
    
    .data-table thead {
        display: none; /* Hide headers, rely on data-label attributes */
    }
    
    .data-table tr {
        margin-bottom: 1rem;
        background: var(--glass);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0.5rem;
    }
    
    .data-table td {
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 0.5rem !important;
        text-align: right; /* Values on the right */
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    
    .data-table td:last-child {
        border-bottom: none;
    }
    
    /* Simulate headers with data-label */
    .data-table td::before {
        content: attr(data-label);
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-muted);
        text-align: left;
    }

    /* --- 2. MODALS AS BOTTOM SHEETS --- */
    .modal-content {
        margin: 0;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        overflow-y: auto;
        animation: slideUpBottomSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes slideUpBottomSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    /* Ensure modal wrappers align items to the bottom */
    .modal {
        align-items: flex-end;
        padding: 0;
    }

    /* --- 3. TOUCH TARGETS (44x44px min) --- */
    .btn, .btn-small, .icon-btn, .tab-btn {
        min-height: 44px;
        padding: 10px 16px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Make checkboxes and toggles more easily tappable */
    input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    .switch {
        min-height: 32px; /* Slight increase for comfort */
    }

    /* --- 4. ZÉRO HOVER DEPENDENCY --- */
    /* If elements were hidden until hover, show them by default on mobile */
    .ar-premium-card .ar-card-actions,
    .list-item .item-actions {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* --- 5. FORMS (1 Column) --- */
    .form-grid, .two-col, .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* --- 6. STICKY BOTTOM BAR --- */
    .mobile-save-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(30, 30, 35, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-top: 1px solid var(--border);
        z-index: 900;
        display: flex;
        justify-content: flex-end; /* Usually we want buttons on the right */
        gap: 1rem;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
        margin-top: 0 !important;
    }
    
    .mobile-save-wrapper .btn-primary {
        flex: 1; /* Stretch the main button on mobile */
    }
    
    /* Ensure content doesn't get hidden behind the sticky bar */
    .view-section {
        padding-bottom: 90px !important; 
    }
}

/* =========================================================
   UX / UI COMPONENTS STANDARDIZATION
   ========================================================= */

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.btn-loading {
    opacity: 0.8;
    cursor: not-allowed !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- SANCTIONS & FILTERS --- */
.filter-chip, .filter-time-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.filter-chip:hover, .filter-time-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--text);
}

.filter-chip.active, .filter-time-btn.active {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.filter-chip.active .chip-count {
    background: var(--primary);
    color: white !important;
}

/* --- RECRUITMENT PREMIUM UI --- */
.recruitment-premium-card {
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.recruitment-premium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}
.premium-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.premium-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.premium-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-main);
}
.premium-card-badge-container {
    margin-bottom: 1.5rem;
}
.premium-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.premium-card-footer {
    margin-top: auto;
}
.premium-config-btn {
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
    transition: all 0.3s;
}
.premium-config-btn:hover {
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}
.new-form-card {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}
.new-form-card:hover {
    border-color: var(--primary);
    background: rgba(88, 101, 242, 0.05);
}
.new-form-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(88, 101, 242, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s;
}
.new-form-card:hover .new-form-icon-container {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}
