:root {
    --primary: #1a3c5e;
    --accent: #e8a020;
    --bg-light: #f4f6f9;
    --primary-dark: #16344f;
    --text-dark: #1f2a37;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
}

.fade-in-card {
    animation: fadeInCard 0.4s ease-out;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bavaria-navbar {
    background-color: rgba(26, 60, 94, 0.85);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notify-pill {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    cursor: pointer;
}

.role-badge {
    display: inline-block;
    background: rgba(232, 160, 32, 0.2);
    color: #ffd48e;
    border: 1px solid rgba(232, 160, 32, 0.45);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
}

.avatar-chip {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--accent);
    color: #253548;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.bavaria-card,
.auth-card,
.role-card,
.message-wrap,
.auth-center {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.auth-shell {
    min-height: calc(100vh - 130px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-select-wrap {
    max-width: 1050px;
    width: 100%;
    padding: 2rem;
}

.brand-logo-xl {
    width: 70px;
    height: 70px;
    border-radius: 14px;
}

.brand-title {
    color: var(--primary);
}

.brand-subtitle {
    color: #5f6b7a;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.role-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.2rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    border: 1px solid #e9edf3;
}

.role-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(26, 60, 94, 0.25);
}

.role-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(26, 60, 94, 0.12), rgba(232, 160, 32, 0.22));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.role-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.role-card p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #516074;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    padding: 1.6rem;
}

.auth-card-header {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 1rem;
}

.auth-card-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.45rem;
}

.auth-card-header p {
    color: #5f6b7a;
    font-size: 0.92rem;
}

.role-chip {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #2d6a9f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.auth-tabs .nav-link {
    border-radius: 8px;
    color: #4a5970;
    border: 1px solid transparent;
    font-weight: 600;
}

.auth-tabs .nav-link.active {
    background: rgba(26, 60, 94, 0.1);
    color: var(--primary);
    border-color: rgba(26, 60, 94, 0.2);
}

.styled-form .form-control,
.styled-form .form-select,
.select2-container--default .select2-selection--single {
    border-radius: 8px;
    min-height: 44px;
    border-color: #d9e1eb;
}

.styled-form .form-control:focus,
.styled-form .form-select:focus {
    border-color: #7fa2c0;
    box-shadow: 0 0 0 0.2rem rgba(26, 60, 94, 0.12);
}

.btn-primary,
.btn-auth {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    min-height: 44px;
    font-weight: 600;
}

.btn-primary:hover,
.btn-auth:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--accent);
}

.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.otp-char {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    border: 1px solid #d5deea;
    border-radius: 10px;
    min-height: 48px;
}

.otp-char:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 60, 94, 0.12);
}

.otp-meta small {
    color: #5d6b7e;
}

.message-wrap .alert {
    border-radius: 10px;
    border: none;
}

.alert-warning {
    background-color: #fff1ce;
    color: #6d4e00;
}

.alert-success {
    background-color: #d4f5e3;
    color: #12593a;
}

.alert-error,
.alert-danger {
    background-color: #ffe1e1;
    color: #7f1d1d;
}

@media (max-width: 767.98px) {
    .role-select-wrap {
        padding: 1.2rem;
    }

    .auth-card {
        padding: 1.1rem;
    }

    .auth-card-header h2 {
        font-size: 1.2rem;
    }
}

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

.dashboard-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--primary);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1020;
    padding: 1.1rem 0.9rem;
    overflow: hidden;
}

.dashboard-offcanvas {
    width: 260px;
    background: var(--primary);
}

.sidebar-profile {
    text-align: center;
    margin-bottom: 1.2rem;
}

.sidebar-avatar {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: var(--accent);
    color: #253548;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.profile-avatar-link {
    display: inline-flex;
    text-decoration: none;
}

.profile-avatar-link .sidebar-avatar,
.profile-avatar-link .topbar-avatar {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-avatar-link:hover .sidebar-avatar,
.profile-avatar-link:hover .topbar-avatar,
.profile-avatar-link:focus-visible .sidebar-avatar,
.profile-avatar-link:focus-visible .topbar-avatar {
    transform: scale(1.03);
    box-shadow: 0 0 0 2px rgba(232, 160, 32, 0.45);
}

.sidebar-avatar img,
.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.sidebar-profile h4 {
    font-size: 0.95rem;
}

.sidebar-role {
    display: inline-block;
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 3px 10px;
    border: 1px solid rgba(232, 160, 32, 0.45);
    color: #ffe2ae;
    background: rgba(232, 160, 32, 0.18);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.2rem;
}

.dashboard-offcanvas .offcanvas-body {
    min-height: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-left: 3px solid transparent;
    padding: 0.64rem 0.75rem;
    border-radius: 8px;
}

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

.sidebar-link.active {
    border-left-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-link.blocked {
    opacity: 0.45;
    cursor: not-allowed;
    border-left-color: transparent;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-logout-form {
    margin-top: 1rem;
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-light);
    overflow-x: hidden;
    min-width: 0; /* Critical for flexbox overflow */
}

.dashboard-topbar {
    background: #fff;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #e6edf4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.dashboard-page-title {
    font-size: 1.1rem;
    margin: 0;
    color: #1c2940;
}

.dashboard-breadcrumb {
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-icon-btn,
.topbar-menu-btn {
    border: 1px solid #d9e1eb;
    background: #fff;
    color: #30445c;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.topbar-notification-wrap {
    position: relative;
}

.notification-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #dc2626;
    top: 8px;
    right: 8px;
    box-shadow: 0 0 0 2px #fff;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.topbar-notification-card {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(360px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid #d9e1eb;
    border-radius: 12px;
    box-shadow: 0 16px 35px rgba(20, 35, 58, 0.2);
    z-index: 1120;
}

.topbar-notification-card.topbar-notification-card-portal {
    position: fixed;
    top: 70px;
    right: auto;
    left: 12px;
    z-index: 5000;
}

.topbar-notification-card-header {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e6edf4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-notification-card-body {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.topbar-notification-item {
    border: 1px solid #e8eef6;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.45rem;
    background: #fff;
}

.topbar-notification-item.unread {
    background: #eef5ff;
    border-color: #cde0ff;
}

.topbar-notification-item:last-child {
    margin-bottom: 0;
}

.topbar-notification-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.topbar-notification-link:hover .topbar-notification-item,
.topbar-notification-link:focus-visible .topbar-notification-item {
    border-color: #c2d8ef;
    background: #f7fbff;
}

.topbar-notification-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1d2c42;
}

.topbar-notification-text {
    margin: 0.2rem 0;
    font-size: 0.78rem;
    color: #354a64;
    line-height: 1.3;
}

.topbar-notification-time {
    font-size: 0.72rem;
    color: #6a7a8f;
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
}

.profile-edit-preview {
    width: 68px;
    height: 68px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #dce8f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.profile-edit-preview-fallback {
    background: #1a3c5e;
    color: #fff;
    font-weight: 700;
}

.dashboard-content-area {
    padding: 1.1rem;
    overflow-x: hidden;
    position: relative;
}

.dashboard-message-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(17, 34, 58, 0.08);
    padding: 0.75rem 0.85rem;
}

.dashboard-welcome-card {
    background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(26, 60, 94, 0.22);
    padding: 1.2rem;
}

.card-stat,
.dashboard-stat-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e6edf4;
    box-shadow: 0 8px 22px rgba(17, 34, 58, 0.1);
    padding: 1rem 1.05rem;
    height: 100%;
}

.card-stat:hover,
.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(17, 34, 58, 0.14);
}

.stat-label {
    color: #5a697d;
    font-size: 0.86rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a2c43;
}

.quick-grid-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(17, 34, 58, 0.08);
    padding: 1rem;
}

.quick-grid-title {
    font-size: 1rem;
    margin-bottom: 0.9rem;
    color: #1f324b;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quick-link-card {
    background: #f7f9fc;
    border: 1px solid #e6edf4;
    border-radius: 10px;
    padding: 0.85rem;
    text-decoration: none;
    color: #2a3a52;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.quick-link-card i {
    color: var(--primary);
}

.module-placeholder-wrap {
    min-height: calc(100vh - 170px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-placeholder-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(17, 34, 58, 0.08);
    max-width: 560px;
    width: 100%;
    padding: 2rem;
}

.module-placeholder-icon {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(26, 60, 94, 0.18), rgba(232, 160, 32, 0.18));
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.status-card {
    max-width: 620px;
}

.status-warning .role-chip {
    background: linear-gradient(135deg, #c78613, #e8a020);
}

@media (max-width: 991.98px) {
    .dashboard-main {
        margin-left: 0;
    }
}

.unit-modules-wrap {
    max-width: 1100px;
    width: 100%;
    padding: 1.8rem;
}

.unit-badge {
    border: 1px solid rgba(232, 160, 32, 0.5);
    color: #8b5a00;
    background: #fff1d3;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-weight: 600;
    font-size: 0.84rem;
}

.unit-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.unit-module-card {
    border: 1px solid #e8eef6;
    border-radius: 14px;
    padding: 1.1rem;
    background: #fff;
    box-shadow: 0 5px 18px rgba(26, 60, 94, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.unit-module-card h3 {
    margin: 0;
    color: #1a2f48;
    font-size: 1.05rem;
}

.unit-module-card p {
    color: #5f6d80;
    font-size: 0.9rem;
    flex: 1;
}

.unit-module-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26, 60, 94, 0.16), rgba(232, 160, 32, 0.16));
    color: var(--primary);
    font-size: 1.25rem;
}

.topbar-module-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-right: 0.4rem;
}

.topbar-meta-chip {
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.topbar-module-chip {
    background: rgba(26, 60, 94, 0.12);
    color: var(--primary);
}

.topbar-location-chip {
    background: rgba(45, 106, 159, 0.12);
    color: #254869;
}

.topbar-unit-chip {
    background: rgba(232, 160, 32, 0.2);
    color: #7a4a00;
}

.topbar-switch-link {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.topbar-switch-link:hover {
    color: #0e2a45;
}

.topbar-country-chip {
    background: rgba(26, 60, 94, 0.08);
    color: #294966;
}

.admin-topbar-meta {
    gap: 0.5rem;
}

.topbar-unit-filter-form {
    margin: 0;
}

.topbar-unit-filter-select {
    min-width: 150px;
    border-radius: 999px;
    border-color: #d6e0eb;
    font-size: 0.76rem;
    height: 30px;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

@media (max-width: 1199.98px) {
    .admin-topbar-meta {
        display: none;
    }
}

.superadmin-permission-card {
    border-color: rgba(232, 160, 32, 0.5);
    background: linear-gradient(135deg, #fff8ea, #fff2d6);
}

.reposition-summary-chip {
    border: 1px solid #dbe7f4;
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.7rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #2d4662;
}

.reposition-summary-inreview {
    background: #eef5ff;
    border-color: #cfe0fb;
}

.reposition-summary-approved {
    background: #ecfaf1;
    border-color: #caedd8;
}

.reposition-summary-rejected {
    background: #fff3f3;
    border-color: #f8cfcf;
}

.reposition-summary-implemented {
    background: #e8f8f0;
    border-color: #bfe6d0;
}

.reposition-summary-notify {
    background: #fff8ed;
    border-color: #f5d8a6;
}

.reposition-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
}

.reposition-type-card {
    border: 1px solid #dce6f0;
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    text-align: center;
    background: #f8fbff;
    color: #2b435d;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.reposition-type-card:hover {
    border-color: #95b6d5;
    transform: translateY(-2px);
}

.reposition-type-card i {
    font-size: 0.95rem;
    color: #1a3c5e;
}

.reposition-type-card span {
    font-size: 0.8rem;
    font-weight: 700;
}

.reposition-type-card.active {
    border-color: #1a3c5e;
    background: #edf5fd;
    box-shadow: 0 6px 16px rgba(26, 60, 94, 0.12);
}

.reposition-employee-preview {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    background: #eef6ff;
    border: 1px solid #cddff3;
    border-radius: 12px;
    padding: 0.8rem;
}

.application-status-badge.reposition-status-draft,
.application-status-badge.reposition-status-pending {
    background: #fff4d8;
    color: #885b00;
    border-color: #ffd781;
}

.application-status-badge.reposition-status-in_review,
.application-status-badge.reposition-status-approved {
    background: #dff6e7;
    color: #12693c;
    border-color: #a8e5bf;
}

.application-status-badge.reposition-status-rejected,
.application-status-badge.reposition-status-cancelled {
    background: #ffe5e5;
    color: #8c1f1f;
    border-color: #f7b5b5;
}

.application-status-badge.reposition-status-implemented {
    background: #e4f7ed;
    color: #155d39;
    border-color: #b6e4ca;
}

.reposition-change-table .reposition-from {
    color: #9f1d1d;
    text-decoration: line-through;
}

.reposition-change-table .reposition-to {
    color: #166534;
    font-weight: 700;
}

.reposition-warning-box {
    border: 1px solid #f3d08b;
    background: #fff8ea;
    border-radius: 10px;
    padding: 0.8rem;
}

#createRepositionModal .modal-content {
    max-height: calc(100vh - 2rem);
}

#createRepositionModal #repositionRequestForm {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 6rem);
}

#createRepositionModal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .reposition-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reposition-employee-preview {
        flex-direction: column;
    }
}

.superadmin-permission-card .unit-module-icon {
    background: linear-gradient(135deg, rgba(232, 160, 32, 0.28), rgba(26, 60, 94, 0.16));
    color: #7c4d00;
}

.sa-filter-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sa-filter-select {
    min-width: 150px;
    border-radius: 999px;
    border-color: #d6e0eb;
    font-size: 0.76rem;
    height: 32px;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(17, 34, 58, 0.08);
    padding: 1rem;
    overflow: hidden; /* Ensure content stays inside */
}

/* Custom Table Scrollbar */
.custom-table-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f0f4f8;
    width: 100%;
    overflow-x: auto;
    display: block;
}

.custom-table-scrollbar::-webkit-scrollbar {
    height: 8px;
}

.custom-table-scrollbar::-webkit-scrollbar-track {
    background: #f0f4f8;
    border-radius: 10px;
}

.custom-table-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
    border: 2px solid #f0f4f8;
}

.custom-table-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-dark);
}

.table-card thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #45566d;
    border-bottom-color: #e8edf4;
}

.permissions-data-table thead th {
    background: var(--primary);
    color: #fff;
    border-bottom-color: var(--primary-dark);
    white-space: nowrap;
}

.permissions-data-table td {
    vertical-align: middle;
}

.action-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin-right: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn-edit {
    border-color: rgba(232, 160, 32, 0.45);
    color: #8a5600;
    background: #fff6e4;
}

.action-btn-edit:hover {
    background: #ffe7bd;
    color: #6f4300;
}

.action-btn-delete {
    border-color: rgba(185, 28, 28, 0.28);
    color: #b91c1c;
    background: #fff1f2;
}

.action-btn-delete:hover {
    background: #ffe1e4;
    color: #8b1212;
}

.permission-empty-state {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #5e6d82;
}

.permission-empty-icon {
    font-size: 3rem;
    color: rgba(26, 60, 94, 0.45);
}

.permission-stat-box {
    border: 1px solid #dfe9f2;
    border-radius: 14px;
    background: #fff;
    padding: 0.95rem 1rem;
    box-shadow: 0 6px 18px rgba(18, 35, 60, 0.08);
}

.permission-stat-box p {
    color: #57667d;
    font-size: 0.86rem;
}

.permission-filter-bar {
    border: 1px solid #e7edf4;
    border-radius: 12px;
    background: #f9fbfe;
    padding: 0.85rem;
}

.module-chip-badge {
    background: #e6eef8;
    color: #264768;
}

.permission-section-card {
    border: 1px solid #e7edf4;
    border-radius: 12px;
    padding: 0.9rem;
    background: #fdfefe;
}

.permission-section-card .section-title {
    color: #1f3652;
}

.permission-switch-wrap {
    border: 1px solid #e3ebf4;
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    background: #f9fbfe;
}

.permission-tabs .nav-link {
    color: #3a526b;
    font-weight: 600;
}

.permission-tabs .nav-link.active {
    color: var(--primary);
}

.permission-tab-content {
    background: #fff;
}

.track-employee-panel {
    min-height: 580px;
}

.track-employee-list {
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.track-employee-item {
    display: flex;
    gap: 0.7rem;
    border: 1px solid #e3eaf3;
    border-radius: 10px;
    padding: 0.6rem;
    text-decoration: none;
    color: #1f334b;
    background: #fff;
}

.track-employee-item:hover {
    border-color: #cfdceb;
    background: #f8fbff;
}

.track-employee-item.active {
    border-color: #95b4d4;
    background: #edf4fd;
}

.track-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
}

.track-employee-meta {
    min-width: 0;
}

.role-badge-customer {
    background: #dff8f4;
    color: #0f766e;
    border-color: #a7eee3;
}

.role-badge-staff {
    background: #e8eaff;
    color: #3730a3;
    border-color: #ccd1ff;
}

.role-badge-unit {
    background: #e8f8eb;
    color: #166534;
    border-color: #c8eccc;
}

.role-badge-admin {
    background: #fff1df;
    color: #c2410c;
    border-color: #ffd8b5;
}

.role-badge-superadmin {
    background: #ffe4e7;
    color: #be123c;
    border-color: #ffc8d2;
}

.global-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 29, 46, 0.6);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-loading-card {
    min-width: 220px;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    text-align: center;
    color: #fff;
    background: rgba(19, 41, 65, 0.92);
    box-shadow: 0 18px 34px rgba(7, 18, 30, 0.35);
}

@media (max-width: 991.98px) {
    .dashboard-topbar {
        padding: 0.75rem 0.85rem;
    }

    .dashboard-page-title {
        font-size: 1rem;
    }

    .topbar-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 1199.98px) {
    .sa-filter-form {
        display: none;
    }
}

.job-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.job-template-card {
    background: #fff;
    border: 1px solid #e5edf6;
    border-top-width: 4px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(16, 35, 58, 0.08);
    padding: 1rem;
}

.job-template-card.jt-role-unit {
    border-top-color: #2d8a5d;
}

.job-template-card.jt-role-admin {
    border-top-color: #e8a020;
}

.job-template-card.jt-role-superadmin {
    border-top-color: #d9465f;
}

.jt-role-badge {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.jt-role-badge.jt-role-unit {
    background: #e7f7ee;
    color: #166534;
    border-color: #bfe8ce;
}

.jt-role-badge.jt-role-admin {
    background: #fff3df;
    color: #9a5200;
    border-color: #ffd59c;
}

.jt-role-badge.jt-role-superadmin {
    background: #ffe8ec;
    color: #be123c;
    border-color: #ffc4cf;
}

.jt-card-meta {
    border-top: 1px dashed #d8e4f1;
}

.job-template-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
}

.job-template-detail-card {
    overflow: hidden;
}

.job-template-header {
    background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
    color: #fff;
    padding: 1rem 1.25rem;
}

.jt-section-title {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #3f5873;
    margin-bottom: 0.55rem;
}

.job-template-preline {
    white-space: pre-line;
    color: #25364b;
    line-height: 1.6;
}

.jt-note-box {
    white-space: pre-line;
    border: 1px solid #e3ebf4;
    border-radius: 10px;
    background: #f9fbfe;
    padding: 0.8rem;
}

.job-template-meta-card {
    top: 82px;
    border-radius: 12px;
}

.job-template-form-wrap {
    width: 100%;
    max-width: 100%;
}

.jt-assignment-card {
    border: 1px solid #dbe7f4;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff, #f2f7fc);
    padding: 1rem;
}

@media (max-width: 1199.98px) {
    .job-template-detail-layout {
        grid-template-columns: 1fr;
    }

    .job-template-meta-card {
        top: 0;
        position: static;
    }
}

.job-post-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1rem;
    align-items: stretch;
}

.job-post-card {
    background: #fff;
    border: 1px solid #e5edf6;
    border-top-width: 4px;
    border-top-color: #1a3c5e;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(16, 35, 58, 0.08);
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.job-post-card.jp-role-unit {
    border-top-color: #2d8a5d;
}

.job-post-card.jp-role-admin {
    border-top-color: #e8a020;
}

.job-post-card.jp-role-superadmin {
    border-top-color: #d9465f;
}

.job-post-card.jp-expired {
    opacity: 0.8;
}

.jp-status-badge {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.jp-status-badge.jp-status-draft {
    background: #eff3f8;
    border-color: #d8e4f1;
    color: #445a74;
}

.jp-status-badge.jp-status-pending {
    background: #fff8dc;
    border-color: #ffe6a8;
    color: #9a6400;
}

.jp-status-badge.jp-status-reviewing {
    background: #e7f2ff;
    border-color: #c9defa;
    color: #1d4e89;
}

.jp-status-badge.jp-status-shortlisted {
    background: #e7f7ee;
    border-color: #bfe8ce;
    color: #166534;
}

.jp-status-badge.jp-status-active {
    background: #e7f7ee;
    border-color: #bfe8ce;
    color: #166534;
}

.jp-status-badge.jp-status-paused {
    background: #fff8dc;
    border-color: #ffe6a8;
    color: #9a6400;
}

.jp-status-badge.jp-status-closed,
.jp-status-badge.jp-status-filled,
.jp-status-badge.jp-status-rejected,
.jp-status-badge.jp-status-hired {
    background: #ffe8ec;
    border-color: #ffc4cf;
    color: #be123c;
}

.jp-status-badge.jp-status-hired {
    background: #e7f7ee;
    border-color: #bfe8ce;
    color: #166534;
}

.text-bg-primary-subtle {
    background-color: #e7f2ff !important;
    color: #1d4e89 !important;
}

.text-bg-secondary-subtle {
    background-color: #eff3f8 !important;
    color: #445a74 !important;
}

.jp-stat-chip {
    border: 1px solid #dfe9f2;
    border-radius: 12px;
    background: #fff;
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    color: #344b65;
}

.jp-stat-chip.jp-stat-active {
    background: #eefaf3;
    border-color: #d1eddc;
    color: #166534;
}

.jp-stat-chip.jp-stat-closed {
    background: #fff4f6;
    border-color: #ffd6df;
    color: #be123c;
}

.jp-template-loader {
    border: 1px solid #dbe7f4;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff, #f2f7fc);
    padding: 1rem;
}

.job-post-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
}

.jp-apply-box {
    border: 1px solid #dbe8f5;
    border-radius: 12px;
    background: #f7fbff;
    padding: 1rem;
}

.jp-summary-strip {
    border: 1px solid #e5edf6;
    border-radius: 10px;
    padding: 0.75rem;
    background: #fbfdff;
}

.job-share-card {
    border: 1px solid #d9e6f4;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5fd 100%);
    padding: 0.85rem;
    overflow: hidden;
}

.job-share-link {
    display: block;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #1a3c5e;
    text-decoration: none;
    word-break: break-all;
}

.job-share-link:hover {
    color: #255b89;
    text-decoration: underline;
}

.job-share-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
}

.job-share-item {
    border: 1px dashed #bfd2e7;
    border-radius: 10px;
    background: #fff;
    padding: 0.65rem;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.job-share-qr {
    width: min(164px, 100%);
    aspect-ratio: 1 / 1;
    min-height: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-share-qr img,
.job-share-qr canvas {
    max-width: 100%;
    height: auto;
}

.job-share-barcode-wrap {
    width: 100%;
    overflow: hidden;
    padding: 0.5rem 0.35rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.job-share-barcode {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: 72px;
}

.application-share-image {
    max-height: 160px;
    object-fit: contain;
}

.app-review-panel {
    border: 1px solid #dbe7f4;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7fbff, #f2f7fc);
    padding: 1rem;
}

.application-history-list {
    display: grid;
    gap: 0.75rem;
}

.application-history-item {
    border: 1px solid #e5edf6;
    border-left: 4px solid #2d6a9f;
    border-radius: 10px;
    background: #fbfdff;
    padding: 0.8rem;
}

.application-verify-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
}

.application-detail-layout {
    align-items: start;
}

.application-hero-card {
    border: 1px solid #d9e7f6;
    background: linear-gradient(135deg, #f8fbff 0%, #eef5fd 100%);
}

.application-hero-header {
    padding: 1.15rem;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.application-hero-photo-wrap {
    width: 150px;
    height: 150px;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid #d8e6f5;
    background: #fff;
    box-shadow: 0 10px 24px rgba(23, 49, 73, 0.12);
}

.application-hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.application-hero-photo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a3c5e;
    background: linear-gradient(145deg, #e5effb, #d8e7f8);
}

.application-hero-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.application-kpi-item {
    border: 1px solid #dbe8f5;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    background: #fff;
}

.application-kpi-label {
    display: block;
    font-size: 0.73rem;
    color: #536982;
    margin-bottom: 0.15rem;
}

.app-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.app-view-field {
    border: 1px solid #e3edf7;
    border-radius: 10px;
    background: #fdfefe;
    padding: 0.7rem 0.8rem;
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.app-view-field-wide {
    grid-column: 1 / -1;
}

.app-view-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #5f738c;
    font-weight: 700;
}

.app-view-value {
    color: #243c55;
    font-size: 0.92rem;
    word-break: break-word;
}

.app-view-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.app-view-pill-yes {
    color: #166534;
    background: #e7f7ee;
    border-color: #bfe8ce;
}

.app-view-pill-no {
    color: #be123c;
    background: #ffe8ec;
    border-color: #ffc4cf;
}

.app-view-pill-neutral {
    color: #1d4e89;
    background: #e7f2ff;
    border-color: #c9defa;
}

.app-view-table-wrap {
    border: 1px solid #e2ecf6;
    border-radius: 10px;
    padding: 0.8rem;
    background: #fbfdff;
}

.app-view-table {
    margin-bottom: 0;
}

.app-view-table th {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: #5a6f89;
    border-bottom-width: 1px;
}

.app-view-table td {
    font-size: 0.86rem;
    color: #2c435e;
    vertical-align: middle;
}

.application-reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.application-reference-card {
    border: 1px solid #dbe8f5;
    border-radius: 10px;
    background: #fff;
    padding: 0.75rem;
}

.interest-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
    color: #fff;
    box-shadow: 0 12px 26px rgba(20, 42, 66, 0.28);
    z-index: 1040;
}

.interest-fab:hover {
    background: linear-gradient(135deg, #14344f, #255b89);
}

.interest-success-state .interest-success-icon {
    font-size: 2.2rem;
    color: #15803d;
}

.public-job-site {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #edf3fb 100%);
    color: #1d2e45;
}

.public-job-site .btn,
.public-job-site .form-control,
.public-job-site .form-select {
    border-radius: 10px;
}

.public-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(248, 251, 255, 0.9);
    border-bottom: 1px solid #e5edf6;
    backdrop-filter: blur(6px);
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #1a3c5e;
    text-decoration: none;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.public-main-wrap {
    min-height: calc(100vh - 140px);
}

.public-hero {
    padding: 2.5rem 0 1rem;
}

.public-hero-inner {
    background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
    color: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 16px 36px rgba(19, 39, 62, 0.2);
}

.public-footer {
    border-top: 1px solid #dfe9f2;
    color: #5e6d82;
}

.public-job-grid .job-post-card {
    border-top-color: #2d6a9f;
}

@media (min-width: 1200px) {
    .job-post-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .job-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767.98px) {
    .job-post-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1199.98px) {
    .job-post-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .interest-fab {
        right: 14px;
        bottom: 14px;
        width: 48px;
        height: 48px;
    }

    .public-hero-inner {
        padding: 1.4rem;
    }

    .application-hero-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .application-hero-photo-wrap {
        margin: 0 auto;
    }

    .app-view-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .job-share-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .job-share-barcode {
        height: 76px;
    }
}

@media (max-width: 575.98px) {
    .job-share-card {
        padding: 0.7rem;
    }

    .job-share-barcode {
        height: 66px;
    }
}

/* Job Application Form Layout */
.app-form-shell {
    width: 100%;
    max-width: none;
}

.app-form-page-header {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.app-form-title {
    color: #1a3c5e;
    font-weight: 800;
}

.app-form-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #1a3c5e;
    flex-shrink: 0;
}

.app-form-progress-line {
    height: 6px;
    border-radius: 99px;
}

.app-form-progress-bar {
    width: 0;
    background: #e8a020;
    transition: width 0.3s;
}

.app-form-progress-labels {
    font-size: 0.78rem;
    color: #888;
}

/* Section Cards */
.app-form-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #edf0f5;
    transition: box-shadow 0.2s;
}

.app-form-section:hover {
    box-shadow: 0 4px 28px rgba(26, 60, 94, 0.12);
}

.app-form-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 28px;
    background: #f8fafc;
    border-bottom: 1px solid #edf0f5;
}

.app-form-section-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.app-form-section-header h4 {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a3c5e;
}

.section-badge {
    margin-left: auto;
    background: #1a3c5e;
    color: #fff;
    border-radius: 99px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.app-form-section-body {
    padding: 28px;
}

.app-icon-personal {
    background: #e8f4ff;
    color: #1a3c5e;
}

.app-icon-contact {
    background: #fff3e0;
    color: #e65100;
}

.app-icon-location {
    background: #e6f7f2;
    color: #0f766e;
}

.app-icon-education {
    background: #e8f5e9;
    color: #2e7d32;
}

.app-icon-identity {
    background: #fce4ec;
    color: #c62828;
}

.app-icon-professional {
    background: #ede7f6;
    color: #4527a0;
}

.app-icon-health {
    background: #e8f5e9;
    color: #c62828;
}

.app-icon-reference {
    background: #fff8e1;
    color: #f57f17;
}

.app-icon-statement {
    background: #e3f2fd;
    color: #1565c0;
}

.app-icon-docs {
    background: #f3e5f5;
    color: #6a1b9a;
}

.app-icon-declaration {
    background: #e3f2fd;
    color: #1a3c5e;
}

.app-form-declaration-header {
    background: #f0f4f8;
}

/* Labels */
.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #374151;
    margin-bottom: 5px;
}

.req-label::after {
    content: " *";
    color: #c62828;
}

/* Photo Upload */
.photo-upload-wrapper {
    width: 120px;
    height: 140px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px dashed #c8d6e5;
    background: #f8fafc;
    cursor: pointer;
}

.photo-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 60, 94, 0.55);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    font-size: 0.8rem;
}

.photo-upload-wrapper:hover .photo-upload-overlay {
    opacity: 1;
}

input[type="file"].real-file-input,
input[type="file"].photo-upload-input {
    display: none;
}

/* Pills and chips */
.gender-pill-group,
.day-chip-group,
.looking-for-toggle,
.yn-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.gender-pill,
.day-chip,
.lf-pill {
    cursor: pointer;
}

.gender-pill input[type="radio"],
.day-chip input[type="checkbox"],
.lf-pill input[type="radio"],
.yn-radio-label input[type="radio"] {
    display: none;
}

.gender-pill span,
.day-chip span,
.lf-pill span,
.yn-pill {
    display: inline-block;
    transition: all 0.15s;
}

.gender-pill span {
    padding: 6px 18px;
    border: 2px solid #c8d6e5;
    border-radius: 99px;
    font-size: 0.88rem;
    font-weight: 500;
    user-select: none;
}

.gender-pill.active span,
.gender-pill input:checked + span {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #fff;
}

.day-chip span {
    padding: 6px 16px;
    border: 2px solid #c8d6e5;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
}

.day-chip.active span,
.day-chip input:checked + span {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #fff;
}

.day-chip.restriction.active span,
.day-chip.restriction input:checked + span {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

.lf-pill span {
    padding: 6px 16px;
    border: 2px solid #c8d6e5;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lf-pill.active span,
.lf-pill input:checked + span {
    background: #e8a020;
    border-color: #e8a020;
    color: #fff;
}

.yn-radio-label {
    cursor: pointer;
    margin-bottom: 0;
}

.yn-pill {
    padding: 5px 18px;
    border: 2px solid #c8d6e5;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
}

.yn-pill.active,
.yn-radio-label input:checked + .yn-pill {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #fff;
}

.yn-question-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #edf0f5;
}

.yn-question-text {
    font-weight: 500;
    color: #374151;
    flex: 1;
    min-width: 200px;
}

.yn-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Support blocks */
.doc-block-card {
    background: #f8fafc;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    padding: 16px 20px;
}

.doc-block-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a3c5e;
}

.edu-level-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.edu-entry-card,
.ref-entry-card {
    background: #f8fafc;
    border: 1px solid #dde3ec;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.ref-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ref-num {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1a3c5e;
}

.upload-drop-zone {
    border: 2px dashed #c8d6e5;
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.upload-drop-zone.drag-over {
    border-color: #1a3c5e;
    background: #e8f0fe;
}

.app-doc-cv-icon {
    color: #c62828;
}

.app-doc-attach-icon,
.app-transfer-icon {
    color: #1a3c5e;
}

.info-highlight-card {
    background: linear-gradient(135deg, #e8f4ff, #f0f8ff);
    border-left: 4px solid #1a3c5e;
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.welfare-questions-block {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #edf0f5;
    overflow: hidden;
}

.welfare-q-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #edf0f5;
    font-size: 0.9rem;
}

.welfare-q-row:last-child {
    border-bottom: none;
}

.terms-scroll-box {
    max-height: 160px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
}

.app-terms-title {
    color: #1a3c5e;
}

.declaration-check-label {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #dde3ec;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.declaration-check-label:hover {
    background: #e8f0fe;
    border-color: #1a3c5e;
}

.declaration-checkbox-wrap input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #1a3c5e;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-submit-primary {
    background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 36px;
    border-radius: 10px;
    border: none;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-submit-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #fff;
}

.btn-submit-primary:disabled {
    opacity: 0.65;
    transform: none;
}

.personal-statement-hint {
    background: #fffde7;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    border: 1px solid #fff59d;
}

.phone-input-group .phone-code-select {
    max-width: 140px;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.phone-input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.location-detect-toolbar {
    background: #f8fafc;
    border: 1px solid #edf0f5;
    border-radius: 10px;
    padding: 10px 12px;
}

.readonly-location-field[readonly] {
    background: #eef2f7;
    border-style: dashed;
    color: #334155;
    cursor: not-allowed;
}

/* Success page */
.app-success-shell {
    min-height: 56vh;
}

.app-success-icon {
    font-size: 5rem;
    color: #2e7d32;
}

.app-success-title {
    color: #1a3c5e;
    font-weight: 800;
}

.app-success-summary-card {
    max-width: 520px;
}

.app-success-summary-head {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.app-success-note {
    max-width: 460px;
}

/* Responsive */
@media (max-width: 991.98px) {
    .app-form-page-header,
    .app-form-section-body {
        padding: 20px;
    }

    .app-form-section-header {
        padding: 16px 20px;
    }
}

@media (max-width: 767.98px) {
    .app-form-shell {
        max-width: 100%;
    }

    .section-badge {
        display: none;
    }

    .app-form-progress-labels {
        display: none !important;
    }

    .app-form-page-header,
    .app-form-section-body {
        padding: 16px;
    }

    .submit-section .ms-auto {
        margin-left: 0 !important;
        width: 100%;
    }
}

/* Unit Number pages */
.unit-form-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #edf0f5;
}

.unit-form-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #edf0f5;
}

.unit-form-card-header h5 {
    font-weight: 700;
    color: #1a3c5e;
    margin-bottom: 2px;
}

.unit-form-card-body {
    padding: 24px;
}

.address-preview-box {
    background: #f0f4f8;
    border: 1px dashed #b0bec5;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a3c5e;
    min-height: 44px;
    transition: color 0.2s;
}

.authorized-person-card {
    background: #fffbf5;
    border: 1px solid #ffe0b2;
    border-top: 3px solid #e8a020;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    transition: opacity 0.2s;
}

.authorized-person-card.is-marked-delete {
    opacity: 0.45;
}

.person-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.person-card-number {
    font-weight: 700;
    color: #e8a020;
    font-size: 0.9rem;
}

.emp-result-banner {
    margin: 10px 0 14px;
}

.emp-found-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 12px 16px;
}

.emp-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1a3c5e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.emp-found-info {
    font-size: 0.88rem;
    line-height: 1.5;
}

.emp-found-info strong {
    display: block;
    font-size: 0.95rem;
    color: #1a3c5e;
}

.user-assignment-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .user-assignment-panel {
        grid-template-columns: 1fr;
    }
}

.assignment-panel-side {
    border: 1px solid #edf0f5;
    border-radius: 12px;
    overflow: hidden;
}

.assignment-panel-header {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #edf0f5;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1a3c5e;
}

.assignment-scroll-list {
    max-height: 280px;
    overflow-y: auto;
}

.assigned-user-row:last-child {
    border-bottom: none !important;
}

#unitNoFeedback {
    font-size: 0.83rem;
    margin-top: 4px;
}

.unit-form-sticky-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #edf0f5;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.07);
    z-index: 100;
    margin: 0 -24px -24px;
    border-radius: 0 0 16px 16px;
}

.authorized-avatar-stack {
    display: inline-flex;
    align-items: center;
}

.authorized-avatar-item,
.authorized-avatar-more {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: -8px;
    border: 2px solid #fff;
}

.authorized-avatar-item {
    background: #f6c46a;
    color: #5a3a00;
}

.authorized-avatar-more {
    background: #1a3c5e;
    color: #fff;
}

/* New Hire Module */
.nh-stat-chip {
    background: #fff;
    border: 1px solid #e0e7f0;
    border-radius: 12px;
    padding: 10px 12px;
    color: #254462;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(18, 35, 60, 0.06);
}

.nh-stat-shortlisted {
    border-color: #f0cc7f;
    color: #7a5200;
    background: #fff7e8;
}

.nh-stat-interview {
    border-color: #abd0ee;
    color: #1f4e79;
    background: #edf7ff;
}

.nh-stat-viva {
    border-color: #c8c1ff;
    color: #433b95;
    background: #f2f0ff;
}

.nh-stat-selected {
    border-color: #a3d9b0;
    color: #1f5e2e;
    background: #ecf9ef;
}

.nh-table thead.nh-table-head th,
.nh-table-head th {
    background: #1a3c5e;
    color: #fff;
    border-bottom-color: #1a3c5e;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.nh-table tbody tr {
    cursor: pointer;
}

.nh-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #1a3c5e;
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nh-progress {
    height: 8px;
    border-radius: 99px;
}

.bg-step-indigo {
    background-color: #4f46e5 !important;
}

.new-hire-detail-wrap {
    max-width: 1100px;
}

.new-hire-header-card {
    background: linear-gradient(135deg, #1a3c5e, #264f78);
    color: #fff;
}

.new-hire-header-card h3 {
    color: #ffffff;
}

.new-hire-contact-line {
    color: rgba(235, 244, 255, 0.95);
    font-weight: 500;
}

.new-hire-contact-line .contact-email-display {
    color: #ffd670;
    font-weight: 700;
}

.new-hire-meta-badges .nh-meta-badge {
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.36rem 0.62rem;
    border: 1px solid transparent;
}

.new-hire-meta-badge-role {
    background: #f8c84a;
    color: #3b2a00;
}

.new-hire-meta-badge-unit {
    background: rgba(255, 255, 255, 0.16);
    color: #f5f9ff;
    border-color: rgba(255, 255, 255, 0.45);
}

.new-hire-meta-badge-light {
    background: #ffffff;
    color: #173f65;
    border-color: #d7e1ec;
}

.new-hire-meta-badge-override {
    background: #ffb703;
    color: #332100;
}

.new-hire-avatar {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f7c668, #e8a020);
    color: #5a3d00;
    font-size: 1.1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nh-review-box {
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fbfdff;
    padding: 14px;
    height: 100%;
}

/* Pipeline Stepper */
.pipeline-stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 8px;
}

@media (max-width: 767px) {
    .pipeline-stepper {
        flex-direction: column;
        gap: 0;
    }
}

.step-node {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 110px;
}

.step-node:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.step-node.step-completed:not(:last-child)::after {
    background: #2e7d32;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    z-index: 1;
    transition: all 0.2s;
    position: relative;
}

.step-node.step-completed .step-circle {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

.step-node.step-current .step-circle {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #fff;
    box-shadow: 0 0 0 0 rgba(26, 60, 94, 0.6);
    animation: stepPulse 1.8s infinite;
}

@keyframes stepPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 60, 94, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(26, 60, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 60, 94, 0);
    }
}

.step-label {
    text-align: center;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    max-width: 100px;
    word-wrap: break-word;
}

.step-node.step-current .step-label {
    color: #1a3c5e;
}

.step-node.step-completed .step-label {
    color: #2e7d32;
}

.step-meta {
    font-size: 0.72rem;
    color: #6b7280;
    text-align: center;
    margin-top: 3px;
    max-width: 120px;
}

/* Step Action Panel */
.step-action-panel {
    display: none;
    background: #fffbf5;
    border: 2px solid #e8a020;
    border-radius: 14px;
    padding: 24px;
    margin-top: 16px;
    animation: fadeIn 0.25s ease;
}

.step-action-panel.show {
    display: block;
}

/* Variable chips */
.var-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 10px;
}

.var-chip {
    padding: 3px 10px;
    background: #e8f4ff;
    border: 1px solid #b0d0ee;
    border-radius: 99px;
    font-size: 0.77rem;
    font-family: monospace;
    cursor: pointer;
    color: #1a3c5e;
    transition: background 0.1s;
}

.var-chip:hover {
    background: #1a3c5e;
    color: #fff;
}

/* Email statuses */
.email-status-sent {
    color: #2e7d32;
    font-weight: 700;
}

.email-status-failed {
    color: #c62828;
    font-weight: 700;
}

.email-status-pending {
    color: #e8a020;
    font-weight: 700;
}

/* Pipeline Settings */
.nh-pipeline-info {
    border-left: 4px solid #1a3c5e;
}

.pipeline-step-card {
    background: #fff;
    border: 1px solid #edf0f5;
    border-left: 4px solid #1a3c5e;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: opacity 0.2s;
}

.pipeline-step-card.step-inactive {
    border-left-color: #9ca3af;
    opacity: 0.65;
}

.drag-handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 1.1rem;
    padding: 0 8px;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Completed Banner */
.completed-banner {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    border-radius: 14px;
    padding: 20px 28px;
    text-align: center;
    margin-top: 20px;
}

.completed-banner h4 {
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

/* Email Preview Modal */
.email-preview-content {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    font-family: Arial, sans-serif;
}

.appointment-letter-card .table td,
.appointment-letter-card .table th {
    vertical-align: middle;
}

.appointment-letter-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 14px;
}

.appointment-send-root {
    width: 100%;
    max-width: 100%;
}

.appointment-send-summary {
    border-left: 4px solid #1a3c5e;
}

.appointment-field-input {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
}

.staff-avatar-lg {
    width: 82px;
    height: 82px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1a3c5e, #2f638f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.staff-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-data-bulk-bar {
    background: #f8fbff;
}

#idCardCanvasViewport {
    min-height: 440px;
}

.id-card-token-btn {
    font-family: Consolas, "Courier New", monospace;
}

/* Leave Application Module */
.leave-balance-bar {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e6edf4;
    box-shadow: 0 8px 22px rgba(26, 60, 94, 0.08);
    margin-bottom: 1rem;
    overflow: hidden;
}

.leave-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, rgba(26, 60, 94, 0.06), rgba(232, 160, 32, 0.15));
    border-bottom: 1px solid #ebf1f7;
}

.leave-balance-title {
    font-weight: 700;
    color: #1a3c5e;
}

.leave-balance-employee {
    color: #44586f;
    font-size: 0.88rem;
}

.leave-balance-cards {
    padding: 0.9rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.65rem;
}

.lb-card {
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 0.65rem;
    display: flex;
    gap: 0.65rem;
    background: #fbfdff;
}

.lb-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1a3c5e;
    background: rgba(26, 60, 94, 0.12);
}

.lb-card-info {
    min-width: 0;
    flex: 1;
}

.lb-card-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f3550;
}

.lb-card-counts {
    font-size: 0.9rem;
    font-weight: 700;
    color: #234262;
}

.lb-divider {
    opacity: 0.55;
    margin: 0 2px;
}

.lb-entitled {
    opacity: 0.75;
}

.lb-remaining {
    color: #1d7d4f;
}

.lb-remaining.lb-zero {
    color: #c0392b;
}

.lb-card-sub {
    font-size: 0.77rem;
    color: #5a6f85;
}

.lb-progress {
    margin-top: 0.35rem;
    height: 5px;
    border-radius: 999px;
    background: #e9eff6;
    overflow: hidden;
}

.lb-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e8a020, #1a3c5e);
}

.lb-balance-highlight.active {
    border-color: rgba(26, 60, 94, 0.5) !important;
    color: #1a3c5e;
    font-weight: 700;
}

.leave-summary-chip {
    background: #fff;
    border: 1px solid #e6edf4;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    box-shadow: 0 4px 14px rgba(26, 60, 94, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leave-summary-chip strong {
    color: #1a3c5e;
    font-size: 1rem;
}

.leave-summary-label {
    color: #5b7086;
    font-size: 0.83rem;
    font-weight: 600;
}

.leave-summary-inreview {
    border-color: #d3e3f2;
    background: #f3f8fe;
}

.leave-summary-approved {
    border-color: #ccead6;
    background: #f2fbf6;
}

.leave-summary-alert {
    border-color: #f6dfb6;
    background: #fffbf2;
}

.leave-tabs .nav-link {
    border-radius: 999px;
    color: #4b6077;
    border: 1px solid #dce7f1;
    margin-right: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.leave-tabs .nav-link.active {
    border-color: #1a3c5e;
    background: #1a3c5e;
    color: #fff;
}

.tab-badge-inline {
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.2);
}

.leave-type-badge {
    background: #f6f8fb;
    border: 1px solid #dde7f2;
    color: #2b435d;
}

.leave-type-casual {
    border-color: #9ad0ff;
    background: #eef8ff;
}

.leave-type-medical {
    border-color: #d0f1dd;
    background: #f1fbf6;
}

.leave-type-annual {
    border-color: #ffe2a8;
    background: #fff9ec;
}

.leave-type-emergency {
    border-color: #ffd2d2;
    background: #fff3f3;
}

.leave-type-maternity,
.leave-type-paternity {
    border-color: #e1d5f8;
    background: #f7f3ff;
}

.leave-type-unpaid,
.leave-type-other {
    border-color: #d7dfeb;
    background: #f5f8fc;
}

.application-status-badge {
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
}

.leave-status-pending {
    background: #fff4d8;
    color: #885b00;
    border-color: #ffd781;
}

.leave-status-in_review {
    background: #e8f2ff;
    color: #0f4a8a;
    border-color: #b8d5fa;
}

.leave-status-approved {
    background: #dff6e7;
    color: #12693c;
    border-color: #a8e5bf;
}

.leave-status-rejected,
.leave-status-cancelled,
.leave-status-withdrawn {
    background: #ffe5e5;
    color: #8c1f1f;
    border-color: #f7b5b5;
}

.mini-chain {
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mini-step {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #c9d4e1;
}

.mini-step.pending {
    background: #f0ad4e;
}

.mini-step.approved {
    background: #2fa567;
}

.mini-step.rejected,
.mini-step.cancelled,
.mini-step.returned {
    background: #d9534f;
}

.mini-step.waiting {
    background: #adb5bd;
}

.mini-chain-line {
    width: 13px;
    height: 2px;
    background: #d6dde6;
    border-radius: 999px;
}

.leave-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.leave-type-card {
    border: 1px solid #dce6f0;
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
    background: #f8fbff;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.leave-type-card:hover {
    border-color: #95b6d5;
    transform: translateY(-2px);
}

.leave-type-card.active {
    border-color: #1a3c5e;
    background: #edf5fd;
    box-shadow: 0 6px 16px rgba(26, 60, 94, 0.12);
}

.lt-icon {
    font-size: 1rem;
    color: #1a3c5e;
    margin-bottom: 0.2rem;
}

.lt-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2b435d;
}

.leave-medical-alert {
    border: 1px solid #f7d17a;
    background: #fff8e8;
    color: #7e5a08;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
}

.leave-form-errors .alert {
    margin-bottom: 0.75rem;
}

.leave-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.leave-detail-grid label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6a7e93;
    margin-bottom: 2px;
}

.leave-detail-grid p {
    margin-bottom: 0;
    color: #243a53;
    font-weight: 600;
}

.leave-detail-note {
    background: #f8fbff;
    border: 1px solid #e4edf6;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
}

.leave-doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.leave-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.leave-level-card {
    border: 1px solid #dce6f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.leave-level-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 0.7rem;
    background: #f7fafd;
    border-bottom: 1px solid #e4edf6;
}

.leave-level-body {
    padding: 0.65rem;
}

.leave-chain-row {
    border: 1px solid #e5edf6;
    border-radius: 10px;
    padding: 0.5rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #fff;
    margin-bottom: 0.45rem;
}

.leave-chain-row.is-current-user {
    border-color: #85afd7;
    box-shadow: 0 0 0 2px rgba(26, 60, 94, 0.12);
}

.leave-chain-comment {
    margin: -0.25rem 0 0.45rem;
    font-size: 0.8rem;
    color: #4f6278;
    padding: 0.45rem 0.5rem;
    border-left: 3px solid #d6e1ed;
    background: #fbfdff;
    border-radius: 0 8px 8px 0;
}

.chain-status-pending {
    background: #fff4d8;
    color: #885b00;
}

.chain-status-approved {
    background: #dff6e7;
    color: #12693c;
}

.chain-status-rejected,
.chain-status-cancelled,
.chain-status-withdrawn,
.chain-status-returned {
    background: #ffe5e5;
    color: #8c1f1f;
}

.chain-status-forwarded,
.chain-status-in_review {
    background: #e8f2ff;
    color: #0f4a8a;
}

.chain-status-waiting {
    background: #ecf1f6;
    color: #4a6179;
}

.leave-level-approved {
    border-color: #bfe5cc;
}

.leave-level-rejected,
.leave-level-returned {
    border-color: #f2c5c5;
}

.leave-level-pending,
.leave-level-waiting {
    border-color: #dce6f0;
}

.leave-decision-feedback {
    margin-bottom: 0.75rem;
}

/* Leave apply modal scroll fix */
#applyLeaveModal .modal-content {
    max-height: calc(100vh - 2rem);
}

#applyLeaveModal #leaveApplicationForm {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 6rem);
}

#applyLeaveModal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .leave-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .leave-balance-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .leave-tabs .nav-link {
        margin-bottom: 0.35rem;
    }
}

.floating-chat-btn {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1a3c5e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1400;
    box-shadow: 0 4px 16px rgba(26, 60, 94, 0.4);
    transition: transform 0.15s;
}

.floating-chat-btn:hover {
    transform: scale(1.08);
}

.floating-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #c62828;
    color: #fff;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border: 2px solid #fff;
    min-width: 18px;
    text-align: center;
}

.sliding-chat-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: calc(100vw - 24px);
    background: #fff;
    z-index: 1350;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 0.25s ease;
}

.sliding-chat-panel.open {
    transform: translateX(0);
    pointer-events: auto;
}

.sliding-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a3c5e;
    color: #fff;
}

.sliding-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    margin-left: auto;
}

.open-full-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.open-full-chat-btn:hover {
    color: #fff;
}

@media (max-width: 767.98px) {
    .floating-chat-btn {
        right: 14px;
        bottom: 74px;
    }

    .sliding-chat-panel {
        width: 100%;
        max-width: 100%;
    }
}

/* Global Horizontal Scroll Fixes */
body {
    overflow-x: hidden !important;
    width: 100vw;
}

.dashboard-main {
    overflow-x: hidden !important;
}

.dashboard-content-area {
    overflow-x: hidden !important;
}

.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
}

/* Custom Scrollbar for Webkit */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
