body {
    background-color: #f8f9fa;
    padding-top: 56px; /* 给固定在顶部的导航栏留出空间 */
    font-size: 0.9rem; /* 电脑端默认字体略小一点 */
}

/* 响应式调整字体大小 */
@media (max-width: 767.98px) {
    body {
        font-size: 1rem; /* 移动端恢复标准字体以保证可读性 */
    }

    .sidebar {
        top: 56px;
        position: static; /* 移动端不固定 */
    }

    /* 移动端表格允许水平滚动以防止撑破屏幕 */
    .table-responsive {
        border: 0;
    }

    /* 移动端卡片间距微调 */
    .card {
        margin-bottom: 1rem !important;
    }
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.hrms-navbar-brand {
    display: inline-flex;
    height: 48px;
    align-items: center;
    gap: 8px;
    padding-block: 2px;
    line-height: 1;
}

.hrms-navbar-brand-mark {
    position: relative;
    display: block;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
}

.hrms-navbar-brand-logo {
    width: 39px;
    height: 39px;
    object-fit: contain;
}

.hrms-navbar-people-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    border: 2px solid rgba(13, 110, 253, .18);
    border-radius: 50%;
    background: #fff;
}

.hrms-navbar-people-badge img {
    width: 11px;
    height: 11px;
    filter: invert(33%) sepia(99%) saturate(1896%) hue-rotate(204deg) brightness(103%) contrast(101%);
}

.hrms-navbar-brand-copy {
    display: grid;
    gap: 2px;
    text-align: left;
}

.hrms-navbar-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.hrms-navbar-brand-subtitle {
    font-size: .72rem;
    font-weight: 500;
    opacity: .92;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

.contract-pdf-modal .modal-content {
    height: min(92vh, 1100px);
}

.contract-pdf-modal-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .75rem;
    overflow: hidden;
    background: #e9eef5;
}

.contract-pdf-stage {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
}

.contract-pdf-page-wrap {
    display: flex;
    min-width: 0;
    min-height: 0;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.contract-pdf-page {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 .25rem 1rem rgba(15, 23, 42, .16);
}

.contract-pdf-page-button {
    width: 2.75rem;
    height: 3.5rem;
    padding: 0;
    background: rgba(255, 255, 255, .9);
}

.contract-pdf-counter {
    flex: 0 0 auto;
    text-align: center;
    color: #495057;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
    .contract-pdf-modal .modal-content {
        height: 100%;
    }

    .contract-pdf-modal-body {
        padding-inline: .5rem;
    }

    .contract-pdf-stage {
        gap: .25rem;
    }

    .contract-pdf-page-button {
        width: 2.25rem;
        height: 3rem;
    }
}

.contract-status-badge.contract-status-terminated {
    background-color: #fd7e14;
    color: #212529;
}

.table th {
    font-weight: 600;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px; /* 导航栏高度 */
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: #212529; /* 深色背景 */
    overflow-y: auto; /* 允许侧边栏内部滚动 */
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    padding: 0.6rem 1rem;
    margin: 0.2rem 1rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
}

.sidebar-heading {
    font-size: .75rem;
    color: #adb5bd;
}

#desktop-sidebar-toggle {
    display: none;
}

@media (min-width: 768px) {
    #desktop-sidebar-toggle {
        position: fixed;
        top: calc(50% + 28px);
        left: calc(25% - 1.5rem);
        z-index: 2;
        display: grid;
        width: 1.25rem;
        height: 2.5rem;
        margin: 0;
        padding: 0;
        place-items: center;
        transform: translateY(-50%);
        border: 1px solid rgba(111, 171, 255, .72);
        border-radius: .4rem;
        background: #212529;
        color: #7fb3ff;
        box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .18);
        transition: left .2s ease, border-color .2s ease, color .2s ease, background-color .2s ease;
    }

    #desktop-sidebar-toggle:hover,
    #desktop-sidebar-toggle:focus-visible {
        border-color: #9bc6ff;
        background: #2b3035;
        color: #b7d7ff;
        outline: none;
    }

    #desktop-sidebar-toggle i {
        font-size: .75rem;
        line-height: 1;
    }

    body:not(.sidebar-collapsed) #sidebarMenu .nav-link {
        margin-right: 1.75rem;
    }

    #mainContent {
        margin-left: 25% !important;
        width: 75%;
    }

    body.sidebar-collapsed #sidebarMenu {
        width: 72px;
    }

    body.sidebar-collapsed #desktop-sidebar-toggle {
        left: calc(72px - 1.5rem);
    }

    body.sidebar-collapsed #mainContent {
        margin-left: 72px !important;
        width: calc(100% - 72px);
        max-width: none;
    }

    body.sidebar-collapsed .sidebar-heading,
    body.sidebar-collapsed .hrms-version-label,
    body.sidebar-collapsed #sidebarMenu .badge {
        display: none !important;
    }

    body.sidebar-collapsed #sidebarMenu .nav-link {
        justify-content: center;
        margin-inline: .5rem;
        padding-inline: .5rem;
        font-size: 0;
    }

    body.sidebar-collapsed #sidebarMenu .nav-link i {
        margin-right: 0 !important;
        font-size: 1.05rem;
    }
}

@media (min-width: 992px) {
    #desktop-sidebar-toggle {
        left: calc(16.666667% - 1.5rem);
    }

    #mainContent {
        margin-left: 16.666667% !important;
        width: 83.333333%;
    }

    body.sidebar-collapsed #desktop-sidebar-toggle {
        left: calc(72px - 1.5rem);
    }

    body.sidebar-collapsed #mainContent {
        margin-left: 72px !important;
        width: calc(100% - 72px);
    }
}

/* 登录页沿用 HRMS 蓝色体系的 C 方案品牌组合。 */
body.hrms-auth-page {
    padding-top: 0;
    background: #f4f7fb;
    color: #243042;
    min-height: 100vh;
}

.hrms-brand-lockup {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto;
}

.hrms-brand-logo {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.hrms-people-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 3px solid rgba(13, 110, 253, .16);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 5px 14px rgba(20, 54, 94, .2);
}

.hrms-people-badge img {
    width: 21px;
    height: 21px;
    filter: invert(33%) sepia(99%) saturate(1896%) hue-rotate(204deg) brightness(103%) contrast(101%);
}

.hrms-login-shell {
    display: grid;
    min-height: 100vh;
    padding: 28px 16px;
    place-items: center;
}

.hrms-login-card {
    width: min(94vw, 540px);
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 16px 44px rgba(31, 45, 61, .14);
}

.hrms-login-header {
    padding: 28px 20px 24px;
    background: #0d6efd;
    color: #fff;
    text-align: center;
}

.tenant-tabs .nav-link {
    color: #5d6570;
    font-weight: 600;
}

.tenant-tabs .nav-link.active {
    color: #0d6efd;
    border-color: transparent transparent #0d6efd;
    border-bottom-width: 3px;
}

.qr-content-spacing {
    padding-top: 28px;
}

.qr-box {
    display: flex;
    min-height: 360px;
    align-items: center;
    justify-content: center;
}

.hrms-mobile-header {
    padding: max(28px, env(safe-area-inset-top)) 24px 34px;
    border-radius: 0 0 28px 28px;
    background: #0d6efd;
    color: #fff;
    text-align: center;
}

.hrms-mobile-card {
    margin: -18px 16px 24px;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(31, 45, 61, .12);
}

.hrms-authorize-button {
    min-height: 52px;
    border-radius: 12px;
    font-weight: 600;
}
.hrms-version-label {
    color: #8a96a8;
    font-size: .82rem;
    text-align: center;
}

.hrms-login-card > .hrms-version-label {
    padding: 0 24px 18px;
    background: #fff;
}
/* V0.3.4 employee Profile flow */
.profile-flow-page { min-height: 100vh; margin: 0; padding-top: 0; background: #f2f6fc; color: #1d2939; }
.profile-flow-shell { width: min(760px, 100%); margin: 0 auto; padding: 0 16px 48px; }
.profile-flow-header { margin: 0 -16px 20px; padding: 28px 24px; display: flex; gap: 16px; align-items: center; color: #fff; background: linear-gradient(135deg, #0d6efd, #3d8bfd); border-radius: 0 0 28px 28px; }
.profile-flow-header img { width: 70px; height: 70px; object-fit: contain; }
.profile-flow-header h1 { margin: 4px 0 0; font-size: clamp(1.55rem, 5vw, 2.1rem); }
.profile-flow-locale { margin-left: auto; align-self: flex-start; }
.profile-flow-card { background: #fff; border: 1px solid #e3eaf4; border-radius: 22px; box-shadow: 0 12px 32px rgba(28, 70, 130, .09); margin-bottom: 16px; padding: 22px; }
.profile-flow-card h2 { font-size: 1.15rem; }
.profile-readonly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0 0; }
.profile-readonly-grid div { background: #f6f8fc; border-radius: 14px; padding: 12px; }
.profile-readonly-grid dt { color: #8090a6; font-size: .82rem; }
.profile-readonly-grid dd { margin: 4px 0 0; font-weight: 600; word-break: break-word; }
.profile-official-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.profile-field-group { background: #f6f8fc; border-radius: 14px; padding: 16px; min-width: 0; }
.profile-field-group-wide { grid-column: 1 / -1; }
.profile-field-group dl { margin: 0; display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 16px; }
.profile-field-group dt { color: #8090a6; font-size: .82rem; }
.profile-field-group dd { margin: 0; font-weight: 600; word-break: break-word; }
.profile-field-materials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.profile-field-material { width: 150px; padding: 8px; border: 1px solid #c9d8ee; border-radius: 12px; background: #fff; color: #0d6efd; text-align: left; }
.profile-field-material-media { display: grid; place-items: center; height: 96px; margin-bottom: 6px; overflow: hidden; border-radius: 8px; background: #eef3fb; }
.profile-field-material-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.profile-field-material-image { background-position: center; background-repeat: no-repeat; background-size: contain; }
.profile-field-material-pdf { font-weight: 700; color: #dc3545; }
.profile-field-material-empty { color: #8090a6; font-size: .9rem; }
.profile-step { margin-bottom: 24px; }
.profile-step-heading { display: flex; align-items: center; gap: 14px; min-width: 0; margin-bottom: 14px; }
.profile-step-number { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #0d6efd; color: #fff; display: grid; place-items: center; font-weight: 700; }
.profile-step-title { flex: 1 1 auto; min-width: 0; margin: 0; }
.profile-step-source { margin-left: auto; color: #5f6f85; white-space: nowrap; }
.profile-step-content { min-width: 0; }
.profile-step label, .profile-upload label { display: block; color: #5f6f85; margin: 12px 0; }
.profile-step input:not([type=checkbox]), .profile-upload input { width: 100%; margin-top: 6px; padding: 11px; border: 1px solid #cfdae8; border-radius: 10px; background: #fff; }
.profile-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: -8px 0 24px 48px; }
.profile-upload { background: #f6f8fc; padding: 14px; border-radius: 14px; }
.profile-upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-native-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-native-picker[hidden], .profile-upload-actions[hidden] { display: none !important; }
.profile-picker-button { margin-top: 12px; padding: 11px 8px; border: 1px solid #0d6efd; border-radius: 10px; color: #0d6efd; background: #fff; font-weight: 600; }
.profile-picker-button:disabled { opacity: .55; }
.profile-pdf-picker { font-size: .88rem; }
.profile-sdk-warning { width: min(728px, calc(100% - 32px)); margin: -36px auto 20px; color: #8a6116; font-size: .88rem; }
.profile-attachment-preview { min-height: 112px; margin-top: 10px; border: 1px dashed #b9c9dd; border-radius: 12px; display: grid; place-items: center; overflow: hidden; color: #718197; background: #fff; }
.profile-attachment-preview img { width: 100%; height: 160px; object-fit: contain; }
.profile-attachment-status { margin-top: 8px; color: #198754; font-size: .88rem; font-weight: 600; }
.profile-upload-failed { border: 1px solid #dc3545; }
.profile-upload-failed .profile-attachment-status { color: #dc3545; }
.profile-upload-progress { height: 5px; margin-top: 8px; background: #dbe6f4; border-radius: 5px; overflow: hidden; }
.profile-upload-progress i { display: block; width: 70%; height: 100%; background: #0d6efd; animation: profile-upload-progress 1s ease-in-out infinite alternate; }
@keyframes profile-upload-progress { to { transform: translateX(42%); } }
.profile-photo-preview { display: flex; align-items: center; gap: 14px; color: #5f6f85; }
.profile-photo-preview img { width: 88px; height: 108px; object-fit: cover; border: 1px solid #cfdae8; border-radius: 12px; }
.profile-admin-photo { display: grid; gap: 6px; color: #0d6efd; text-decoration: none; }
.profile-admin-photo img { width: 104px; height: 128px; object-fit: cover; border: 1px solid #cfdae8; border-radius: 12px; }
.profile-attachment-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; }
.profile-attachment-thumb { border: 1px solid #cfdae8; border-radius: 14px; background: #fff; padding: 10px; color: #0d6efd; text-align: left; }
.profile-attachment-thumb-media { height: 128px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #f2f6fc; margin-bottom: 8px; }
.profile-attachment-thumb img, .profile-attachment-thumb object { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.profile-preview-open { overflow: hidden; }
.profile-preview-layer { position: fixed; inset: 0; z-index: 1080; background: rgba(18, 30, 49, .82); padding: 4vh 4vw; }
.profile-preview-dialog { position: relative; max-width: 1080px; height: 92vh; margin: auto; background: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; }
.profile-preview-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: #58677b; font-size: 2rem; line-height: 1; }
.profile-preview-content { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.profile-preview-content img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.profile-preview-content img { transform: rotate(var(--profile-preview-rotation, 0deg)); transform-origin: center center; }
.profile-preview-content object { width: 100%; height: 100%; }
.profile-preview-nav { display: flex; justify-content: center; gap: 10px; padding-top: 12px; }
.profile-preview-nav [hidden] { display: none !important; }
.profile-check { display: flex !important; align-items: center; gap: 8px; }
.profile-submit-form { padding-bottom: 12px; }
.profile-defer-form { padding-bottom: env(safe-area-inset-bottom); }
.profile-document-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.profile-archive-section { background: #f8faff; border: 1px solid #e2e9f4; border-radius: 16px; padding: 20px; }
.employee-summary-card { border: 1px solid #e2e9f4; box-shadow: 0 10px 28px rgba(31, 72, 126, .08); }
.employee-summary-identity { min-width: 0; }
.employee-summary-divider { height: 1px; background: #e2e9f4; margin: 20px 0; }
.employee-summary-fields { margin-top: 0; }
.employee-summary-line { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: center; min-height: 34px; }
.employee-summary-line > .text-muted { font-weight: 600; }
.employee-summary-line strong { color: #1d2939; word-break: break-word; }
.employee-positions-section { padding-top: 4px; }
.employee-record-tabs { border-bottom-color: #dce5f2; }
.employee-record-tabs .nav-link { color: #607086; font-weight: 600; }
.employee-record-tabs .nav-link.active { color: #0d6efd; border-color: #dce5f2 #dce5f2 #fff; }
.employee-record-pane { padding: 20px; border: 1px solid #dce5f2; border-top: 0; border-radius: 0 0 14px 14px; background: #fff; }
.employee-record-summary dd { font-weight: 600; }
.employee-record-action { min-width: 96px; white-space: nowrap; }
@media (max-width: 576px) { .profile-readonly-grid, .profile-upload-grid, .profile-official-fields { grid-template-columns: 1fr; } .profile-step-heading { align-items: center; flex-wrap: wrap; } .profile-step-number { width: 34px; height: 34px; flex: 0 0 34px; } .profile-step-title { min-height: 34px; display: flex; align-items: center; } .profile-step-source { flex: 1 0 100%; margin-left: 0; white-space: normal; } .profile-upload-grid { margin: 0 0 24px; } .profile-flow-card { padding: 18px; } .profile-native-picker { grid-template-columns: 1fr; } }

.roster-column-config-list { display: grid; gap: 1rem; }
.roster-column-config-group { min-width: 0; }
.roster-column-config-heading { margin: 0 0 .5rem; color: #526175; font-size: .82rem; font-weight: 700; }
.roster-column-config-fields { display: flex; flex-wrap: wrap; gap: .5rem; }
.roster-column-config-item { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .7rem; border: 1px solid #d7e0eb; border-radius: .5rem; background: #fff; user-select: none; }
.roster-column-order-heading { color: #526175; font-size: .82rem; font-weight: 700; }
.roster-column-order-list { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .75rem; border-top: 1px solid #d7e0eb; }
.roster-column-order-item { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .65rem; border: 1px dashed #aebdce; border-radius: .5rem; background: #fff; cursor: grab; user-select: none; }
.roster-column-order-item:active { cursor: grabbing; }
.roster-drag-handle { color: #7b8797; letter-spacing: -.2rem; }
.roster-employee-id-link { text-decoration: none; }
.roster-department-value {
    display: block;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.roster-tenure-header-badge,
.roster-tenure-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .42rem;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0d6efd;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.roster-tenure-header-badge { background: #edf2f7; color: #526175; }
.roster-sort-toggle { color: #0d6efd; font-size: .72rem; line-height: 1; text-decoration: none; }
.roster-filter { position: relative; }
.roster-filter > summary { color: #6c757d; cursor: pointer; list-style: none; }
.roster-filter > summary::-webkit-details-marker { display: none; }
.roster-filter-menu { position: absolute; top: calc(100% + .4rem); left: 0; z-index: 1080; min-width: 230px; padding: .8rem; border: 1px solid #d7e0eb; border-radius: .5rem; background: #fff; box-shadow: 0 .5rem 1.25rem rgba(31, 45, 61, .16); font-weight: 400; }
.roster-filter-options { max-height: 240px; overflow-y: auto; }
.roster-table-scroll { overflow-x: auto; }
.roster-table { min-width: max-content; }
.hrms-locale-picker .form-select {
    min-width: 9rem;
    border-color: rgba(255, 255, 255, .7);
    background-color: rgba(255, 255, 255, .96);
}
.hrms-locale-picker { display: flex; align-items: center; gap: .4rem; }
.hrms-locale-flag { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }
.roster-operation-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.offboarding-action-state {
    white-space: nowrap;
}
.payroll-wizard-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:20px;background:#fff;border-radius:14px}.payroll-wizard-steps span{display:flex;align-items:center;gap:10px;color:#667085}.payroll-wizard-steps b{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#eaf2ff;color:#1677ff}.payroll-wizard-steps .active{color:#1677ff;font-weight:700}.payroll-wizard-steps .active b{background:#1677ff;color:#fff}.payroll-release-preview{position:sticky;top:88px}
