/* Finstra HRMS: Bootstrap 5 theme overrides. */

:root {
    --hrm-primary: #5b30c4;
    --hrm-primary-rgb: 91, 48, 196;
    --hrm-primary-dark: #4a24a8;
    --hrm-primary-soft: #efe9fc;
    --hrm-sidebar-bg: #1f1640;
    --hrm-sidebar-text: #c9c2e3;
    --hrm-sidebar-width: 240px;
    --hrm-body-bg: #f5f6fa;

    --bs-primary: var(--hrm-primary);
    --bs-primary-rgb: var(--hrm-primary-rgb);
    --bs-link-color: var(--hrm-primary);
    --bs-link-color-rgb: var(--hrm-primary-rgb);
    --bs-link-hover-color: var(--hrm-primary-dark);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: 0.9rem;
    --bs-border-radius: 0.5rem;
}

/* Page background only; --bs-body-bg stays white because Bootstrap also uses it for inputs. */
body { background-color: var(--hrm-body-bg); }

.btn-primary {
    --bs-btn-bg: var(--hrm-primary);
    --bs-btn-border-color: var(--hrm-primary);
    --bs-btn-hover-bg: var(--hrm-primary-dark);
    --bs-btn-hover-border-color: var(--hrm-primary-dark);
    --bs-btn-active-bg: var(--hrm-primary-dark);
    --bs-btn-active-border-color: var(--hrm-primary-dark);
    --bs-btn-disabled-bg: var(--hrm-primary);
    --bs-btn-disabled-border-color: var(--hrm-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--hrm-primary);
    --bs-btn-border-color: var(--hrm-primary);
    --bs-btn-hover-bg: var(--hrm-primary);
    --bs-btn-hover-border-color: var(--hrm-primary);
    --bs-btn-active-bg: var(--hrm-primary-dark);
    --bs-btn-active-border-color: var(--hrm-primary-dark);
}

/* Compact controls: forms and buttons match the 0.9rem body text. */
.btn { --bs-btn-font-size: .875rem; --bs-btn-padding-y: .4rem; --bs-btn-padding-x: .8rem; }
.btn-sm { --bs-btn-font-size: .8rem; --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .45rem; }
.form-control, .form-select, .input-group-text { font-size: .875rem; padding-top: .4rem; padding-bottom: .4rem; }
.form-select { padding-right: 2rem; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .page-link:hover, .stretched-link:hover, .app-brand-link:hover { text-decoration: none; }

.text-bg-primary { background-color: var(--hrm-primary) !important; }
.text-primary { color: var(--hrm-primary) !important; }
.bg-primary-soft { background-color: var(--hrm-primary-soft) !important; }

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(var(--hrm-primary-rgb), .5);
    box-shadow: 0 0 0 .2rem rgba(var(--hrm-primary-rgb), .15);
}

.form-check-input:checked {
    background-color: var(--hrm-primary);
    border-color: var(--hrm-primary);
}

.pagination {
    --bs-pagination-color: var(--hrm-primary);
    --bs-pagination-active-bg: var(--hrm-primary);
    --bs-pagination-active-border-color: var(--hrm-primary);
    margin-bottom: 0;
}

/* ---------- Shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    --bs-offcanvas-width: var(--hrm-sidebar-width);
    --bs-offcanvas-bg: var(--hrm-sidebar-bg);
    /* !important: Bootstrap's .offcanvas-lg forces a transparent background on large screens. */
    background-color: var(--hrm-sidebar-bg) !important;
    color: var(--hrm-sidebar-text);
}

@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        width: var(--hrm-sidebar-width);
        flex: 0 0 var(--hrm-sidebar-width);
        overflow-y: auto;
    }

    /* Bootstrap hides the offcanvas header and strips body padding on large screens. */
    .app-sidebar .offcanvas-header { display: flex; }
    .app-sidebar .app-nav { padding: .75rem; }
}

.app-brand { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.app-brand-link { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: 1.05rem; }
.app-brand-logo { display: block; width: 100%; max-width: 170px; height: auto; border-radius: .25rem; }

.app-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: .5rem;
    background: linear-gradient(135deg, #7b3fe4, #c13ad6);
    color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.app-brand-mark-lg { width: 3rem; height: 3rem; font-size: 1.1rem; border-radius: .75rem; }

.app-nav { display: flex; padding: .75rem; gap: 2px; }
.app-nav .nav-link {
    display: flex; align-items: center; gap: .65rem;
    padding: .5rem .75rem; border-radius: .4rem;
    color: var(--hrm-sidebar-text); font-weight: 500;
}
.app-nav .nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; }
.app-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.app-nav .nav-link.active { color: #fff; background: var(--hrm-primary); }
.app-nav .nav-link.disabled { opacity: .45; }
.app-nav-section {
    margin: .9rem .75rem .3rem; font-size: .7rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .4);
}

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem 1.5rem; background: #fff; border-bottom: 1px solid var(--bs-border-color);
}

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--hrm-primary-soft); color: var(--hrm-primary); font-weight: 600; font-size: .75rem;
}

.app-content { padding: 1.25rem 1.5rem 2rem; }
.app-footer { margin-top: auto; padding: .75rem 1.5rem; border-top: 1px solid var(--bs-border-color); text-align: center; font-size: .8rem; }
.app-footer a, .guest-footer a { color: var(--bs-secondary-color); text-decoration: none; }
.app-footer a:hover, .guest-footer a:hover { color: var(--hrm-primary); text-decoration: underline; }

@media (max-width: 575.98px) {
    .app-topbar { padding: .5rem 1rem; }
    .app-content { padding: 1rem 1rem 1.5rem; }
}

/* ---------- Cards, tables, details ---------- */

.card { border-color: #e6e7ee; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { background: #fff; font-weight: 600; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
    font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
    color: #6b7280; background: #fafafc; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table td.actions, .table th.actions { text-align: end; white-space: nowrap; width: 1%; }

.sort-link { color: inherit; text-decoration: none; }
.sort-link i { opacity: .45; font-size: .8rem; }
.sort-link.active, .sort-link:hover { color: var(--hrm-primary); }
.sort-link.active i { opacity: 1; }

.detail-label { font-size: .75rem; color: #6b7280; margin-bottom: .1rem; }
.detail-value { font-weight: 500; word-break: break-word; }
.text-pre-line { white-space: pre-line; }

.form-label { font-weight: 500; margin-bottom: .3rem; }
.form-section-title {
    font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    color: var(--hrm-primary); border-bottom: 1px solid #ecebf3; padding-bottom: .35rem; margin-bottom: .9rem;
}
fieldset + fieldset { margin-top: 1.25rem; }

/* ---------- Dashboard ---------- */

.stat-card .stat-icon {
    width: 2.5rem; height: 2.5rem; border-radius: .6rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card a.stretched-link:hover ~ * { color: var(--hrm-primary); }

.dash-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.dash-greeting-icon { font-size: 2.2rem; color: #f59e0b; }
.dash-banner { display: flex; align-items: center; background: var(--hrm-primary); color: #fff; border-radius: .75rem; padding: .6rem 1rem; }

.dash-stat .card-body { display: flex; align-items: flex-start; gap: .85rem; }
.dash-stat { transition: box-shadow .15s ease, transform .15s ease; }
.dash-stat:hover { box-shadow: 0 6px 18px rgba(var(--hrm-primary-rgb), .12); transform: translateY(-1px); }
.dash-stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }

.dash-icon { width: 2.75rem; height: 2.75rem; border-radius: .75rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.dash-icon-sm { width: 2.1rem; height: 2.1rem; border-radius: .6rem; font-size: 1rem; }
.dash-icon-primary { background: var(--hrm-primary-soft); color: var(--hrm-primary); }
.dash-icon-purple { background: #f3e8ff; color: #7e22ce; }
.dash-icon-success { background: #dcfce7; color: #15803d; }
.dash-icon-danger { background: #fce7f3; color: #be185d; }
.dash-icon-warning { background: #fef3c7; color: #b45309; }
.dash-icon-info { background: #e0f2fe; color: #0369a1; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--bs-secondary-color); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; }
.dot-present, .bar-present { background: var(--hrm-primary); }
.dot-absent, .bar-absent { background: #ec4899; }
.dot-leave, .bar-leave { background: #a78bfa; }

.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 220px; border-bottom: 1px solid #ecebf3;
    background: repeating-linear-gradient(to top, #f4f3f9 0 1px, transparent 1px 44px); }
.bar-group { flex: 1; display: flex; flex-direction: column; height: 100%; position: relative; }
.bar-group .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { width: 28%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 0; }
.bar-wide { width: 55%; max-width: 32px; }
.bar-label { position: absolute; top: 100%; left: 0; right: 0; padding-top: .35rem; text-align: center; font-size: .72rem; color: var(--bs-secondary-color); line-height: 1.2; }
.bar-label span { color: var(--bs-tertiary-color); }
.bar-chart { margin-bottom: 2.4rem; }

.donut { position: relative; width: 170px; height: 170px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dept-legend li { display: flex; align-items: center; gap: .25rem; padding: .2rem 0; min-width: 9rem; }
.dept-legend strong { margin-left: auto; padding-left: 1rem; }

.quick-link { display: flex; align-items: center; gap: .6rem; padding: .85rem .9rem; border-radius: .7rem; border: 1px solid #ecebf3;
    color: inherit; text-decoration: none; font-size: .875rem; font-weight: 500; transition: background .15s ease, border-color .15s ease; }
.quick-link i { font-size: 1.2rem; }
.quick-link:hover { border-color: var(--hrm-primary); background: var(--hrm-primary-soft); text-decoration: none; }
.quick-link-primary i { color: var(--hrm-primary); }
.quick-link-purple i { color: #7e22ce; }
.quick-link-success i { color: #15803d; }
.quick-link-danger i { color: #be185d; }
.quick-link-warning i { color: #b45309; }
.quick-link-info i { color: #0369a1; }

/* ---------- Salary Pay ---------- */

.avatar-md { width: 2.1rem; height: 2.1rem; font-size: .85rem; flex-shrink: 0; }
.avatar-lg { width: 2.75rem; height: 2.75rem; font-size: 1.05rem; flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.salary-list tr.is-selected > td { background: var(--hrm-primary-soft); }
.salary-list tr.is-selected > td:first-child { box-shadow: inset 3px 0 0 var(--hrm-primary); }
.mini-stat { border: 1px solid #ecebf3; border-radius: .5rem; padding: .5rem .65rem; height: 100%; background: #fff; }
.mini-stat .value { font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
@media (min-width: 768px) {
    .salary-details { position: sticky; top: 4.5rem; }
}
.avatar-xl { width: 3.5rem; height: 3.5rem; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .stat-icon.stat-icon-lg { width: 3rem; height: 3rem; font-size: 1.35rem; flex-shrink: 0; }
.month-picker { width: auto; }
.salary-search { width: 18rem; max-width: 100%; }
.text-bg-success-soft { background: #dcfce7 !important; color: #15803d !important; }
.text-bg-warning-soft { background: #fef3c7 !important; color: #b45309 !important; }
.text-bg-secondary-soft { background: #eef0f4 !important; color: #4b5563 !important; }
.salary-picker { max-height: 34rem; overflow-y: auto; }
.salary-picker .list-group-item.is-selected { background: var(--hrm-primary-soft); box-shadow: inset 3px 0 0 var(--hrm-primary); }
.salary-empty-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 7rem; height: 7rem; border-radius: 50%;
    background: var(--hrm-primary-soft); color: var(--hrm-primary); font-size: 3rem;
}
.salary-empty { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.pay-card { border: 1px solid #ecebf3; border-radius: .5rem; padding: .75rem .9rem; height: 100%; background: #fff; }
.pay-card .value { font-weight: 700; font-size: 1.2rem; overflow-wrap: anywhere; }
.salary-table th:nth-child(3), .salary-table td:nth-child(3) { border-left: 1px solid #ecebf3; }

.pipeline-step { border: 1px solid #ecebf3; border-radius: .5rem; padding: .6rem .75rem; background: #fff; height: 100%; }
.pipeline-step .count { font-size: 1.25rem; font-weight: 700; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.25rem; border-left: 2px solid #ecebf3; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -6px; top: .25rem;
    width: 10px; height: 10px; border-radius: 50%; background: var(--hrm-primary);
}

/* ---------- Guest ---------- */

.guest-body { background: linear-gradient(160deg, #f5f3ff 0%, #f5f6fa 60%); }
.guest-wrapper { max-width: 400px; margin: 0 auto; padding: 4rem 1rem 1rem; }
.guest-wrapper-wide { max-width: 820px; padding-top: 2.5rem; }
.guest-brand-logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.guest-footer { padding: 0 1rem 1.5rem; text-align: center; font-size: .8rem; }

/* Sign-in page: split card, brand side with decorative circles on the left, form on the right. */
.login-body {
    min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem; background: #dcd6f3;
}
.login-card {
    display: flex; width: 100%; max-width: 1040px; min-height: 580px; overflow: hidden;
    background: #fff; box-shadow: 0 1.5rem 3.5rem rgba(35, 24, 68, .22);
}
.login-brand {
    position: relative; flex: 1 1 50%; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 3rem 2rem 4.5rem; background: #eceaf6;
}
.login-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.login-shape-a { width: 46%; aspect-ratio: 1; top: -22%; left: 34%; background: #f7d778; }
.login-shape-b { width: 28%; aspect-ratio: 1; top: -9%; right: -6%; background: linear-gradient(160deg, #5b30c4, #2a1470); }
.login-shape-c { width: 34%; aspect-ratio: 1; top: 48%; left: -15%; background: linear-gradient(200deg, #9b7fe6, #4a24a8); }
.login-shape-d { width: 7%; aspect-ratio: 1; bottom: 7%; right: 10%; background: #4a24a8; }
.login-shape-e { width: 20%; aspect-ratio: 1; bottom: -8%; right: -2%; background: #f7d778; opacity: .85; }
.login-brand-center { position: relative; text-align: center; }
.login-logo { width: 100%; max-width: 250px; height: auto; }
.login-brand-name { margin-top: 1rem; color: #1f1640; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.login-brand-company { max-width: 300px; margin: .15rem auto 0; color: #666276; font-size: .85rem; }
.login-links {
    position: absolute; left: 0; right: 0; bottom: 1.75rem;
    display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.75rem; padding: 0 1rem;
}
.login-links a { color: #1f1640; font-size: .8rem; font-weight: 600; text-decoration: none; }
.login-links a:hover { color: var(--hrm-primary); text-decoration: underline; }

.login-form-side { position: relative; flex: 1 1 50%; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem 4rem; }
.login-form { width: 100%; max-width: 300px; }
.login-title { margin: 0; color: #1f1640; font-size: 2rem; font-weight: 700; }
.login-subtitle { margin: .3rem 0 1.75rem; color: #8a879a; font-size: .85rem; }
.login-field { position: relative; margin-bottom: 1.4rem; }
.login-label { display: block; color: #6b6880; font-size: .78rem; font-weight: 500; }
.login-input.form-control {
    padding: .35rem 0; border: 0; border-bottom: 1.5px solid #4b4570; border-radius: 0;
    background: transparent; box-shadow: none; color: #1f1640; font-size: .95rem;
}
.login-input.form-control::placeholder { color: #b9b6c8; }
.login-input.form-control:focus { border-bottom-color: var(--hrm-primary); box-shadow: 0 1.5px 0 var(--hrm-primary); }
.login-input.form-control.is-invalid { border-bottom-color: var(--bs-danger); background-image: none; padding-right: 0; }
.login-input-password.form-control, .login-input-password.form-control.is-invalid { padding-right: 2rem; }
.login-eye {
    position: absolute; right: 0; top: .3rem; padding: .25rem; border: 0; background: none;
    color: #4b4570; line-height: 1;
}
.login-eye:hover, .login-eye:focus-visible { color: var(--hrm-primary); }
.login-remember { margin-bottom: 1.25rem; font-size: .8rem; color: #6b6880; }
.login-remember .form-check-input:checked { background-color: var(--hrm-primary); border-color: var(--hrm-primary); }
.login-submit {
    width: 66%; padding: .55rem 1rem; border: 0; border-radius: 2rem;
    background: var(--hrm-primary); color: #fff; font-size: .9rem; font-weight: 600;
}
.login-submit:hover, .login-submit:focus-visible { background: var(--hrm-primary-dark); color: #fff; }
.login-forgot { margin-top: 1.1rem; font-size: .8rem; color: #8a879a; }
.login-forgot summary { width: fit-content; cursor: pointer; list-style: none; }
.login-forgot summary::-webkit-details-marker { display: none; }
.login-forgot summary:hover { color: var(--hrm-primary); text-decoration: underline; }
.login-forgot p { margin: .4rem 0 0; color: #6b6880; }
.login-footer { position: absolute; left: 0; right: 0; bottom: 1.25rem; text-align: center; font-size: .72rem; color: #a3a0b3; }

/* Phones: brand header (logo, circles, product name) above a white sheet with only email, password and Log in. */
@media (max-width: 767.98px) {
    .login-body { display: block; padding: 0; background: #eceaf6; }
    .login-card { flex-direction: column; min-height: 100vh; min-height: 100dvh; background: none; box-shadow: none; }
    .login-brand { flex: 0 0 auto; padding: 3.25rem 1.5rem 4.25rem; }
    .login-shape-a { width: 34%; top: -22%; left: 56%; }
    .login-shape-b { width: 24%; top: -8%; right: -9%; }
    .login-shape-c { width: 26%; top: 40%; left: -13%; }
    .login-shape-d, .login-brand-company, .login-links, .login-subtitle, .login-remember { display: none; }
    .login-logo { max-width: 150px; }
    .login-brand-name { margin-top: .6rem; font-size: 1.4rem; }
    .login-form-side {
        flex: 1 1 auto; align-items: flex-start; margin-top: -2rem; padding: 2.25rem 1.5rem 4rem;
        background: #fff; border-radius: 1.75rem 1.75rem 0 0; box-shadow: 0 -.5rem 1.5rem rgba(35, 24, 68, .08);
    }
    .login-form { max-width: 360px; margin: 0 auto; }
    .login-title { margin-bottom: 1.5rem; font-size: 1.5rem; }
    .login-submit { width: 100%; margin-top: .5rem; padding: .7rem 1rem; }
    .login-forgot { text-align: center; }
    .login-forgot summary { margin: 0 auto; }
}

/* ---------- Print (offer letter) ---------- */

.letter { max-width: 800px; margin: 0 auto; background: #fff; padding: 2.5rem; }
@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
    .letter { padding: 0; box-shadow: none; border: 0; }
}

/* ---------- Simple HRMS screens ---------- */

/* One line under a page title: "You enter -> You get". */
.io-strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem;
    padding: .55rem .85rem; margin-bottom: 1rem; border: 1px dashed #dcd9e8; border-radius: .5rem;
    background: #faf9fd; font-size: .825rem;
}
.io-strip .io-group { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.io-strip .io-label { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.io-strip .io-pill { padding: .05rem .6rem; border: 1px solid #e3e1ec; border-radius: 99px; background: #fff; }
.io-strip .io-get .io-pill { border-color: var(--hrm-primary); color: var(--hrm-primary); }
.io-strip .io-arrow { color: var(--hrm-primary); font-weight: 700; }

/* Numbered progress steps (onboarding, exit). */
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; counter-reset: step; }
.stepper li {
    counter-increment: step; display: flex; align-items: center; gap: .4rem;
    padding: .2rem .75rem .2rem .3rem; border: 1px solid #e3e1ec; border-radius: 99px; font-size: .8rem; color: #6b7280; background: #fff;
}
.stepper li::before {
    content: counter(step); display: inline-flex; align-items: center; justify-content: center;
    width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #f1f0f6; font-size: .7rem; font-weight: 700;
}
.stepper li.done { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-color: transparent; }
.stepper li.done::before { content: "\2713"; background: var(--bs-success); color: #fff; }
.stepper li.now { border-color: var(--hrm-primary); color: var(--hrm-primary); font-weight: 600; }
.stepper li.now::before { background: var(--hrm-primary); color: #fff; }
.stepper li a { color: inherit; text-decoration: none; }
.stepper li a:hover { text-decoration: underline; }
/* A linked step is clickable as a whole: the link stretches over the number circle and the label. */
.stepper li:has(a) { position: relative; cursor: pointer; }
.stepper li a::after { content: ""; position: absolute; inset: 0; z-index: 2; }

/* Bigger stepper (onboarding): numbered circles joined by a line, label underneath. */
.stepper-lg { flex-wrap: nowrap; gap: 0; padding: 1.1rem .5rem; background: #fff; border: 1px solid #e6e7ee; border-radius: .75rem; }
.stepper-lg li {
    position: relative; flex: 1 1 0; flex-direction: column; gap: .5rem; min-width: 0;
    padding: 0 .25rem; border: 0; border-radius: 0; background: transparent; font-size: .9rem; text-align: center;
}
.stepper-lg li::before { position: relative; z-index: 1; width: 2.6rem; height: 2.6rem; font-size: 1rem; background: #fff; border: 2px solid #e3e1ec; }
.stepper-lg li:not(:last-child)::after {
    content: ""; position: absolute; top: 1.3rem; left: calc(50% + 1.6rem); right: calc(-50% + 1.6rem); height: 2px; background: #e3e1ec;
}
.stepper-lg li.done { background: transparent; color: var(--bs-success-text-emphasis); font-weight: 500; }
.stepper-lg li.done::before { border-color: var(--bs-success); }
.stepper-lg li.done::after { background: var(--bs-success); }
.stepper-lg li.now::before { border-color: var(--hrm-primary); box-shadow: 0 0 0 4px var(--hrm-primary-soft); }
.stepper-lg li:has(a):hover::before { box-shadow: 0 0 0 4px var(--hrm-primary-soft); transform: scale(1.06); }
.stepper-lg li:has(a):hover a { text-decoration: underline; }
.stepper-lg li::before { transition: box-shadow .15s ease, transform .15s ease; }
@media (max-width: 575.98px) {
    .stepper-lg li { font-size: .75rem; }
    .stepper-lg li::before { width: 2rem; height: 2rem; font-size: .85rem; }
    .stepper-lg li:not(:last-child)::after { top: 1rem; left: calc(50% + 1.2rem); right: calc(-50% + 1.2rem); }
}

/* Onboarding step filters: one card per step with its count. */
.step-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; }
.step-card {
    display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid #e6e7ee; border-radius: .75rem;
    background: #fff; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .15s ease, box-shadow .15s ease;
}
.step-card:hover { border-color: var(--hrm-primary); color: inherit; }
.step-card.active { border-color: var(--hrm-primary); box-shadow: 0 0 0 3px var(--hrm-primary-soft); }
.step-card-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.6rem; height: 2.6rem; border-radius: .6rem; background: var(--hrm-primary-soft); color: var(--hrm-primary); font-size: 1.2rem;
}
.step-card.active .step-card-icon { background: var(--hrm-primary); color: #fff; }
.step-card-note { display: block; font-size: .75rem; color: #6b7280; }
.step-card-label { display: block; font-weight: 600; }
.step-card-count { margin-left: auto; font-size: 1.4rem; font-weight: 700; color: var(--hrm-primary); }


/* Clickable rows (Home page "Needs your attention"). */
.list-link { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid #ecebf3; color: inherit; text-decoration: none; }
.list-link:last-child { border-bottom: 0; }
.list-link:hover { background: #faf9fd; text-decoration: none; }
.list-link.active { background: var(--hrm-primary-soft); }

/* Salary breakup and slips. */
.calc-table td { padding: .4rem 0; border-bottom: 1px dashed #e6e7ee; }
.calc-table thead th { padding: .35rem 0; background: transparent; }
.calc-table tr.total td { font-weight: 700; border-top: 2px solid #e6e7ee; border-bottom: 0; }
.net-pay { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .75rem 1rem; border-radius: .5rem; background: var(--hrm-primary-soft); }
.net-pay .amount { font-size: 1.4rem; font-weight: 700; color: var(--hrm-primary); }
.letter-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--hrm-primary); padding-bottom: .75rem; margin-bottom: 1rem; }
.letter-head strong { font-size: 1.1rem; color: var(--hrm-primary); }
.letter-logo { width: 110px; height: auto; flex-shrink: 0; }

/* Salary slip: plain, bordered and easy to print. */
.salary-slip { max-width: 900px; margin: 0 auto; padding: 2rem; background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-radius: .5rem; }
.slip-header { display: flex; align-items: center; gap: 1.25rem; }
.slip-logo { width: 110px; height: auto; flex-shrink: 0; }
.slip-company { flex: 1; text-align: center; color: #64748b; font-size: .875rem; }
.slip-company-name { font-size: 1.35rem; font-weight: 600; color: #1e293b; }
.slip-title { width: fit-content; margin: 1.25rem auto; padding: .5rem 2.5rem; border: 1.5px solid #334155; font-weight: 600; letter-spacing: .08em; }
.slip-box { border: 1.5px solid #334155; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.slip-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.slip-details dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.slip-details dt { font-weight: 600; }
.slip-details dd { margin: 0; }
.slip-details dd::before { content: ": "; }
.slip-table, .slip-summary { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.slip-table th, .slip-table td { border: 1px solid #cbd5e1; padding: .55rem .75rem; }
.slip-table th { background: #eef2f8; text-align: center; font-weight: 600; }
.slip-table .slip-total td, .slip-summary .slip-net td { font-weight: 700; }
.slip-table .slip-total td { background: #f5f7fb; }
.slip-summary { border: 1.5px solid #334155; }
.slip-summary td { padding: .55rem 1.25rem; border-bottom: 1px solid #cbd5e1; }
.slip-summary .slip-net td { background: #dfe9f6; font-size: 1.15rem; border-bottom: 0; }
.slip-words { margin-bottom: 1rem; }
.slip-payment { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center; }
.slip-label { color: #64748b; }
.slip-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: #64748b; font-size: .85rem; }
@media (max-width: 575.98px) {
    .salary-slip { padding: 1rem; }
    .slip-header { flex-direction: column; }
    .slip-details, .slip-payment { grid-template-columns: 1fr; }
}
@media print {
    .salary-slip { border: 0; padding: 0; max-width: none; }
    .slip-table th, .slip-table .slip-total td, .slip-summary .slip-net td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Employee visiting card preview. */
.visiting-card-pair { display: flex; flex-wrap: wrap; gap: 1rem; }
.visiting-card {
    flex: 1 1 320px;
    max-width: 400px;
    min-height: 220px;
    overflow: hidden;
    border: 1px solid #e3e1ec;
    border-radius: .75rem;
    background: #fff url("../images/visiting-card-front.svg") center / 100% 100% no-repeat;
    box-shadow: 0 .35rem 1rem rgba(35, 24, 68, .1);
}
.visiting-card-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-bottom: 2px solid var(--hrm-primary);
}
.visiting-card-logo { height: 34px; width: auto; }
.visiting-card-details { padding: 1.1rem 1.25rem; }
.visiting-card-details h3 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.visiting-card-role { margin: .2rem 0 .9rem; color: #666276; font-size: .875rem; }
.visiting-card-contact { display: grid; gap: .35rem; font-size: .85rem; overflow-wrap: anywhere; }
.visiting-card-contact i { color: var(--hrm-primary); }
.visiting-card-back {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    padding: 1.25rem; text-align: center; background-image: url("../images/visiting-card-back.svg");
}
.visiting-card-logo-lg { height: 64px; width: auto; }
.visiting-card-logo-xl { height: 90px; width: auto; }
.visiting-card-company { color: var(--hrm-primary); font-weight: 700; }
.visiting-card-contact-back { justify-items: center; font-size: .8rem; color: #4b5563; }
.visiting-card-company-front .visiting-card-logo-xl { height: 68px; }
.visiting-card-company-front .visiting-card-company { padding-bottom: .4rem; border-bottom: 2px solid var(--hrm-primary); }
.visiting-card-company-front .visiting-card-contact-back { justify-items: start; }
.visiting-card-with-qr { align-items: stretch; gap: 0; padding: 0; text-align: left; }
.visiting-card-back-body { display: flex; align-items: flex-start; gap: 1rem; flex: 1; padding: 1rem 1.25rem; }
.visiting-card-with-qr .visiting-card-back-details { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.visiting-card-with-qr .visiting-card-logo-lg { height: 44px; align-self: flex-start; }
.visiting-card-with-qr .visiting-card-contact-back { justify-items: start; gap: .25rem; font-size: .72rem; }
.visiting-card-qr { width: 96px; height: 96px; flex-shrink: 0; margin-top: .5rem; padding: 4px; background: #fff; border-radius: .4rem; }
.visiting-card-contact a { color: inherit; text-decoration: none; }
.visiting-card-contact a:hover, .visiting-card-contact a:focus-visible { color: var(--hrm-primary); text-decoration: underline; }
.visiting-card-social { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.1rem; padding: .45rem 1rem; background: var(--hrm-primary); }
.visiting-card-social a { display: flex; align-items: center; gap: .35rem; color: #fff; font-size: .72rem; text-decoration: none; }
.visiting-card-social a:hover, .visiting-card-social a:focus-visible { text-decoration: underline; }
.visiting-card-social img { width: 16px; height: 16px; flex-shrink: 0; }

/* Employee ID card, portrait (CR80 proportions), front and back. The card is 306 x 486, the size of the
   corner-shape SVG behind it; the content sits above the bottom band (24px) and clear of the left strip. */
.id-card-pair { display: flex; flex-wrap: wrap; gap: 1rem; }
.id-card {
    position: relative; flex: 0 0 auto;
    width: 306px; max-width: 100%; aspect-ratio: 306 / 486;
    overflow: hidden; color: #1f1640;
    border: 1px solid #e3e1ec; border-radius: .9rem;
    background: #fff center / 100% 100% no-repeat;
    box-shadow: 0 .35rem 1rem rgba(35, 24, 68, .12);
}
.id-card-content {
    position: absolute; inset: 0 0 24px 0;
    display: flex; flex-direction: column; align-items: center;
    padding: 18px 28px 12px 36px; text-align: center;
}
.id-card-logo { height: 40px; width: auto; }
.id-card-photo { width: 112px; height: 128px; margin-top: 10px; object-fit: cover; background: #e5e7eb; }
.id-card-initials { display: flex; align-items: center; justify-content: center; color: #4a24a8; font-size: 2.4rem; font-weight: 700; }
.id-card-name { margin: 10px 0 0; font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.id-card-role { margin-top: 6px; padding: .2rem .65rem; background: #4a24a8; color: #fff; font-size: .78rem; font-weight: 700; }
.id-card-facts {
    display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem;
    width: 100%; margin: 12px 0 0; font-size: .78rem; text-align: left;
}
.id-card-facts dt { font-weight: 700; }
.id-card-facts dd { margin: 0; overflow-wrap: anywhere; }
.id-card-barcode { width: 236px; max-width: 100%; height: 36px; margin-top: auto; }
.id-card-content-back { padding-top: 34px; padding-left: 28px; }
.id-card-terms-title { margin: 12px 0 0; font-size: 1.2rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.id-card-terms { margin-top: 10px; font-size: .68rem; line-height: 1.35; text-align: justify; }
.id-card-terms p { margin: 0 0 .45rem; }
.id-card-terms .id-card-return { font-size: .68rem; color: #4b5563; text-align: center; }
.id-card-number { margin-top: auto; padding: .25rem .7rem; background: #4a24a8; color: #fff; font-size: .8rem; font-weight: 700; }

/* Attendance QR codes: fixed size, white background so phones can read them in dark mode. */
.qr-code { width: 15rem; max-width: 100%; padding: .5rem; background: #fff; border-radius: .5rem; }
.qr-code svg { display: block; width: 100%; height: auto; }

/* Result popup icon (x-flash). */
.flash-icon { font-size: 3.5rem; line-height: 1; }

/* Spinner while the next page loads. */
.page-loading { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .6); }
.page-loading[hidden] { display: none; }
.page-loading .spinner-border { width: 3rem; height: 3rem; }

/* ---------- Tasks ---------- */

.page-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 3.25rem; height: 3.25rem; border-radius: .75rem; background: var(--hrm-primary-soft); color: var(--hrm-primary); font-size: 1.5rem;
}
.page-icon.page-icon-sm { width: 2.4rem; height: 2.4rem; border-radius: .6rem; font-size: 1.1rem; }
.task-steps {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .35rem .9rem;
    border: 1px solid #e3ddf7; border-radius: 99px; background: #faf8ff; font-size: .8rem; color: var(--hrm-primary-dark);
}
.task-search { width: 20rem; max-width: 100%; }
.task-remark { max-width: 16rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table tr.is-selected > td { background: var(--hrm-primary-soft); }
.table tr.is-selected > td:first-child { box-shadow: inset 3px 0 0 var(--hrm-primary); }
.text-bg-info-soft { background: #e0f2fe !important; color: #0369a1 !important; }
.text-bg-danger-soft { background: #fee2e2 !important; color: #b91c1c !important; }
.priority-pill { display: inline-flex; align-items: center; gap: .3rem; }
.priority-dot { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.task-facts { display: grid; grid-template-columns: 40% 1fr; margin: 0; }
.task-facts dt, .task-facts dd { margin: 0; padding: .65rem 1rem; border-bottom: 1px solid #f0eff5; }
.task-facts dt { font-weight: 400; color: #6b7280; }
.task-facts dt:last-of-type, .task-facts dd:last-of-type { border-bottom: 0; }
.task-timeline { list-style: none; margin: 0; padding: 0 0 0 .9rem; border-left: 2px solid #e3ddf7; }
.task-timeline > li { position: relative; display: flex; gap: .6rem; padding-bottom: .9rem; }
.task-timeline > li::before { content: ""; position: absolute; left: -1.3rem; top: .7rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--hrm-primary); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item { padding: .9rem 1rem; border-bottom: 1px solid #ecebf3; }
.task-item:last-child { border-bottom: 0; }
.task-day-timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 2px solid #e6e7ee; }
.task-day-timeline > li { position: relative; padding: .25rem 0 1rem; border-bottom: 1px solid #f0eff5; margin-bottom: .75rem; }
.task-day-timeline > li:last-child { border-bottom: 0; margin-bottom: 0; }
.task-day-dot { position: absolute; left: -2.15rem; top: .35rem; background: #fff; font-size: 1.1rem; line-height: 1; }
