:root {
    --app-radius: 16px;
    --app-radius-sm: 12px;
    --app-shadow: 0 20px 40px rgba(10, 18, 36, 0.12);
    --app-shadow-soft: 0 10px 28px rgba(10, 18, 36, 0.08);
    --app-accent: #0ea5a3;
    --app-accent-strong: #0b8a88;
    --app-brand: #0f172a;
    --app-warm: #f59e0b;
}

html,
body {
    font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
}

.app-body {
    position: relative;
    min-height: 100vh;
}

[data-bs-theme="dark"] .app-body {
    background: linear-gradient(180deg, rgba(10, 15, 30, 0.95) 0%, rgba(8, 12, 22, 0.98) 100%);
}

.app-shell,
.app-auth-shell,
.toast-container {
    position: relative;
    z-index: 2;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 280px;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .app-sidebar {
    border-right-color: rgba(148, 163, 184, 0.2);
}

.app-content {
    min-width: 0;
}

.app-brand {
    letter-spacing: 0.02em;
    color: var(--app-brand);
}

[data-bs-theme="dark"] .app-brand {
    color: #e2e8f0;
}

.nav-pill-icon {
    width: 1.25rem;
}

.nav-pills .nav-link {
    border-radius: var(--app-radius-sm);
    transition: all 0.22s ease;
}

.nav-pills .nav-link:hover {
    transform: translateX(3px);
    background: rgba(14, 165, 163, 0.1);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--app-accent), #22c55e);
    box-shadow: 0 10px 24px rgba(14, 165, 163, 0.26);
}

.app-topbar {
    backdrop-filter: blur(8px);
}

.app-main-content {
    padding-top: 0.85rem !important;
}

.app-auth-shell {
    padding-top: 1.5rem !important;
}

.app-main-content .card,
.app-auth-shell .card,
.app-main-content .table,
.app-main-content .alert {
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--app-shadow-soft);
    border-radius: var(--app-radius);
}

[data-bs-theme="dark"] .app-main-content .card,
[data-bs-theme="dark"] .app-auth-shell .card,
[data-bs-theme="dark"] .app-main-content .table,
[data-bs-theme="dark"] .app-main-content .alert {
    border-color: rgba(148, 163, 184, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-accent), #14b8a6);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(14, 165, 163, 0.26);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--app-accent-strong), #0d9488);
}

.btn-outline-primary {
    border-color: var(--app-accent);
    color: var(--app-accent-strong);
}

.btn-outline-primary:hover {
    background: rgba(14, 165, 163, 0.14);
    border-color: var(--app-accent);
    color: var(--app-accent-strong);
}

.table-responsive {
    overflow-y: visible;
}

.dropdown-menu {
    z-index: 2000;
    border-radius: 14px;
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: var(--app-shadow-soft);
}

.toast-container {
    z-index: 1080;
}

/* Hard fail-safe: never allow modal backdrop to dim the page. */
.modal-backdrop,
.modal-backdrop.show,
.modal-backdrop.fade,
.modal-backdrop.fade.show {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* Prevent sticky body lock when modal state gets out of sync. */
body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.reveal-item {
    opacity: 0;
    transform: translateY(12px);
    animation: appReveal 0.45s ease forwards;
}

@keyframes appReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .app-main-content {
        padding-top: 0.65rem !important;
    }

    .app-auth-shell {
        padding-top: 1rem !important;
    }

    .app-bg-orb {
        width: 230px;
        height: 230px;
        filter: blur(28px);
    }
}