/* ——— Main navigation: left brand | center links | right logo + logout ——— */
.protrak-main-nav {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.protrak-nav-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.35rem;
    width: 100%;
}

/* Left: wordmark — fixed block, does not shrink */
.protrak-nav-left {
    flex: 0 0 auto;
}

.protrak-nav-brand {
    font-size: clamp(1.15rem, 2.2vw, 1.65rem);
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: #0f172a !important;
    margin-right: 0;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    white-space: nowrap;
    display: flex; /* Use flex to align logo/text vertically */
    align-items: center; /* Center items vertically */
}

.protrak-nav-brand:hover {
    color: #1e40af !important;
}

.navbar-nav .nav-link.active-page {
    color: #007bff !important;
    font-weight: bold;
}

.protrak-nav-brand .protrak-brand-text {
    /* Default: hide text on all pages */
    display: none;
}

.protrak-nav-brand .protrak-brand-logo {
    /* Default: show standard logo on all pages */
    display: inline-block;
    height: 60px; /* Standard size for non-active pages */
    width: auto;
    vertical-align: middle;
}

.protrak-nav-brand.active-main-page {
    color: #0c1e3d !important;
    font-weight: 700;
}

.protrak-nav-brand.active-main-page .protrak-brand-text {
    display: none; /* Hide text when active */
}

.protrak-nav-brand.active-main-page .protrak-brand-logo {
    display: inline-block; /* Show logo when active */
    height: 65px; /* Bigger size */
    border: 2px solid #007bff; /* Blue border */
    border-radius: 8px; /* Slightly rounded corners */
    padding: 2px; /* Padding inside the border */
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.5); /* Subtle glow */
}

/* Distinguish navigation from collapse toggle */
.protrak-section-nav-link {
    color: inherit;
    transition: opacity 0.2s;
}

.protrak-section-nav-link:hover {
    opacity: 0.8;
}

.protrak-section-nav-link:hover .protrak-section-title {
    color: #2563eb !important;
    text-decoration: underline;
}

.rate-calculation-toggle {
    color: #64748b;
    transition: color 0.2s, transform 0.3s;
}

.rate-calculation-toggle i {
    font-size: 1.75rem; /* Larger toggle for better UI */
}

.rate-calculation-toggle[aria-expanded="false"] i {
    transform: rotate(-90deg);
}

/* Mobile: logo sits in top-right band before menu button */
.protrak-nav-logo-bar {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center;
}

.protrak-nav-toggler {
    flex: 0 0 auto;
    align-self: center;
    border-color: rgba(15, 23, 42, 0.12);
    padding: 0.35rem 0.55rem;
}

/* Center: menu — full width under top row on mobile; grows between columns on sm+ */
.protrak-nav-center {
    flex: 1 1 100%;
    width: 100%;
}

@media (min-width: 576px) {
    .protrak-nav-row {
        flex-wrap: nowrap;
        column-gap: 0.75rem;
        align-items: center;
    }

    .protrak-nav-center {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .protrak-navbar-collapse.protrak-nav-center {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
}

/* Nav links: centered cluster; wrap to extra lines instead of squashing text */
.protrak-nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    row-gap: 0.1rem;
    column-gap: 0;
    margin-bottom: 0;
}

.protrak-nav-links .nav-link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    white-space: nowrap;
}

.protrak-nav-mobile-logout {
    width: 100%;
    padding-top: 0.5rem;
    margin-top: 0.35rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* Right: logout + logo — fixed block on sm+, aligned with nav links */
.protrak-nav-right {
    flex: 0 0 auto;
}

.protrak-nav-logout-link {
    white-space: nowrap;
}

.protrak-nav-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 0;
    flex-shrink: 0;
}

.protrak-nav-logo-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
    border-radius: 6px;
}

/* Logo height matches nav bar line; width scales with aspect ratio */
.protrak-nav-logo {
    height: 42px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    vertical-align: middle;
}

@media (min-width: 768px) {
    .protrak-nav-logo {
        height: 46px;
        max-width: 200px;
    }
}

@media (max-width: 575.98px) {
    .protrak-nav-links {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .protrak-nav-links .nav-link {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Site Protrak navbar stays visible while scrolling any page. */
body > header {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #ffffff;
}

body > header .navbar {
    margin-bottom: 0.65rem;
    background: #ffffff;
}

/* Fix footer collision with tables and implement a sticky footer */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-bottom: 0 !important; /* Reset default margin-bottom from template */
}

.footer {
    position: static !important; /* Remove absolute positioning that causes overlap */
    margin-top: auto;            /* Pushes footer to bottom on short pages */
    padding: 2rem 0;             /* Adds breathing room around the footer */
    width: 100%;
}

.app-version {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
    opacity: 0.75;
    white-space: nowrap;
}

/* ——— Login page ——— */
.protrak-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 12rem);
    padding: 2rem 1rem;
}

.protrak-login__card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.protrak-login__brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(350px, 100%);
    margin: 0 auto 1.75rem;
}

.protrak-login__logo {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    box-shadow: none;
    filter: none;
}

.protrak-login__subtitle {
    margin: -0.95rem 0.1rem 0 0;
    padding: 0;
    align-self: flex-end;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    color: #0f172a;
    text-align: right;
}

.protrak-login__title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #0f172a;
}

.protrak-login__form {
    text-align: left;
}
