@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap");

:root {
    --brand: #1d4ed8;
    --brand-strong: #1e40af;
    --accent: #f59e0b;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --line: #d7dde8;
    --shadow: 0 16px 38px rgba(17, 24, 39, 0.1);
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.app-body {
    font-family: "Manrope", sans-serif;
    color: var(--ink-soft);
    line-height: 1.65;
    background:
        radial-gradient(1300px 700px at -4% 0%, rgba(37, 99, 235, 0.14), transparent 58%),
        radial-gradient(900px 500px at 100% 0%, rgba(245, 158, 11, 0.15), transparent 58%),
        linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%);
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-1,
.display-2,
.display-3,
.display-4 {
    font-family: "Sora", sans-serif;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -0.02em;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-strong);
}

.page-content {
    flex: 1;
    animation: page-enter 0.45s ease-out;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-navbar {
    background: linear-gradient(120deg, rgba(17, 24, 39, 0.94), rgba(30, 64, 175, 0.92));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(96, 165, 250, 0.35);
    box-shadow: 0 6px 18px rgba(3, 7, 18, 0.3);
    padding-top: 0.16rem;
    padding-bottom: 0.16rem;
    min-height: 44px;
    z-index: 1030;
}

.navbar-brand {
    font-family: "Sora", sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #eff6ff;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1;
    font-size: 0.84rem;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    color: #ffffff;
    opacity: 0.95;
}

.brand-kicker {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.12em;
    padding: 0.12rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
}

.brand-title {
    font-weight: 700;
}

.navbar-brand .dot {
    color: var(--accent);
}

.navbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4);
    border-color: rgba(147, 197, 253, 0.7);
    outline: none;
}

.navbar .navbar-toggler-icon {
    filter: invert(1);
    width: 1.1em;
    height: 1.1em;
}

.navbar .navbar-nav .nav-link {
    color: rgba(239, 246, 255, 0.92);
    font-weight: 600;
    padding: 0.22rem 0.42rem;
    border-radius: 6px;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.nav-icon-link i {
    font-size: 0.88rem;
    line-height: 1;
}

/* Compact dropdown */
.dropdown-menu-compact {
    min-width: 200px;
    padding: 0.25rem;
}

.dropdown-menu-district {
    min-width: 230px;
    max-height: 60vh;
    overflow-y: auto;
}

.dropdown-header-sm {
    display: block;
    padding: 0.22rem 0.5rem;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

.dropdown-menu {
    border-radius: 10px;
    border: 1px solid rgba(191, 219, 254, 0.8);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.98);
}

.dropdown-item,
.dropdown-menu > a {
    border-radius: 5px;
    font-weight: 500;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.52rem;
    font-size: 0.76rem;
    transition: all 0.12s ease;
}

.dropdown-item i {
    font-size: 0.88rem;
    width: 0.95rem;
    flex-shrink: 0;
    color: var(--muted);
}

.dropdown-item:hover,
.dropdown-menu > a:hover {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--brand-strong);
}

.nav-account {
    margin-left: 0.2rem;
}

.account-pill {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 0.52rem;
    border-radius: 999px;
    color: #e0f2fe;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.69rem;
    font-weight: 700;
    white-space: nowrap;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.26rem 0.62rem;
    font-size: 0.76rem;
    transition: all 0.18s ease;
}

.btn-brand {
    background: linear-gradient(135deg, var(--accent) 0%, #f97316 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-brand:hover {
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink-soft);
}

.table > :not(caption) > * > * {
    border-bottom-color: #e7edf4;
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    vertical-align: middle;
}

.table thead th {
    font-family: "Sora", sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-bottom-width: 1px;
}

.list-group-item {
    border-color: #e8eef5;
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid #cfd9e5;
    background-color: #fff;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.15);
}

.alert {
    border: 1px solid transparent;
    border-radius: 14px;
}

.footer {
    background: linear-gradient(120deg, #0b1220 0%, #1e3a8a 100%);
    margin-top: auto;
}

.footer .footer-bottom {
    padding: 1rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.footer p {
    color: #cbd5e1;
    font-size: 0.94rem;
}

/* Desktop animations and alignments (>= 992px) */
@media (min-width: 992px) {
    .navbar-expand-lg .dropdown-menu {
        animation: navDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        transform-origin: top center;
    }

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

/* Tablet & Mobile Collapsed Navigation (< 992px) */
@media (max-width: 991.98px) {
    .navbar .navbar-collapse {
        margin-top: 0.6rem;
        padding: 0.85rem 0.75rem;
        border-radius: 14px;
        background: rgba(15, 23, 42, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
        max-height: calc(85vh - 65px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .navbar-nav {
        gap: 0.25rem !important;
    }

    .navbar .navbar-nav .nav-link {
        padding: 0.55rem 0.85rem;
        font-size: 0.88rem;
        width: 100%;
        border-radius: 8px;
    }

    .navbar-nav .dropdown-menu {
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
        margin: 0.3rem 0 0.5rem 0.6rem;
        padding: 0.4rem;
        border-radius: 10px;
    }

    .navbar-nav .dropdown-item,
    .navbar-nav .dropdown-menu > a {
        color: #e2e8f0;
        padding: 0.45rem 0.65rem;
        font-size: 0.82rem;
    }

    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-menu > a:hover {
        background-color: rgba(59, 130, 246, 0.25);
        color: #ffffff;
    }

    .navbar-nav .dropdown-item i {
        color: #94a3b8;
    }

    .navbar-nav .dropdown-header-sm {
        color: #94a3b8;
    }

    .navbar-nav .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.12);
    }

    .nav-account {
        margin-top: 0.65rem;
        margin-left: 0;
        width: 100%;
    }

    .account-pill {
        width: 100%;
        height: 36px;
        justify-content: center;
        font-size: 0.8rem;
    }

    .navbar-nav .btn {
        width: 100%;
        margin-top: 0.4rem !important;
        margin-left: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }

    .page-content .container {
        padding-top: 1.25rem !important;
        padding-bottom: 1.75rem !important;
    }
}

/* Sleek Scrollbar for Dropdown menus & mobile nav */
.dropdown-menu-district::-webkit-scrollbar,
.navbar-collapse::-webkit-scrollbar {
    width: 5px;
}

.dropdown-menu-district::-webkit-scrollbar-track,
.navbar-collapse::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.dropdown-menu-district::-webkit-scrollbar-thumb,
.navbar-collapse::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 4px;
}

.dropdown-menu-district::-webkit-scrollbar-thumb:hover,
.navbar-collapse::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}
