.emp-page {
    background: #f8f9fa;
    min-height: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.emp-header {
    margin-bottom: 24px;
}

.btn-export {
    background: #1a1a2e;
    border: none;
    color: #fff;
    font-size: 15px;
    padding: 12px 18px;
    font-weight: 500;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-export:hover:not(:disabled) {
        background: #2d2d44;
        color: #fff;
    }

    .btn-export:disabled {
        background: #9ca3af;
        color: #fff;
        cursor: not-allowed;
        opacity: 0.7;
    }

.emp-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.filter-bar {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 0 0 240px;
    width: 240px;
}

.filter-dropdowns {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.search-box input {
    width: 100%;
    height: 44px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0 12px 0 40px;
    color: #333;
}

    .search-box input::placeholder {
        color: #999;
    }

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.filter-select {
    height: 44px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0 32px 0 12px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    min-width: 140px;
}

.emp-table {
    width: 100%;
    border-collapse: collapse;
}

    .emp-table th {
        background: #fafafa;
        font-size: 16px;
        font-weight: 600;
        padding: 18px 20px;
        color: #666;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
        white-space: nowrap;
        cursor: pointer;
    }

        .emp-table th:hover {
            color: #333;
        }

        .emp-table th.text-center {
            text-align: center;
        }

.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    margin-left: 6px;
    vertical-align: middle;
    gap: 1px;
    opacity: 0.4;
}

    .sort-arrows svg {
        width: 8px;
        height: 5px;
    }

th.sort-asc .sort-arrows,
th.sort-desc .sort-arrows {
    opacity: 1;
}

    th.sort-asc .sort-arrows svg:first-child {
        color: #1a1a2e;
    }

    th.sort-desc .sort-arrows svg:last-child {
        color: #1a1a2e;
    }

.emp-table td {
    font-size: 16px;
    padding: 18px 20px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.emp-table tbody tr:hover {
    background: #fafafa;
}

.emp-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.emp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.av-orange {
    background: #f97316;
}

.av-pink {
    background: #ec4899;
}

.av-teal {
    background: #14b8a6;
}

.av-purple {
    background: #a855f7;
}

.av-red {
    background: #ef4444;
}

.av-blue {
    background: #3b82f6;
}

.av-indigo {
    background: #6366f1;
}

.av-green {
    background: #22c55e;
}

.av-cyan {
    background: #06b6d4;
}

.emp-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.emp-email {
    color: #666;
}

.emp-dept {
    color: #666;
}

.emp-alert {
    color: #333;
}

.emp-alert.text-center {
    text-align: center;
}

.emp-alert.text-center .emp-alert-badges {
    display: inline-flex;
    justify-content: center;
}

.emp-col-action {
    width: 1%;
    white-space: nowrap;
}

.emp-alert-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
}

.alert-badge i {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-badge-good {
    background: #f0fdf4;
    color: #22c55e;
}

.alert-badge-warning {
    background: #fffbeb;
    color: #f59e0b;
}

.alert-badge-critical {
    background: #fef2f2;
    color: #ef4444;
}

.btn-view {
    color: #1a1a2e;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
}

    .btn-view:hover {
        color: #000;
    }

    .btn-view svg {
        width: 20px;
        height: 20px;
    }

.table-footer {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.page-info {
    font-size: 15px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-select {
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0 24px 0 8px;
    font-size: 13px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .page-btn:hover:not(:disabled) {
        background: #f5f5f5;
    }

    .page-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

/* ===== Employee Details Page - Match Dashboard/Reviews/Metrics ===== */
.details-page {
    background: #f4f6f8;
    min-height: 0;
    padding: 0;
    max-width: 100%;
}

.details-header {
    padding: 0;
}

.details-back-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 0.9rem;
}

.details-employee-card {
    background-color: #1A445A;
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.details-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.details-employee-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.details-employee-meta {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
}

.details-employee-label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.details-employee-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
}

/* Section cards - match Dashboard/Reviews */
.details-section-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    overflow: hidden;
}

.details-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
}

    .details-card-header .card-header-title {
        font-size: 1.125rem;
        font-weight: 600;
        color: #111827;
    }

    .details-card-header .card-header-actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

/* Details page - consistent font sizes */
.details-page .small {
    font-size: 0.875rem !important;
}

.details-page h6 {
    font-size: 1rem;
    word-break: break-all;
}

.details-page h5 {
    font-size: 1.125rem;
}

.details-page .metric-tab {
    font-size: 0.875rem;
    padding: 6px 14px;
}

.icon-box-success {
    background: #dcfce7;
    color: #22c55e;
}

.icon-box-danger {
    background: #fee2e2;
    color: #ef4444;
}

.text-success-custom {
    color: #22c55e;
}

.text-warning-custom {
    color: #f59e0b;
}

.text-danger-custom {
    color: #ef4444;
}

.badge-critical {
    background: #fef2f2;
    color: #ef4444;
}

.badge-warning {
    background: #fffbeb;
    color: #f59e0b;
}

.badge-good {
    background: #f0fdf4;
    color: #22c55e;
}

.metric-tab.active {
    background: #1e3a2f !important;
    border-color: #1e3a2f !important;
    color: #fff !important;
}

.btn-primary-custom {
    background: #1e3a2f;
    border-color: #1e3a2f;
    font-size: 0.875rem;
}

    .btn-primary-custom:hover {
        background: #2d5a47;
        border-color: #2d5a47;
    }

.view-comments-toggle {
    color: #0d9488;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
}

    .view-comments-toggle:hover {
        color: #0f766e;
    }

    .view-comments-toggle i {
        transition: transform 0.2s ease;
    }

.comment-item {
    padding-bottom: 0.75rem;
}

    .comment-item:not(:last-child) {
        border-bottom: 1px solid #f3f4f6;
    }

.metric-value {
    font-weight: 600;
    font-size: 0.9375rem;
}

.comment-text {
    font-weight: 500;
    font-size: 0.9375rem;
}

.date-range-picker {
    background: #fff;
    height: 42px;
}

    .date-range-picker:focus-within {
        border-color: #86b7fe !important;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

    .date-range-picker input[type="date"] {
        background: transparent;
        font-size: 1.125rem;
        color: #6c757d;
    }

        .date-range-picker input[type="date"]::-webkit-calendar-picker-indicator {
            opacity: 0.6;
            cursor: pointer;
        }

/* Date range input - Details page (attractive styling) */
.details-page .date-filter .datefilerstyle {
    background-color: #f8faf9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%230d9488' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    border: 1px solid #c5e1d9;
    border-radius: 0.5rem;
    color: #1e3a2f;
    padding: 0.5rem 0.875rem 0.5rem 2.5rem;
    height: 42px;
    min-height: 42px;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(30, 58, 47, 0.06);
}

/* Date range needs more width for "MMM DD, YYYY - MMM DD, YYYY" format - prevent text cutoff */
.details-page .date-filter[data-filter-type="DateRange"] .datefilerstyle {
    min-width: 320px;
}

.details-page .date-filter .datefilerstyle::placeholder {
    color: #6b9080;
}

.details-page .date-filter .datefilerstyle:hover {
    border-color: #0d9488;
    background-color: #fff;
}

.details-page .date-filter .datefilerstyle:focus {
    background-color: #fff;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
    outline: none;
}

/* Metrics card - allow dropdown to overflow (no clipping) */
.details-page #metricsCard {
    overflow: visible;
}

    .details-page #metricsCard .card-body {
        overflow: visible;
    }

.details-page .metric-card {
    border-radius: 8px;
}

    .details-page .metric-card .badge {
        font-size: 0.9375rem;
        padding: 6px 14px;
    }

.details-page .comment-input {
    font-size: 0.875rem;
}

/* Metrics dropdown - position relative so menu aligns under toggle */
.details-page .metrics-dropdown {
    position: relative;
    flex-shrink: 0;
    min-width: 200px;
    max-width: 380px;
}

.details-page .global-filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Date filter dropdowns - match metrics dropdown size */
.details-page .employee-details-date-dropdown {
    min-width: 200px;
    height: 42px;
    min-height: 42px;
}

/* Metrics dropdown - align style with date filter (match height exactly) */
.details-page .metrics-dropdown .metrics-dropdown-toggle,
.details-page .metrics-dropdown .dropdown-toggle {
    min-width: 200px;
    width: 100%;
    max-width: 380px;
    height: 42px;
    min-height: 42px;
    background-color: #f8faf9;
    border: 1px solid #c5e1d9;
    border-radius: 0.5rem;
    color: #1e3a2f;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    text-align: left;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(30, 58, 47, 0.06);
}

/* Selected metric label - truncate with ellipsis to keep fixed height */
.details-page .metrics-dropdown .metric-dropdown-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-page .metrics-dropdown .metrics-dropdown-toggle:hover,
.details-page .metrics-dropdown .metrics-dropdown-toggle:focus,
.details-page .metrics-dropdown .dropdown-toggle:hover,
.details-page .metrics-dropdown .dropdown-toggle:focus {
    background-color: #fff;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
    color: #1e3a2f;
}

/* Dropdown menu - static display, match date filter styling */
.details-page .metrics-dropdown .dropdown-menu {
    left: 0 !important;
    right: auto !important;
    min-width: min(380px, 100%);
    width: 100%;
    max-width: min(400px, calc(100vw - 2rem));
    max-height: min(280px, 50vh);
    border: 1px solid #c5e1d9;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(30, 58, 47, 0.06), 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    z-index: 1060;
    overflow-x: hidden;
}

.details-page .metrics-dropdown .dropdown-item {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: unset;
}

    .details-page .metrics-dropdown .dropdown-item:hover,
    .details-page .metrics-dropdown .dropdown-item.active {
        background-color: #f0fdfa;
        color: #1e3a2f;
    }

    .details-page .metrics-dropdown .dropdown-item.active {
        font-weight: 600;
    }

/* ===== Employee Index - Responsive (match Dashboard) ===== */
/* Tablet Portrait (768px - 991px) */
@media (max-width: 991.98px) {
    .page-header {
        gap: 0.875rem;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .emp-page .search-box {
        flex: 1 1 100%;
        width: 100%;
    }

    .emp-page .filter-dropdowns {
        margin-left: 0;
        width: 100%;
    }

        .emp-page .filter-dropdowns .filter-select {
            flex: 1;
            min-width: 140px;
        }

    .global-filter-container {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.75rem !important;
        align-items: center !important;
        width: 100%;
    }

        .global-filter-container select {
            flex: 1;
            min-width: 130px;
        }
}

/* Large Mobile (576px - 767px) */
@media (max-width: 767.98px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .emp-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .global-filter-container {
        display: flex !important;
        flex-direction: row;
        gap: 0.75rem !important;
        align-items: center !important;
        width: 100%;
        flex-wrap: wrap;
    }

        .global-filter-container select {
            flex: 1;
            min-width: 120px;
        }

        .global-filter-container select {
            flex: 1;
            min-width: 120px;
        }

    .emp-card {
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .filter-bar {
        padding: 1rem;
    }

    .emp-table th,
    .emp-table td {
        padding: 14px 16px;
        font-size: 15px;
    }

    .emp-alert-badges {
        flex-wrap: wrap;
        justify-content: center;
    }

    .alert-badge {
        padding: 5px 10px;
        font-size: 14px;
    }

}

/* Small Mobile (< 576px) - Card layout like Dashboard */
@media (max-width: 575.98px) {
    .emp-page {
        padding: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 1rem;
    }

    .emp-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        gap: 12px;
        padding: 0 1rem;
    }

    .global-filter-container {
        display: flex !important;
        flex-direction: row;
        gap: 0.625rem !important;
        align-items: center !important;
        width: 100%;
        flex-wrap: nowrap;
    }

        .global-filter-container select {
            flex: 1;
            min-width: 80px;
            padding: 0.5rem 0.5rem;
            font-size: 0.875rem;
        }

    .btn-export {
        padding: 10px 14px;
        font-size: 0.875rem;
    }

    .emp-card {
        border-radius: 12px;
        box-shadow: none;
        border: none;
        margin: 0;
        background: transparent;
    }

        .emp-card .filter-bar {
            background: #fff;
            border-radius: 12px;
            margin: 0 1rem 0.75rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
            border-bottom: none;
        }

        .emp-card .pagination-footer {
            background: #fff;
            border-radius: 12px;
            margin: 0.75rem 1rem 0;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
            border-top: none;
        }

    .filter-bar {
        padding: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .emp-page .search-box {
        flex: 1 1 100%;
        min-width: 0;
    }

    .emp-page .filter-dropdowns {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1 1 100%;
        gap: 10px;
    }

        .emp-page .filter-dropdowns .filter-select {
            flex: 1;
            min-width: 120px;
        }

    .table-responsive {
        padding: 0;
        border: none;
        overflow: visible;
    }

    .emp-table thead {
        display: none;
    }

    .emp-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin: 0 1rem 0.75rem;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

        .emp-table tbody tr:first-of-type {
            margin-top: 0.75rem;
        }

        .emp-table tbody tr:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .emp-table tbody tr.emp-no-results-row {
            margin: 0 1rem;
            padding: 2rem 1rem;
            border-radius: 12px;
        }

            .emp-table tbody tr.emp-no-results-row td {
                display: block;
                padding: 0;
            }

                .emp-table tbody tr.emp-no-results-row td::before {
                    display: none;
                }

    .emp-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
        font-size: 0.9375rem;
    }

        .emp-table td::before {
            content: attr(data-label);
            font-weight: 600;
            color: #6b7280;
            font-size: 0.8125rem;
            flex-shrink: 0;
            margin-right: 12px;
        }

        .emp-table td[data-label=""]::before {
            display: none;
        }

        .emp-table td.emp-col-action {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            padding: 0.75rem 0 0;
            border-top: 1px solid #f3f4f6;
            margin-top: 0.5rem;
        }

            .emp-table td.emp-col-action .btn-view {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                gap: 6px;
                padding: 10px 20px;
                background: #1A445A;
                color: #fff !important;
                border-radius: 8px;
                font-size: 0.875rem;
                font-weight: 500;
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }

                .emp-table td.emp-col-action .btn-view:hover {
                    background: #153a4d !important;
                    color: #fff !important;
                }

                .emp-table td.emp-col-action .btn-view svg {
                    width: 18px;
                    height: 18px;
                    flex-shrink: 0;
                }

                .emp-table td.emp-col-action .btn-view::after {
                    content: "View Details";
                }

    .emp-table td {
        flex-wrap: wrap;
    }

        .emp-table td.emp-alert .emp-alert-badges {
            flex: 1;
            justify-content: flex-end;
        }

    .emp-cell {
        gap: 10px;
    }

    .emp-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    .emp-name {
        font-size: 1rem;
        font-weight: 600;
    }

    .emp-email,
    .emp-dept {
        font-size: 0.9375rem;
        color: #6b7280;
        word-break: break-word;
    }

    .alert-badge {
        padding: 4px 10px;
        font-size: 0.8125rem;
    }

        .alert-badge i {
            font-size: 1rem;
        }
}

/* Extra Small Mobile (< 400px) */
@media (max-width: 399.98px) {
    .emp-table tbody tr {
        margin: 0 0.5rem 0.625rem;
        padding: 0.875rem 1rem;
    }

        .emp-table tbody tr.emp-no-results-row {
            margin: 0 0.5rem;
        }

    .emp-name {
        font-size: 0.9375rem;
    }

    .emp-table td {
        font-size: 0.875rem;
    }
}

/* Metrics dropdown - responsive breakpoints */
@media (max-width: 768px) {
    .details-page .metrics-dropdown {
        width: 100%;
    }

    .details-page .employee-details-date-dropdown {
        min-width: 0;
        width: 100%;
    }

    .details-page .metrics-dropdown .metrics-dropdown-toggle,
    .details-page .metrics-dropdown .dropdown-toggle {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .details-page .metrics-dropdown .dropdown-menu {
        min-width: 100%;
        max-width: calc(100vw - 2rem);
        left: 0 !important;
    }
}

@media (max-width: 576px) {
    .details-page .metrics-filters-row {
        flex-direction: column;
        align-items: stretch !important;
        flex-wrap: wrap;
    }

        .details-page .metrics-filters-row .d-flex.ms-auto {
            margin-left: 0 !important;
        }

    .details-page .metrics-dropdown .dropdown-menu {
        min-width: 100%;
        max-width: calc(100vw - 1.5rem);
        left: 0 !important;
    }
}
