#addStaffBtn,
#exportBonusCSVBtn {
    width: auto !important;
    min-width: 140px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #10b981, #059669) !important;
    border: none;
    color: white;
}

#addStaffBtn:hover,
#exportBonusCSVBtn:hover {
    background: linear-gradient(90deg, #059669, #047857) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


* {
    margin: 0;

    padding: 0;
    box-sizing: border-box;
}

/* Zoom-based normalization styles */
:root {
    /* Neutral / grey-first theme */
    --primary-color: #6b7280;
    /* neutral grey */
    --secondary-color: #9ca3af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --border-color: #e6e9ee;
    --text-primary: #374151;
    /* darker grey for text */
    --text-secondary: #6b7280;
    --hover-bg: #f6f7f9;

    /* Zoom normalization variables */
    --zoom-font-scale: 1;
    --zoom-card-scale: 1;
    --zoom-current-zoom: 100%;
}

/* Zoom-specific adjustments */
.zoom-80 {
    --zoom-font-scale: 1.25;
    --zoom-card-scale: 1.1;
}

.zoom-90 {
    --zoom-font-scale: 1;
    --zoom-card-scale: 1;
}

.zoom-100 {
    --zoom-font-scale: 1;
    --zoom-card-scale: 1;
}

.zoom-110 {
    --zoom-font-scale: 0.95;
    --zoom-card-scale: 0.97;
}

.zoom-120 {
    --zoom-font-scale: 0.8;
    --zoom-card-scale: 0.85;
}

/* Apply zoom-based font scaling */
.zoom-80 html,
.zoom-90 html,
.zoom-100 html,
.zoom-110 html,
.zoom-120 html {
    font-size: calc(16px * var(--zoom-font-scale)) !important;
}

/* Force consistent base font size for zoom 80% */
.zoom-80 {
    --zoom-font-scale: 1.35;
    --zoom-card-scale: 1.15;
}

.zoom-80 html {
    font-size: 21.6px !important;
    /* 16px * 1.35 */
}

/* Apply zoom-based card scaling */
.zoom-80 .login-card,
.zoom-80 .content-card,
.zoom-80 .modal-content,
.zoom-90 .login-card,
.zoom-90 .content-card,
.zoom-90 .modal-content,
.zoom-100 .login-card,
.zoom-100 .content-card,
.zoom-100 .modal-content,
.zoom-110 .login-card,
.zoom-110 .content-card,
.zoom-110 .modal-content,
.zoom-120 .login-card,
.zoom-120 .content-card,
.zoom-120 .modal-content {
    transform: scale(var(--zoom-card-scale));
    transform-origin: center top;
}

/* Adjust spacing for scaled cards */
.zoom-100 .login-card,
.zoom-100 .content-card,
.zoom-100 .modal-content {
    margin-top: calc(20px * var(--zoom-card-scale));
}

.zoom-80 .login-card,
.zoom-80 .content-card,
.zoom-80 .modal-content {
    margin-top: calc(15px * var(--zoom-card-scale));
}

/* Button and input scaling */
.zoom-80 .btn,
.zoom-80 input,
.zoom-80 select,
.zoom-80 textarea,
.zoom-90 .btn,
.zoom-90 input,
.zoom-90 select,
.zoom-90 textarea,
.zoom-100 .btn,
.zoom-100 input,
.zoom-100 select,
.zoom-100 textarea,
.zoom-110 .btn,
.zoom-110 input,
.zoom-110 select,
.zoom-110 textarea,
.zoom-120 .btn,
.zoom-120 input,
.zoom-120 select,
.zoom-120 textarea {
    font-size: calc(14px * var(--zoom-font-scale));
    padding: calc(8px * var(--zoom-font-scale)) calc(12px * var(--zoom-font-scale));
}

/* Specific adjustments for login forms */
.zoom-100 .login-form .form-group input,
.zoom-100 .login-form .form-group select {
    font-size: calc(15px * var(--zoom-font-scale));
    padding: calc(10px * var(--zoom-font-scale)) calc(14px * var(--zoom-font-scale));
}

.zoom-80 .login-form .form-group input,
.zoom-80 .login-form .form-group select {
    font-size: calc(16px * var(--zoom-font-scale));
    padding: calc(12px * var(--zoom-font-scale)) calc(16px * var(--zoom-font-scale));
}

/* Table and data display scaling */
.zoom-80 .kpi-table,
.zoom-80 .data-table,
.zoom-90 .kpi-table,
.zoom-90 .data-table,
.zoom-100 .kpi-table,
.zoom-100 .data-table,
.zoom-110 .kpi-table,
.zoom-110 .data-table,
.zoom-120 .kpi-table,
.zoom-120 .data-table {
    font-size: calc(14px * var(--zoom-font-scale));
}

.zoom-80 .kpi-table td,
.zoom-80 .kpi-table th,
.zoom-80 .data-table td,
.zoom-80 .data-table th,
.zoom-90 .kpi-table td,
.zoom-90 .kpi-table th,
.zoom-90 .data-table td,
.zoom-90 .data-table th,
.zoom-100 .kpi-table td,
.zoom-100 .kpi-table th,
.zoom-100 .data-table td,
.zoom-100 .data-table th,
.zoom-110 .kpi-table td,
.zoom-110 .kpi-table th,
.zoom-110 .data-table td,
.zoom-110 .data-table th,
.zoom-120 .kpi-table td,
.zoom-120 .kpi-table th,
.zoom-120 .data-table td,
.zoom-120 .data-table th {
    padding: calc(12px * var(--zoom-font-scale)) calc(16px * var(--zoom-font-scale));
}

/* Modal content scaling adjustments */
.zoom-100 .modal-content {
    max-width: calc(600px * var(--zoom-card-scale));
}

.zoom-80 .modal-content {
    max-width: calc(650px * var(--zoom-card-scale));
}

/* Dashboard card scaling */
.zoom-80 .stat-card,
.zoom-90 .stat-card,
.zoom-100 .stat-card,
.zoom-110 .stat-card,
.zoom-120 .stat-card {
    padding: calc(16px * var(--zoom-card-scale));
}

.zoom-80 .stat-card h3,
.zoom-90 .stat-card h3,
.zoom-100 .stat-card h3,
.zoom-110 .stat-card h3,
.zoom-120 .stat-card h3 {
    font-size: calc(18px * var(--zoom-font-scale));
}

.zoom-80 .stat-card .metric,
.zoom-90 .stat-card .metric,
.zoom-100 .stat-card .metric,
.zoom-110 .stat-card .metric,
.zoom-120 .stat-card .metric {
    font-size: calc(24px * var(--zoom-font-scale));
}

/* Responsive zoom adjustment for larger screens */
@media screen and (min-width: 1024px) {

    /* Increase base font size on larger screens for readability */
    html {
        font-size: 16px;
        /* larger base font */
    }

    /* Avoid layout-squashing zoom transforms — prefer larger font sizes */
    body {
        zoom: 1;
    }
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Prevent page scrolling */
}

/* Ensure compatibility with zoom adjustments */
html {
    box-sizing: border-box;
}

/* Two-by-two grid for compact sections like Development & Improvement Plan */
.two-by-two-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.two-by-two-grid .form-group {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .two-by-two-grid {
        grid-template-columns: 1fr;
    }
}

/* Mid-year modal styling */
#midYearModal .midyear-modal-shell {
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
}

.midyear-modal-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.35);
    padding: 18px;
    border: 1px solid rgba(99, 102, 241, 0.06);
}

.midyear-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.midyear-modal-header .icon-btn {
    background: transparent;
    border: 0;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.midyear-modal-body {
    padding-top: 6px;
}

.midyear-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.midyear-label {
    width: 140px;
    font-weight: 700;
    color: #374151;
    font-size: 14px;
}

.midyear-number-input {
    padding: 8px;
    border: 1px solid #e6eef8;
    border-radius: 8px;
    width: 120px;
    font-weight: 700;
}

.midyear-textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eef8;
    min-height: 110px;
}

.midyear-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.midyear-progress-wrap {
    background: #eef2ff;
    border-radius: 999px;
    height: 12px;
    width: 260px;
    overflow: hidden;
}

.midyear-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #10b981);
    transition: width 300ms ease;
}

@media (max-width: 760px) {
    .midyear-row {
        flex-direction: column;
    }

    .midyear-label {
        width: 100%;
    }
}

body {
    font-family: 'Georgia', serif;
    background: white;
    min-height: 100vh;
    color: var(--text-primary);
    font-size: 16px;
    /* explicit body font-size for consistent scaling */
    line-height: 1.6;
    /* improve readability */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.login-page {
    background: white;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

body.register-page,
body.employee-register {
    background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%), url('https://images.unsplash.com/photo-1552664730-d307ca884978?w=1200&h=1200&fit=crop');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

.background-carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background: transparent;
}

.background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background: transparent;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.carousel-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
}

.carousel-slide.active {
    opacity: 1;
}

/* Typography tweaks */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Georgia', 'Georgia', 'Georgia', sans-serif;
    color: var(--text-primary);
    line-height: 1.15;
}

/* Slightly larger headings for emphasis */
h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.95rem;
}

/* Use Georgia for tables for consistent styling */
table,
.kpi-table,
.data-table,
.kpi-table th,
.kpi-table td {
    font-family: 'Georgia', serif;
    font-size: 15px;
    /* increase table font-size for readability */
}

/* Override: keep table column headers in sentence case (don't force uppercase) */
table th,
.kpi-table th,
.data-table th,
.staff-table th,
.staff-records-table th,
.consolidated-table th,
.approval-table th {
    text-transform: none !important;
}

/* Ensure badges/labels remain as designed but avoid forced uppercase on header text */
.kpi-table .achieved-badge,
.kpi-table .achieved-badge * {
    text-transform: none;
}

/* Beautify the KPI header area and Period Under Review */
.kpi-header-section {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.kpi-header-section .staff-info-inline {
    flex: 1 1 220px;
}

/* Larger, more prominent staff header */
.kpi-header-section .staff-info-inline h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.kpi-header-section .staff-info-inline p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    opacity: 0.95;
}

.kpi-header-section .form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.kpi-header-section .form-group {
    background: linear-gradient(180deg, #ffffff, #fbfcfd);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}

.kpi-header-section .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    text-transform: none;
}

#period {
    font-family: 'Georgia', serif;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    min-width: 220px;
    background: #fff;
    transition: all 0.18s ease;
}

#period::placeholder {
    color: #9ca3af;
    font-style: italic;
}

#period:focus {
    outline: none;
    border-color: #a1a1aa;
    box-shadow: 0 10px 30px rgba(99, 102, 106, 0.06);
    background: #fff;
}

/* 2x2 grid for KPI header fields */
.bsc-fields-grid {
    display: grid;
    /* Allow three columns so Review Start/End and Review Date fit without overlap */
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 20px;
    /* slightly larger gap to avoid cramped inputs */
    align-items: start;
    /* align items to the top so taller groups don't vertically center */
    width: 100%;
    max-width: 720px;
}

/* Ensure any inline range controls stack nicely and leave breathing room */
.bsc-fields-grid .form-group>div[style*="display:flex"] {
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
    /* separate inline month inputs from the read-only display */
}

.kpi-fields-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 820px) {
    .kpi-fields-grid {
        grid-template-columns: 1fr;
    }

    .kpi-header-section {
        gap: 10px;
    }

    .staff-info-inline {
        order: -1;
    }

    .kpi-header-section .staff-info-inline h2 {
        font-size: 18px;
    }

    .kpi-header-section .staff-info-inline p {
        font-size: 13px;
    }
}

/* KPI table inputs should use Georgia for consistency with the UI */
.kpi-table input,
.kpi-table textarea,
.kpi-table select {
    font-family: 'Georgia', serif;
    font-size: 15px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    box-sizing: border-box;
    /* inherit cell text alignment so header alignment applies to inputs */
    text-align: inherit;
}

.kpi-table td input,
.kpi-table td textarea {
    width: 100%;
}

.kpi-table input:focus,
.kpi-table textarea:focus,
.kpi-table select:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 8px 20px rgba(99, 102, 106, 0.06);
}

/* Status badges for staff KPI status */
.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    min-width: 78px;
    text-align: center;
}

.status-approved {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.status-pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-rejected {
    background: #fff1f2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-submitted {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.status-reviewing {
    background: #fed7aa;
    color: #7c2d12;
    border: 1px solid #fdba74;
}

.status-reviewed {
    background: #fed7aa;
    color: #7c2d12;
    border: 1px solid #fdba74;
}

.status-hod_approved {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.status-hod_reviewing {
    background: #fed7aa;
    color: #7c2d12;
    border: 1px solid #fdba74;
}

/* Column filter button improved look */
.column-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #e6e9ee;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.column-filter-btn:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* Small status chip inside dropdown */
.status-chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    margin: 4px;
    cursor: pointer;
    font-weight: 700;
}

.status-chip.approved {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.status-chip.pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-chip.rejected {
    background: #fff1f2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

/* Prevent KPI sections from flashing while JS initializes */
.kpi-init-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 180ms ease, transform 200ms ease;
}

.kpi-ready {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Read-only KPI card styling (colorful) */
.kpi-readonly-card {
    background: linear-gradient(180deg, #ffffff, #fbfcff);
    border: 1px solid #e6eef8;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.04);
}

.kpi-readonly-header h4 {
    margin: 0 0 8px 0;
    color: #0f172a;
    /* strong dark */
    font-size: 18px;
}

.kpi-readonly-banner {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f97316, #fb923c);
    color: #fff;
    font-weight: 700;
    margin-bottom: 10px;
}

.kpi-readonly-meta {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 12px;
}

.kpi-readonly-grid {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.kpi-readonly-item {
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #eef2ff;
}

.kpi-readonly-item .label {
    color: #475569;
    font-weight: 700;
    font-size: 13px;
}

.kpi-readonly-item .value {
    color: #0b5cff;
    font-weight: 800;
    margin-top: 6px;
}

/* Wide multi-select used for quarter comparison - avoid shrinking and look good */
.wide-multi-select {
    min-width: 420px;
    max-width: 100%;
    width: 520px;
    box-sizing: border-box;
    font-family: 'Georgia', serif;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
}

/* On small screens let the select expand to available width */
@media (max-width: 820px) {
    .wide-multi-select {
        width: 100%;
        min-width: auto;
    }
}

/* Prevent wrapping in Name and Position columns and inputs inside them */
.kpi-table td.name-col,
.kpi-table td.position-col {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    /* avoid extreme growth */
}

.kpi-table td.name-col input,
.kpi-table td.position-col input,
.kpi-table td.name-col textarea,
.kpi-table td.position-col textarea {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Searchable multi-select control used for quarter selection */
.search-multi-select {
    position: relative;
    display: inline-block;
    font-family: 'Georgia', serif;
}

.search-multi-select .ms-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e6e9ee;
    background: #fff;
    cursor: pointer;
    min-height: 40px;
}

.search-multi-select .ms-control:focus {
    outline: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.search-multi-select .ms-badge {
    background: #f1f5f9;
    color: #334155;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
}

.search-multi-select .ms-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e6e9ee;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    z-index: 60;
    display: none;
    max-height: 320px;
    overflow: auto;
}

.search-multi-select .ms-panel[aria-hidden="false"] {
    display: block;
}

.search-multi-select .ms-panel-search {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.search-multi-select .ms-panel-search input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #eef2f6;
}

.search-multi-select .ms-panel-list {
    padding: 6px;
    display: block;
}

.search-multi-select .ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
}

.search-multi-select .ms-option input {
    margin: 0;
}

.search-multi-select .ms-option:hover {
    background: #fbfbfd;
}

.search-multi-select .ms-option label {
    cursor: pointer;
}

.search-multi-select .ms-empty {
    padding: 12px;
    color: #64748b;
}

/* small responsive tweaks */
@media (max-width: 640px) {
    .search-multi-select .ms-panel {
        max-height: 220px;
    }
}

/* Subtle header styling to match the grey palette */
.dashboard-header h1 {
    color: var(--text-primary);
}

/* Enhanced employee dashboard header card (red & white) */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: 12px;
    background: #ffffff;
    /* white base */
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.04);
    margin-bottom: 18px;
    border-left: 8px solid #ef4444;
    /* red accent */
}

.dashboard-header .header-left h1 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    color: #7f1d1d;
    /* dark red */
}

.dashboard-header .header-left p {
    margin: 0;
    color: #9a1b1b;
    /* muted red tone */
    font-weight: 600;
}

.dashboard-header .user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    /* keep avatar white for contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #ef4444;
    /* red initials */
    font-size: 14px;
    border: 2px solid #ef4444;
    /* red border */
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.08);
}

.user-info .user-name {
    font-size: 16px;
    font-weight: 800;
    color: #7f1d1d;
    /* dark red */
}

.user-info .user-role {
    font-size: 12px;
    color: #ef4444;
    /* red */
    text-transform: capitalize;
}

@media (max-width: 760px) {
    .dashboard-header {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* Make primary buttons slightly more neutral with the grey tone */
.btn-primary {
    background: linear-gradient(180deg, var(--primary-color) 0%, #4b5563 100%);
}

/* Login button specific styling */
#loginBtn {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#loginBtn:hover {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Compact variant for registration page only (does not affect login page) */
.login-page.register-page .login-card {
    padding: 40px 40px 25px 40px;
    max-width: 520px;
}

.login-page.register-page .login-card .login-header h1 {
    font-size: 18px;
    margin-bottom: 4px;
}

.login-page.register-page .login-card .login-header p {
    margin-bottom: 6px;
    font-size: 12px;
}

.login-page.register-page .login-card .login-form .form-group {
    margin-bottom: 8px;
    /* tighter spacing between fields */
}

.login-page.register-page .login-card .form-actions {
    margin-top: 10px;
}

.login-page.register-page .login-form .form-group input,
.login-page.register-page .login-form .form-group select {
    padding: 8px 10px;
    font-size: 14px;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 40px 40px 25px 40px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.03);
    width: 100%;
    max-width: 520px;
    animation: slideUp 0.45s cubic-bezier(.2, .9, .3, 1);
}

/* Make the login card more compact only on the employee registration page */
.employee-register .login-card {
    padding: 40px 40px 25px 40px;
    max-width: 520px;
}

.employee-register .login-form .form-group {
    margin-bottom: 8px;
}

.employee-register .login-form .form-group input {
    padding: 8px 10px;
    font-size: 14px;
}

/* Further compact header and form elements only for employee register page */
.employee-register .login-header {
    margin-bottom: 12px;
}

.employee-register .login-logo {
    max-width: 100px;
    margin-bottom: 8px;
}

.employee-register .login-header h1 {
    font-size: 18px;
    margin-bottom: 6px;
}

.employee-register .login-header p {
    font-size: 12px;
    margin-bottom: 0;
}

.employee-register .login-form .form-group {
    margin-bottom: 10px;
}

.employee-register .login-form input[type="text"],
.employee-register .login-form input[type="password"],
.employee-register .login-form input[type="email"] {
    padding: 8px 10px;
}

.employee-register .form-actions .btn {
    padding: 8px 12px;
    font-size: 14px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 15px;
    opacity: 0.95;
}

.login-background-logo {
    width: 500px;
    height: auto;
    margin-bottom: 15px;
    opacity: 0.95;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 400;
    opacity: 0.8;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 44px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 8px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Modal Form Styles */
.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.modal-content .form-group input::placeholder,
.modal-content .form-group textarea::placeholder {
    color: #94a3b8;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #f8fafc;
}

.modal-content .form-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-content .form-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

/* Custom multi-select (checkbox dropdown) */
.multi-select {
    position: relative;
    width: 100%;
}

.multi-select-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(2, 6, 23, 0.04);
}

.multi-select-toggle:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.multi-select-toggle:active {
    transform: translateY(0);
}

.multi-select-toggle .placeholder {
    color: #64748b;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 120px);
    font-size: 15px;
}

.multi-select-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.multi-select-toggle::after {
    content: '▼';
    font-size: 10px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 60;
    padding: 0;
    display: none;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.multi-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.multi-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.multi-select-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.multi-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.multi-select-dropdown.show {
    display: block;
}

/* Search box in dropdown */
.multi-select-search {
    position: sticky;
    top: 0;
    background: white;
    padding: 12px;
    border-bottom: 2px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
    z-index: 61;
}

.multi-select-search input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.multi-select-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.multi-select-search input::placeholder {
    color: #94a3b8;
}

/* Container for items with scrolling */
.multi-select-items-container {
    padding: 12px;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.multi-select-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
    font-size: 14px;
}

.multi-select-item:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.multi-select-item:hover span {
    color: var(--primary-color);
}

.multi-select-item input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.multi-select-help {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding: 0 12px;
}

/* Empty state message in dropdown */
.multi-select-empty {
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 12px;
}

.form-actions {
    margin-top: 25px;
}

.btn {
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.22s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);

    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.btn-secondary:hover {
    background: #eef2ff;
}

/* KPI Process Tab Navigation Hover Effects */
.kpi-process-tab {
    position: relative;
}

.kpi-process-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.kpi-process-tab:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: inherit;
    border-radius: 2px;
    opacity: 0.3;
}

/* Specific hover effects for each KPI tab */
#kpi-setting-tab:hover {
    background: #eff6ff;
    color: #0284c7;
    border-bottom-color: #0284c7;
}

#kpi-review-tab:hover {
    background: #ecfdf5;
    color: #059669;
    border-bottom-color: #059669;
}

#kpi-approval-tab:hover {
    background: #fef3c7;
    color: #d97706;
    border-bottom-color: #d97706;
}

#kpi-appraisal-tab:hover {
    background: #faf5ff;
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

/* Line Manager KPI Process Tab Hover Effects */
.lm-kpi-process-tab {
    position: relative;
}

.lm-kpi-process-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

#lm-kpi-setting-tab:hover {
    background: #eff6ff;
    color: #0284c7;
    border-bottom-color: #0284c7;
}

#lm-kpi-review-tab:hover {
    background: #ecfdf5;
    color: #059669;
    border-bottom-color: #059669;
}

#lm-kpi-approval-tab:hover {
    background: #fef3c7;
    color: #d97706;
    border-bottom-color: #d97706;
}

#lm-kpi-appraisal-tab:hover {
    background: #faf5ff;
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

.form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-footer p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.form-footer p:first-child,
.form-footer p:nth-child(2) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.form-footer p:first-child::before {
    content: '✨';
    font-size: 14px;
}

.form-footer p:nth-child(2)::before {
    content: '👤';
    font-size: 14px;
}

.form-footer p:nth-child(3)::before {
    content: '🔑';
    font-size: 14px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.form-footer a:hover {
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.error-message {
    color: var(--danger-color);
    background: #fee2e2;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    color: var(--success-color);
    background: #d1fae5;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    height: 100vh;
    background: #f0f4f8;
}

.sidebar {
    width: 60px;
    /* Start narrow */
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    /* Use top/bottom anchors instead of fixed vh heights to avoid
       layout mismatches when the page is zoomed or transformed. */
    position: fixed;
    top: 0;
    bottom: 0;
    height: auto;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 900;
    /* keep sidebar below modal overlay */
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

/* Expand sidebar on hover */
.sidebar:hover {
    width: 280px;
}

/* Auto-hide sidebar - slide out by default */
.sidebar.hidden {
    transform: translateX(-100%);
}

/* Sidebar stays hidden until explicitly shown via JavaScript */

.main-content {
    flex: 1;
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    background: #f0f4f8;
    margin-left: 60px;
    /* Account for narrow sidebar width */
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expand content when sidebar is hovered */
.sidebar:hover~.main-content {
    margin-left: 280px;
}

/* Full width when sidebar is hidden */
.main-content.sidebar-hidden {
    margin-left: 0;
}


.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-header h2 {
    font-size: 18px;
    margin: 0;
    color: white;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex: 1;
}

/* Compact year selector layout inside sidebar header */
.sidebar-header {
    padding: 12px;
    /* reduce vertical padding so header stays compact when selector is present */
    position: relative;
    /* allow absolute / flex placement of children if needed */
}

.sidebar-header .year-wrap {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 110px;
}

.sidebar-header h2,
.sidebar-header .year-wrap {
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
    /* Delay appearance */
}

/* Show header content when sidebar is hovered */
.sidebar:hover .sidebar-header h2,
.sidebar:hover .sidebar-header .year-wrap {
    opacity: 1;
    visibility: visible;
}

.sidebar-header .year-wrap select {
    width: 110px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #f1f5f9;
    color: #111827;
    font-size: 13px;
    cursor: pointer;
}

@media (max-width: 760px) {
    .sidebar-header {
        padding: 10px;
    }

    .sidebar-header .year-wrap {
        min-width: 90px;
    }

    .sidebar-header .year-wrap select {
        width: 90px;
        padding: 6px 6px;
    }
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 12px;
    list-style: none;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    cursor: pointer;
    justify-content: center;
    /* Center icons when narrow */
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #e0e7ff;
    border-left-color: #3b82f6;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #60a5fa;
    border-left-color: #3b82f6;
    font-weight: 600;
    box-shadow: inset 0 2px 8px rgba(59, 130, 246, 0.1);
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 15px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 15px;
    border-left: 3px solid transparent;
    justify-content: center;
    /* Center icons when narrow */
}

/* Hide text in sidebar menu items (both sidebar-menu and sidebar-nav) */
.sidebar-menu a span,
.sidebar-nav .nav-item span,
.sidebar-submenu a span,
.sidebar-footer .nav-item span {
    display: none;
    /* Hide text by default in narrow mode */
    white-space: nowrap;
    /* Prevent text wrapping */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
    /* Delay text appearance after width transition */
}

/* Show text when sidebar is hovered - left align menu items */
.sidebar:hover .sidebar-menu a,
.sidebar:hover .sidebar-nav .nav-item {
    justify-content: flex-start;
    /* Left align when expanded */
    padding-left: 20px;
    /* Restore left padding */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar:hover .sidebar-menu a span,
.sidebar:hover .sidebar-nav .nav-item span,
.sidebar:hover .sidebar-submenu a span,
.sidebar:hover .sidebar-footer .nav-item span {
    display: inline;
}

.sidebar-menu i {
    font-size: 16px;
    /* Larger icons for narrow sidebar */
    transition: all 0.3s ease;
}

.sidebar-menu .kpi-menu-toggle i {
    transition: transform 0.3s ease;
}

.sidebar-menu .kpi-menu-toggle.expanded i {
    transform: rotate(90deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-submenu li {
    margin: 0;
}

.sidebar-submenu a {
    display: block;
    padding: 10px 20px 10px 40px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #667eea;
    color: #fff;
}

.sidebar-menu a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #e0e7ff;
    border-left-color: #3b82f6;
    padding-left: 23px;
}

/* Mail sidebar folder + submenu styles */
.sidebar-mail-folder {
    padding: 0 12px;
}

.sidebar-mail-folder .mail-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px;
    color: #cbd5e1;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-mail-folder .mail-parent:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border-radius: 6px;
}

.sidebar-mail-folder #mailToggleIcon {
    font-size: 12px;
    opacity: 0.9;
    transition: transform 0.18s ease;
    padding-left: 8px;
}

.sidebar-mail-folder #mailToggleIcon.collapsed {
    transform: rotate(-90deg);
}

.mail-submenu {
    margin-top: 6px;
}

.mail-submenu .mail-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 35px;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.18s ease, transform 0.12s ease;
    font-size: 14px;
}

.mail-submenu .mail-sub-link i {
    font-size: 14px;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.mail-submenu .mail-sub-link span:nth-child(2) {
    flex: 1;
}

.mail-submenu .mail-sub-link .mail-unread {
    margin-left: auto;
    flex-shrink: 0;
}

.mail-submenu .mail-sub-link:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

/* Badge styles (pill) */
.mail-unread {
    display: none;
}

.mail-unread.muted {
    background: #64748b;
}

/* Show badge only when it has content (robust against whitespace) */
.mail-unread:not(:empty) {
    display: inline-block;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    line-height: 28px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: white !important;
    background: var(--danger-color);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

/* Keep explicit rule to hide truly empty badges */
.mail-unread:empty {
    display: none !important;
}

/* Ensure submenu spacing fits sidebar layout */
.sidebar-menu .sidebar-mail-folder {
    margin: 6px 0 10px 0;
}

.sidebar-menu li.active a {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-left-color: #3b82f6;
    padding-left: 23px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-footer #userInfo {
    font-size: 12px;
    /* Smaller text in narrow mode */
    color: #cbd5e1;
    text-align: center;
    margin: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    /* Delay appearance */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
}

/* Larger text when sidebar is hovered */
.sidebar:hover .sidebar-footer #userInfo {
    font-size: 14px;
    opacity: 1;
    visibility: visible;
}

.sidebar-footer .nav-item {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left-color: transparent;
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    padding: 12px 16px;
}

.sidebar-footer .nav-item:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    border-left-color: transparent;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

/* Hamburger Menu Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 950;
    width: 44px;
    height: 44px;
    padding: 8px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #1e293b;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle-btn:hover {
    background: #f0f4f8;
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Show hamburger button when sidebar is hidden */
.sidebar.hidden~.main-content .sidebar-toggle-btn {
    display: flex;
}

.main-content {
    flex: 1;
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    background: #f0f4f8;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 0;
    padding: 0;
    position: sticky;
    top: 0;
    background: #f0f4f8;
    z-index: 5;
    border-bottom: 1px solid #cbd5e1;
}

.dashboard-header h1 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-card.stat-primary {
    border-left-color: #2563eb;
}

.stat-card.stat-success {
    border-left-color: #10b981;
}

.stat-card.stat-warning {
    border-left-color: #f59e0b;
}

.stat-card.stat-info {
    border-left-color: #06b6d4;
}

.stat-card h3 {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* View sections layout */
.view-section {
    padding: 0;
    display: flex;
    flex-direction: column;
}

#reportConsolidatedView {
    height: calc(100vh - 140px);
    overflow: visible;
    /* allow children to show scrollbars (table will handle scrolling) */
}

.content-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
    display: contents;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.content-card:not(:has(.kpi-form)):not(#myProfileView .content-card) {
    max-height: 70vh;
}

/* Keep change password forms compact and centered (override display: contents) */
#changePasswordView .content-card {
    display: block !important;
    /* ensure the wrapper participates in layout */
    max-width: 640px !important;
    margin: 36px auto !important;
    padding: 20px !important;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08) !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, #ffffff, #fbfdff) !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 9999 !important;
    margin-top: 84px !important;
    /* avoid header overlap */
}

/* Make form fields visible and clearly spaced inside the change password card */
#changePasswordView .content-card input[type="password"],
#changePasswordView .content-card input[type="text"] {
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
}

#changePasswordView .content-card .btn {
    padding: 8px 12px !important;
}

/* Optimize report view to use full available height */
#reportConsolidatedView .content-card {
    max-height: none;
    height: auto;
    /* use contents to let the table's scroll container control layout (matches Qtr by Qtr change) */
    display: contents;
    flex-direction: initial;
    padding: 12px;
    margin-top: 8px;
}

.content-card h2 {
    margin: 0 0 18px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

/* Profile form specific styling */
#myProfileView .content-card {
    max-width: 100%;
    overflow: visible;
}

/* Make KPI tab navigation sticky when scrolling in employee portal */
.content-card>div[style*="display: flex"] {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
}

#lmProfileForm {
    width: 100%;
    box-sizing: border-box;
}

/* Beautify My Profile page in LM portal */
#myProfileView .content-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

#myProfileView .content-card>div:first-child {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 24px;
    margin: -24px -24px 24px -24px;
    border-radius: 12px 12px 0 0;
}

#myProfileView .content-card>div:first-child h2 {
    color: white !important;
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}

#myProfileView .content-card>div:first-child p {
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 4px 0 0 0;
    font-size: 14px;
}

#myProfileView .content-card>div:first-child i {
    color: white;
}

/* Profile sections */
#lmProfileForm>div {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

#lmProfileForm>div h3 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#lmProfileForm>div:nth-child(2) h3:before {
    content: '\f2bd';
    /* user icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #3b82f6;
}

#lmProfileForm>div:nth-child(3) h3:before {
    content: '\f0e0';
    /* envelope icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #10b981;
}

#lmProfileForm>div:nth-child(4) h3:before {
    content: '\f0b1';
    /* briefcase icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #f59e0b;
}

/* Form groups in profile */
#myProfileView .form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}

#myProfileView .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
    background: white;
}

#myProfileView .form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

#myProfileView .form-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Action buttons */
#myProfileView .content-card>form>div:last-child {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

#lmProfileSaveBtn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
    padding: 10px 16px !important;
    /* reduced vertical padding */
    font-weight: 600;
    font-size: 15px;
}

#lmProfileSaveBtn:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-2px);
}

/* Message area */
#lmProfileMsg {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

#lmProfileMsg[style*="background: #d1fae5"] {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0;
}

#lmProfileMsg[style*="background: #fee2e2"] {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca;
}

/* Increase readability for My KPI Records cards */
#overviewView #kpisList .content-card {
    padding: 18px;
}

#overviewView #kpisList .content-card h4 {
    font-size: 16px;
    /* period/title */
    margin-bottom: 4px;
}

#overviewView #kpisList .content-card p {
    font-size: 13px;
    color: #475569;
}

#overviewView #kpisList .content-card label {
    font-size: 11px;
    color: #64748b;
}

#overviewView #kpisList .content-card .status-badge,
#overviewView #kpisList .content-card span {
    font-size: 12px;
    padding: 5px 10px;
}

#overviewView #kpisList .content-card p strong,
#overviewView #kpisList .content-card p b {
    font-size: 14px;
}

.staff-table-wrapper {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.staff-grid {
    display: table;
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-family: 'Georgia', 'Georgia', 'Georgia', sans-serif;
}

.staff-table thead {
    background: #f0f4f8;
}

.staff-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 2px solid #cbd5e1;
    letter-spacing: 0.3px;
}

.staff-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.staff-table tbody tr:hover {
    background: #f8fafc;
}

.staff-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
    font-family: 'Georgia', 'Georgia', 'Georgia', sans-serif;
}

/* Wider first column for staff-records tables (Name column) */
.staff-records-table th:first-child,
.staff-records-table td:first-child {
    width: 240px;
    min-width: 100px;
}

@media (max-width: 820px) {

    .staff-records-table th:first-child,
    .staff-records-table td:first-child {
        width: auto;
        min-width: 0;
    }
}

/* Widen Full Name column in data-table line managers list */
.data-table .kpi-table th:first-child,
.data-table .kpi-table td:first-child {
    width: 300px;
    min-width: 220px;
}

@media (max-width: 820px) {

    .data-table .kpi-table th:first-child,
    .data-table .kpi-table td:first-child {
        width: auto;
        min-width: 0;
    }
}

.staff-table td strong {
    font-weight: 600;
}

.staff-table .btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: auto;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    /* ensure modal overlay sits above the sidebar and other UI */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

/* When shown (via JS setting display:flex), center the modal content */
.modal {
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 40px auto;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 850px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 100000;
    /* place content above the overlay/backdrop */
}

/* Prevent modal content from overflowing the viewport when many fields are present */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Fullscreen modal variant for KPI table */
.modal-content.fullscreen-modal {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

/* Force BSC Review Modal to cover the entire viewport */
#bscReviewModal.modal {
    /* prevent centering so content fills top-to-bottom */
    align-items: stretch !important;
    justify-content: flex-start !important;
}

#bscReviewModal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow-y: auto !important;
    box-shadow: none !important;
}

/* Ensure modal header/footer remain visible and usable */
#bscReviewModal .modal-header,
#bscReviewModal .modal-footer {
    flex: 0 0 auto;
}

#bscReviewModal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* Also make the BSC View Modal full-screen (used on All Balanced Scorecard Records page) */
#bscModal.modal {
    align-items: stretch !important;
    justify-content: flex-start !important;
}

#bscModal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow-y: auto !important;
    box-shadow: none !important;
}

#bscModal .bsc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100001;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
}

/* Chat Modal full-screen styles */
#chatModal.modal {
    align-items: center !important;
    justify-content: center !important;
    background-color: transparent !important;
    display: flex !important;
}

#chatModal .modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99998 !important;
    pointer-events: none !important;
}

#chatModal .modal-content {
    width: 90vw !important;
    max-width: 800px !important;
    height: 85vh !important;
    max-height: 600px !important;
    margin: auto !important;
    padding: 0 !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    z-index: 100000 !important;
}

#bscModal h2#modalBSCStaffName {
    margin: 20px 24px 0 24px;
}

#bscModal #modalBSCContent {
    padding: 16px 24px 40px 24px;
    overflow-y: auto;
    width: 100%;
}

/* Muted / subtle color palette for BSC modals (override flashy inline styles) */
#bscReviewModal .modal-header,
#bscModal .modal-content .modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%) !important;
    color: #1f2937 !important;
}

#bscReviewModal .modal-header i,
#bscModal .modal-content .modal-header i {
    color: #6b7280 !important;
    /* muted icon color */
}

#bscReviewModal .modal-body p,
#bscModal .modal-content .modal-body p {
    color: #475569 !important;
    /* muted description */
}

/* Important notice box - subtle */
#bscReviewModal .modal-body>div[style*="background"],
#bscModal .modal-content .important-notice {
    background: #f1f5f9 !important;
    border-left: 4px solid #cbd5e1 !important;
    color: #334155 !important;
}

/* Confirm button - softer blue */
#bscReviewModal #bscReviewConfirmBtn,
#bscModal .confirm-bsc-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18) !important;
}

/* Cancel button - neutral */
#bscReviewModal .btn-secondary,
#bscModal .btn-secondary {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #e6eef7 !important;
}

/* Close button subdued */
#bscReviewModal .modal-close,
#bscModal .bsc-modal-close {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #334155 !important;
}

/* Ensure textarea focus color is subtle */
#bscReviewModal textarea:focus,
#bscModal textarea:focus {
    border-color: #94a3b8 !important;
    box-shadow: none !important;
}

/* Ensure modal content fills the viewport height exactly and reaches the bottom */
#bscModal.modal,
#bscReviewModal.modal {
    padding: 0 !important;
}

#bscModal .modal-content,
#bscReviewModal .modal-content {
    box-sizing: border-box !important;
    min-height: 100vh !important;
    height: 100vh !important;
}

/* Use fixed positioning to avoid any parent offsets interfering */
#bscModal .modal-content,
#bscReviewModal .modal-content {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* BSC Review Modal - Full Screen */
#bscReviewModal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin: 0 0 30px 0;
    font-size: 26px;
    color: var(--text-primary);
    font-weight: 700;
}

/* Compact modal variant for denser forms (used on Add Staff modal) */
.modal-content.compact-modal {
    padding: 16px;
    max-width: 760px;
}

.modal-content.compact-modal h2 {
    font-size: 20px;
    margin-bottom: 18px;
}

.modal-content.compact-modal .form-group {
    margin-bottom: 12px;
}

.modal-content.compact-modal .form-group input,
.modal-content.compact-modal .form-group select,
.modal-content.compact-modal .form-group textarea {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.modal-content.compact-modal .form-actions {
    margin-top: 14px;
}

.modal-content.compact-modal .form-actions button {
    padding: 10px 18px;
    font-size: 13px;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-primary);
}

/* BSC Modal Close Button */
.bsc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 36px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bsc-modal-close:hover {
    color: var(--text-primary);
}

.modal-content.qtr-modal {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.22);
    border: 1px solid rgba(14, 165, 233, 0.06);
}

.modal.qtr-modal-backdrop {
    backdrop-filter: blur(4px) brightness(0.9);
}

.modal-content.qtr-modal .modal-header h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 4px;
}

.modal-content.qtr-modal .modal-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.modal-content.qtr-modal .ms-panel-search input[type="search"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e6eef8;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.04) inset;
    font-size: 14px;
}

.modal-content.qtr-modal .ms-panel-list {
    margin-top: 10px;
    max-height: 300px;
    overflow: auto;
    padding-right: 6px;
}

.modal-content.qtr-modal .ms-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.12s ease;
}

.modal-content.qtr-modal .ms-option:hover {
    background: #f8fbff;
}

.modal-content.qtr-modal .ms-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.modal-content.qtr-modal .ms-panel-list .ms-empty {
    color: var(--text-secondary);
    padding: 12px;
}

.modal-content.qtr-modal .ms-panel-list::-webkit-scrollbar {
    width: 10px;
}

.modal-content.qtr-modal .ms-panel-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 106, 0.12);
    border-radius: 8px;
}

.modal-content.qtr-modal .ms-panel-list label {
    font-size: 14px;
    color: var(--text-primary);
}

.modal-content.qtr-modal .ms-panel-search {
    margin-bottom: 8px;
}

.modal-content.qtr-modal .btn {
    border-radius: 8px;
}

.modal-content.qtr-modal .btn-primary {
    padding: 10px 16px;
}

.modal-content.qtr-modal+button.bsc-modal-close,
.modal-content.qtr-modal .bsc-modal-close {
    right: 12px;
    top: 12px;
    font-size: 28px;
    color: var(--text-secondary);
}

.modal-content.qtr-modal .bsc-modal-close:hover {
    color: var(--text-primary);
}

/* KPI Department Modal enhancements */
.modal-content.kpi-modal {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.2);
    border: 1px solid rgba(14, 165, 233, 0.06);
}

.kpi-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.kpi-dept-item {
    background: #fff;
    border: 1px solid #e6eef8;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.kpi-dept-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.12);
    border-color: #3b82f6;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.kpi-dept-item .dept-name {
    font-weight: 600;
    color: var(--text-primary);
}

.kpi-dept-item .dept-count {
    background: #3b82f6;
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}

.kpi-dept-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 18px;
}

/* Scoped tweaks for the Edit Profile modal so action buttons sit visually on the card */
#editProfileModal .modal-content {
    /* reduce bottom padding so buttons appear closer to the card edge */
    padding-bottom: 12px;
}

#editProfileModal .modal-content .form-actions {
    margin-top: 6px !important;
    /* move actions up slightly */
    justify-content: flex-end;
    /* keep actions to the right like other modals */
    gap: 12px;
}

#editProfileModal .modal-content .form-actions .btn {
    padding: 10px 16px;
}

/* Prevent primary button from expanding full width inside modal action rows */
#editProfileModal .modal-content .form-actions .btn-primary {
    width: auto !important;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

#editProfileModal .modal-content .form-actions .btn-secondary {
    min-width: 100px;
}

/* Registration success modal styling */
#regSuccessModal .modal-content {
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
    border: 1px solid rgba(16, 185, 129, 0.12);
    box-shadow: 0 10px 30px rgba(4, 120, 87, 0.08);
}

#regSuccessModal .modal-content h3 {
    font-size: 18px;
    font-weight: 700;
}

#regSuccessModal .modal-content p {
    font-size: 14px;
    color: #065f46;
}

/* Admin KPI modal: extend downward and make content area scrollable */
#kpiModal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 96vw;
    max-width: 1200px;
    /* allow modal to grow to fit table content instead of forcing an inner scroll */
    height: auto;
    max-height: 80vh;
    padding: 8px 0 16px 0;
    overflow: auto;
}

#kpiModal .modal-content .close {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 26px;
}

#kpiModal #modalKPIContent {
    flex: 1 1 auto;
    /* show full content rather than a scroller so the modal expands */
    overflow: visible;
    padding: 12px 24px;
}

/* Make tables inside KPI modal easier to scan */
#kpiModal .kpi-table,
#kpiModal table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#kpiModal .kpi-table th,
#kpiModal .kpi-table td,
#kpiModal table th,
#kpiModal table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
}

/* Allow horizontal scroll for very wide tables */
/* Ensure responsive tables inside KPI modal get a bounded height and scroll when needed */
#kpiModal .table-responsive {
    /* Do not constrain the table with an inner max-height; permit the modal
       to expand so the entire table is visible. If the table is extremely
       large it will make the page scroll, showing all rows as requested. */
    overflow: visible;
    max-height: none;
}

/* KPI Form Styles */

/* Larger typography for KPI Detail Modal */
#kpiDetailModal .modal-content {
    /* ensure modal can be wide enough for table */
    max-width: 1200px;
    padding: 28px 28px;
}

#kpiDetailModal .modal-content h2 {
    font-size: 22px;
    margin-bottom: 18px;
}

#kpiDetailModal .modal-content table {
    font-size: 15px;
    /* increase base font for table */
}

#kpiDetailModal .modal-content table th {
    font-size: 14px;
    padding: 14px 12px;
}

#kpiDetailModal .modal-content table td {
    font-size: 14px;
    padding: 12px;
}

#kpiDetailModal .modal-content p,
#kpiDetailModal .modal-content label,
#kpiDetailModal .modal-content div {
    font-size: 14px;
}

#kpiDetailModal .modal-content .kpi-items .kpi-row {
    font-size: 14px;
}

.kpi-form {
    margin-top: 0;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    background: transparent;
    border-radius: 8px;
}

.kpi-header-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.staff-info-inline {
    margin-bottom: 24px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(79, 70, 229, 0.08) 100%);
    border-radius: 8px;
    border-left: 5px solid #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.staff-info-inline h2 {
    color: #1e293b;
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
}

.staff-info-inline p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}

/* KPI Form Fields */
.kpi-header-section .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.kpi-header-section .form-group {
    display: flex;
    flex-direction: column;
}

.kpi-header-section label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-header-section input {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.kpi-header-section input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fafbff;
}

.kpi-header-section input:hover {
    border-color: #cbd5e1;
}

/* Mailbox Styles */
.mailbox {
    display: flex;
    gap: 16px;
}

.mailbox-left {
    width: 540px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.mailbox-folders {
    display: flex;
    gap: 8px;
}

.mailbox-folders .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.mailbox-list {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: auto;
    background: #ffffff;
}

.mail-item {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mail-item:hover {
    background: var(--hover-bg);
}

.mail-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.mail-item .title {
    font-weight: 700;
    color: var(--text-primary);
}

.mail-item .preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.mail-unread {
    color: var(--danger-color);
    font-size: 10px;
    margin-left: 6px;
}

/* Badge attention animation for new mail */
@keyframes badge-pop {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
    }

    30% {
        transform: scale(1.35);
        box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
    }

    60% {
        transform: scale(0.95);
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
    }
}

.mail-unread.attention {
    animation: badge-pop 900ms cubic-bezier(.2, .9, .3, 1);
}

.mail-view {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.mail-view-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mail-view-header #mailViewHeaderTitle,
#lmMailHeader {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.mail-view-body {
    padding: 16px;
    flex: 1;
    overflow: auto;
}

.mail-meta {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.mail-meta strong {
    color: #2563eb;
}

.mail-meta div {
    margin: 4px 0;
    font-size: 13px;
}

.mail-replies {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* visually group replies as a threaded block */
    border-left: 3px solid var(--border-color);
    padding-left: 14px;
    margin-left: 6px;
}

/* Each reply item sits inside the threaded block and has subtle separation */
.reply-item {
    background: rgba(99, 102, 241, 0.02);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.reply-item .reply-meta {
    margin-bottom: 6px;
}

.reply-item .reply-bubble {
    margin: 0;
}

/* Label shown above reply/thread blocks */
.replies-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 8px 0 6px;
    padding-left: 6px;
}

/* Message/Reply bubble styling */
.reply-bubble {
    padding: 12px 14px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 14px;
}

.reply-bubble.admin {
    background: #e0e7ff;
    color: #312e81;
    border-left: 4px solid #2563eb;
}

.reply-bubble.line-manager {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #10b981;
}

.reply-bubble.me {
    background: linear-gradient(180deg, #2563eb, #1e40af);
    color: white;
    margin-left: auto;
    border: none;
}

.reply-meta {
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

.reply-meta.admin {
    color: #2563eb;
}

.reply-meta.line-manager {
    color: #10b981;
}

.reply-meta .badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.reply-meta .admin-badge {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 700;
}

.reply-meta .lm-badge {
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}

.reply-area {
    border-top: 1px solid #f1f5f9;
    padding: 12px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.reply-area textarea {
    flex: 1;
    min-height: 80px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.reply-area button {
    padding: 10px 16px;
}

/* Compose Modal tweaks */
.compose-modal .modal-content {
    max-width: 760px;
}

.compose-form .form-group textarea {
    min-height: 180px;
}

/* Compose subject and message sizing (override inline styles for better UX) */
#composeSubject {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
}

#composeBody {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    min-height: 260px !important;
    line-height: 1.45;
    resize: vertical;
}

@media (max-width: 900px) {
    .mailbox {
        flex-direction: column;
    }

    .mailbox-left {
        width: 100%;
    }
}

/* Mail view defaults moved from inline styles */
#mailView {
    display: none;
}

.mail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mail-section-header h2 {
    font-size: 18px;
    margin: 0;
    color: var(--text-primary);
}

.mail-compose {
    margin-top: 8px;
}

.mail-compose-title {
    margin: 8px 0 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

#lmReplyArea {
    display: none;
}

.mail-inbox-section {
    margin-top: 12px;
}

.mail-section-title {
    margin: 8px 0 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.mail-empty-text {
    color: #64748b;
}

.reply-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* hide change-password username input by CSS instead of inline */
#changePasswordUsername {
    display: none;
}

.staff-info-inline p {
    margin: 0;
    font-size: 12px;
    color: #1e40af;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
    align-items: end;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #1e293b;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: #475569;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #f0f9ff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.kpi-table-container {
    margin: 28px 0 20px 0;
    overflow-x: auto;
}

.kpi-table-container h3 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

.table-responsive {
    overflow: auto;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    max-height: 70vh;
    min-height: 200px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Expand table to fill available space in report view and make it scrollable */
#reportConsolidatedView .table-responsive {
    flex: 1;
    max-height: calc(100vh - 220px);
    height: auto;
    margin: 0;
    border-radius: 4px;
    overflow: auto;
    /* allow vertical and horizontal scroll */
    -webkit-overflow-scrolling: touch;
}

/* Make table inside consolidated view horizontally scrollable when wide */
#reportConsolidatedView .table-responsive table {
    width: max-content;
    /* let table widen beyond container so scrollbar appears */
    min-width: 100%;
    white-space: nowrap;
}

/* Hide pagination controls inside the consolidated report view */
#reportConsolidatedView .pagination,
#reportConsolidatedView .pagination-container,
#reportConsolidatedView .pagination-controls,
#reportConsolidatedView .page-numbers {
    display: none !important;
}

/* Also hide the inline consolidated pager and per-page selector */
#reportConsolidatedView #consolidatedPagination,
#reportConsolidatedView #consolidatedPagerControls,
#reportConsolidatedView #consolidatedPagerInfo,
#reportConsolidatedView #consolidatedPageSize {
    display: none !important;
}

/* Qtr-by-Qtr Comparison view: ensure outer container does NOT scroll and
   only the table wrapper inside the content scrolls. */
#reportQtrComparisonView {
    height: calc(100vh - 140px);
    overflow: hidden;
    /* prevent page-level scrolling from this view */
}

#reportQtrComparisonView .content-card {
    display: contents;
    /* let inner table container control layout */
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    padding: 12px;
    margin-top: 8px;
}

/* Target the dynamically-injected wrapper that renderQtrComparisonPage creates
   (it uses an inline div). Use !important to override inline max-height if present. */
#reportQtrComparisonView #reportQtrComparisonContent>div {
    overflow: auto !important;
    /* ensure inner scroll only */
    max-height: calc(100vh - 220px) !important;
    -webkit-overflow-scrolling: touch;
}

#reportQtrComparisonView #reportQtrComparisonContent>div table {
    width: max-content;
    min-width: 100%;
    white-space: nowrap;
}

/* Excel-like KPI Table */
.kpi-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-family: 'Georgia', 'Georgia', sans-serif;
}

.kpi-table thead {
    background: #2d5016;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.kpi-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-right: 1px solid #4a7c1d;
    border-bottom: 2px solid #1a3a0a;
    background: #575e52;
    white-space: nowrap;
    color: #f0f0f0;
    line-height: 1.3;
}

.kpi-table th:last-child {
    border-right: none;
}

.kpi-table tbody tr {
    border-bottom: 1px solid #d9dfe1;
    transition: background-color 0.1s ease;
}

.kpi-table tbody tr:hover {
    background: #e8f5e9;
}

.kpi-table tbody tr:nth-child(even) {
    background: #f5f5f5;
}

.kpi-table tbody tr:nth-child(even):hover {
    background: #e8f5e9;
}

.kpi-table td {
    padding: 12px 10px;
    text-align: left;
    font-size: 13px;
    color: #1e293b;
    border-right: 1px solid #d9dfe1;
    vertical-align: middle;
    min-height: 45px;
    display: table-cell;
}

.kpi-table td:nth-child(1) {
    text-align: center;
    width: 35px;
    font-weight: 600;
    color: #475569;
}

.kpi-table td:last-child {
    border-right: none;
}

/* Input fields in KPI table cells - Excel style */
.kpi-table input[type="text"],
.kpi-table input[type="number"],
.kpi-table input[type="date"],
.kpi-table select,
.kpi-table textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bfbfbf;
    border-radius: 2px;
    font-size: 13px;
    font-family: 'Georgia', 'Georgia', sans-serif;
    color: #000000;
    background: #ffffff;
    transition: all 0.1s ease;
    box-sizing: border-box;
}

.kpi-table input[type="text"]:focus,
.kpi-table input[type="number"]:focus,
.kpi-table input[type="date"]:focus,
.kpi-table select:focus,
.kpi-table textarea:focus {
    outline: none;
    border-color: #2d5016;
    box-shadow: 0 0 0 1px #2d5016;
    background: #fffacd;
}

.kpi-table textarea {
    min-height: 50px;
    resize: vertical;
}

/* Compact inputs for numeric columns */
.kpi-table td:nth-child(4) input,
.kpi-table td:nth-child(5) input,
.kpi-table td:nth-child(6) input,
.kpi-table td:nth-child(8) input {
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
}

/* Unit select size (column 3) and remove button */
.kpi-table td:nth-child(3) select {
    padding: 10px 12px;
    font-size: 13px;
    min-width: 120px;
}

.kpi-table .remove-row {
    background: transparent;
    border: none;
    color: #dc2626;
    font-weight: 700;
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    transition: color 0.15s ease;
}

.kpi-table .remove-row:hover {
    color: #7f1d1d;
}

/* Total row (footer) styling - Excel style */
.kpi-table tfoot {
    background: #d4edda;
    font-weight: 700;
}

.kpi-table tfoot tr {
    border-top: 3px solid #2d5016;
    border-bottom: 2px solid #2d5016;
}

.kpi-table tfoot td {
    padding: 14px 12px;
    color: #1b3d0ffb;
    font-size: 13px;
    font-weight: 700;
    background: #ede4d4;
    border-right: 1px solid #b0d9b0;
    text-align: center;
}

.kpi-table tfoot td:last-child {
    border-right: none;
}

/* Achievement badge styling */
.kpi-table .achieved-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.achieved-badge.achieved {
    background: #c6efce;
    color: #006100;
    border: 1px solid #a9d08e;
}

.achieved-badge.not-achieved {
    background: #ffc7ce;
    color: #9c0006;
    border: 1px solid #f8cbad;
}

/* KPI Modal Header Styling */
.kpi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.kpi-modal-info h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.kpi-modal-info p {
    margin: 4px 0;
    font-size: 15px;
    color: #64748b;
}

/* KPI modal meta row: bonus and UFL values */
.kpi-meta-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

.bonus-badge {
    background: linear-gradient(90deg, #eef2ff, #f0f9ff);
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
}

.bonus-badge span {
    color: #0f172a;
    margin-left: 6px;
}

.ufl-values {
    color: #475569;
    font-size: 14px;
}

.kpi-modal-earned {
    text-align: right;
    min-width: 150px;
}

/* Action buttons in table */
.kpi-table .action-btn {
    padding: 6px 10px;
    margin: 0 4px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.kpi-table .delete-btn {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.kpi-table .delete-btn:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* KPI Form Action Buttons */
.kpi-form .form-actions {
    margin-top: 30px;
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

/* Move action buttons up slightly for setting/review views (Line Manager UX)
   — reduces the gap so the Clear / Save KPI / Submit KPI buttons sit higher. */
.kpi-setting-content .form-actions,
.kpi-review-content .form-actions {
    margin-top: 12px;
    padding-top: 8px;
}

.kpi-form .form-actions button {
    padding: 8px 14px;
    /* smaller clickable area */
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 13px;
    /* slightly smaller text */
    font-family: 'Georgia', serif;
    /* use Georgia for buttons */
    text-transform: none;
    /* preserve natural casing */
    letter-spacing: 0.2px;
}

.kpi-form .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    width: auto;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.kpi-form .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.kpi-form .btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    width: auto;
}

.kpi-form .btn-secondary:hover {
    background: #cbd5e1;
    border-color: #94a3b8;
}

/* Add KPI Row Button */
.kpi-form .add-row-btn {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kpi-form .add-row-btn:hover {
    background: #bbf7d0;
    border-color: #86efac;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-danger:focus,
.btn-danger:active {
    background: #dc2626;
    box-shadow: none;
    outline: none;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-info {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-info:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Success button style (green) - used for KPI presence and primary success actions */
.btn-success {
    background: #10b981;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    border: none;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

.staff-info-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.staff-info-header h2 {
    color: white;
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 700;
}

.staff-info-header p {
    opacity: 0.95;
    font-size: 13px;
    margin: 0;
}

/* Previous KPI Records */
.kpi-record {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    min-width: 240px;
    flex-shrink: 0;
}

.kpi-record:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.kpi-record h4 {
    color: #2563eb;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
}

.kpi-record p {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0;
    display: flex;
    gap: 8px;
}

.kpi-record p strong {
    color: #1e293b;
    font-weight: 600;
}

.kpi-record-action {
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    border: 1px solid #93c5fd;
    transition: all 0.2s ease;
}

.kpi-record:hover .kpi-record-action {
    background: #bfdbfe;
    border-color: #60a5fa;
}

/* BSC Record Card Styles */
.bsc-record {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #059669;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    min-width: 240px;
    flex-shrink: 0;
}

.bsc-record:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dbeafe 100%);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    transform: translateY(-2px);
}

.bsc-record h4 {
    color: #059669;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
}

.bsc-record p {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0;
    display: flex;
    gap: 8px;
}

.bsc-record p strong {
    color: #1e293b;
    font-weight: 600;
}

.bsc-record-action {
    background: #d1fae5;
    color: #065f46;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    border: 1px solid #6ee7b7;
    transition: all 0.2s ease;
}

.bsc-record:hover .bsc-record-action {
    background: #a7f3d0;
    border-color: #6ee7b7;
}

/* Admin Dashboard Styles */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
}

.data-table {
    overflow-x: auto;
}

.summary-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0;
    padding-right: 8px;
    max-height: 600px;
}

.summary-grid::-webkit-scrollbar {
    height: 8px;
}

.summary-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.summary-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.summary-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Section header with navigation controls */
.section-header-with-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-header-with-nav h2 {
    margin: 0;
    flex: 1;
}

.carousel-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(2, 6, 23, 0.06);
}

.carousel-btn:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
    color: #cbd5e1;
}

.carousel-container {
    position: relative;
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.department-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.department-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.department-card h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
}

.department-card p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
}

.summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
    min-width: 220px;
    flex-shrink: 0;
}

.summary-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.summary-card h4 {
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-card-icon {
    font-size: 16px;
    color: #667eea;
}

.summary-card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.summary-card-item {
    display: flex;
    flex-direction: column;
}

.summary-card-item label {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.summary-card-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .staff-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .kpi-table {
        font-size: 12px;
    }

    .kpi-table th,
    .kpi-table td {
        padding: 8px;
    }
}

/* Staff Records Table Enhancements */
.staff-records-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.staff-records-table tbody tr:hover {
    background: #f8fafc;
    box-shadow: inset 1px 0 0 0 #667eea;
}

.staff-records-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.staff-records-table td {
    padding: 6px 8px;
    font-size: 13px;
}

.staff-records-table th {
    padding: 8px 8px;
    font-size: 12px;
}

.staff-records-table tbody td:first-child {
    font-weight: 600;
    color: #1e293b;
}

/* Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: #f1f5f9;
    border-color: #667eea;
    color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.pagination-size select {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #1e293b;
    font-family: 'Georgia', 'Georgia', 'Georgia', sans-serif;
    transition: all 0.2s ease;
}

.pagination-size select:hover {
    border-color: #667eea;
}

.pagination-size select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading State Overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Transparent background to show page content while loading */
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loadingOverlay.show {
    display: flex;
}

.loading-container {
    text-align: center;
    background: transparent;
    padding: 40px;
    border-radius: 12px;
    /* remove heavy shadow so the container blends into the white background */
    box-shadow: none;
    min-width: 200px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-top: 16px;
}

/* Horizontal carousel for previous KPI cards */
.previous-kpi-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0 4px 0;
    padding-right: 8px;
}

.previous-kpi-carousel::-webkit-scrollbar {
    height: 8px;
}

.previous-kpi-carousel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.previous-kpi-carousel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.previous-kpi-carousel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* BSC Carousel Styles */
.previous-bsc-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0 4px 0;
    padding-right: 8px;
}

.previous-bsc-carousel::-webkit-scrollbar {
    height: 8px;
}

/* Modal styles for BSC save modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.modal-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px;
    width: 460px;
    max-width: 94%;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
    color: #0f172a;
}

/* Scoped fixes for employee portal modals
   Some employee pages include an internal .modal-overlay that can sit
   above .modal-content and block interactions. These rules lower the
   overlay z-index for employee modals and ensure the modal-content sits
   above the overlay. This is scoped to the employee modal IDs so admin
   and line-manager portals are unaffected. */
#editProfileModal .modal-overlay,
#kpiDetailModal .modal-overlay,
#bscDetailModal .modal-overlay,
#chatModal .modal-overlay {
    z-index: 1000;
    pointer-events: none !important;
}

#editProfileModal .modal-content,
#kpiDetailModal .modal-content,
#bscDetailModal .modal-content,
#chatModal .modal-content {
    position: relative;
    z-index: 1100;
    /* sits above the overlay inside the modal */
}

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

.modal-title {
    margin: 0;
    font-size: 16px;
    color: #064e3b;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #475569;
}

.modal-body p {
    margin: 0 0 12px 0;
    color: #334155;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.modal-card:focus {
    outline: none;
}

.previous-bsc-carousel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.previous-bsc-carousel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.previous-bsc-carousel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.previous-kpi-card {
    min-width: 280px;
    flex-shrink: 0;
}

.previous-bsc-card {
    min-width: 280px;
    flex-shrink: 0;
}

/* Chat modal specific adjustments */
#chatModal .modal-content {
    padding: 12px !important;
    max-width: 920px !important;
    height: 80vh !important;
    display: flex !important;
    flex-direction: column !important;
}

#chatModal #chatMessagesList {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    background: #fbfbfd;
}

#chatModal .chat-message.mine {
    text-align: right;
}

#chatModal .chat-message {
    margin-bottom: 12px;
}

#chatModal .chat-message .meta {
    font-size: 12px;
    color: #475569;
    margin-bottom: 6px;
}

#chatModal .chat-message .body {
    font-size: 14px;
    color: #0f172a;
    padding: 10px;
    display: inline-block;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e6e9ee;
}

#chatModal .chat-message.mine .body {
    background: linear-gradient(90deg, #fee2e2, #fff1f1);
    border-color: rgba(239, 68, 68, 0.16);
}

#chatModal .chat-reply {
    margin-left: 12px;
    margin-top: 8px;
}

#chatModal .chat-reply .author {
    font-size: 12px;
    color: #475569;
    margin-bottom: 6px;
}

#chatModal .avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    color: #ef4444;
    border: 2px solid #ef4444;
    font-weight: 700;
    margin-right: 8px;
    font-size: 12px;
}

#chatModal .reply-actions {
    margin-top: 6px;
}

/* badge small style */
.mail-unread {
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    display: inline-block;
}

/* Chat input row layout and sizing */
.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-row textarea#chatInput {
    flex: 1 1 auto;
    min-width: 0;
    /* allow flex to shrink properly */
    max-width: calc(100% - 120px);
    min-height: 96px;
    font-size: 14px;
}

.chat-input-row #chatSendBtn {
    flex: 0 0 110px;
    align-self: flex-end;
    padding: 10px 14px;
}

/* LM Chat page input styles (match chat modal) */
.chat-input-row textarea#lmChatPageInput,
.chat-input-row textarea#lmChatInput {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 120px);
    min-height: 120px;
    /* increased height */
    font-size: 15px;
}

.chat-input-row #lmChatPageSendBtn,
.chat-input-row #lmChatSendBtn {
    flex: 0 0 110px;
    align-self: flex-end;
    padding: 10px 14px;
}

@media (max-width: 720px) {
    .chat-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-input-row #chatSendBtn {
        width: 100%;
        flex: 0 0 auto;
    }

    .chat-input-row textarea#chatInput {
        max-width: 100%;
    }
}

/* Enhanced Notify Admin Modal Styles */
.notify-modal-content {
    border-top: 5px solid #f59e0b !important;
    padding: 0 !important;
}

.notify-modal-content .modal-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 24px;
    border-bottom: 1px solid #fcd34d;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notify-modal-content .modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notify-modal-content .modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #92400e;
    cursor: pointer;
    padding: 8px 12px;
    line-height: 1;
    transition: color 0.2s ease;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notify-modal-content .modal-close:hover {
    color: #d97706;
}

.notify-modal-body {
    padding: 32px 24px;
    text-align: center;
}

.notify-icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 16px;
    animation: slideDown 0.5s ease;
}

.notify-modal-body h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
}

.notify-modal-body p {
    margin: 0 0 24px 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.notify-details {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #166534;
}

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

.detail-item i {
    color: #10b981;
    font-size: 16px;
    flex-shrink: 0;
}

.notify-modal-footer {
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.notify-modal-footer .btn {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.notify-modal-footer .btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid #cbd5e1;
}

.notify-modal-footer .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.notify-modal-footer .btn-primary {
    background: #10b981;
    color: white;
    border: none;
}

.notify-modal-footer .btn-primary:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.notify-modal-footer .btn-primary:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .notify-modal-content {
        max-width: 90% !important;
    }

    .notify-modal-footer {
        flex-direction: column-reverse;
    }

    .notify-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Logout Modal Styles */
.logout-modal-content {
    border-top: 5px solid #ef4444 !important;
    padding: 0 !important;
}

.logout-modal-content .modal-header {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    padding: 24px;
    border-bottom: 1px solid #fca5a5;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-modal-content .modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #7f1d1d;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-modal-content .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #7f1d1d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.logout-modal-content .modal-close:hover {
    color: #dc2626;
}

/* KPI Department Modal - Customized Close Button */
#kpiDepartmentModal .modal-close {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
    padding: 8px 14px;
    line-height: 1;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    font-weight: 600;
    position: relative;
}

#kpiDepartmentModal .modal-close:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

#kpiDepartmentModal .modal-close:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.2);
}

/* Balanced Scorecard Review Modal - Customized Close Button */
#bscReviewModal .modal-close {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: none !important;
    font-size: 24px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    padding: 8px 14px !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2) !important;
    font-weight: 600 !important;
    position: relative !important;
}

#bscReviewModal .modal-close:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

#bscReviewModal .modal-close:active {
    transform: scale(0.96) !important;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.2) !important;
}

/* Mid-year Review Modal - Customized Close Button */
#midYearModal .icon-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    font-size: 24px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    padding: 8px 12px !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2) !important;
    font-weight: 600 !important;
}

#midYearModal .icon-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

#midYearModal .icon-btn:active {
    transform: scale(0.96) !important;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2) !important;
}

/* ============================================
   EMPLOYEE DASHBOARD HEADER CUSTOMIZATION
   ============================================ */

.dashboard-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-header:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Header Left Section */
.dashboard-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

/* User Card Inline - Main Container */
.user-card-inline {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.user-card-inline:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

/* User Avatar in Header */
#userAvatarSmall {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700;
    line-height: 38px !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#userAvatarSmall:hover {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    transform: scale(1.05);
}

/* User Info Container */
.user-card-inline>div:last-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 0px;
}

/* Header Name */
#headerName {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
    line-height: 1.15;
}

.user-card-inline:hover #headerName {
    color: #2563eb;
}

/* Header Position */
#headerPosition {
    font-size: 11px !important;
    color: #64748b !important;
    margin-top: 0px !important;
    font-weight: 500;
    transition: color 0.3s ease;
    line-height: 1.1;
}

.user-card-inline:hover #headerPosition {
    color: #475569;
}

/* Header Grade */
#headerGrade {
    font-size: 10px !important;
    color: #9ca3af !important;
    margin-top: 0px !important;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: color 0.3s ease;
    line-height: 1;
}

.user-card-inline:hover #headerGrade {
    color: #64748b;
}

/* Header Right Section */
.dashboard-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* Hidden User Card for Layout Preservation */
.dashboard-header .user-card[style*="visibility:hidden"] {
    visibility: hidden;
    position: absolute;
    pointer-events: none;
}

/* Smooth Transitions for Header Elements */
.dashboard-header * {
    transition: all 0.2s ease;
}

.logout-modal-body {
    padding: 32px 24px;
    text-align: center;
}

.logout-icon {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
    animation: slideDown 0.5s ease;
}

.logout-modal-body h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
}

.logout-modal-body p {
    margin: 0 0 24px 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.logout-details {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.detail-item.warning-detail {
    color: #7f1d1d;
}

.detail-item.warning-detail i {
    color: #ef4444;
}

.logout-modal-footer {
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.logout-modal-footer .btn {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.logout-modal-footer .btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid #cbd5e1;
}

.logout-modal-footer .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.logout-modal-footer .btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.logout-modal-footer .btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.logout-modal-footer .btn-danger:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .logout-modal-content {
        max-width: 90% !important;
    }

    .logout-modal-footer {
        flex-direction: column-reverse;
    }

    .logout-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   BALANCED SCORECARD (BSC) STYLES
   ============================================ */

.bsc-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* BSC Header Section */
.bsc-header-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.bsc-header-section .staff-info-inline {
    flex: 1 1 220px;
}

.bsc-header-section .staff-info-inline h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.bsc-header-section .staff-info-inline p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.bsc-fields-grid {
    display: grid;
    /* Allow three columns so Review Start/End and Review Date fit without overlap */
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    align-items: start;
    /* top-align fields so shorter cards don't vertically center */
    width: 100%;
    max-width: 720px;
}

.bsc-fields-grid .form-group {
    background: linear-gradient(180deg, #ffffff, #fbfcfd);
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}

.bsc-fields-grid .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.bsc-fields-grid input {
    font-family: 'Georgia', serif;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    width: 100%;
    background: #fff;
    transition: all 0.2s ease;
}

.bsc-fields-grid input:focus {
    outline: none;
    border-color: #a1a1aa;
    box-shadow: 0 8px 20px rgba(99, 102, 106, 0.06);
    background: #fff;
}

/* Four Perspectives Container */
.bsc-perspectives-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.bsc-perspective-card {
    background: linear-gradient(135deg, #ffffff 0%, #fbfcfd 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bsc-perspective-card:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* Perspective color coding */
.financial-perspective {
    border-top: 4px solid #10b981;
}

.customer-perspective {
    border-top: 4px solid #3b82f6;
}

.process-perspective {
    border-top: 4px solid #f59e0b;
}

.growth-perspective {
    border-top: 4px solid #8b5cf6;
}

.perspective-header {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
}

.perspective-icon {
    font-size: 28px;
    min-width: 44px;
    text-align: center;
    opacity: 0.8;
}

.financial-perspective .perspective-icon {
    color: #10b981;
}

.customer-perspective .perspective-icon {
    color: #3b82f6;
}

.process-perspective .perspective-icon {
    color: #f59e0b;
}

.growth-perspective .perspective-icon {
    color: #8b5cf6;
}

.perspective-title-input {
    width: 100%;
    margin: 0 0 4px 0;
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    color: var(--text-primary);
    font-family: Georgia, serif;
    transition: border-color 0.3s ease;
}

.perspective-title-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.perspective-description-input {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    color: var(--text-secondary);
    line-height: 1.4;
    font-family: Georgia, serif;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s ease;
}

/* Give the title group more horizontal space within the perspective header */
.perspective-title-group {
    flex: 1 1 auto;
    min-width: 260px;
}

.perspective-description-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.perspective-description {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.perspective-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perspective-content .form-group {
    margin: 0;
}

.perspective-content label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 6px;
}

.perspective-content input,
.perspective-content textarea {
    font-family: 'Georgia', serif;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.perspective-content input:focus,
.perspective-content textarea:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(99, 102, 106, 0.08);
}

.perspective-weight {
    font-weight: 600;
}

.perspective-score {
    font-weight: 600;
}

.perspective-kpis {
    resize: vertical;
    min-height: 60px;
}

.perspective-weighted-score {
    background: #f8fafc;
    font-weight: 700;
    color: #10b981;
    cursor: default;
}

/* Summary Section */
.bsc-summary-section {
    margin: 24px 0;
}

.bsc-summary-sticky {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #ffffff 0%, #fbfcfd 100%);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.bsc-summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #fbfcfd 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
}

.bsc-summary-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.summary-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.summary-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.rating-badge {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    display: inline-block;
    text-align: center;
    font-weight: 700;
}

.rating-outstanding {
    background: #d1fae5;
    color: #065f46;
}

.rating-exceeds {
    background: #dbeafe;
    color: #0c4a6e;
}

.rating-meets {
    background: #fef3c7;
    color: #92400e;
}

.rating-needs {
    background: #fed7aa;
    color: #92400b;
}

.rating-unsatisfactory {
    background: #fee2e2;
    color: #991b1b;
}

#weightWarning {
    font-size: 11px;
    margin-top: 4px;
}

/* BSC Sections */
.bsc-section {
    background: linear-gradient(135deg, #ffffff 0%, #fbfcfd 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.bsc-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bsc-section h3 i {
    font-size: 18px;
    opacity: 0.7;
}

.bsc-section .form-group {
    margin-bottom: 16px;
}

.bsc-section .form-group:last-child {
    margin-bottom: 0;
}

.bsc-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.bsc-section textarea {
    font-family: 'Georgia', serif;
    font-size: 13px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 100%;
    color: var(--text-primary);
    background: #ffffff;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.bsc-section textarea:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(99, 102, 106, 0.08);
}

.bsc-section textarea::placeholder {
    color: #9ca3af;
}

/* Form Actions */
.bsc-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

.bsc-form .form-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 14px;
}

/* Messages */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-left: 4px solid #10b981;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .bsc-header-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .bsc-fields-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .bsc-perspectives-container {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .bsc-form .form-actions {
        flex-direction: column;
    }

    .bsc-form .form-actions button {
        width: 100%;
    }
}

/* Tablet / Small screens: 2 columns for perspectives */
@media (min-width: 601px) and (max-width: 1024px) {
    .bsc-perspectives-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens: 2x2 grid for 4 perspectives */
@media (min-width: 1025px) {
    .bsc-perspectives-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== Legal Pages Styling (Terms & Conditions, Privacy & Cookies) ==================== */

.legal-page {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    min-height: 100vh;
    padding: 20px 20px;
    font-family: Georgia, 'Times New Roman', serif;
}

.legal-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4b5563 100%);
    color: white;
    padding: 20px 30px;
    position: relative;
}

.legal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    margin-bottom: 20px;
}

.legal-back-btn:hover {
    opacity: 1;
}

.legal-back-btn i {
    font-size: 12px;
}

.legal-title {
    text-align: center;
}

.legal-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    opacity: 0.95;
    border-radius: 50%;
}

.legal-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    font-family: Georgia, serif;
}

.legal-subtitle {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 400;
    font-family: 'Segoe UI', sans-serif;
}

.legal-content {
    padding: 50px 40px;
    max-height: 70vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.legal-content::-webkit-scrollbar {
    width: 8px;
}

.legal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.legal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    opacity: 0.6;
}

.legal-content::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

.legal-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
    animation: fadeInSection 0.6s ease-out;
}

.legal-section:last-of-type {
    border-bottom: none;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.legal-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Georgia, serif;
}

.legal-section h2 i {
    font-size: 16px;
    color: #2563eb;
    width: 24px;
    text-align: center;
}

.legal-section p {
    color: #475569;
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 12px;
    font-family: Georgia, serif;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    list-style: none;
    margin-top: 12px;
}

.legal-section ul li {
    color: #475569;
    line-height: 1.8;
    font-size: 15px;
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
    font-family: Georgia, serif;
}

.legal-section ul li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
}

.legal-section strong {
    color: #1e293b;
    font-weight: 600;
}

.contact-info {
    background: #f8fafc;
    padding: 15px 20px;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    margin-top: 12px;
}

.contact-info p {
    margin-bottom: 6px;
    color: #334155;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-info i {
    color: #2563eb;
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.legal-footer-note {
    background: linear-gradient(135deg, #f0f4f8 0%, #f9fafb 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
}

.legal-footer-note p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.legal-footer-note p:last-child {
    margin-bottom: 0;
}

.legal-footer-note strong {
    color: var(--primary-color);
    font-weight: 600;
}

.legal-footer {
    background: #f8fafc;
    padding: 20px 40px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.legal-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.legal-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.legal-separator {
    color: #cbd5e1;
}

/* Footer Links for Login and Register Pages */
.auth-footer-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.auth-footer-link {
    font-size: 12px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.auth-footer-link:hover {
    color: #2563eb;
}

.auth-footer-link i {
    font-size: 10px;
}

.auth-footer-separator {
    color: #cbd5e1;
}

/* Responsive Design for Legal Pages */
@media (max-width: 768px) {
    .legal-page {
        padding: 20px 10px;
    }

    .legal-container {
        border-radius: 8px;
    }

    .legal-header {
        padding: 30px 20px;
    }

    .legal-back-btn {
        font-size: 12px;
    }

    .legal-title h1 {
        font-size: 24px;
    }

    .legal-content {
        padding: 30px 20px;
        max-height: 60vh;
    }

    .legal-section {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }

    .legal-section h2 {
        font-size: 16px;
        gap: 8px;
    }

    .legal-section p,
    .legal-section ul li {
        font-size: 13px;
    }

    .legal-footer {
        flex-direction: column;
        padding: 15px 20px;
        gap: 8px;
    }

    .legal-footer-note {
        padding: 15px;
    }

    .auth-footer-links {
        gap: 12px;
    }

    .auth-footer-link {
        font-size: 11px;
    }
}

/* Consolidated Report Table Styling */
.consolidated-table th {
    white-space: nowrap !important;
    position: relative;
    cursor: help;
}

.consolidated-table th[title] {
    border-bottom: 1px dotted #cbd5e1;
}

.consolidated-table th[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
    max-width: 220px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    line-height: 1.4;
    word-wrap: break-word;
}

.consolidated-table th[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    z-index: 1000;
}

.consolidated-table th.wrap-header {
    white-space: normal !important;
    word-break: break-word;
    max-width: 100px;
    padding: 10px 6px !important;
    text-align: center;
    vertical-align: middle;
    line-height: 1.3;
    font-size: 11px;
    min-width: 90px;
}

.consolidated-table td {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 6px !important;
    max-width: 120px;
    font-size: 12px;
}

/* Allow Name column to display full names without wrapping */
.consolidated-table td:nth-child(3) {
    white-space: nowrap !important;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Optimize consolidated table for data density */
#reportConsolidatedView .kpi-table td {
    padding: 6px 4px !important;
    font-size: 13px;
    min-height: auto;
}

#reportConsolidatedView .kpi-table th {
    padding: 8px 4px !important;
    font-size: 12px;
}

/* ============================================
   MOBILE RESPONSIVE DESIGN (< 768px)
   ============================================ */

@media (max-width: 768px) {

    /* General Mobile Adjustments */
    html,
    body {
        font-size: 14px;
    }

    body {
        overflow: auto;
    }

    /* Dashboard Layout - Stack on Mobile */
    .dashboard-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* Sidebar - Full Width Mobile Menu */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 75vw;
        max-width: 300px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    /* Main Content - Full Width on Mobile */
    .main-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 12px;
        flex: 1;
    }

    .main-content.sidebar-hidden {
        margin-left: 0;
    }

    /* Header - Mobile Optimized */
    .dashboard-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 900;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .dashboard-header h1 {
        font-size: 18px;
        flex-basis: 100%;
    }

    .dashboard-header .header-left {
        min-width: auto;
        flex: 1;
    }

    .dashboard-header .header-left h1 {
        font-size: 16px;
        margin: 0;
    }

    .dashboard-header .header-left p {
        font-size: 12px;
    }

    /* Modal Overlay - Mobile Friendly */
    .modal-overlay {
        z-index: 999;
    }

    .modal {
        width: 95vw !important;
        max-width: 100% !important;
        margin: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Forms - Mobile Friendly */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 10px;
        width: 100%;
    }

    /* Buttons - Touch Friendly */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        min-width: 44px;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Tables - Horizontal Scroll on Mobile */
    .kpi-table {
        font-size: 12px;
        width: 100%;
        overflow-x: auto;
        display: block;
    }

    .kpi-table thead,
    .kpi-table tbody,
    .kpi-table th,
    .kpi-table td,
    .kpi-table tr {
        display: block;
    }

    .kpi-table thead {
        display: none;
    }

    .kpi-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 8px;
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 8px;
    }

    .kpi-table td {
        padding: 8px;
        text-align: left;
        display: grid;
        grid-template-columns: 120px 1fr;
        column-gap: 8px;
    }

    .kpi-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        text-transform: uppercase;
        font-size: 11px;
    }

    /* Cards - Mobile Optimized */
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    /* Grid Layouts - Single Column on Mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }

    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .chart-container {
        height: 300px;
        margin-bottom: 12px;
    }

    /* Navigation - Mobile Friendly */
    .sidebar-nav {
        padding: 12px;
        gap: 4px;
    }

    .nav-item {
        padding: 10px 12px;
        font-size: 14px;
        gap: 8px;
    }

    /* Dropdown Menus - Mobile Friendly */
    .dropdown-menu {
        min-width: auto;
        position: fixed;
        left: 0;
        right: 0;
        margin: 0 auto;
        max-width: calc(100vw - 20px);
    }

    /* Chat/Messages - Mobile Optimized */
    .message {
        font-size: 13px;
        padding: 8px;
        margin-bottom: 8px;
    }

    .chat-container {
        height: 300px;
    }

    /* Sidebar Header - Compact on Mobile */
    .sidebar-header {
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
    }

    .sidebar-logo {
        width: 32px;
        height: 32px;
    }

    .sidebar-header h2 {
        font-size: 16px;
    }

    .sidebar-header .year-wrap {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-left: 0;
        margin-top: 8px;
    }

    .sidebar-header .year-wrap select {
        width: 100px;
    }

    /* Badges and Tags */
    .badge {
        font-size: 11px;
        padding: 4px 6px;
    }

    /* Modals - Full Screen on Mobile */
    .modal.modal-xl {
        width: 95vw !important;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-body {
        padding: 12px;
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }

    /* Login/Register Pages - Mobile Optimized */
    .login-container {
        padding: 12px;
        min-height: 100vh;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 16px;
        border-radius: 8px;
    }

    .login-form .form-group {
        margin-bottom: 12px;
    }

    .login-form input {
        font-size: 16px;
        padding: 12px;
    }

    /* Dashboard Cards - Responsive */
    .dashboard-card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .dashboard-card h3 {
        font-size: 14px;
    }

    .dashboard-card .metric {
        font-size: 20px;
    }

    /* Info Boxes */
    .info-box {
        padding: 8px;
        margin-bottom: 8px;
        font-size: 12px;
    }

    /* Tabs - Mobile Friendly */
    .tabs {
        flex-wrap: wrap;
        gap: 0;
    }

    .tab-button {
        flex: 1;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Search Bars - Full Width */
    .search-bar {
        width: 100%;
        margin-bottom: 12px;
    }

    .search-bar input {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    /* Filter Controls - Stack on Mobile */
    .filter-controls {
        flex-direction: column;
        gap: 8px;
    }

    .filter-controls select,
    .filter-controls input {
        width: 100%;
    }

    /* Text Adjustments */
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    h4 {
        font-size: 14px;
    }

    p {
        font-size: 13px;
    }

    /* Utility Margins */
    .mt {
        margin-top: 8px !important;
    }

    .mb {
        margin-bottom: 8px !important;
    }

    .p {
        padding: 8px !important;
    }
}

/* ============================================
   EXTRA SMALL DEVICES (< 480px)
   ============================================ */

@media (max-width: 480px) {

    html,
    body {
        font-size: 13px;
    }

    .sidebar {
        width: 85vw;
    }

    .dashboard-header {
        padding: 8px;
        margin-top: 0;
    }

    .dashboard-header h1 {
        font-size: 16px;
    }

    .sidebar-toggle {
        font-size: 20px;
        top: 8px;
        left: 8px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .card {
        padding: 8px;
        margin-bottom: 8px;
    }

    .modal {
        width: 98vw !important;
        padding: 8px !important;
    }

    .modal-body {
        max-height: calc(100vh - 120px);
        padding: 8px;
    }

    .login-card {
        padding: 12px;
        border-radius: 6px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 10px;
    }

    .kpi-table tr {
        grid-template-columns: 100px 1fr;
    }

    .kpi-table td::before {
        font-size: 10px;
    }

    /* ============================================
   ORGANIZATIONAL STRUCTURE / ORGANOGRAM STYLING
   ============================================ */

    /* Override content-card display for org-structure view */
    #org-structureView .content-card {
        display: block !important;
        overflow: visible !important;
        max-height: none !important;
    }

    #org-structureView .content-card h2 {
        margin: 0 0 20px 0;
        color: #1e293b;
        font-size: 18px;
        font-weight: 700;
    }

    /* All org-tree styles have been moved to org-structure.css for better organization
   and to avoid conflicts. Do not add org-tree styles here.
*/

    /* Reduce spacing on very small screens */
    .sidebar-nav {
        padding: 8px;
        gap: 2px;
    }

    .nav-item {
        padding: 8px 10px;
        font-size: 12px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 16px;
    }

    h3 {
        font-size: 14px;
    }

    h4 {
        font-size: 12px;
    }

    p {
        font-size: 12px;
    }

    /* Hide some non-essential elements on tiny screens */
    .sidebar-header h2 {
        display: none;
    }

    .header-left p {
        display: none;
    }
}

/* Customize close button for lmReviewModal */
#lmReviewModal .modal-close {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    color: #64748b;
    font-size: 18px;
    transition: all 0.2s ease;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#lmReviewModal .modal-close:hover {
    background: #e2e8f0;
    color: #475569;
    border-color: #94a3b8;
}