:root {
    color-scheme: dark;
    --bg-0: #0a0518;
    --bg-1: #0d0720;
    --bg-2: #12092a;
    --bg-3: #180c34;
    --surface: rgba(22, 12, 42, 0.95);
    --surface-strong: rgba(26, 14, 50, 0.98);
    --surface-soft: rgba(32, 17, 60, 0.9);
    --surface-muted: rgba(18, 10, 35, 0.86);
    --stroke: rgba(168, 85, 247, 0.3);
    --stroke-strong: rgba(192, 132, 252, 0.65);
    --stroke-soft: rgba(168, 85, 247, 0.2);
    --text-main: #f8fafc;
    --text-muted: #9aa3b2;
    --text-soft: #cbd5f5;
    --bs-body-color: var(--text-main);
    --bs-card-color: var(--text-main);
    --bs-secondary-color: var(--text-muted);
    --bs-heading-color: var(--text-soft);
    --accent: #a855f7;
    --accent-2: #7c3aed;
    --accent-3: #c084fc;
    --accent-glow: rgba(168, 85, 247, 0.35);
    --shadow-sm: 0 8px 18px rgba(6, 4, 16, 0.45);
    --shadow-lg: 0 22px 45px rgba(6, 4, 16, 0.65);
    --shadow-md: 0 12px 28px rgba(6, 4, 16, 0.55);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --focus-ring: 0 0 0 0.2rem rgba(192, 132, 252, 0.35);
}

body.app-body {
    background: var(--bg-0);
    color: var(--text-main);
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    letter-spacing: 0.01em;
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

body.app-body::before,
body.app-body::after {
    display: none;
}

.app-noise,
.app-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.app-noise {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    mix-blend-mode: screen;
}

.app-grid {
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.12;
    mix-blend-mode: screen;
}

h1, h2, h3, h4, h5, h6,
.page-title,
.page-subtitle,
.section-title {
    color: var(--text-main);
}

.text-body { color: var(--text-main) !important; }
.text-white,
.text-purple-100,
.text-purple-200,
.text-purple-300 { color: var(--text-main) !important; }
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar-app {
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
    border-bottom: 1px solid var(--stroke-soft);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
    color: var(--text-main);
}

.navbar-app .navbar-nav .nav-link {
    color: var(--text-main);
    font-weight: 700;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    transition: all 0.18s ease;
}

.navbar-app .navbar-nav .nav-link:hover,
.navbar-app .navbar-nav .nav-link:focus {
    color: var(--accent-2);
    background: rgba(124, 58, 237, 0.12);
}

.navbar-app .navbar-nav .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.35), 0 0 25px rgba(124, 58, 237, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand {
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main) !important;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.5);
}

.brand-name { line-height: 1; }

.navbar-nav {
    gap: 0.4rem;
    align-items: center;
    row-gap: 0.35rem;
}

.guild-pill {
    background: #0f172a !important;
    border: 1px solid #0f172a;
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.4);
}

.user-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    background: rgba(10, 6, 24, 0.6);
    color: var(--text-main);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(192, 132, 252, 0.6);
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.45);
}

.app-content {
    position: relative;
    z-index: 1;
    padding: 2rem 0 3rem;
    max-width: 1200px;
}

.card-surface {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(192, 132, 252, 0.2), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.12), transparent 40%);
    opacity: 0.35;
    pointer-events: none;
}

.card-surface:hover { transform: translateY(-4px); border-color: var(--stroke-strong); box-shadow: 0 28px 50px rgba(8, 6, 20, 0.75); }
.card-surface:hover::before { opacity: 1; }
.card { color: var(--text-main); }
.bg-dark { color: var(--text-main) !important; }

.btn {
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn::after {
    content: "";
    position: absolute;
    inset: -120% -50%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transition: transform 0.5s ease;
}

.btn:hover::after { transform: translateX(60%); }
.btn:focus-visible { box-shadow: var(--focus-ring); }
.btn-outline-light { border-color: rgba(226, 232, 240, 0.4); color: #e2e8f0; }
.btn-outline-light:hover { background-color: rgba(226, 232, 240, 0.08); color: #f8fafc; }
.btn-outline-secondary { border-color: rgba(148, 163, 184, 0.5); color: #cbd5f5; }
.btn-outline-secondary:hover { background-color: rgba(148, 163, 184, 0.12); color: #f8fafc; }
.btn-success { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); border: none; box-shadow: 0 12px 28px rgba(34, 197, 94, 0.32); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(34, 197, 94, 0.45); }
.btn-danger { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); border: none; box-shadow: 0 12px 28px rgba(239, 68, 68, 0.32); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(239, 68, 68, 0.45); }
.btn-outline-danger { border-color: rgba(239, 68, 68, 0.6); color: #fecaca; }
.btn-outline-warning { border-color: rgba(234, 179, 8, 0.6); color: #fde047; }
.badge { padding: 0.35rem 0.55rem; font-weight: 600; letter-spacing: 0.02em; border-radius: 999px; }

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
    background-color: rgba(10, 10, 24, 0.85);
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--text-main);
    box-shadow: none;
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(192, 132, 252, 0.7);
    box-shadow: var(--focus-ring);
    background-color: rgba(12, 12, 30, 0.95);
}

.form-control::placeholder { color: rgba(148, 163, 184, 0.7); }
.form-select, .form-select:focus { padding-right: 2.4rem; }
.form-check-input { width: 1.1rem; height: 1.1rem; background-color: rgba(10, 10, 24, 0.85); border-color: rgba(168, 85, 247, 0.35); box-shadow: none; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent-3); }
.form-check-input:focus { box-shadow: var(--focus-ring); }
.form-check-label { color: var(--text-soft); }
.form-switch .form-check-input { width: 2.4rem; height: 1.2rem; }

.table { color: var(--text-main); --bs-table-bg: transparent; margin-bottom: 0; border-collapse: separate; border-spacing: 0 0.65rem; }
.table thead th { color: var(--text-muted); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.12em; border-bottom: none; padding-bottom: 0.4rem; border-bottom: 1px solid var(--stroke-soft); margin-bottom: 0.8rem; }
.table tbody > tr > * { background: var(--surface-soft); border-top: 1px solid rgba(148, 163, 184, 0.16); border-bottom: 1px solid rgba(148, 163, 184, 0.16); padding: 0.85rem 0.9rem; }
.table tbody tr:hover > * { background: rgba(168, 85, 247, 0.12); }
.table tbody > tr > *:first-child { border-left: 1px solid rgba(148, 163, 184, 0.16); border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.table tbody > tr > *:last-child { border-right: 1px solid rgba(148, 163, 184, 0.16); border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.alert-success { background-color: rgba(34, 197, 94, 0.15); color: #bbf7d0; border-color: rgba(34, 197, 94, 0.4); border-radius: var(--radius-md); border-left: 4px solid rgba(34, 197, 94, 0.75); }
.alert-danger { background-color: rgba(239, 68, 68, 0.15); color: #fecaca; border-color: rgba(239, 68, 68, 0.4); border-radius: var(--radius-md); border-left: 4px solid rgba(239, 68, 68, 0.75); }

.list-group { display: flex; flex-direction: column; gap: 0.6rem; }
.list-group-item { background-color: var(--surface-strong); border-color: rgba(148, 163, 184, 0.2); color: var(--text-main); border-radius: var(--radius-md); padding: 0.95rem 1rem; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.list-group-item:hover { transform: translateY(-1px); border-color: var(--stroke-strong); box-shadow: var(--shadow-sm); }

.nav-link { color: rgba(226, 232, 240, 0.82); padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid transparent; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.nav-link:hover, .nav-link:focus { color: #f3e8ff; background-color: rgba(168, 85, 247, 0.18); transform: translateY(-1px); }
.nav-link.active { color: #fff; background-color: rgba(168, 85, 247, 0.22); border-color: rgba(192, 132, 252, 0.6); box-shadow: 0 10px 22px rgba(10, 6, 28, 0.45); }
.nav-link:focus-visible { box-shadow: var(--focus-ring); }

.page-title { font-size: 1.6rem; font-weight: 700; margin: 0; }
.page-subtitle { margin: 0; color: var(--text-muted); max-width: 720px; }
.section-title { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
.empty-state { border: 1px dashed var(--stroke-soft); border-radius: var(--radius-md); padding: 1rem; background: rgba(12, 8, 24, 0.55); color: var(--text-muted); }

.action-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.form-section { background: var(--surface-muted); border: 1px solid var(--stroke-soft); border-radius: var(--radius-md); padding: 1rem; }
.form-section + .form-section { margin-top: 1rem; }

.theme-toggle {
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--text-main);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--stroke-strong); }
:root[data-theme="light"] {
    color-scheme: light;
    --bg-0: #f5f4fb;
    --bg-1: #f2f1fa;
    --bg-2: #ebe9f7;
    --bg-3: #e3e0f4;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-soft: rgba(255, 255, 255, 0.92);
    --surface-muted: rgba(245, 243, 253, 0.9);
    --stroke: rgba(124, 58, 237, 0.2);
    --stroke-strong: rgba(124, 58, 237, 0.45);
    --stroke-soft: rgba(124, 58, 237, 0.12);
    --text-main: #0f172a;
    --text-muted: #4b5563;
    --text-soft: #1f2937;
    --bs-body-color: var(--text-main);
    --bs-card-color: var(--text-main);
    --bs-secondary-color: var(--text-muted);
    --bs-heading-color: var(--text-soft);
    --accent: #7c3aed;
    --accent-2: #a855f7;
    --accent-3: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.2);
    --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 22px 42px rgba(15, 23, 42, 0.18);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] .navbar-app {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(233, 231, 251, 0.9));
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

:root[data-theme="light"] .navbar-app .nav-link {
    color: #1f2937 !important;
}

:root[data-theme="light"] .navbar-app .nav-link:hover,
:root[data-theme="light"] .navbar-app .nav-link:focus {
    color: #6d28d9 !important;
    background: rgba(124, 58, 237, 0.12);
}

:root[data-theme="light"] .navbar-app .nav-link.active {
    color: #fff !important;
}

:root[data-theme="light"] .guild-pill {
    background: #111827 !important;
    border-color: #111827;
    color: #fff;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.25);
}

:root[data-theme="light"] .card-surface {
    background: #fff;
    border-color: rgba(124, 58, 237, 0.15);
    box-shadow: var(--shadow-sm);
}

:root[data-theme="light"] .card-surface::before {
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 55%);
}

:root[data-theme="light"] .card-surface::after {
    border-color: rgba(124, 58, 237, 0.08);
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.08), transparent 40%);
}

:root[data-theme="light"] .list-group-item {
    background: #fff;
    color: #111827;
    border-color: rgba(209, 213, 219, 0.6);
}

:root[data-theme="light"] .list-group-item .text-muted {
    color: #4b5563 !important;
}

:root[data-theme="light"] .btn-outline-light {
    color: #111827;
    border-color: #d1d5db;
    background: #fff;
}

:root[data-theme="light"] .btn-outline-light:hover,
:root[data-theme="light"] .btn-outline-light:focus {
    color: #111827;
    background: #f3f4f6;
    border-color: #9ca3af;
}

:root[data-theme="light"] .btn-outline-primary {
    color: #111827;
    border-color: rgba(124, 58, 237, 0.35);
    background: #fff;
}

:root[data-theme="light"] .btn-outline-primary:hover,
:root[data-theme="light"] .btn-outline-primary:focus {
    background: #f3f4f6;
    color: #111827;
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.1);
}

:root[data-theme="light"] .btn-outline-secondary {
    border-color: #d1d5db;
    color: #111827;
    background: #fff;
}

:root[data-theme="light"] .btn-outline-secondary:hover,
:root[data-theme="light"] .btn-outline-secondary:focus {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

:root[data-theme="light"] .btn-outline-danger {
    border-color: #dc2626;
    color: #dc2626;
    background: #fff;
}

:root[data-theme="light"] .btn-outline-danger:hover,
:root[data-theme="light"] .btn-outline-danger:focus {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.15);
}

:root[data-theme="light"] .form-control,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .form-control:focus,
:root[data-theme="light"] .form-select:focus {
    background-color: #fff;
    color: #0f172a;
    border-color: rgba(124, 58, 237, 0.25);
}

:root[data-theme="light"] .form-control:focus,
:root[data-theme="light"] .form-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.18);
}

:root[data-theme="light"] .form-check-input {
    background-color: #e5e7eb;
    border-color: rgba(124, 58, 237, 0.35);
}

:root[data-theme="light"] .form-check-input:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

:root[data-theme="light"] .guild-icon {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
}

:root[data-theme="light"] .guild-icon-fallback {
    background: rgba(124, 58, 237, 0.15);
    color: #111827;
    border: 1px solid rgba(124, 58, 237, 0.35);
}

:root[data-theme="light"] .empty-state {
    background: #f8fafc;
    color: #111827;
    border-color: rgba(124, 58, 237, 0.2);
}

:root[data-theme="light"] .option-pill {
    background: #f8f5ff;
    border-color: rgba(124, 58, 237, 0.35);
    color: #111827;
    box-shadow: 0 8px 14px rgba(17, 24, 39, 0.08);
}

:root[data-theme="light"] .option-remove {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

:root[data-theme="light"] .option-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #7f1d1d;
}

:root[data-theme="light"] .user-identity {
    background: #fff;
    border-color: rgba(124, 58, 237, 0.25);
    color: #0f172a;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
}

:root[data-theme="light"] .btn-outline-danger,
:root[data-theme="light"] .btn-outline-primary,
:root[data-theme="light"] .btn-outline-secondary,
:root[data-theme="light"] .btn-outline-light {
    text-shadow: none;
}

:root[data-theme="light"] .page-title,
:root[data-theme="light"] .page-subtitle,
:root[data-theme="light"] .section-title,
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] h4,
:root[data-theme="light"] h5,
:root[data-theme="light"] h6 {
    color: #0f172a;
}
:root {
    color-scheme: dark;
    --bg-0: #0a0518;
    --bg-1: #0d0720;
    --bg-2: #12092a;
    --bg-3: #180c34;
    --surface: rgba(22, 12, 42, 0.95);
    --surface-strong: rgba(26, 14, 50, 0.98);
    --surface-soft: rgba(32, 17, 60, 0.9);
    --surface-muted: rgba(18, 10, 35, 0.86);
    --stroke: rgba(168, 85, 247, 0.3);
    --stroke-strong: rgba(192, 132, 252, 0.65);
    --stroke-soft: rgba(168, 85, 247, 0.2);
    --text-main: #f8fafc;
    --text-muted: #9aa3b2;
    --text-soft: #cbd5f5;
    --bs-body-color: var(--text-main);
    --bs-card-color: var(--text-main);
    --bs-secondary-color: var(--text-muted);
    --bs-heading-color: var(--text-soft);
    --accent: #a855f7;
    --accent-2: #7c3aed;
    --accent-3: #c084fc;
    --accent-glow: rgba(168, 85, 247, 0.35);
    --shadow-sm: 0 8px 18px rgba(6, 4, 16, 0.45);
    --shadow-lg: 0 22px 45px rgba(6, 4, 16, 0.65);
    --shadow-md: 0 12px 28px rgba(6, 4, 16, 0.55);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --focus-ring: 0 0 0 0.2rem rgba(192, 132, 252, 0.35);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-0: #f5f4fb;
    --bg-1: #f2f1fa;
    --bg-2: #ebe9f7;
    --bg-3: #e3e0f4;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-soft: rgba(255, 255, 255, 0.92);
    --surface-muted: rgba(245, 243, 253, 0.9);
    --stroke: rgba(124, 58, 237, 0.2);
    --stroke-strong: rgba(124, 58, 237, 0.45);
    --stroke-soft: rgba(124, 58, 237, 0.12);
    --text-main: #0f172a;
    --text-muted: #4b5563;
    --text-soft: #1f2937;
    --bs-body-color: var(--text-main);
    --bs-card-color: var(--text-main);
    --bs-secondary-color: var(--text-muted);
    --bs-heading-color: var(--text-soft);
    --accent: #7c3aed;
    --accent-2: #a855f7;
    --accent-3: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.2);
    --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 22px 42px rgba(15, 23, 42, 0.18);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.15);
}

body.app-body {
    background: var(--bg-0);
    color: var(--text-main);
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    letter-spacing: 0.01em;
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

body.app-body::before,
body.app-body::after {
    display: none;
}

.app-noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

.app-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar-app {
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
    border-bottom: 1px solid var(--stroke-soft);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
    color: var(--text-main);
}

.navbar-app .navbar-nav .nav-link {
    color: var(--text-main);
    font-weight: 700;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    transition: all 0.18s ease;
}

.navbar-app .navbar-nav .nav-link:hover,
.navbar-app .navbar-nav .nav-link:focus {
    color: var(--accent-2);
    background: rgba(124, 58, 237, 0.12);
}

.navbar-app .navbar-nav .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.35), 0 0 25px rgba(124, 58, 237, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand {
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main) !important;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.5);
}

.brand-name {
    line-height: 1;
}

.text-body {
    color: var(--text-main) !important;
}

.navbar-nav {
    gap: 0.4rem;
    align-items: center;
    row-gap: 0.35rem;
}

.navbar-app .navbar-brand,
.navbar-app .nav-link,
.navbar-app .navbar-text {
    color: var(--text-main) !important;
}

.navbar-app .nav-link:hover,
.navbar-app .nav-link:focus,
.navbar-app .nav-link.active {
    color: var(--accent-3) !important;
}

.navbar-app .navbar-brand {
    color: var(--text-main) !important;
}

:root[data-theme="light"] .navbar-app {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(233, 231, 251, 0.9));
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

:root[data-theme="light"] .navbar-app .nav-link {
    color: #1f2937 !important;
}

:root[data-theme="light"] .navbar-app .nav-link:hover,
:root[data-theme="light"] .navbar-app .nav-link:focus {
    color: #6d28d9 !important;
    background: rgba(124, 58, 237, 0.12);
}

:root[data-theme="light"] .navbar-app .nav-link.active {
    color: #fff !important;
}

.guild-pill {
    background: #0f172a !important;
    border: 1px solid #0f172a;
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.4);
}

:root[data-theme="light"] .guild-pill {
    background: #111827 !important;
    border-color: #111827;
    color: #fff;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.25);
}

.user-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    background: rgba(10, 6, 24, 0.6);
    color: var(--text-main);
}

:root[data-theme="light"] .user-identity {
    background: #fff;
    border-color: rgba(124, 58, 237, 0.25);
    color: #0f172a;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(192, 132, 252, 0.6);
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.45);
}

.app-content {
    position: relative;
    z-index: 1;
    padding: 2rem 0 3rem;
    max-width: 1200px;
}

.app-content > * + * {
    margin-top: 1.5rem;
}

.app-content > * {
    animation: rise 0.7s ease both;
}

.app-content > *:nth-child(2) { animation-delay: 0.05s; }
.app-content > *:nth-child(3) { animation-delay: 0.1s; }
.app-content > *:nth-child(4) { animation-delay: 0.15s; }
.app-content > *:nth-child(5) { animation-delay: 0.2s; }

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

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(35px, -20px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

.card-surface {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(192, 132, 252, 0.2), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.12), transparent 40%);
    opacity: 0.35;
    pointer-events: none;
}

.card-surface:hover {
    transform: translateY(-4px);
    border-color: var(--stroke-strong);
    box-shadow: 0 28px 50px rgba(8, 6, 20, 0.75);
}

.card-surface:hover::before {
    opacity: 1;
}

.card {
    color: var(--text-main);
}

.bg-dark {
    color: var(--text-main) !important;
}

.text-muted,
.form-text {
    color: var(--text-muted) !important;
}

.form-label {
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    font-weight: 600;
    color: var(--text-soft);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
    background-color: rgba(10, 10, 24, 0.85);
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--text-main);
    box-shadow: none;
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(192, 132, 252, 0.7);
    box-shadow: var(--focus-ring);
    background-color: rgba(12, 12, 30, 0.95);
}

:root[data-theme="light"] .form-control,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .form-control:focus,
:root[data-theme="light"] .form-select:focus {
    background-color: #fff;
    color: #0f172a;
    border-color: rgba(124, 58, 237, 0.25);
}

:root[data-theme="light"] .form-control:focus,
:root[data-theme="light"] .form-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.18);
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.form-select,
.form-select:focus {
    padding-right: 2.4rem;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    background-color: rgba(10, 10, 24, 0.85);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: none;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent-3);
}

:root[data-theme="light"] .form-check-input {
    background-color: #e5e7eb;
    border-color: rgba(124, 58, 237, 0.35);
}

:root[data-theme="light"] .form-check-input:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

:root[data-theme="light"] .card-surface {
    background: #fff;
    border-color: rgba(124, 58, 237, 0.15);
    box-shadow: var(--shadow-sm);
}

:root[data-theme="light"] .card-surface::before {
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 55%);
}

:root[data-theme="light"] .card-surface::after {
    border-color: rgba(124, 58, 237, 0.08);
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.08), transparent 40%);
}

:root[data-theme="light"] .list-group-item {
    background: #fff;
    color: #111827;
    border-color: rgba(209, 213, 219, 0.6);
}

:root[data-theme="light"] .list-group-item .text-muted {
    color: #4b5563 !important;
}

:root[data-theme="light"] .btn-outline-light {
    color: #111827;
    border-color: #d1d5db;
    background: #fff;
}

:root[data-theme="light"] .btn-outline-light:hover,
:root[data-theme="light"] .btn-outline-light:focus {
    color: #111827;
    background: #f3f4f6;
    border-color: #9ca3af;
}

.text-white {
    color: var(--text-main) !important;
}

.text-purple-100,
.text-purple-200,
.text-purple-300 {
    color: var(--text-main) !important;
}

.page-title,
.page-subtitle,
.section-title,
.h6,
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
}

:root[data-theme="light"] .page-title,
:root[data-theme="light"] .page-subtitle,
:root[data-theme="light"] .section-title,
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] h4,
:root[data-theme="light"] h5,
:root[data-theme="light"] h6 {
    color: #0f172a;
}

.form-check-input:focus {
    box-shadow: var(--focus-ring);
}

.form-check-label {
    color: var(--text-soft);
}

.form-switch .form-check-input {
    width: 2.4rem;
    height: 1.2rem;
}

.table {
    color: var(--text-main);
    --bs-table-bg: transparent;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 0.65rem;
}

.table thead th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    border-bottom: none;
    padding-bottom: 0.4rem;
}

.table td,
.table th {
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--text-main) !important;
}

.table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table tbody tr:hover {
    background-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(8, 6, 20, 0.35);
}

.table > :not(caption) > * > * {
    background-color: transparent;
}

.table tbody > tr > * {
    background: var(--surface-soft);
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    padding: 0.85rem 0.9rem;
}

.table tbody tr:hover > * {
    background: rgba(168, 85, 247, 0.12);
}

.table tbody > tr > *:first-child {
    border-left: 1px solid rgba(148, 163, 184, 0.16);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table tbody > tr > *:last-child {
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.4);
    border-radius: var(--radius-md);
    border-left: 4px solid rgba(34, 197, 94, 0.75);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-md);
    border-left: 4px solid rgba(239, 68, 68, 0.75);
}

.btn {
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn::after {
    content: "";
    position: absolute;
    inset: -120% -50%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: translateX(-60%);
    transition: transform 0.45s ease;
}

.btn:hover::after {
    transform: translateX(60%);
}

.btn-primary {
    background: linear-gradient(135deg, #6d28d9 0%, #9333ea 50%, #c084fc 100%);
    border: none;
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 35px rgba(168, 85, 247, 0.45);
}

.btn-outline-primary {
    border-color: rgba(168, 85, 247, 0.6);
    color: #e9d5ff;
}

.btn-outline-primary:hover {
    background-color: rgba(168, 85, 247, 0.2);
    color: #f3e8ff;
}

.btn-outline-light {
    border-color: rgba(226, 232, 240, 0.4);
    color: #e2e8f0;
}

.btn-outline-light:hover {
    background-color: rgba(226, 232, 240, 0.08);
    color: #f8fafc;
}

.btn-outline-secondary {
    border-color: rgba(148, 163, 184, 0.5);
    color: #cbd5f5;
}

.btn-outline-secondary:hover {
    background-color: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

:root[data-theme="light"] .btn-outline-secondary {
    border-color: #d1d5db;
    color: #111827;
    background: #fff;
}

:root[data-theme="light"] .btn-outline-secondary:hover,
:root[data-theme="light"] .btn-outline-secondary:focus {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.32);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(34, 197, 94, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border: none;
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.32);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(239, 68, 68, 0.45);
}

.btn:focus-visible {
    box-shadow: var(--focus-ring);
}

.badge {
    padding: 0.35rem 0.55rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 999px;
}

.btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.6);
    color: #fecaca;
}

:root[data-theme="light"] .btn-outline-danger {
    border-color: #dc2626;
    color: #dc2626;
    background: #fff;
}

:root[data-theme="light"] .btn-outline-danger:hover,
:root[data-theme="light"] .btn-outline-danger:focus {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.15);
}

.btn-outline-warning {
    border-color: rgba(234, 179, 8, 0.6);
    color: #fde047;
}

.badge.bg-secondary {
    background-color: rgba(148, 163, 184, 0.25) !important;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: var(--text-main);
}

.badge.bg-success {
    background-color: rgba(34, 197, 94, 0.25) !important;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.list-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.list-group-item {
    background-color: var(--surface-strong);
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.list-group-item:hover {
    transform: translateY(-1px);
    border-color: var(--stroke-strong);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    color: rgba(226, 232, 240, 0.82);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: #f3e8ff;
    background-color: rgba(168, 85, 247, 0.18);
    transform: translateY(-1px);
}

.nav-link.active {
    color: #fff;
    background-color: rgba(168, 85, 247, 0.22);
    border-color: rgba(192, 132, 252, 0.6);
    box-shadow: 0 10px 22px rgba(10, 6, 28, 0.45);
}

.nav-link:focus-visible {
    box-shadow: var(--focus-ring);
}

.password-inline {
    width: 160px;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f3e8ff;
    margin: 0;
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    max-width: 720px;
}

.section-title {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state {
    border: 1px dashed var(--stroke-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: rgba(12, 8, 24, 0.55);
    color: var(--text-muted);
}

:root[data-theme="light"] .empty-state {
    background: #f8fafc;
    color: #111827;
    border-color: rgba(124, 58, 237, 0.2);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.form-section {
    background: var(--surface-muted);
    border: 1px solid var(--stroke-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.form-section + .form-section {
    margin-top: 1rem;
}

.section-header {
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--stroke-soft);
    margin-bottom: 0.8rem;
}

.filter-chips {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-soft);
    background: rgba(12, 8, 28, 0.6);
}

.filter-chips .btn {
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    box-shadow: none;
}

.filter-chips .btn-primary {
    box-shadow: 0 10px 22px rgba(168, 85, 247, 0.3);
}

.btn-outline-primary {
    color: var(--text-main);
    border-color: var(--accent);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(124, 58, 237, 0.12);
    color: var(--text-main);
    border-color: var(--accent-2);
}

:root[data-theme="light"] .btn-outline-primary {
    color: #111827;
    border-color: rgba(124, 58, 237, 0.35);
    background: #fff;
}

:root[data-theme="light"] .btn-outline-primary:hover,
:root[data-theme="light"] .btn-outline-primary:focus {
    background: #f3f4f6;
    color: #111827;
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.1);
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.stat-value {
    font-size: clamp(1.6rem, 1.4vw + 1.2rem, 2.2rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
}

.role-badge {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid transparent;
}

.role-owner {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.6);
    color: #f3e8ff;
}

.role-admin {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    color: #dbeafe;
}

.role-reviewer {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.6);
    color: #d1fae5;
}

.guild-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 10px 20px rgba(7, 6, 24, 0.45);
}

.guild-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.2);
    color: #f3e8ff;
    font-weight: 600;
    text-transform: uppercase;
}

:root[data-theme="light"] .guild-icon {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
}

:root[data-theme="light"] .guild-icon-fallback {
    background: rgba(124, 58, 237, 0.15);
    color: #111827;
    border: 1px solid rgba(124, 58, 237, 0.35);
}

.question-card {
    border: 1px solid rgba(168, 85, 247, 0.22);
}

.question-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.question-panel {
    background: var(--surface-muted);
    border: 1px solid var(--stroke-soft);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
}

.panel-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.question-type-toggle .btn {
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--text-soft);
    background: rgba(12, 8, 24, 0.7);
}

.question-type-toggle .btn:hover {
    background: rgba(168, 85, 247, 0.18);
    color: #f3e8ff;
}

.question-type-toggle .btn-check:checked + .btn {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(168, 85, 247, 0.95));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px rgba(168, 85, 247, 0.35);
}

.question-order {
    min-width: 120px;
}

.option-builder .input-group {
    gap: 0.5rem;
}

.option-builder .input-group .form-control {
    border-radius: var(--radius-md);
}

.option-helper {
    margin-top: 0.4rem;
}

.option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.option-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(12, 8, 24, 0.75);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #f3e8ff;
    font-size: 0.85rem;
    box-shadow: 0 8px 18px rgba(12, 8, 28, 0.35);
}

:root[data-theme="light"] .option-pill {
    background: #f8f5ff;
    border-color: rgba(124, 58, 237, 0.35);
    color: #111827;
    box-shadow: 0 8px 14px rgba(17, 24, 39, 0.08);
}

:root[data-theme="light"] .option-remove {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

:root[data-theme="light"] .option-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #7f1d1d;
}

.option-remove {
    border: none;
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    line-height: 1;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.option-remove:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
}

.section-header {
    margin: 1.5rem 0 0.8rem;
}

.app-footer {
    margin-top: auto;
    padding: 1.4rem 0;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    background: rgba(10, 6, 24, 0.8);
    backdrop-filter: blur(6px);
}

.app-footer a {
    color: #e9d5ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(192, 132, 252, 0.45);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.app-footer a:hover {
    color: #f3e8ff;
    border-color: rgba(226, 232, 240, 0.6);
}

.theme-toggle {
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--text-main);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--stroke-strong);
}

.role-pill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
}

.role-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid var(--stroke);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.role-pill:hover {
    border-color: var(--stroke-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.role-pill input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1.05rem;
    height: 1.05rem;
}

.role-pill .role-name {
    color: var(--text-main);
    font-weight: 600;
}

.role-pill .role-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

:root[data-theme="light"] .app-footer {
    background: rgba(255, 255, 255, 0.9);
    border-top-color: rgba(124, 58, 237, 0.2);
}

:root[data-theme="light"] .app-footer a {
    color: #5b21b6;
    border-color: rgba(124, 58, 237, 0.35);
}

@media (max-width: 991px) {
    .navbar-nav {
        padding-top: 0.5rem;
    }
    .nav-link {
        margin: 0.15rem 0;
    }
    .app-content {
        padding: 1.6rem 0 2.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
