:root {
    --primary: #2563eb;
    --primary-glow: #3b82f6;
}

/*
   Every Bootstrap size (headings, badges, buttons, .fs-*, icon glyphs - bi
   icons are font glyphs, so they scale with this too) is defined in rem,
   which is relative to the root (html) font-size. Dropping it from the
   16px default to 14px scales all of that down together in one place,
   instead of hunting down every heading/label across every page.

   Text still needs to shrink a bit further as the screen gets smaller - a
   14px base that looks right on a laptop reads noticeably bigger on a phone,
   where the same rem-sized headings/badges/tiles have much less width to
   work with. These breakpoints match the ones already used for the sidebar
   (992px) and the star-rating widget (576px) elsewhere in this file, so the
   whole responsive scheme stays on one shared set of steps.
*/
html {
    font-size: 14px;
}

@media (max-width: 991.98px) {
    html {
        font-size: 13.5px;
    }
}

@media (max-width: 575.98px) {
    html {
        font-size: 13px;
    }
}

body {
    font-family: 'Segoe UI', sans-serif;
}

/*
   position: sticky + align-self: flex-start keeps the sidebar pinned to
   exactly the viewport height, independent of its flex sibling (main). By
   default a flex row stretches every child to match the tallest one
   (align-items: stretch), so without this the sidebar's rendered height
   would track whatever main happens to be at that instant - very visible on
   pages like Manager/PerformanceEvaluation/Create, where selecting an
   employee reveals/hides large blocks of criteria via JS and used to make
   the sidebar visibly grow/shrink along with it. overflow-y lets the nav
   scroll on its own if it ever has more links than a short window can fit.

   flex-shrink: 0 is just as important: every flex item defaults to
   flex-shrink: 1, so if main's content is ever wider than the space left for
   it (e.g. a wide table/form on a page like the one above), the browser
   would otherwise shrink the sidebar along with it to make room, even below
   its own 250px width. main gets min-width: 0 (see the layout files) so IT
   absorbs all of that instead - the sidebar now never gives up width no
   matter how wide main's content gets.
*/
.sidebar {
    width: 250px;
    height: 100vh;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow-y: auto;
    background-color: #1d4ed8;
}

/* ===================== Responsive app shell ===================== */
/*
   Below 992px (phones and portrait tablets) the sidebar becomes an
   off-canvas panel: fixed, translated fully off-screen, and slid in over a
   dimmed backdrop via the .sidebar-open toggle class (see
   wwwroot/js/sidebar-toggle.js). At 992px and up (landscape tablets,
   laptops, desktops) none of this applies - the sidebar rules above just
   render statically like before, and .mobile-topbar stays hidden.
*/
.mobile-topbar {
    display: none;
    align-items: center;
    gap: .75rem;
    background-color: #0a2aa8;
    color: #fff;
    padding: .75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1040;
}

    .mobile-topbar .sidebar-toggle-btn {
        background: rgba(255,255,255,.12);
        border: 0;
        color: #fff;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        font-size: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .mobile-topbar .sidebar-toggle-btn:hover {
            background: rgba(255,255,255,.22);
        }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 1045;
    border: 0;
    padding: 0;
}

@media (max-width: 991.98px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        max-width: 82vw;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .2s ease-in-out;
        overflow-y: auto;
    }

        .sidebar.sidebar-open {
            transform: translateX(0);
        }

    .sidebar-backdrop.show {
        display: block;
    }
}

    .sidebar h4 {
        font-size: 1.15rem;
    }

    .sidebar .nav-link {
        font-size: .9rem;
        border-radius: 8px;
        margin-bottom: 4px;
        padding: 8px 14px;
    }

        .sidebar .nav-link:hover {
            background: rgba(255,255,255,.15);
        }

    .sidebar .nav-section-label {
        font-size: .68rem;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: rgba(255,255,255,.55);
        margin: 14px 10px 4px;
    }

.card-stat {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

    .card-stat .icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--primary), var(--primary-glow));
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
    }

.table thead th {
    background: #f1f5f9;
    font-weight: 600;
}

.badge-soft-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-soft-success {
    background: #dcfce7;
    color: #166534;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ===================== Star rating (Performance Evaluation) ===================== */
/*
   Each star is an outlined star with a filled blue star layered on top, clipped
   to 0%, 50% or 100% width. That's what makes a true half star possible
   without a second icon set.
*/
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
}

    .star-rating .star {
        position: relative;
        display: inline-block;
        width: 1em;
        height: 1em;
    }

    .star-rating .star-bg,
    .star-rating .star-fg {
        position: absolute;
        top: 0;
        left: 0;
        height: 1em;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
    }

    .star-rating .star-bg {
        width: 1em;
        color: #cbd5e1;
    }

    /* Width is set inline to 0 / 50% / 100% - this is the blue fill. */
    .star-rating .star-fg {
        width: 0;
        color: #0d6efd;
        transition: width .08s linear;
    }

        .star-rating .star-bg i,
        .star-rating .star-fg i {
            display: block;
            width: 1em;
            font-size: inherit;
        }

    /* Interactive variant */
    .star-rating[data-star-input] {
        cursor: pointer;
    }

        .star-rating[data-star-input]:hover .star-fg {
            color: #3d8bfd;
        }

    .star-rating.readonly {
        cursor: default;
    }

    .star-rating.sm {
        font-size: 1rem;
    }

    .star-rating.lg {
        font-size: 1.9rem;
    }

.star-value-label {
    font-size: .8rem;
    color: #64748b;
}

.star-clear-btn {
    border: 0;
    background: none;
    color: #94a3b8;
    font-size: .8rem;
    padding: 0 .25rem;
    line-height: 1;
}

    .star-clear-btn:hover {
        color: #dc3545;
    }

@media (max-width: 575.98px) {
    .star-rating {
        font-size: 1.3rem;
    }
}

/* ===================== Stat tiles ===================== */
.stat-tile {
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    background: #fff;
    padding: 1rem;
    height: 100%;
}

    .stat-tile .stat-label {
        font-size: .75rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: #64748b;
        font-weight: 600;
    }

    .stat-tile .stat-value {
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .stat-tile .stat-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

/* ===================== Report charts ===================== */
/* Chart.js needs a sized, positioned parent to render into. */
.chart-box {
    position: relative;
    height: 340px;
}

.chart-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: #64748b;
    font-size: .9rem;
}
