@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Colors - DARK (Default) */
    --bg-base: #0a0e17;
    --bg-surface: rgba(22, 27, 34, 0.7);
    --bg-surface-hover: rgba(35, 41, 49, 0.9);
    --bg-glass: rgba(15, 20, 25, 0.6);
    --bg-input: rgba(0, 0, 0, 0.2);

    --primary: #5865F2;
    --primary-hover: #4752C4;
    --primary-glow: rgba(88, 101, 242, 0.4);

    --accent: #57F287;
    --danger: #ED4245;
    --warning: #FEE75C;

    --text-primary: #ffffff;
    --text-main: #E5E7EB;
    --text-muted: #9CA3AF;

    --border: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Effects */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --glass-blur: blur(15px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.06);

    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-hover: #eef2f6;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-input: #e2e8f0;

    --text-primary: #0f172a;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.1);

    --primary-glow: rgba(88, 101, 242, 0.1);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

[data-theme="light"] .imsg-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .modal-overlay {
    background: rgba(226, 232, 240, 0.7) !important;
    backdrop-filter: blur(10px) !important;
}

[data-theme="light"] .imsg-input::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] .modal-content {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
    color: #1e293b !important;
}

[data-theme="light"] .modal-body,
[data-theme="light"] .modal-title,
[data-theme="light"] .modal-header h3 {
    color: #0f172a !important;
}

[data-theme="light"] .btn-ios {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    font-weight: 600 !important;
}

[data-theme="light"] .btn-ios-primary {
    background: linear-gradient(135deg, #5865f2, #4752c4) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3) !important;
}

[data-theme="light"] .btn-ios:hover {
    background: #e2e8f0 !important;
}

[data-theme="light"] .btn-ios-primary:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}

[data-theme="light"] .btn-ios {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .btn-ios:hover {
    background: #e2e8f0 !important;
}

[data-theme="light"] .overview-banner-content h1 {
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    background: transparent;
}

[data-theme="light"] .overview-banner-content div {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

[data-theme="light"] .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .overview-banner-bg {
    filter: brightness(0.8) saturate(1.1) !important;
}

[data-theme="light"] .msg-v2:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .chat-sidebar-v2 {
    background: #f1f5f9;
    border-right: 1px solid #e2e8f0;
}

[data-theme="light"] .chat-content-v3 {
    background: #ffffff;
}

[data-theme="light"] .chat-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .chat-navbar-title {
    color: #1e293b;
}

[data-theme="light"] .chat-messages-v3 {
    background: #f8fafc;
}

[data-theme="light"] .msg-v2-text {
    color: #334155;
}

[data-theme="light"] .msg-v2-author {
    font-weight: 700;
}

[data-theme="light"] .chat-input-row-v3 {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .chat-input-wrapper-v3 {
    background: #f1f5f9;
}

[data-theme="light"] #chat-input {
    color: #1e293b;
}

[data-theme="light"] .stat-value {
    color: #1e293b;
}

[data-theme="light"] .stat-label {
    color: #64748b;
}

[data-theme="light"] .data-name {
    color: #1e293b;
}

[data-theme="light"] .data-meta {
    color: #64748b;
}

[data-theme="light"] .tabs {
    background: #e2e8f0;
}

[data-theme="light"] .tab.active {
    background: #ffffff;
    color: #5865F2;
}

[data-theme="light"] .sidebar {
    background: #ffffff;
}

[data-theme="light"] .nav-item:hover, [data-theme="light"] .nav-item.active {
    background: #f1f5f9;
}

[data-theme="light"] .top-navbar {
    background: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ════════════ Animated Background ════════════ */
.bg-aurora {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 50% 50%, rgba(88, 101, 242, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(87, 242, 135, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(237, 66, 69, 0.05) 0%, transparent 30%);
    animation: aurora-rotate 60s linear infinite;
    z-index: -2;
}

@keyframes aurora-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

/* ════════════ Typography & Utilities ════════════ */
h1,
h2,
h3,
h4 {
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    color: var(--primary-hover);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* ════════════ Top Navbar ════════════ */
.top-navbar {
    height: 70px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-logo {
    height: 32px;
    width: 32px;
    border-radius: 8px;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
    background: var(--bg-surface);
}

/* ════════════ Login Screen (Glassmorphism) ════════════ */
.login-screen {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg), 0 0 40px var(--primary-glow);
    text-align: center;
    animation: fade-in-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo-wrap {
    position: relative;
    margin: 0 auto 20px;
    width: 80px;
    height: 80px;
}

.login-logo {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.login-title {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-sans);
    transition: var(--transition);
    outline: none;
    font-size: 0.95rem;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(0, 0, 0, 0.4);
}

/* ════════════ Buttons ════════════ */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7280ed);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-surface);
}

.btn-accent {
    background: var(--accent);
    color: #000;
}

.btn-accent:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(237, 66, 69, 0.1);
    color: var(--danger);
    border: 1px solid rgba(237, 66, 69, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.btn-icon:hover {
    color: var(--text-main);
    background: var(--bg-surface);
}

/* Loader */
.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* --- Tactile Feedback Animations --- */
.btn-pop {
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-pop:active {
    transform: scale(0.85);
}
.btn-pop.clicked {
    animation: btn-pop-anim 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes btn-pop-anim {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.copy-success {
    color: var(--accent) !important;
    filter: drop-shadow(0 0 5px var(--accent));
}

/* ════════════ Main Dashboard SPA ════════════ */
.dashboard {
    flex: 1;
    display: flex;
    overflow: hidden;
    /* Important: dashboard container stays fixed */
}

/* ════════════ Sidebar ════════════ */
.sidebar {
    width: 280px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 900;
}

.sidebar.collapsed {
    width: 80px;
    overflow: hidden;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-user-info {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 0;
}

.sidebar.collapsed .sidebar-toggle {
    margin: 0;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: rotate(180deg);
    font-size: 1.5rem;
    padding: 8px;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.sidebar.collapsed .sidebar-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    font-size: 0 !important; /* Removes flex width from naked text nodes */
    color: transparent !important;
    overflow: hidden;
}

.sidebar.collapsed .nav-item.active {
    background: rgba(88, 101, 242, 0.15) !important;
}

.sidebar.collapsed .nav-item-icon {
    color: var(--text-muted); /* Restores icon color */
    font-size: 1.4rem !important;
    min-width: 24px;
    margin: 0;
    text-align: center;
}

.sidebar.collapsed .nav-item:hover .nav-item-icon {
    color: var(--text-main);
}

.sidebar.collapsed .nav-item.active .nav-item-icon {
    color: var(--primary);
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    align-items: center; /* Prevents avatar stretching */
    padding: 20px 0;
    flex-direction: column;
    gap: 15px;
}

.sidebar.collapsed .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    margin: 0;
}

.sidebar.collapsed #btn-logout {
    margin: 0;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .card-title {
    color: var(--text-primary);
}

[data-theme="light"] .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Ensure content doesn't jump */
.sidebar>* {
    min-width: 80px;
}

/* ════════════ Main Content ════════════ */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    padding: 30px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: rgba(22, 27, 34, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card:hover {
    border-color: rgba(88, 101, 242, 0.3);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: 800;
    flex: 1;
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 6px;
}

.sidebar-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.nav-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    margin: 16px 0 8px 12px;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.15) 0%, transparent 100%);
    color: var(--primary);
    border-left: 4px solid var(--primary);
    font-weight: 600;
    text-shadow: 0 0 12px rgba(88, 101, 242, 0.4);
}

.nav-item-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-user {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    position: relative;
}

.content-header {
    padding: 30px 40px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.content-body {
    flex: 1;
    padding: 20px 40px 40px;
    overflow-y: auto;
}

/* ════════════ Layout Cards & Stats ════════════ */
.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(145deg, var(--bg-surface), rgba(20, 20, 25, 0.4));
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    background: var(--bg-surface-hover);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(88, 101, 242, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    color: var(--text-main);
    letter-spacing: -1px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.card {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-accent {
    background: rgba(88, 101, 242, 0.15);
    color: var(--primary);
}

.badge-success {
    background: rgba(87, 242, 135, 0.15);
    color: var(--accent);
}

.badge-danger {
    background: rgba(237, 66, 69, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(254, 231, 92, 0.15);
    color: var(--warning);
}

/* Tabs inside Cards */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: var(--transition);
}

.tab:hover {
    background: var(--bg-surface);
    color: var(--text-main);
}

.tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Lists (Lineups/Tops/Members) */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
    gap: 16px;
}

.data-item:hover {
    background: var(--bg-surface);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.data-rank {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-muted);
    width: 40px;
    text-align: center;
}

.data-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.data-info {
    flex: 1;
}

.data-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.data-actions {
    display: flex;
    gap: 8px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ════════════ Modals ════════════ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px) saturate(180%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

@keyframes modal-spring {
    0% { transform: scale(0.6) translateY(100px); opacity: 0; }
    70% { transform: scale(1.05) translateY(-5px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-content {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.modal-close {
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff3b30;
}

.modal-body {
    padding: 30px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.btn-ios {
    padding: 12px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-ios:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-ios-primary {
    background: var(--primary) !important;
    border: none;
    color: white;
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.3);
}

.btn-ios-primary:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 12px 30px rgba(88, 101, 242, 0.5);
    transform: translateY(-3px) scale(1.02);
}

/* ════════════ Autocomplete ════════════ */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--bg-surface);
}

.autocomplete-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ════════════ Toasts ════════════ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
}

.toast {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    font-weight: 500;
}

.toast.out {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(50px);
    }
}

.toast-success {
    border-left: 4px solid var(--accent);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments */
/* ════════════ Overview Banner ════════════ */
.overview-banner-container {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.overview-banner-bg {
    position: absolute;
    inset: 0;
    filter: brightness(0.6);
}

.overview-banner-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 40px;
    gap: 25px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.avatar-wrap { position: relative; }
.banner-avatar {
    width: 120px;
    height: 120px;
    border-radius: 35px;
    border: 5px solid rgba(255,255,255,0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: cover;
}

.banner-admin-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    border: 3px solid var(--bg-surface);
}

.banner-display-name {
    font-size: 3rem;
    margin: 0;
    font-weight: 900;
    letter-spacing: -1.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.banner-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    opacity: 0.9;
}

.banner-username {
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.banner-id { font-size: 0.9rem; letter-spacing: 1px; opacity: 0.7; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        width: 260px;
        transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
    }

    .sidebar.show { transform: translateX(0); }

    .top-navbar { padding: 0 12px; height: 60px; }
    .nav-links { display: none; }
    .guild-drop-item span { max-width: 120px; }

    .main-content { margin-left: 0 !important; padding-top: 70px !important; }

    .content-body { padding: 12px; }
    
    .chat-sidebar-v3 {
        position: absolute;
        width: 240px;
        z-index: 10;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .chat-sidebar-v3.show { transform: translateX(0); }
}

@media (max-width: 480px) {
    .banner-display-name { font-size: 2rem; }
    .banner-avatar { width: 80px; height: 80px; border-radius: 24px; }
    .overview-banner-container { height: 180px; border-radius: 20px; }
    .overview-banner-content { padding: 20px; gap: 15px; }
    
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 20px; }
    .stat-value { font-size: 1.8rem; }
    
    .data-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .data-rank { text-align: left; width: auto; font-size: 0.9rem; }
    .data-actions { width: 100%; justify-content: flex-end; }
    
    .modal-card { height: 100%; max-height: 100%; border-radius: 0; }
    
    .banner-display-name { font-size: 1.8rem; }
    .nav-brand-name { display: none; } /* Specific brand hiding */
    #guild-selector-header button { min-width: 140px; padding: 6px 10px !important; }
    #guild-selector-header span { display: inline-block !important; max-width: 100px; }
    #guild-dropdown-menu { width: 280px !important; right: -50px !important; } /* Center better on small screens */
    .guild-drop-item span { display: block !important; }
}

/* Responsive Utility Classes */
.mobile-only { display: none !important; }
@media (max-width: 768px) {
    .mobile-only { display: inline-block !important; }
    .desktop-only { display: none !important; }
}

/* Pulse animation for bot status indicator */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3);
    }
}

/* Stat cards responsive */
@media (max-width: 900px) {
    .stat-card {
        min-width: 120px;
    }
}

/* Audit log code styling */
code {
    background: rgba(88, 101, 242, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--primary);
}

/* ════════════ Toggle Switch ════════════ */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.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: .4s;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ════════════ Badges & Data Items ════════════ */
.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-accent {
    background: rgba(87, 242, 135, 0.15);
    color: var(--accent);
}

.badge-success {
    background: rgba(87, 242, 135, 0.2);
    color: var(--accent);
}

.data-item {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.data-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-name {
    font-weight: 700;
    font-size: 1.05rem;
}

/* Tabs responsive wrap */
.tabs {
    display: flex;
    flex-wrap: wrap;
}

/* ════════════ Evolution Chat 2.0 ════════════ */
/* ════════════ Evolution Chat V3 (Social & Comunidad) ════════════ */
.chat-layout-v2 {
    display: flex;
    height: 100%;
    min-height: 0;
    max-height: calc(100vh - 120px);
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    border: var(--glass-border);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.chat-sidebar-v3 {
    width: 260px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-content-v3 {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(0, 0, 0, 0.05);
}

.chat-messages-v3 {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.chat-input-row-v3 {
    padding: 20px 24px 24px;
    background: transparent;
}

.chat-input-wrapper-v3 {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 6px 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.chat-input-wrapper-v3:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.chat-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: calc(100vh - 70px);
    /* Fill remaining screen height */
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    margin: -10px;
    /* Bleed for full area feel */
    overflow: hidden;
}

.chat-sidebar-v2 {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 16px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-category-v2 {
    padding: 18px 12px 6px 16px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-arrow {
    font-size: 0.6rem;
    opacity: 0.6;
}

.chat-channels-v2 {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-v2 {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 500;
}

.channel-v2:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.channel-v2.active {
    background: rgba(88, 101, 242, 0.2);
    color: var(--primary);
}

.channel-v2-icon {
    font-size: 1.2rem;
    opacity: 0.5;
    font-family: var(--font-mono);
}

.chat-content-v2 {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.chat-navbar {
    height: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.chat-navbar-title {
    font-weight: 700;
    font-size: 1rem;
}

.chat-messages-v2 {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Chat Media Components */
.chat-media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    max-width: 100%;
}

.media-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-width: 400px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

.media-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

[data-theme="light"] .media-item {
    background: rgba(0, 0, 0, 0.05);
}

.discord-msg {
    display: flex;
    gap: 16px;
    padding: 2px 16px;
    margin-top: 17px;
    transition: background 0.1s;
    position: relative;
}

.discord-msg:hover {
    background: rgba(255, 255, 255, 0.02);
}

.discord-msg.grouped {
    margin-top: 0;
    padding-top: 1px;
    padding-bottom: 1px;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    margin-top: 2px;
}

.discord-msg.grouped .discord-avatar {
    visibility: hidden;
    height: 0;
}

.discord-content {
    flex: 1;
    min-width: 0;
}

.discord-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.discord-author {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
}

.discord-author:hover {
    text-decoration: underline;
}

.discord-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.discord-msg.grouped .discord-header {
    display: none;
}

.discord-msg.grouped .discord-time-inline {
    position: absolute;
    left: 8px;
    top: 5px;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    width: 45px;
    text-align: right;
}

.discord-msg.grouped:hover .discord-time-inline {
    opacity: 1;
}

.discord-text {
    color: #dbdee1;
    line-height: 1.375;
    font-size: 0.95rem;
    word-break: break-word;
    white-space: pre-wrap;
}

.discord-mention {
    background: rgba(88, 101, 242, 0.15);
    color: #c9cdfb;
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
}

.discord-mention:hover {
    background: var(--primary);
    color: #fff;
}

/* Embeds Style */
.discord-embed {
    margin-top: 8px;
    padding: 12px 16px;
    background: #2b2d31;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.discord-embed-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.discord-embed-desc {
    font-size: 0.9rem;
    color: #dbdee1;
}

/* Connection Status indicator */
.sse-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #23a55a;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 8px #23a55a;
}

.sse-status-dot.connecting {
    background: #f0b232;
    box-shadow: 0 0 8px #f0b232;
    animation: pulse-status 1s infinite;
}

.sse-status-dot.disconnected {
    background: #f23f43;
    box-shadow: 0 0 8px #f23f43;
}

@keyframes pulse-status {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.chat-input-container-v2 {
    padding: 0 20px 20px 20px;
    background: transparent;
}

.chat-input-wrapper-v2 {
    background: var(--bg-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    min-height: 44px;
    border: 1px solid var(--border);
}

.chat-input-wrapper-v2 input {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-main);
    outline: none;
}

.chat-reply-bar {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-send-v2 {
    background: var(--primary);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-send-v2:hover {
    transform: scale(1.1);
}

.reaction-v2 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.reaction-v2.active {
    background: rgba(88, 101, 242, 0.15);
    border-color: var(--primary);
}

/* ════════════ Move UI ════════════ */
.move-controls {
    display: flex;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.card:hover .move-controls,
.data-item:hover .move-controls {
    opacity: 1;
}

.btn-move {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-main);
}

.btn-move:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Dynamic Logo Styling */
.nav-logo-container {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-guild-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ════════════ Administration Modules (Tickets, BL, Strikes) ════════════ */
.content-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-surface);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.header-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-glow);
    border-radius: 18px;
    color: var(--primary);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.header-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.data-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.strike-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    background: var(--danger);
    color: white;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* ════════════ Mobile Enhancements v13.5 ════════════ */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        background: var(--bg-surface);
        backdrop-filter: blur(20px);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #main-content {
        margin-left: 0 !important;
        padding: 75px 15px 15px 15px !important; /* Proper top gap for navbar */
        width: 100%;
        overflow-x: hidden;
    }

    .top-navbar {
        padding: 0 15px;
        height: 65px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-links {
        display: none;
    }

    #sidebar-collapse-btn {
        display: flex !important;
        position: relative;
        z-index: 2100;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: 12px;
        width: 44px;
        height: 44px;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 12px var(--primary-glow);
        margin-right: 12px;
        font-size: 1.5rem;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(6px);
        z-index: 1900;
        animation: fadeIn 0.3s ease;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .data-grid-v2 {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 12px 24px;
    }
}

/* Hidden by default on desktop */
#sidebar-collapse-btn {
    display: none;
}

/* ════════════ Modern Chat & Scroll Styles ════════════ */

/* Thin Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Container Specifics */
#tk-chat-stream {
    scroll-behavior: smooth;
    padding-right: 10px !important;
}

/* Animations */
@keyframes bubble-in {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.apple-ticket-item {
    animation: bubble-in 0.3s ease-out backwards;
}

/* Ticket Sidebar/Control Scroll */
.apple-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.apple-card::-webkit-scrollbar {
    width: 4px;
}

.apple-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.apple-card:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.widget-btn {
    width: 100%;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.widget-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ════════════ Spinner & Loading Stats ════════════ */
.btn-loader-mini {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
    margin-right: 8px;
}

.btn-ios.loading .btn-loader-mini {
    display: inline-block;
}

.btn-ios.loading {
    pointer-events: none;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

/* ════════════ Skeleton & Pulse Loading ════════════ */
.skeleton-msg {
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    animation: skeleton-pulse 1.8s infinite ease-in-out;
}

[data-theme="light"] .skeleton-msg {
    background: #eef2f6 !important;
}

/* ════════════ Autocomplete Mentions (@) ════════════ */
.mention-box {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 20px;
    width: 280px;
    max-height: 250px;
    background: rgba(15, 15, 20, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
    z-index: 10000;
    overflow-y: auto;
    display: none;
    animation: modal-pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.mention-item:last-child { border-bottom: none; }

.mention-item:hover, .mention-item.active {
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: inset 2px 0 0 var(--primary);
}

.mention-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; border: 1px solid rgba(255,255,255,0.1);
}

.mention-info {
    flex: 1; min-width: 0;
}

.mention-name {
    font-size: 0.9rem; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mention-user {
    font-size: 0.75rem; color: var(--text-muted); opacity: 0.7;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mention-box::-webkit-scrollbar { width: 4px; }
.mention-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

/* ════════════ iOS-Style Glassmorphism & Custom Select ════════════ */
.ios-blur {
    background: rgba(var(--bg-rgb), 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ow-select {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.ow-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ow-select-trigger:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
}

.ow-select.active .ow-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.ow-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(20, 20, 25, 0.9);
    backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ow-select.active .ow-select-options {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.ow-option {
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ow-option:hover {
    background: rgba(var(--primary-rgb), 0.15);
    color: #fff;
}

.ow-option.selected {
    background: rgba(var(--primary-rgb), 0.3);
    font-weight: 700;
}

/* ════════════ Ticket Layout Fix (Fixed Height) ════════════ */
.tk-layout-v2 {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    height: calc(100vh - 110px);
    background: var(--bg-surface);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tk-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tk-main-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.tk-control-panel {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-surface);
}

.chat-stream-fixed {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ════════════ Modern Verify UI ════════════ */
.vf-card-premium {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 24px;
    transition: transform 0.3s;
}

.vf-card-premium:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
}

.vf-icon-wrap {
    width: 42px; height: 42px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

/* ════════════ Modern Profile Modal & Animations ════════════ */
@keyframes modal-pop {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content.modern-modal {
    animation: modal-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 28px;
    padding: 0;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.1);
}

.profile-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--primary), #7289da);
    position: relative;
}

.profile-avatar-wrapper {
    position: absolute;
    bottom: -40px;
    left: 24px;
    padding: 4px;
    background: var(--bg-surface);
    border-radius: 22px;
}

.profile-avatar {
    width: 80px; height: 80px; border-radius: 18px; 
    object-fit: cover; cursor: pointer; transition: 0.3s;
}
.profile-avatar:hover { transform: scale(1.05); filter: brightness(1.1); }

.profile-info-section {
    padding: 50px 24px 24px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.zoom-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 9999;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(10px); cursor: zoom-out;
}
.zoom-content { max-width: 90%; max-height: 90%; border-radius: 12px; box-shadow: 0 0 50px rgba(0,0,0,0.5); }

/* Custom Select Styling */
.modern-select {
    width: 100%; padding: 10px 14px; border-radius: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main); font-size: 0.9rem; outline: none; transition: 0.3s;
}
.modern-select:focus { border-color: var(--primary); }

/* ════════════ iOS 18 AUDIT LOG REMODEL ════════════ */
.audit-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px 5px;
}

.audit-ios-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: audit-slide-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    position: relative;
    overflow: hidden;
}

.audit-ios-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 6px; height: 100%;
    background: var(--accent-color, var(--primary));
    opacity: 0.8;
}

.audit-ios-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.01) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.audit-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent-glow, rgba(88, 101, 242, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: inset 0 0 15px rgba(255,255,255,0.05);
}

.audit-info-main {
    flex: 1;
    min-width: 0;
}

.audit-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.audit-time-badge {
    padding: 6px 14px;
    background: rgba(0,0,0,0.25);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
}

@keyframes audit-slide-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Action Specific iOS Glows */
.audit-type-danger { --accent-color: #ff3b30; --accent-glow: rgba(255, 59, 48, 0.15); }
.audit-type-success { --accent-color: #34c759; --accent-glow: rgba(52, 199, 89, 0.15); }
.audit-type-warning { --accent-color: #ffcc00; --accent-glow: rgba(255, 204, 0, 0.15); }
.audit-type-info { --accent-color: #007aff; --accent-glow: rgba(0, 122, 255, 0.15); }
.audit-type-purple { --accent-color: #af52de; --accent-glow: rgba(175, 82, 222, 0.15); }
