/* ══════════════════════════════════════════════════════════
   Base / Reset
   ══════════════════════════════════════════════════════════ */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
}

/* ── Focus Outlines ───────────────────────────────────── */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ── Floating Labels ──────────────────────────────────── */

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* ══════════════════════════════════════════════════════════
   Navbar & Navigation Overrides
   ══════════════════════════════════════════════════════════ */

/* ── Navbar Base ──────────────────────────────────────── */

#mainNav {
    background-color: #f0f1f3;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    transition: box-shadow .25s ease, border-color .25s ease;
}

#mainNav.nav-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    border-bottom-color: transparent;
}

/* ── Nav Links ────────────────────────────────────────── */

#mainNav .navbar-nav .nav-link {
    color: #495057;
    font-weight: 500;
    font-size: .9rem;
    padding: .55rem .85rem;
    border-radius: 6px;
    position: relative;
    transition: color .2s ease, background-color .2s ease;
}

#mainNav .navbar-nav .nav-link:hover,
#mainNav .navbar-nav .nav-link:focus {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, .06);
}

#mainNav .navbar-nav .nav-link.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, .08);
    font-weight: 600;
}

/* Active underline indicator (desktop only) */
@media (min-width: 992px) {
    #mainNav .navbar-nav .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 2.5px;
        background-color: #0d6efd;
        border-radius: 2px;
    }
}

/* ── Admin Nav Link ───────────────────────────────────── */

#mainNav .navbar-nav .nav-link.nav-link-admin {
    color: #dc3545;
}

#mainNav .navbar-nav .nav-link.nav-link-admin:hover,
#mainNav .navbar-nav .nav-link.nav-link-admin:focus {
    color: #b02a37;
    background-color: rgba(217, 119, 6, .07);
}

#mainNav .navbar-nav .nav-link.nav-link-admin.active {
    color: #dc3545;
    background-color: rgba(217, 119, 6, .1);
}

@media (min-width: 992px) {
    #mainNav .navbar-nav .nav-link.nav-link-admin.active::after {
        background-color: #dc3545;
    }
}

/* ── Mobile Toggler ───────────────────────────────────── */

#mainNav .navbar-toggler {
    border: 0;
}

#mainNav .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .2);
}

/* ── Sub-navbar gradient strip ────────────────────────── */

#mainNav::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .08), transparent);
    pointer-events: none;
}


/* ══════════════════════════════════════════════════════════
   User Menu & Dropdown
   ══════════════════════════════════════════════════════════ */

.user-menu-btn {
    text-decoration: none;
}

.user-display-name {
    color: #212529;
    font-weight: 500;
    font-size: .88rem;
    transition: color .2s ease;
}

.user-menu-btn:hover .user-display-name,
.user-menu-btn:focus .user-display-name {
    color: #0d6efd;
}

.user-menu-btn + .dropdown-menu,
#userMenuDropdown ~ .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;
    padding: .35rem;
    min-width: 180px;
    margin-top: .35rem;
}

.user-menu-btn + .dropdown-menu .dropdown-item,
#userMenuDropdown ~ .dropdown-menu .dropdown-item {
    border-radius: 5px;
    font-size: .88rem;
    font-weight: 450;
}

.user-menu-btn + .dropdown-menu .dropdown-item:hover,
.user-menu-btn + .dropdown-menu .dropdown-item:focus,
#userMenuDropdown ~ .dropdown-menu .dropdown-item:hover,
#userMenuDropdown ~ .dropdown-menu .dropdown-item:focus {
    background-color: rgba(13, 110, 253, .06);
    color: #0d6efd;
}


/* ══════════════════════════════════════════════════════════
   Footer
   ══════════════════════════════════════════════════════════ */

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 450;
    transition: color .2s ease;
}

.footer-link:hover {
    color: #0d6efd;
}


/* ══════════════════════════════════════════════════════════
   Sidebar Grid & Styles
   ══════════════════════════════════════════════════════════ */

/* ── Grid Layout ──────────────────────────────────────── */

.sidebar-grid {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 0;
    align-items: start;
}

@media (max-width: 991.98px) {
    .sidebar-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Sidebar ──────────────────────────────────────────── */

.sidebar-nav {
    padding: .75rem .75rem 0 .75rem;
}

/* ── Sidebar Card ─────────────────────────────────────── */

.sidebar-nav .card {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-nav .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    font-size: .88rem;
    color: #495057;
    padding: .65rem 1rem;
}

/* ── Sidebar Links ────────────────────────────────────── */

.sidebar-nav .list-group-item {
    font-size: .88rem;
    font-weight: 450;
    color: #495057;
    padding: .6rem 1rem;
    border-color: rgba(0, 0, 0, .04);
    transition: color .2s ease, background-color .2s ease;
}

.sidebar-nav .list-group-item:hover,
.sidebar-nav .list-group-item:focus {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, .04);
}

.sidebar-nav .list-group-item.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, .07);
    border-color: rgba(0, 0, 0, .04);
    border-left: 3px solid #0d6efd;
    font-weight: 500;
}

.sidebar-nav .list-group-item i {
    width: 1.15em;
    text-align: center;
    color: #6c757d;
    transition: color .2s ease;
}

.sidebar-nav .list-group-item:hover i,
.sidebar-nav .list-group-item.active i {
    color: #0d6efd;
}

/* ── Admin link accent ──────────────── */

.sidebar-nav .sidebar-admin-link {
    border-left: 3px solid #dc3545;
}

.sidebar-nav .sidebar-admin-link:hover,
.sidebar-nav .sidebar-admin-link:focus {
    border-left: 3px solid #dc3545;
}

.sidebar-nav .sidebar-admin-link.active {
    border-left: 3px solid #dc3545;
}

/* ── Content Area ─────────────────────────────────────── */

.sidebar-content {
    min-width: 0;
    padding: .75rem 1.25rem;
    background-color: #fff;
}