:root {
    color-scheme: dark;
    --bg-deep: #0a061c;
    --bg-mid: #120a2c;
    --surface: #151024;
    --surface-elevated: #1c1433;
    --border-glow: rgba(168, 85, 247, 0.3);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #a855f7;
    --accent-strong: #c084fc;
}

body.app-body {
    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, 0.35), transparent 45%),
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.2), transparent 40%),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 55%, #1b1033 100%);
    color: var(--text-main);
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    letter-spacing: 0.01em;
}

.app-content {
    position: relative;
    z-index: 1;
}

body.app-body::before,
body.app-body::after {
    content: "";
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.55;
}

body.app-body::before {
    top: -120px;
    right: -140px;
    background: rgba(168, 85, 247, 0.45);
}

body.app-body::after {
    bottom: -160px;
    left: -140px;
    background: rgba(59, 130, 246, 0.35);
}

.navbar-app {
    background: rgba(11, 7, 32, 0.88);
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
    backdrop-filter: blur(8px);
}

.navbar-brand {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card-surface {
    background: var(--surface);
    border: 1px solid var(--border-glow);
    box-shadow: 0 18px 40px rgba(7, 6, 24, 0.55);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: floatIn 0.6s ease both;
}

.card-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: inherit;
    pointer-events: none;
}

.card-surface:hover {
    transform: translateY(-3px);
    border-color: rgba(192, 132, 252, 0.6);
    box-shadow: 0 22px 50px rgba(12, 10, 32, 0.65);
}

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

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

.form-control,
.form-select,
.form-check-input,
.form-control:focus,
.form-select:focus {
    background-color: #0f172a;
    border-color: rgba(168, 85, 247, 0.35);
    color: var(--text-main);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(192, 132, 252, 0.7);
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.2);
}

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

.table {
    color: var(--text-main);
    --bs-table-bg: transparent;
}

.table thead th {
    color: var(--text-muted);
}

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

.table tbody tr:hover {
    background-color: rgba(148, 163, 184, 0.08);
}

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

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.4);
    border-radius: 0.75rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.4);
    border-radius: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c084fc 100%);
    border: none;
    box-shadow: 0 12px 25px rgba(168, 85, 247, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px 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.1);
    color: #f8fafc;
}

.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.bg-secondary {
    background-color: rgba(148, 163, 184, 0.25) !important;
}

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

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

.list-group-item {
    background-color: var(--surface-elevated);
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--text-main);
}

.nav-link {
    color: rgba(226, 232, 240, 0.8);
}

.nav-link:hover,
.nav-link:focus {
    color: #f3e8ff;
}

.password-inline {
    width: 160px;
}

.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;
}
